mirror of
https://github.com/BEARlogin/max-telegram-bridge-bot.git
synced 2026-04-28 20:00:03 +00:00
Initial commit: TG↔MAX bridge
Bi-directional message bridge between Telegram and MAX messengers. Features: 1:1 chat pairing, reply support, message formatting, prefix toggle, SQLite/PostgreSQL with golang-migrate, Dockerfile, CI/CD with GitHub Actions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
commit
28f671d41c
28 changed files with 2048 additions and 0 deletions
24
migrations/sqlite/000002_add_prefix_and_created_at.down.sql
Normal file
24
migrations/sqlite/000002_add_prefix_and_created_at.down.sql
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
-- SQLite doesn't support DROP COLUMN before 3.35.0, so recreate tables
|
||||
|
||||
CREATE TABLE pairs_backup (
|
||||
tg_chat_id INTEGER NOT NULL,
|
||||
max_chat_id INTEGER NOT NULL,
|
||||
PRIMARY KEY (tg_chat_id, max_chat_id)
|
||||
);
|
||||
INSERT INTO pairs_backup SELECT tg_chat_id, max_chat_id FROM pairs;
|
||||
DROP TABLE pairs;
|
||||
ALTER TABLE pairs_backup RENAME TO pairs;
|
||||
CREATE INDEX IF NOT EXISTS idx_pairs_tg ON pairs(tg_chat_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_pairs_max ON pairs(max_chat_id);
|
||||
|
||||
CREATE TABLE messages_backup (
|
||||
tg_chat_id INTEGER NOT NULL,
|
||||
tg_msg_id INTEGER NOT NULL,
|
||||
max_chat_id INTEGER NOT NULL,
|
||||
max_msg_id TEXT NOT NULL,
|
||||
PRIMARY KEY (tg_chat_id, tg_msg_id)
|
||||
);
|
||||
INSERT INTO messages_backup SELECT tg_chat_id, tg_msg_id, max_chat_id, max_msg_id FROM messages;
|
||||
DROP TABLE messages;
|
||||
ALTER TABLE messages_backup RENAME TO messages;
|
||||
CREATE INDEX IF NOT EXISTS idx_messages_max ON messages(max_msg_id);
|
||||
Loading…
Add table
Add a link
Reference in a new issue