mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-18 21:48:49 -04:00
more work on postage migration
This commit is contained in:
@@ -15,6 +15,16 @@ down_revision = '0384_remove_letter_branding_'
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_constraint('ft_billing_pkey', 'ft_billing', type_='primary')
|
||||
op.create_primary_key('ft_billing_pkey', 'ft_billing', ['local_date',
|
||||
'template_id',
|
||||
'service_id',
|
||||
'notification_type',
|
||||
'provider',
|
||||
'rate_multiplier',
|
||||
'international',
|
||||
'rate'])
|
||||
|
||||
# we need to replace the entire notifications_all_time_view in order to update it
|
||||
op.execute("DROP VIEW notifications_all_time_view;")
|
||||
op.execute("""
|
||||
@@ -78,15 +88,6 @@ def upgrade():
|
||||
op.drop_column('templates', 'postage')
|
||||
op.drop_column('templates_history', 'postage')
|
||||
op.drop_column('ft_billing', 'postage')
|
||||
# op.drop_constraint('ft_billing_pkey', 'ft_billing', type_='primary')
|
||||
# op.create_primary_key('ft_billing_pkey', 'ft_billing', ['bst_date',
|
||||
# 'template_id',
|
||||
# 'service_id',
|
||||
# 'notification_type',
|
||||
# 'provider',
|
||||
# 'rate_multiplier',
|
||||
# 'international',
|
||||
# 'rate'])
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
@@ -98,16 +99,16 @@ def downgrade():
|
||||
op.add_column('notifications', sa.Column('postage', sa.VARCHAR(), autoincrement=False, nullable=True))
|
||||
op.add_column('notification_history', sa.Column('postage', sa.VARCHAR(), autoincrement=False, nullable=True))
|
||||
|
||||
# op.drop_constraint('ft_billing_pkey', 'ft_billing', type_='primary')
|
||||
# op.create_primary_key('ft_billing_pkey', 'ft_billing', ['bst_date',
|
||||
# 'template_id',
|
||||
# 'service_id',
|
||||
# 'notification_type',
|
||||
# 'provider',
|
||||
# 'rate_multiplier',
|
||||
# 'international',
|
||||
# 'rate',
|
||||
# 'postage'])
|
||||
op.drop_constraint('ft_billing_pkey', 'ft_billing', type_='primary')
|
||||
op.create_primary_key('ft_billing_pkey', 'ft_billing', ['local_date',
|
||||
'template_id',
|
||||
'service_id',
|
||||
'notification_type',
|
||||
'provider',
|
||||
'rate_multiplier',
|
||||
'international',
|
||||
'rate',
|
||||
'postage'])
|
||||
|
||||
op.execute("DROP VIEW notifications_all_time_view;")
|
||||
op.execute("""
|
||||
|
||||
Reference in New Issue
Block a user