You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
748 B
29 lines
748 B
|
3 months ago
|
const { Sequelize } = require('sequelize');
|
||
|
|
const sequelize = new Sequelize('wechat_app', 'root', 'schl@2025', {
|
||
|
|
host: '1.95.162.61',
|
||
|
|
port: 3306,
|
||
|
|
dialect: 'mysql',
|
||
|
|
logging: false
|
||
|
|
});
|
||
|
|
|
||
|
|
async function cleanup() {
|
||
|
|
try {
|
||
|
|
// 删除测试会话相关的消息
|
||
|
|
await sequelize.query('DELETE FROM chat_messages WHERE conversation_id = ?', {
|
||
|
|
replacements: ['conv_1765767582602']
|
||
|
|
});
|
||
|
|
|
||
|
|
// 删除测试会话
|
||
|
|
await sequelize.query('DELETE FROM chat_conversations WHERE conversation_id = ?', {
|
||
|
|
replacements: ['conv_1765767582602']
|
||
|
|
});
|
||
|
|
|
||
|
|
console.log('测试会话记录已删除');
|
||
|
|
} catch (e) {
|
||
|
|
console.error('删除错误:', e.message);
|
||
|
|
} finally {
|
||
|
|
await sequelize.close();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
cleanup();
|