Jun 28 - Fix issue with missing table - Tenant branding error

This commit is contained in:
2026-06-28 12:33:00 -04:00
parent f292c8fb7b
commit 29be753460
3 changed files with 54 additions and 1 deletions
@@ -469,10 +469,26 @@ def upgrade():
if not _index_exists(bind, 'notifications', 'ix_notifications_user_id'):
op.execute(sa.text("CREATE INDEX ix_notifications_user_id ON notifications (user_id)"))
# phase33 — per-tenant branding settings
if not _table_exists(bind, 'tenant_settings'):
op.execute(sa.text("""CREATE TABLE tenant_settings (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
company_name VARCHAR(150) NULL,
logo_url VARCHAR(500) NULL,
primary_color VARCHAR(7) NOT NULL DEFAULT '#1a56db',
accent_color VARCHAR(7) NOT NULL DEFAULT '#16a34a',
support_email VARCHAR(255) NULL,
updated_at DATETIME NOT NULL,
updated_by INT NULL,
CONSTRAINT fk_tenant_settings_user
FOREIGN KEY (updated_by) REFERENCES users(id) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4"""))
def downgrade():
bind = op.get_bind()
if _table_exists(bind, 'tenant_settings'):
op.execute(sa.text('DROP TABLE tenant_settings'))
if _table_exists(bind, 'notifications'):
op.execute(sa.text('DROP TABLE notifications'))
if _table_exists(bind, 'issue_followers'):