Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

fix(telegram): drop and recreate telegram_users table for schema change

yushen6284ffd74a7c
diff --git a/src/gateway/telegram/telegram-user.store.ts b/src/gateway/telegram/telegram-user.store.ts
index 1570bc8d6e..d7f64cf9c2 100644
--- a/src/gateway/telegram/telegram-user.store.ts
+++ b/src/gateway/telegram/telegram-user.store.ts
@@ -39,10 +39,11 @@ export class TelegramUserStore implements OnModuleInit {
console.log("[TelegramUserStore] Done");
}
- /** Create telegram_users table if not exists */
+ /** Drop and recreate telegram_users table (schema changed: hub_url -> hub_id + agent_id) */
private async ensureTable(): Promise<void> {
+ await this.db.execute("DROP TABLE IF EXISTS telegram_users");
const sql = `
- CREATE TABLE IF NOT EXISTS telegram_users (
+ CREATE TABLE telegram_users (
telegram_user_id VARCHAR(64) PRIMARY KEY,
hub_id VARCHAR(64) NOT NULL,
agent_id VARCHAR(64) NOT NULL,