Create scheduled_messages for databases that never had it #80
Reference in New Issue
Block a user
Delete Branch "fix/scheduled-messages-migration"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
No committed migration creates
scheduled_messages. Migrations 6–10 were generated outside the repo and never committed (the first state that knowsScheduledMessageis migration 11's snapshot). Production has the table; fresh databases, including the local dev DB, don't. On top of #79 a fresh database fails at migration 20'sALTER TABLE scheduled_messages.Fix:
6_20260603000000_add_scheduled_messages.py, aCREATE TABLE IF NOT EXISTS. Aerich applies any file missing from its version table in numeric order, so:⚠️ Not generated by
aerich migrate, against the usual rule. Aerich can't generate this file because its saved state already includes the table. The DDL is Tortoise's own schema output (get_schema_sql) for the model as of migration 19, not hand-typed.Verified on scratch Postgres:
aerich upgradesucceeds through 19. Before this change it couldn't create the table at all.440 unit tests pass.
🤖 Generated with Claude Code
Correction to the description: this branch is based on main, which has 371 unit tests (all passing), not 440. 440 included #78's configuration tests.