feat: auto-migrate SQLite data to Postgres on first deploy

- Add trumpsignal.db to git (one-time migration source)
- entrypoint.sh detects empty Postgres and runs migration automatically
- scripts/migrate_sqlite_to_postgres.py: posts, subscriptions, bot_trades
- Add psycopg2-binary to requirements for migration script

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
k
2026-04-21 20:48:05 +08:00
parent 1deb6a3918
commit 6021a3883d
6 changed files with 149 additions and 4 deletions
+1 -2
View File
@@ -7,8 +7,7 @@ env/
.env
*.pem
# 数据库
*.db
# 数据库 (trumpsignal.db 是例外,用于一次性迁移到 Postgres)
*.sqlite
*.sqlite3