mirror of
https://github.com/massbug/judge4c.git
synced 2026-05-20 13:18:52 +00:00
20 lines
518 B
PL/PgSQL
20 lines
518 B
PL/PgSQL
BEGIN;
|
|
|
|
-- Remove the unused TA variant from CourseEnrollmentRole.
|
|
CREATE TYPE "CourseEnrollmentRole_new" AS ENUM ('STUDENT');
|
|
|
|
ALTER TABLE "CourseEnrollment"
|
|
ALTER COLUMN "role" DROP DEFAULT;
|
|
|
|
ALTER TABLE "CourseEnrollment"
|
|
ALTER COLUMN "role" TYPE "CourseEnrollmentRole_new"
|
|
USING ("role"::text::"CourseEnrollmentRole_new");
|
|
|
|
ALTER TABLE "CourseEnrollment"
|
|
ALTER COLUMN "role" SET DEFAULT 'STUDENT';
|
|
|
|
DROP TYPE "CourseEnrollmentRole";
|
|
ALTER TYPE "CourseEnrollmentRole_new" RENAME TO "CourseEnrollmentRole";
|
|
|
|
COMMIT;
|