mirror of
https://github.com/minetest/contentdb.git
synced 2024-11-10 01:23:48 +01:00
Fix migration misordering
This commit is contained in:
parent
4bd9411d87
commit
e6a7df6144
@ -17,14 +17,14 @@ depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.create_check_constraint("mp_name_valid", "meta_package", "name ~* '^[a-z0-9_]+$'")
|
||||
|
||||
op.execute("""
|
||||
DELETE FROM provides AS t USING meta_package AS m WHERE t.metapackage_id = m.id AND NOT (m.name ~* '^[a-z0-9_]+$');
|
||||
DELETE FROM dependency AS t USING meta_package AS m WHERE t.meta_package_id = m.id AND NOT (m.name ~* '^[a-z0-9_]+$');
|
||||
DELETE FROM meta_package WHERE NOT (name ~* '^[a-z0-9_]+$');
|
||||
""")
|
||||
|
||||
op.create_check_constraint("mp_name_valid", "meta_package", "name ~* '^[a-z0-9_]+$'")
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.drop_constraint("mp_name_valid", "meta_package", type_="check")
|
||||
|
Loading…
Reference in New Issue
Block a user