2019_12_10_023604_create_newsroom_table.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. class CreateNewsroomTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('newsroom', function (Blueprint $table) {
  15. $table->bigIncrements('id');
  16. $table->bigInteger('user_id')->unsigned()->nullable();
  17. $table->string('header_photo_url')->nullable();
  18. $table->string('title')->nullable();
  19. $table->string('slug')->nullable()->unique()->index();
  20. $table->string('category')->default('update');
  21. $table->text('summary')->nullable();
  22. $table->text('body')->nullable();
  23. $table->text('body_rendered')->nullable();
  24. $table->string('link')->nullable();
  25. $table->boolean('force_modal')->default(false);
  26. $table->boolean('show_timeline')->default(false);
  27. $table->boolean('show_link')->default(false);
  28. $table->boolean('auth_only')->default(true);
  29. $table->timestamp('published_at')->nullable();
  30. $table->timestamps();
  31. });
  32. }
  33. /**
  34. * Reverse the migrations.
  35. *
  36. * @return void
  37. */
  38. public function down()
  39. {
  40. Schema::dropIfExists('site_news');
  41. }
  42. }