From a8389d00bee8004e934dcf9a1cb468dcaf271e9a Mon Sep 17 00:00:00 2001 From: Harkamal Randhawa Date: Tue, 14 Apr 2026 15:39:30 -0600 Subject: [PATCH] nullable petId in appointment --- .../resources/db/migration/V3__nullable_appointment_petid.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 backend/src/main/resources/db/migration/V3__nullable_appointment_petid.sql diff --git a/backend/src/main/resources/db/migration/V3__nullable_appointment_petid.sql b/backend/src/main/resources/db/migration/V3__nullable_appointment_petid.sql new file mode 100644 index 00000000..06639401 --- /dev/null +++ b/backend/src/main/resources/db/migration/V3__nullable_appointment_petid.sql @@ -0,0 +1,3 @@ +ALTER TABLE appointment MODIFY petId BIGINT NULL; +ALTER TABLE appointment DROP FOREIGN KEY fk_appointment_pet; +ALTER TABLE appointment ADD CONSTRAINT fk_appointment_pet FOREIGN KEY (petId) REFERENCES pet(petId) ON DELETE SET NULL; -- 2.49.1