Skip to content

Commit

Permalink
Add datatype migration #10552
Browse files Browse the repository at this point in the history
  • Loading branch information
chiatt committed Jan 26, 2024
1 parent 34e677f commit 2d84413
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions arches/app/models/migrations/10552_add_reference_datatype.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("models", "10541_controlled_list_manager"),
]

operations = [
migrations.RunSQL(
sql="""
INSERT INTO d_data_types(
datatype,
iconclass,
modulename,
classname,
defaultconfig,
configcomponent,
configname,
isgeometric,
defaultwidget,
issearchable
) VALUES (
'reference',
'fa fa-list',
'datatypes.py',
'ReferenceDataType',
'views/components/datatypes/reference',
{"controlledList": null, "multiValue": false},
reference-datatype-config,
FALSE,
'19e56148-82b8-47eb-b66e-f6243639a1a8',
TRUE
);
INSERT INTO widgets(
widgetid,
name,
component,
datatype,
defaultconfig
) VALUES (
'19e56148-82b8-47eb-b66e-f6243639a1a8',
'reference-select-widget',
'views/components/widgets/reference-select',
'{"i18n_properties": ["placeholder"]}',
'reference'
);
""",
reverse_sql="""
DELETE FROM widgets WHERE widgetid = '19e56148-82b8-47eb-b66e-f6243639a1a8';
DELETE FROM d_data_types WHERE datatype = 'reference';
""",
),
]

0 comments on commit 2d84413

Please sign in to comment.