2018-12-12 12:14:49 +00:00
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
Revision ID: 0246_notifications_index
|
|
|
|
|
Revises: 0245_archived_flag_jobs
|
|
|
|
|
Create Date: 2018-12-12 12:00:09.770775
|
|
|
|
|
|
|
|
|
|
"""
|
2024-04-01 15:12:33 -07:00
|
|
|
|
2018-12-12 12:14:49 +00:00
|
|
|
from alembic import op
|
2024-03-13 12:42:11 -04:00
|
|
|
from sqlalchemy import text
|
2018-12-12 12:14:49 +00:00
|
|
|
|
2023-08-29 14:54:30 -07:00
|
|
|
revision = "0246_notifications_index"
|
|
|
|
|
down_revision = "0245_archived_flag_jobs"
|
2018-12-12 12:14:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
def upgrade():
|
|
|
|
|
conn = op.get_bind()
|
2024-03-13 12:42:11 -04:00
|
|
|
query = text(
|
2018-12-12 12:14:49 +00:00
|
|
|
"CREATE INDEX IF NOT EXISTS ix_notifications_service_created_at ON notifications (service_id, created_at)"
|
|
|
|
|
)
|
2024-03-13 12:42:11 -04:00
|
|
|
conn.execute(query)
|
2018-12-12 12:14:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
def downgrade():
|
|
|
|
|
conn = op.get_bind()
|
2024-03-13 12:42:11 -04:00
|
|
|
query = text("DROP INDEX IF EXISTS ix_notifications_service_created_at")
|
|
|
|
|
conn.execute(query)
|