mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 09:51:11 -05:00
Adding another set of columns to the migration.
Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
This commit is contained in:
@@ -2138,9 +2138,9 @@ class FactNotificationStatus(db.Model):
|
||||
nullable=False,
|
||||
)
|
||||
job_id = db.Column(UUID(as_uuid=True), primary_key=True, index=True, nullable=False)
|
||||
notification_type = db.Column(db.Text, primary_key=True, nullable=False)
|
||||
key_type = db.Column(db.Text, primary_key=True, nullable=False)
|
||||
notification_status = db.Column(db.Text, primary_key=True, nullable=False)
|
||||
notification_type = enum_column(NotificationType, primary_key=True, nullable=False)
|
||||
key_type = enum_column(KeyType, primary_key=True, nullable=False)
|
||||
notification_status = enum_column(NotificationStatus, primary_key=True, nullable=False)
|
||||
notification_count = db.Column(db.Integer(), nullable=False)
|
||||
created_at = db.Column(
|
||||
db.DateTime,
|
||||
|
||||
@@ -560,6 +560,30 @@ def upgrade():
|
||||
existing_nullable=False,
|
||||
postgresql_using=enum_using("code_type", CodeType),
|
||||
)
|
||||
op.alter_column(
|
||||
"ft_notification_status",
|
||||
"notification_type",
|
||||
existing_type=sa.TEXT(),
|
||||
type_=enum_type(NotificationType),
|
||||
existing_nullable=False,
|
||||
postgresql_using=enum_using("notification_type", NotificationType),
|
||||
)
|
||||
op.alter_column(
|
||||
"ft_notification_status",
|
||||
"key_type",
|
||||
existing_type=sa.TEXT(),
|
||||
type_=enum_type(KeyType),
|
||||
existing_nullable=False,
|
||||
postgresql_using=enum_using("key_type", KeyType),
|
||||
)
|
||||
op.alter_column(
|
||||
"ft_notification_status",
|
||||
"notification_type",
|
||||
existing_type=sa.TEXT(),
|
||||
type_=enum_type(NotificationStatus),
|
||||
existing_nullable=False,
|
||||
postgresql_using=enum_using("notification_status", NotificationStatus),
|
||||
)
|
||||
|
||||
# Drop old enum types.
|
||||
enum_drop(
|
||||
@@ -587,6 +611,30 @@ def downgrade():
|
||||
enum_create(values=["email", "sms"], name="verify_code_types")
|
||||
|
||||
# Alter columns back
|
||||
op.alter_column(
|
||||
"ft_notification_status",
|
||||
"notification_type",
|
||||
existing_type=enum_type(NotificationStatus),
|
||||
type_=sa.TEXT(),
|
||||
existing_nullable=False,
|
||||
postgresql_using=enum_using("notification_status", NotificationStatus),
|
||||
)
|
||||
op.alter_column(
|
||||
"ft_notification_status",
|
||||
"key_type",
|
||||
erxisting_type=enum_type(KeyType),
|
||||
type_=sa.TEXT(),
|
||||
existing_nullable=False,
|
||||
postgresql_using=enum_using("key_type", KeyType),
|
||||
)
|
||||
op.alter_column(
|
||||
"ft_notification_status",
|
||||
"notification_type",
|
||||
existing_type=enum_type(NotificationType),
|
||||
type_=sa.TEXT(),
|
||||
existing_nullable=False,
|
||||
postgresql_using=enum_using("notification_type", NotificationType),
|
||||
)
|
||||
op.alter_column(
|
||||
"verify_codes",
|
||||
"code_type",
|
||||
|
||||
Reference in New Issue
Block a user