feat: Organization services
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- The values [user] on the enum `ORG_ROLE` will be removed. If these variants are still used in the database, this will fail.
|
||||
- The values [ordinary] on the enum `USER_ROLE` will be removed. If these variants are still used in the database, this will fail.
|
||||
|
||||
*/
|
||||
|
||||
-- AlterEnum
|
||||
BEGIN;
|
||||
CREATE TYPE "ORG_ROLE_new" AS ENUM ('owner', 'admin', 'member');
|
||||
ALTER TABLE "public"."organization_user_join" ALTER COLUMN "role" DROP DEFAULT;
|
||||
ALTER TABLE "organization_user_join" ALTER COLUMN "role" TYPE "ORG_ROLE_new" USING ("role"::text::"ORG_ROLE_new");
|
||||
ALTER TYPE "ORG_ROLE" RENAME TO "ORG_ROLE_old";
|
||||
ALTER TYPE "ORG_ROLE_new" RENAME TO "ORG_ROLE";
|
||||
DROP TYPE "public"."ORG_ROLE_old";
|
||||
ALTER TABLE "organization_user_join" ALTER COLUMN "role" SET DEFAULT 'member';
|
||||
COMMIT;
|
||||
|
||||
-- AlterEnum
|
||||
BEGIN;
|
||||
CREATE TYPE "USER_ROLE_new" AS ENUM ('superadmin', 'user');
|
||||
ALTER TABLE "public"."user" ALTER COLUMN "role" DROP DEFAULT;
|
||||
ALTER TABLE "user" ALTER COLUMN "role" TYPE "USER_ROLE_new" USING ("role"::text::"USER_ROLE_new");
|
||||
ALTER TYPE "USER_ROLE" RENAME TO "USER_ROLE_old";
|
||||
ALTER TYPE "USER_ROLE_new" RENAME TO "USER_ROLE";
|
||||
DROP TYPE "public"."USER_ROLE_old";
|
||||
ALTER TABLE "user" ALTER COLUMN "role" SET DEFAULT 'user';
|
||||
COMMIT;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "organization_user_join" ALTER COLUMN "role" SET DEFAULT 'member';
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "user" ALTER COLUMN "role" SET DEFAULT 'user';
|
||||
1
prisma/migrations/20260221131903_new_enum/migration.sql
Normal file
1
prisma/migrations/20260221131903_new_enum/migration.sql
Normal file
@@ -0,0 +1 @@
|
||||
-- This is an empty migration.
|
||||
@@ -0,0 +1,11 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- Added the required column `requestType` to the `organization_join_request` table without a default value. This is not possible if the table is not empty.
|
||||
|
||||
*/
|
||||
-- CreateEnum
|
||||
CREATE TYPE "ORGANIZATION_JOIN_REQUEST_TYPE" AS ENUM ('INVITED', 'REQUESTED');
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "organization_join_request" ADD COLUMN "requestType" "ORGANIZATION_JOIN_REQUEST_TYPE" NOT NULL;
|
||||
Reference in New Issue
Block a user