feat:添加位置消息记录表

main
gzydong 2021-10-31 21:32:50 +08:00
parent 8f240806ef
commit d89c696514
2 changed files with 51 additions and 10 deletions

View File

@ -20,6 +20,7 @@ class TalkMessageType
const FRIEND_APPLY_MESSAGE = 7; //好友申请 const FRIEND_APPLY_MESSAGE = 7; //好友申请
const USER_LOGIN_MESSAGE = 8; //登录通知 const USER_LOGIN_MESSAGE = 8; //登录通知
const GROUP_INVITE_MESSAGE = 9; //入群退群消息 const GROUP_INVITE_MESSAGE = 9; //入群退群消息
const LOCATION_MESSAGE = 10; //位置消息(预留)
/** /**
* 获取可转发的消息类型列表 * 获取可转发的消息类型列表

View File

@ -0,0 +1,40 @@
<?php
use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;
class CreateTalkRecordsLocation extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('talk_records_location', function (Blueprint $table) {
$table->unsignedInteger('id', true)->comment('自增ID');
$table->unsignedInteger('record_id')->default(0)->comment('消息记录ID');
$table->unsignedInteger('user_id')->default(0)->comment('用户ID');
$table->decimal('longitude', 11, 6)->default('0.000000')->comment('经度');
$table->decimal('latitude', 11, 6)->default('0.000000')->comment('纬度');
$table->dateTime('created_at')->nullable(true)->comment('创建时间');
$table->charset = 'utf8';
$table->collation = 'utf8_general_ci';
$table->engine = 'InnoDB';
$table->unique(['record_id'], 'uk_record_id');
$table->index(['user_id'], 'idx_user_id');
$table->comment('聊天对话记录(位置消息)');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('talk_records_location');
}
}