diff --git a/.github/workflows/pr-backend-ci.yml b/.github/workflows/pr-backend-ci.yml index 339295b1..d0c15756 100644 --- a/.github/workflows/pr-backend-ci.yml +++ b/.github/workflows/pr-backend-ci.yml @@ -6,6 +6,7 @@ env: JWT_REFRESH_SECRET: "test_refresh" JWT_EXPIRATION_TIME: "15min" CORS_ORIGIN: "" + APP_URL: "http://app.example" EMAIL_ADAPTER: "mailhog" DATABASE_URL: "" SMTP_HOST: "" diff --git a/apps/api/src/storage/migrations/0008_change_role_teacher_tutor.sql b/apps/api/src/storage/migrations/0008_change_role_teacher_tutor.sql index 4e500814..f40d9cad 100644 --- a/apps/api/src/storage/migrations/0008_change_role_teacher_tutor.sql +++ b/apps/api/src/storage/migrations/0008_change_role_teacher_tutor.sql @@ -3,9 +3,12 @@ BEGIN IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'role') THEN CREATE TYPE role AS ENUM ('admin', 'student', 'tutor'); ELSE - ALTER TYPE role ADD VALUE IF NOT EXISTS 'tutor'; + IF NOT EXISTS (SELECT 1 FROM pg_enum WHERE enumlabel = 'tutor' AND enumtypid = 'role'::regtype) THEN + ALTER TYPE role ADD VALUE 'tutor'; + END IF; - IF EXISTS (SELECT 1 FROM pg_enum WHERE enumtypid = 'role'::regtype AND enumlabel = 'teacher') THEN + IF EXISTS (SELECT 1 FROM pg_enum WHERE enumlabel = 'teacher' AND enumtypid = 'role'::regtype) + AND NOT EXISTS (SELECT 1 FROM pg_enum WHERE enumlabel = 'tutor' AND enumtypid = 'role'::regtype) THEN ALTER TYPE role RENAME VALUE 'teacher' TO 'tutor'; END IF; END IF; diff --git a/apps/api/src/users/users.service.ts b/apps/api/src/users/users.service.ts index 730e3a59..f2b64758 100644 --- a/apps/api/src/users/users.service.ts +++ b/apps/api/src/users/users.service.ts @@ -43,7 +43,7 @@ export class UsersService { const passwordToken = crypto.randomUUID(); /** - * TODO: Add expiration of token in set-password link + * TODO: Add expiration of set password link * https://selleolabs.atlassian.net/browse/LC-136 */