Skip to content

Commit

Permalink
Leave datatype and widget on reverse mirgation #10552
Browse files Browse the repository at this point in the history
  • Loading branch information
chiatt authored and jacobtylerwalls committed May 15, 2024
1 parent 3b1c8dd commit 122851a
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions arches/app/models/migrations/10552_add_reference_datatype.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ class Migration(migrations.Migration):
FALSE,
'19e56148-82b8-47eb-b66e-f6243639a1a8',
TRUE
);
)
ON CONFLICT DO NOTHING;
INSERT INTO widgets(
widgetid,
Expand All @@ -46,21 +47,10 @@ class Migration(migrations.Migration):
'views/components/widgets/reference-select',
'reference',
'{"placeholder": "Select an option", "i18n_properties": ["placeholder"]}'
);
)
ON CONFLICT DO NOTHING;
""",
reverse_sql="""
DELETE FROM cards_x_nodes_x_widgets
WHERE nodeid IN (SELECT nodeid FROM nodes WHERE datatype = 'reference');
DELETE FROM edges
WHERE domainnodeid IN (SELECT nodeid FROM nodes WHERE datatype = 'reference')
OR rangenodeid IN (SELECT nodeid FROM nodes WHERE datatype = 'reference');
DELETE FROM constraints_x_nodes
WHERE nodeid IN (SELECT nodeid FROM nodes WHERE datatype = 'reference');
DELETE FROM nodes WHERE datatype = 'reference';
DELETE FROM widgets WHERE widgetid = '19e56148-82b8-47eb-b66e-f6243639a1a8';
DELETE FROM d_data_types WHERE datatype = 'reference';
DELETE FROM tiles WHERE nodegroupid IN (SELECT nodegroupid FROM nodes WHERE datatype = 'reference');
""",
reverse_sql=migrations.RunSQL.noop,
),
]

0 comments on commit 122851a

Please sign in to comment.