Skip to content

Commit 98f2248

Browse files
committed
feat: ✨ (api) users に role を追加
1 parent bd938a1 commit 98f2248

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
-- CreateEnum
2+
CREATE TYPE "UserRole" AS ENUM ('USER', 'OCCUPIER');
3+
4+
-- AlterTable
5+
ALTER TABLE "users" ADD COLUMN "role" "UserRole" NOT NULL DEFAULT 'USER';

apps/api/src/infra/prisma/schema.prisma

+6
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ datasource db {
1010
extensions = [pgvector(map: "vector", schema: "public")]
1111
}
1212

13+
enum UserRole {
14+
USER
15+
OCCUPIER
16+
}
17+
1318
enum LostAndFoundState {
1419
NONE
1520
DELIVERING
@@ -22,6 +27,7 @@ model User {
2227
hashedFingerprintId String? @unique @map("hashed_fingerprint_id") @db.Char(64)
2328
name String @map("name") @db.VarChar(64)
2429
email String @map("email") @db.VarChar(320)
30+
role UserRole @default(USER)
2531
lostAndFoundState LostAndFoundState @default(NONE) @map("lost_and_found_state")
2632
avatarUrl String @map("avatar_url")
2733

0 commit comments

Comments
 (0)