2021_01_16_132307_create_policies_table.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. class CreatePoliciesTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('policies', function (Blueprint $table) {
  15. $table->id();
  16. $table->bigInteger('province')->default(0)->comment('省份');
  17. $table->bigInteger('city')->default(0)->comment('市');
  18. $table->bigInteger('area')->default(0)->comment('县/区');
  19. $table->bigInteger('street')->default(0)->comment('乡级');
  20. $table->string('address', 300)->nullable()->comment('地址');
  21. $table->string('title')->nullable()->comment('标题');
  22. $table->string('description', 500)->nullable()->comment('简介');
  23. $table->text('body')->nullable()->comment('内容');
  24. $table->string('source')->nullable()->comment('来源');
  25. $table->date('release_time')->comment('发布时间');
  26. $table->bigInteger('admin_id')->default(0);
  27. $table->tinyInteger('status')->default(1);
  28. $table->timestamps();
  29. });
  30. }
  31. /**
  32. * Reverse the migrations.
  33. *
  34. * @return void
  35. */
  36. public function down()
  37. {
  38. Schema::dropIfExists('policies');
  39. }
  40. }