Alter old migrations so that they can downgrade
The Role -> User foreign key constraint was preventing roles from being deleted once there were existing users referencing the role. I realized it was best to just pass on the downgrade and allow the tables to be deleted.
This commit is contained in:
parent
e99ddd491a
commit
dcb45c64e8
@ -34,6 +34,4 @@ def upgrade():
|
|||||||
|
|
||||||
|
|
||||||
def downgrade():
|
def downgrade():
|
||||||
db = op.get_bind()
|
pass
|
||||||
db.execute("DELETE FROM roles WHERE name = 'default'")
|
|
||||||
|
|
||||||
|
@ -169,15 +169,4 @@ def upgrade():
|
|||||||
|
|
||||||
|
|
||||||
def downgrade():
|
def downgrade():
|
||||||
db = op.get_bind()
|
pass
|
||||||
db.execute("""
|
|
||||||
DELETE FROM roles
|
|
||||||
WHERE name IN (
|
|
||||||
'ccpo',
|
|
||||||
'owner',
|
|
||||||
'admin',
|
|
||||||
'developer',
|
|
||||||
'billing_auditor',
|
|
||||||
'security_auditor'
|
|
||||||
);
|
|
||||||
""")
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user