Files
notifications-api/migrations/versions/0109_rem_old_noti_status.py

63 lines
1.5 KiB
Python
Raw Normal View History

2017-07-10 15:38:11 +01:00
"""
Revision ID: 0109_rem_old_noti_status
Revises: 0108_change_logo_not_nullable
Create Date: 2017-07-10 14:25:15.712055
"""
2024-04-01 15:12:33 -07:00
2017-07-10 15:38:11 +01:00
import sqlalchemy as sa
from alembic import op
2017-07-10 15:38:11 +01:00
from sqlalchemy.dialects import postgresql
2023-08-29 14:54:30 -07:00
revision = "0109_rem_old_noti_status"
down_revision = "0108_change_logo_not_nullable"
2017-07-10 15:38:11 +01:00
def upgrade():
2023-08-29 14:54:30 -07:00
op.drop_column("notification_history", "status")
op.drop_column("notifications", "status")
2017-07-10 15:38:11 +01:00
def downgrade():
op.add_column(
2023-08-29 14:54:30 -07:00
"notifications",
2017-07-10 15:38:11 +01:00
sa.Column(
2023-08-29 14:54:30 -07:00
"status",
2017-07-10 15:38:11 +01:00
postgresql.ENUM(
2023-08-29 14:54:30 -07:00
"created",
"sending",
"delivered",
"pending",
"failed",
"technical-failure",
"temporary-failure",
"permanent-failure",
"sent",
name="notify_status_type",
2017-07-10 15:38:11 +01:00
),
autoincrement=False,
2023-08-29 14:54:30 -07:00
nullable=True,
),
2017-07-10 15:38:11 +01:00
)
op.add_column(
2023-08-29 14:54:30 -07:00
"notification_history",
2017-07-10 15:38:11 +01:00
sa.Column(
2023-08-29 14:54:30 -07:00
"status",
2017-07-10 15:38:11 +01:00
postgresql.ENUM(
2023-08-29 14:54:30 -07:00
"created",
"sending",
"delivered",
"pending",
"failed",
"technical-failure",
"temporary-failure",
"permanent-failure",
"sent",
name="notify_status_type",
2017-07-10 15:38:11 +01:00
),
autoincrement=False,
2023-08-29 14:54:30 -07:00
nullable=True,
),
2017-07-10 15:38:11 +01:00
)