2021_11_10_153049_create_im_groups_table.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. use Illuminate\Database\Schema\Blueprint;
  3. use Illuminate\Database\Migrations\Migration;
  4. /**
  5. * Class CreateImGroupsTable.
  6. */
  7. class CreateImGroupsTable extends Migration
  8. {
  9. /**
  10. * Run the migrations.
  11. *
  12. * @return void
  13. */
  14. public function up()
  15. {
  16. Schema::create('im_groups', function(Blueprint $table) {
  17. $table->increments('id');
  18. $table->integer('m_id')->default(0)->index('m_id')->comment('会员(发起人)ID');
  19. $table->integer('shop_id')->default(0)->index('shop_id')->comment('店铺ID');
  20. $table->integer('service_id')->default(0)->index('service_id')->comment('客服ID');
  21. $table->integer('handle_id')->index('handle_id')->comment('处理该组消息(即接收)人ID');
  22. $table->tinyInteger('group_type')->comment('消息组关系类型 1:用户与用户,2:用户与店铺,3:用户与平台');
  23. $table->string('logo')->comment('接收人logo');
  24. $table->string('name')->comment('接收人昵称');
  25. $table->tinyInteger('text_type')->comment('最后一条消息内容类型 1:文字,2:图片');
  26. $table->string('text')->comment('最后一条消息内容');
  27. $table->timestamp('last_time')->comment('最后一条消息时间');
  28. $table->tinyInteger('is_del')->default(0)->index('is_del')->comment('是否删除 0:否,1:是');
  29. $table->timestamps();
  30. $table->engine = 'InnoDB';
  31. });
  32. }
  33. /**
  34. * Reverse the migrations.
  35. *
  36. * @return void
  37. */
  38. public function down()
  39. {
  40. Schema::drop('im_groups');
  41. }
  42. }