mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-09 13:19:49 -04:00
Initial commit for sqlalchemy2.0 migration
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user