Prepare to stop inserting NotificationHistory at the time of inserting a notificaiton.

Need to remove foreign key to complaints.
Make sure if getting Notification.id we look to both tables.
This commit is contained in:
Rebecca Law
2019-05-21 16:08:18 +01:00
parent bde1e751ad
commit 3374e03ce9
4 changed files with 34 additions and 12 deletions

View File

@@ -0,0 +1,21 @@
"""
Revision ID: 0293_drop_complaint_fk
Revises: 0292_give_users_folder_perms
Create Date: 2019-05-16 14:05:18.104274
"""
from alembic import op
revision = '0293_drop_complaint_fk'
down_revision = '0292_give_users_folder_perms'
def upgrade():
op.drop_constraint('complaints_notification_id_fkey', table_name='complaints', type_='foreignkey')
def downgrade():
op.create_foreign_key('complaints_notification_id_fkey', 'complaints',
'notification_history', ['notification_id'], ['id'])