diff --git a/packages/db/migrations/0034_extend_pet_profile_columns.sql b/packages/db/migrations/0034_extend_pet_profile_columns.sql new file mode 100644 index 0000000..e931dc4 --- /dev/null +++ b/packages/db/migrations/0034_extend_pet_profile_columns.sql @@ -0,0 +1,8 @@ +-- Migration: 0034_extend_pet_profile_columns.sql +-- GRO-1850: Adds temperament_score, temperament_flags, medical_alerts, +-- and preferred_cuts columns to the pets table. + +ALTER TABLE "pets" ADD COLUMN "temperament_score" integer; +ALTER TABLE "pets" ADD COLUMN "temperament_flags" jsonb DEFAULT '[]'; +ALTER TABLE "pets" ADD COLUMN "medical_alerts" jsonb DEFAULT '[]'; +ALTER TABLE "pets" ADD COLUMN "preferred_cuts" jsonb DEFAULT '[]'; \ No newline at end of file diff --git a/packages/db/migrations/meta/0034_snapshot.json b/packages/db/migrations/meta/0034_snapshot.json new file mode 100644 index 0000000..66c1851 --- /dev/null +++ b/packages/db/migrations/meta/0034_snapshot.json @@ -0,0 +1,210 @@ +{ + "id": "0034_extend_pet_profile_columns", + "prevId": "b3a381ca-f7a4-450f-aa7e-fdc2d652dc97", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.pets": { + "name": "pets", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "client_id": { + "name": "client_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "species": { + "name": "species", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "breed": { + "name": "breed", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "weight_kg": { + "name": "weight_kg", + "type": "numeric(5, 2)", + "primaryKey": false, + "notNull": false + }, + "date_of_birth": { + "name": "date_of_birth", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "health_alerts": { + "name": "health_alerts", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "grooming_notes": { + "name": "grooming_notes", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cut_style": { + "name": "cut_style", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "shampoo_preference": { + "name": "shampoo_preference", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "special_care_notes": { + "name": "special_care_notes", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "coat_type": { + "name": "coat_type", + "type": "coat_type", + "primaryKey": false, + "notNull": false + }, + "pet_size_category": { + "name": "pet_size_category", + "type": "pet_size_category", + "primaryKey": false, + "notNull": false + }, + "temperament_score": { + "name": "temperament_score", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "temperament_flags": { + "name": "temperament_flags", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'[]'::jsonb" + }, + "medical_alerts": { + "name": "medical_alerts", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'[]'::jsonb" + }, + "preferred_cuts": { + "name": "preferred_cuts", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'[]'::jsonb" + }, + "custom_fields": { + "name": "custom_fields", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "photo_key": { + "name": "photo_key", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "photo_uploaded_at": { + "name": "photo_uploaded_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "image": { + "name": "image", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "pets_client_id_clients_id_fk": { + "name": "pets_client_id_clients_id_fk", + "tableFrom": "pets", + "tableTo": "clients", + "columnsFrom": [ + "client_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": { + "coat_type": { + "name": "coat_type", + "values": [ + "short", + "medium", + "long", + "wire", + "double", + "hairless", + "curly" + ] + }, + "pet_size_category": { + "name": "pet_size_category", + "values": [ + "small", + "medium", + "large", + "extra_large" + ] + } + }, + "nativeEnums": {} +} \ No newline at end of file diff --git a/packages/db/migrations/meta/_journal.json b/packages/db/migrations/meta/_journal.json index a364fe1..db9e36c 100644 --- a/packages/db/migrations/meta/_journal.json +++ b/packages/db/migrations/meta/_journal.json @@ -239,6 +239,13 @@ "when": 1779500000000, "tag": "0033_add_services_default_buffer_minutes", "breakpoints": true + }, + { + "idx": 34, + "version": "7", + "when": 1751140800000, + "tag": "0034_extend_pet_profile_columns", + "breakpoints": true } ] } \ No newline at end of file