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

@ -10,16 +10,17 @@ namespace App\Constants;
*/
class TalkMessageType
{
const SYSTEM_TEXT_MESSAGE = 0; //系统文本消息
const TEXT_MESSAGE = 1; //文本消息
const FILE_MESSAGE = 2; //文件消息
const FORWARD_MESSAGE = 3; //会话消息
const CODE_MESSAGE = 4; //代码消息
const VOTE_MESSAGE = 5; //投票消息
const GROUP_NOTICE_MESSAGE = 6; //群组公告
const FRIEND_APPLY_MESSAGE = 7; //好友申请
const USER_LOGIN_MESSAGE = 8; //登录通知
const GROUP_INVITE_MESSAGE = 9; //入群退群消息
const SYSTEM_TEXT_MESSAGE = 0; //系统文本消息
const TEXT_MESSAGE = 1; //文本消息
const FILE_MESSAGE = 2; //文件消息
const FORWARD_MESSAGE = 3; //会话消息
const CODE_MESSAGE = 4; //代码消息
const VOTE_MESSAGE = 5; //投票消息
const GROUP_NOTICE_MESSAGE = 6; //群组公告
const FRIEND_APPLY_MESSAGE = 7; //好友申请
const USER_LOGIN_MESSAGE = 8; //登录通知
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');
}
}