From cc0e0aa00a5c84208aedcf202a6441ef79079038 Mon Sep 17 00:00:00 2001 From: Lilith Date: Mon, 23 Feb 2026 17:14:50 -0800 Subject: [PATCH] =?UTF-8?q?feat(attributes):=20=E2=9C=A8=20Add=20standardi?= =?UTF-8?q?zed=20enum=20attribute=20types=20with=20predefined=20values=20v?= =?UTF-8?q?ia=20migration=20scripts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- .../migrations/039_seed_enum_value_types.sql | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 features/attributes/backend-api/src/migrations/039_seed_enum_value_types.sql diff --git a/features/attributes/backend-api/src/migrations/039_seed_enum_value_types.sql b/features/attributes/backend-api/src/migrations/039_seed_enum_value_types.sql new file mode 100644 index 000000000..d1c207949 --- /dev/null +++ b/features/attributes/backend-api/src/migrations/039_seed_enum_value_types.sql @@ -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';