This commit is contained in:
2026-07-16 09:53:14 +07:00
parent 0fc112a2e8
commit 29cec708a3
1236 changed files with 212848 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
ALTER TABLE "training_records" ADD COLUMN "course_name" text;
--> statement-breakpoint
UPDATE "training_records" AS "tr"
SET "course_name" = "c"."name"
FROM "courses" AS "c"
WHERE "tr"."course_id" = "c"."id"
AND "tr"."course_name" IS NULL;
--> statement-breakpoint
UPDATE "training_records"
SET "course_name" = 'External course'
WHERE "course_name" IS NULL;
--> statement-breakpoint
ALTER TABLE "training_records" ALTER COLUMN "course_name" SET NOT NULL;
--> statement-breakpoint
ALTER TABLE "training_records" ALTER COLUMN "course_id" DROP NOT NULL;