Skip to content

Commit bb85727

Browse files
committed
Add a column in the OATs table to differentiate between user and system generated
1 parent 7d97ebe commit bb85727

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
CREATE TYPE "OrganizationAccessTokenType" AS ENUM ('USER', 'SYSTEM');
2+
13
CREATE TABLE "OrganizationAccessToken" (
24
"id" TEXT NOT NULL,
35
"name" TEXT NOT NULL,
6+
"type" "OrganizationAccessTokenType" NOT NULL DEFAULT 'USER',
47
"encryptedToken" JSONB NOT NULL,
58
"obfuscatedToken" TEXT NOT NULL,
69
"hashedToken" TEXT NOT NULL,

internal-packages/database/prisma/schema.prisma

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,20 @@ model PersonalAccessToken {
133133
authorizationCodes AuthorizationCode[]
134134
}
135135

136+
enum OrganizationAccessTokenType {
137+
USER
138+
SYSTEM
139+
}
140+
136141
model OrganizationAccessToken {
137142
id String @id @default(cuid())
138143
139144
/// User-provided name for the token
140145
name String
141146
147+
/// Used to differentiate between user-generated and system-generated tokens
148+
type OrganizationAccessTokenType @default(USER)
149+
142150
/// This is the token encrypted using the ENCRYPTION_KEY
143151
encryptedToken Json
144152

0 commit comments

Comments
 (0)