mirror of
https://github.com/GSA/notifications-api.git
synced 2026-04-17 07:39:42 -04:00
Merge pull request #2387 from alphagov/remove-fk-to-users
Removing the foreign from to users from Notification_history.
This commit is contained in:
@@ -1615,8 +1615,7 @@ class NotificationHistory(db.Model, HistoryModel):
|
||||
phone_prefix = db.Column(db.String, nullable=True)
|
||||
rate_multiplier = db.Column(db.Float(asdecimal=False), nullable=True)
|
||||
|
||||
created_by = db.relationship('User')
|
||||
created_by_id = db.Column(UUID(as_uuid=True), db.ForeignKey('users.id'), nullable=True)
|
||||
created_by_id = db.Column(UUID(as_uuid=True), nullable=True)
|
||||
|
||||
postage = db.Column(db.String, nullable=True)
|
||||
CheckConstraint("""
|
||||
|
||||
19
migrations/versions/0279_remove_fk_to_users.py
Normal file
19
migrations/versions/0279_remove_fk_to_users.py
Normal file
@@ -0,0 +1,19 @@
|
||||
"""
|
||||
|
||||
Revision ID: 0279_remove_fk_to_users
|
||||
Revises: 0278_add_more_stuff_to_orgs
|
||||
Create Date: 2019-03-06 16:49:28.674498
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
|
||||
revision = '0279_remove_fk_to_users'
|
||||
down_revision = '0278_add_more_stuff_to_orgs'
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.drop_constraint('notification_history_created_by_id_fkey', 'notification_history', type_='foreignkey')
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.create_foreign_key('notification_history_created_by_id_fkey', 'notification_history', 'users', ['created_by_id'], ['id'])
|
||||
Reference in New Issue
Block a user