[30388f42] Infrastructure Hardening: Repaired CE/Connector DB schema, fixed frontend styling build, implemented robust echo shield in worker v2.1.1, and integrated Lead Engine into gateway.
This commit is contained in:
@@ -89,6 +89,17 @@ def migrate_tables():
|
||||
""")
|
||||
logger.info("Table 'reported_mistakes' ensured to exist.")
|
||||
|
||||
# 4. Update CONTACTS Table (Two-step for SQLite compatibility)
|
||||
logger.info("Checking 'contacts' table schema for unsubscribe_token...")
|
||||
contacts_columns = get_table_columns(cursor, "contacts")
|
||||
|
||||
if 'unsubscribe_token' not in contacts_columns:
|
||||
logger.info("Adding column 'unsubscribe_token' to 'contacts' table...")
|
||||
cursor.execute("ALTER TABLE contacts ADD COLUMN unsubscribe_token TEXT")
|
||||
|
||||
logger.info("Creating UNIQUE index on 'unsubscribe_token' column...")
|
||||
cursor.execute("CREATE UNIQUE INDEX IF NOT EXISTS idx_contacts_unsubscribe_token ON contacts (unsubscribe_token)")
|
||||
|
||||
conn.commit()
|
||||
logger.info("All migrations completed successfully.")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user