2020_10_16_081824_create_docter_messages_table.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. use Illuminate\Support\Facades\DB;
  6. class CreateDocterMessagesTable extends Migration
  7. {
  8. /**
  9. * Run the migrations.
  10. *
  11. * @return void
  12. */
  13. public function up()
  14. {
  15. Schema::create('docter_messages', function (Blueprint $table) {
  16. $table->bigIncrements('id');
  17. $table->integer('user_id')->comment("用户ID");
  18. $table->integer('docter_id')->comment("医生ID");
  19. $table->tinyInteger('status')->comment("状态(1.未读 2.已读)");
  20. $table->tinyInteger('type')->comment("类型(1.图文订单 2.电话订单 3.预约订单 4.评价通知 5.系统通知)");
  21. $table->integer('relation_id')->comment("关联ID(发出消息操作关联的表的id,比如:医生结束消息时,就该关联意见单ID,因为用户点击消息会进入看意见单)");
  22. $table->string('content',500)->comment("消息内容");
  23. $table->timestamps();
  24. });
  25. DB::statement("ALTER TABLE `docter_messages` comment '医生消息表'");
  26. }
  27. /**
  28. * Reverse the migrations.
  29. *
  30. * @return void
  31. */
  32. public function down()
  33. {
  34. Schema::dropIfExists('docter_messages');
  35. }
  36. }