2019_05_08_160636_create_messages_table.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. class CreateMessagesTable extends Migration {
  5. /**
  6. * Run the migrations.
  7. *
  8. * @return void
  9. */
  10. public function up()
  11. {
  12. Schema::create('messages', function(Blueprint $table)
  13. {
  14. $table->increments('id');
  15. $table->string('title', 191)->comment('消息标题');
  16. $table->text('content', 65535)->nullable()->comment('消息内容');
  17. $table->integer('read')->default(1)->comment('1-未读,2-已读');
  18. $table->char('send_uuid', 36)->default(1)->comment('消息发送者UUID,1表示系统发送');
  19. $table->char('accept_uuid', 36)->comment('消息接收者UUID');
  20. $table->integer('flag')->comment('消息对应关系:12-系统推送给后台,13-系统推送给前台,22-后台推送给后台,23-后台推送给前台,32-前台推送给后台,33-前台推送给前台,');
  21. $table->timestamps();
  22. });
  23. }
  24. /**
  25. * Reverse the migrations.
  26. *
  27. * @return void
  28. */
  29. public function down()
  30. {
  31. Schema::drop('messages');
  32. }
  33. }