Initial commit for sqlalchemy2.0 migration

This commit is contained in:
Aditi Anand
2024-03-13 12:42:11 -04:00
parent 158316a77b
commit 385ec3583f
23 changed files with 1694 additions and 1590 deletions

View File

@@ -6,6 +6,7 @@ Create Date: 2018-12-12 12:00:09.770775
"""
from alembic import op
from sqlalchemy import text
revision = "0246_notifications_index"
down_revision = "0245_archived_flag_jobs"
@@ -13,11 +14,13 @@ down_revision = "0245_archived_flag_jobs"
def upgrade():
conn = op.get_bind()
conn.execute(
query = text(
"CREATE INDEX IF NOT EXISTS ix_notifications_service_created_at ON notifications (service_id, created_at)"
)
conn.execute(query)
def downgrade():
conn = op.get_bind()
conn.execute("DROP INDEX IF EXISTS ix_notifications_service_created_at")
query = text("DROP INDEX IF EXISTS ix_notifications_service_created_at")
conn.execute(query)