mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-18 05:28:49 -04:00
Merge branch 'cycle-notification_history-table' of github.com:alphagov/notifications-api into cycle-notification_history-table
This commit is contained in:
23
migrations/versions/0321_notification_history_pivot.py
Normal file
23
migrations/versions/0321_notification_history_pivot.py
Normal file
@@ -0,0 +1,23 @@
|
||||
"""
|
||||
|
||||
Revision ID: 0321_notification_history_pivot
|
||||
Revises: 0320_optimise_notifications
|
||||
Create Date: 2020-03-26 11:16:12.389524
|
||||
|
||||
"""
|
||||
import os
|
||||
|
||||
from alembic import op
|
||||
|
||||
revision = '0321_notification_history_pivot'
|
||||
down_revision = '0320_optimise_notifications'
|
||||
environment = os.environ['NOTIFY_ENVIRONMENT']
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.execute('CREATE TABLE notification_history_pivot AS SELECT * FROM notification_history WHERE 1=2')
|
||||
op.execute('ALTER TABLE notification_history_pivot ADD PRIMARY KEY (id)')
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.execute('DROP TABLE notifications_history_pivot')
|
||||
Reference in New Issue
Block a user