Initial BizOne portal setup
This commit is contained in:
15
prisma/migrations/0006_user_invites/migration.sql
Normal file
15
prisma/migrations/0006_user_invites/migration.sql
Normal file
@ -0,0 +1,15 @@
|
||||
ALTER TYPE "UserStatus" ADD VALUE IF NOT EXISTS 'invited';
|
||||
|
||||
ALTER TABLE "users"
|
||||
ALTER COLUMN "password_hash" DROP NOT NULL,
|
||||
ALTER COLUMN "status" SET DEFAULT 'invited',
|
||||
ADD COLUMN IF NOT EXISTS "invite_token_hash" TEXT,
|
||||
ADD COLUMN IF NOT EXISTS "invite_token_expires_at" TIMESTAMP(3),
|
||||
ADD COLUMN IF NOT EXISTS "email_verified_at" TIMESTAMP(3),
|
||||
ADD COLUMN IF NOT EXISTS "last_login_at" TIMESTAMP(3);
|
||||
|
||||
UPDATE "users"
|
||||
SET "status" = 'active'
|
||||
WHERE "status" IS NULL OR "status"::text = 'active';
|
||||
|
||||
CREATE INDEX IF NOT EXISTS "users_invite_token_hash_idx" ON "users"("invite_token_hash");
|
||||
Reference in New Issue
Block a user