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;