2021_11_10_153057_create_im_messages_table.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. use Illuminate\Database\Schema\Blueprint;
  3. use Illuminate\Database\Migrations\Migration;
  4. /**
  5. * Class CreateImMessagesTable.
  6. */
  7. class CreateImMessagesTable extends Migration
  8. {
  9. /**
  10. * Run the migrations.
  11. *
  12. * @return void
  13. */
  14. public function up()
  15. {
  16. Schema::create('im_messages', function(Blueprint $table) {
  17. $table->increments('id');
  18. $table->integer('group_id')->index('group_id')->comment('分组id');
  19. $table->integer('m_id')->index('m_id')->comment('发送人会员ID');
  20. $table->integer('handle_id')->index('handle_id')->comment('处理(接收)该条消息会员ID');
  21. $table->integer('shop_id')->default(0)->index('shop_id')->comment('店铺ID');
  22. $table->integer('service_id')->default(0)->index('service_id')->comment('客服ID');
  23. $table->tinyInteger('text_type')->comment('消息内容类型 1:文字,2:图片');
  24. $table->string('text')->comment('消息内容');
  25. $table->tinyInteger('status')->default(0)->index('status')->comment('消息状态 0:未读,1:已读');
  26. $table->tinyInteger('is_del')->default(0)->index('is_del')->comment('是否删除 0:否,1:是');
  27. $table->timestamps();
  28. $table->engine = 'InnoDB';
  29. });
  30. }
  31. /**
  32. * Reverse the migrations.
  33. *
  34. * @return void
  35. */
  36. public function down()
  37. {
  38. Schema::drop('im_messages');
  39. }
  40. }