2017_07_03_225411_create_drafts_table.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class CreateDraftsTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('drafts', function (Blueprint $table) {
  15. $table->string('id',64)->primary();
  16. $table->integer('user_id')->unsigned()->index();
  17. $table->longText('editor_content')->comment('编辑器内容');
  18. $table->string('subject')->nullable()->comment('主题');
  19. $table->text('form_data')->nullable()->comment('表单其他参数');
  20. $table->string('source_type',32)->comment('数据类型:question,answer,article');
  21. $table->integer('source_id')->default(0);
  22. $table->timestamps();
  23. });
  24. }
  25. /**
  26. * Reverse the migrations.
  27. *
  28. * @return void
  29. */
  30. public function down()
  31. {
  32. Schema::drop('drafts');
  33. }
  34. }