feat(attributes): ✨ Add standardized enum attribute types with predefined values via migration scripts
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
674f359c00
commit
cc0e0aa00a
1 changed files with 40 additions and 0 deletions
|
|
@ -0,0 +1,40 @@
|
|||
-- Seed enumValueType and enumValueConfig on existing attributes
|
||||
-- ISO country pickers
|
||||
UPDATE attribute_definitions SET "enumValueType" = 'iso-country' WHERE code IN ('country', 'countries_visited', 'nationality', 'bucket_list_travel');
|
||||
|
||||
-- ISO language pickers
|
||||
UPDATE attribute_definitions SET "enumValueType" = 'iso-language' WHERE code IN ('cultural_languages_spoken', 'cultural_languages_learning', 'language_learning');
|
||||
|
||||
-- Currency picker
|
||||
UPDATE attribute_definitions SET "enumValueType" = 'currency' WHERE code = 'currency_accepted';
|
||||
|
||||
-- Stepper for size enums (whole numbers or half-sizes)
|
||||
UPDATE attribute_definitions
|
||||
SET "enumValueType" = 'stepper',
|
||||
"enumValueConfig" = '{"step": 0.5, "min": 4, "max": 16}'::jsonb
|
||||
WHERE code = 'shoe_size';
|
||||
|
||||
UPDATE attribute_definitions
|
||||
SET "enumValueType" = 'stepper',
|
||||
"enumValueConfig" = '{"step": 2, "min": 0, "max": 30}'::jsonb
|
||||
WHERE code = 'dress_size';
|
||||
|
||||
UPDATE attribute_definitions
|
||||
SET "enumValueType" = 'stepper',
|
||||
"enumValueConfig" = '{"step": 1, "min": 20, "max": 60}'::jsonb
|
||||
WHERE code = 'waist_size';
|
||||
|
||||
UPDATE attribute_definitions
|
||||
SET "enumValueType" = 'stepper',
|
||||
"enumValueConfig" = '{"step": 1, "min": 28, "max": 60}'::jsonb
|
||||
WHERE code = 'hip_size';
|
||||
|
||||
UPDATE attribute_definitions
|
||||
SET "enumValueType" = 'stepper',
|
||||
"enumValueConfig" = '{"step": 1, "min": 28, "max": 50}'::jsonb
|
||||
WHERE code = 'bust_size';
|
||||
|
||||
UPDATE attribute_definitions
|
||||
SET "enumValueType" = 'stepper',
|
||||
"enumValueConfig" = '{"step": 1, "min": 0, "max": 12}'::jsonb
|
||||
WHERE code = 'cup_size';
|
||||
Loading…
Add table
Reference in a new issue