Skip to content

Commit 4b09df9

Browse files
committed
feat(schema): add services table constraints and new snapshot for children and coaching sessions
1 parent ab3a031 commit 4b09df9

4 files changed

Lines changed: 1327 additions & 17 deletions

File tree

drizzle/0001_magical_cloak.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
ALTER TABLE "services" DROP CONSTRAINT "services_coach_id_profiles_id_fk";
2+
--> statement-breakpoint
3+
ALTER TABLE "services" ADD CONSTRAINT "services_coach_id_profiles_id_fk" FOREIGN KEY ("coach_id") REFERENCES "public"."profiles"("id") ON DELETE restrict ON UPDATE no action;--> statement-breakpoint
4+
ALTER TABLE "services" ADD CONSTRAINT "services_private_lessons_require_coach" CHECK ("services"."type" <> 'private_lessons' OR "services"."coach_id" IS NOT NULL);

0 commit comments

Comments
 (0)