0001_normal_juggernaut.sql 1.1 KB

123456789101112
  1. ALTER TABLE "classes" DROP CONSTRAINT "classes_period_id_periods_id_fk";
  2. --> statement-breakpoint
  3. ALTER TABLE "attendance" ADD COLUMN "partial_id" uuid;--> statement-breakpoint
  4. ALTER TABLE "classes" ADD COLUMN "credits" integer NOT NULL;--> statement-breakpoint
  5. ALTER TABLE "classes" ADD COLUMN "description" text;--> statement-breakpoint
  6. ALTER TABLE "partials" ADD COLUMN "start_date" date NOT NULL;--> statement-breakpoint
  7. ALTER TABLE "partials" ADD COLUMN "end_date" date NOT NULL;--> statement-breakpoint
  8. ALTER TABLE "sections" ADD COLUMN "period_id" uuid;--> statement-breakpoint
  9. ALTER TABLE "sections" ADD COLUMN "max_students" integer NOT NULL;--> statement-breakpoint
  10. ALTER TABLE "attendance" ADD CONSTRAINT "attendance_partial_id_partials_id_fk" FOREIGN KEY ("partial_id") REFERENCES "public"."partials"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
  11. ALTER TABLE "sections" ADD CONSTRAINT "sections_period_id_periods_id_fk" FOREIGN KEY ("period_id") REFERENCES "public"."periods"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
  12. ALTER TABLE "classes" DROP COLUMN "period_id";