Files
jianfeng-server/app/im/info/UpdateSql.php
2025-10-02 10:33:06 +08:00

30 lines
1.1 KiB
PHP
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
//获取表前缀
$prefix = longbing_get_prefix();
//每个一个sql语句结束都必须以英文分号结束。因为在执行sql时需要分割单个脚本执行。
//表前缀需要自己添加{$prefix} 以下脚本被测试脚本
$sql = <<<updateSql
CREATE TABLE IF NOT EXISTS `{$prefix}longbing_card_message_friend` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(10) NOT NULL COMMENT '发送消息用户id',
`friend_id` int(10) NOT NULL COMMENT '接收消息用户id',
`message_type` varchar(50) NOT NULL DEFAULT 'text',
`lastmessage` text COMMENT '消息内容',
`not_read_message_count` int(11) NOT NULL DEFAULT '0' COMMENT '未读消息数量',
`uniacid` int(10) NOT NULL,
`create_time` int(11) NOT NULL DEFAULT '0',
`update_time` int(11) NOT NULL DEFAULT '0',
`is_read` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `chat_id` (`user_id`,`friend_id`,`create_time`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=175 DEFAULT CHARSET=utf8mb4 COMMENT='名片--聊天记录表';
ALTER TABLE `{$prefix}longbing_card_message_friend` ADD COLUMN `is_read` tinyint(1) NOT NULL DEFAULT 0;
updateSql;
return $sql;