This commit is contained in:
Kenneth Kehl
2023-08-29 14:54:30 -07:00
parent 19dcd7a48b
commit 1ecb747c6d
588 changed files with 34100 additions and 23589 deletions

View File

@@ -9,33 +9,67 @@ from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
revision = '0147_drop_mapping_tables'
down_revision = '0146_add_service_callback_api'
revision = "0147_drop_mapping_tables"
down_revision = "0146_add_service_callback_api"
def upgrade():
op.drop_table('notification_to_sms_sender')
op.drop_table('notification_to_email_reply_to')
op.drop_table("notification_to_sms_sender")
op.drop_table("notification_to_email_reply_to")
def downgrade():
op.create_table('notification_to_email_reply_to',
sa.Column('notification_id', postgresql.UUID(), autoincrement=False, nullable=False),
sa.Column('service_email_reply_to_id', postgresql.UUID(), autoincrement=False, nullable=False),
sa.ForeignKeyConstraint(['notification_id'], ['notifications.id'],
name='notification_to_email_reply_to_notification_id_fkey'),
sa.ForeignKeyConstraint(['service_email_reply_to_id'], ['service_email_reply_to.id'],
name='notification_to_email_reply_to_service_email_reply_to_id_fkey'),
sa.PrimaryKeyConstraint('notification_id', 'service_email_reply_to_id',
name='notification_to_email_reply_to_pkey')
)
op.create_table('notification_to_sms_sender',
sa.Column('notification_id', postgresql.UUID(), autoincrement=False, nullable=False),
sa.Column('service_sms_sender_id', postgresql.UUID(), autoincrement=False, nullable=False),
sa.ForeignKeyConstraint(['notification_id'], ['notifications.id'],
name='notification_to_sms_sender_notification_id_fkey'),
sa.ForeignKeyConstraint(['service_sms_sender_id'], ['service_sms_senders.id'],
name='notification_to_sms_sender_service_sms_sender_id_fkey'),
sa.PrimaryKeyConstraint('notification_id', 'service_sms_sender_id',
name='notification_to_sms_sender_pkey')
)
op.create_table(
"notification_to_email_reply_to",
sa.Column(
"notification_id", postgresql.UUID(), autoincrement=False, nullable=False
),
sa.Column(
"service_email_reply_to_id",
postgresql.UUID(),
autoincrement=False,
nullable=False,
),
sa.ForeignKeyConstraint(
["notification_id"],
["notifications.id"],
name="notification_to_email_reply_to_notification_id_fkey",
),
sa.ForeignKeyConstraint(
["service_email_reply_to_id"],
["service_email_reply_to.id"],
name="notification_to_email_reply_to_service_email_reply_to_id_fkey",
),
sa.PrimaryKeyConstraint(
"notification_id",
"service_email_reply_to_id",
name="notification_to_email_reply_to_pkey",
),
)
op.create_table(
"notification_to_sms_sender",
sa.Column(
"notification_id", postgresql.UUID(), autoincrement=False, nullable=False
),
sa.Column(
"service_sms_sender_id",
postgresql.UUID(),
autoincrement=False,
nullable=False,
),
sa.ForeignKeyConstraint(
["notification_id"],
["notifications.id"],
name="notification_to_sms_sender_notification_id_fkey",
),
sa.ForeignKeyConstraint(
["service_sms_sender_id"],
["service_sms_senders.id"],
name="notification_to_sms_sender_service_sms_sender_id_fkey",
),
sa.PrimaryKeyConstraint(
"notification_id",
"service_sms_sender_id",
name="notification_to_sms_sender_pkey",
),
)