2018_06_07_092825_create_messages_table.php 1.2 KB

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