mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 16:38:19 +01:00
refactor(database): 🐛 Don't allow token userId to be null
This commit is contained in:
parent
633e92d4e9
commit
203ea4b482
1
drizzle/0015_easy_mojo.sql
Normal file
1
drizzle/0015_easy_mojo.sql
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
ALTER TABLE "Tokens" ALTER COLUMN "userId" SET NOT NULL;
|
||||||
1965
drizzle/meta/0015_snapshot.json
Normal file
1965
drizzle/meta/0015_snapshot.json
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -106,6 +106,13 @@
|
||||||
"when": 1713389937821,
|
"when": 1713389937821,
|
||||||
"tag": "0014_wonderful_sandman",
|
"tag": "0014_wonderful_sandman",
|
||||||
"breakpoints": true
|
"breakpoints": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idx": 15,
|
||||||
|
"version": "5",
|
||||||
|
"when": 1713399438164,
|
||||||
|
"tag": "0015_easy_mojo",
|
||||||
|
"breakpoints": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
@ -210,10 +210,12 @@ export const Tokens = pgTable("Tokens", {
|
||||||
createdAt: timestamp("created_at", { precision: 3, mode: "string" })
|
createdAt: timestamp("created_at", { precision: 3, mode: "string" })
|
||||||
.defaultNow()
|
.defaultNow()
|
||||||
.notNull(),
|
.notNull(),
|
||||||
userId: uuid("userId").references(() => Users.id, {
|
userId: uuid("userId")
|
||||||
onDelete: "cascade",
|
.references(() => Users.id, {
|
||||||
onUpdate: "cascade",
|
onDelete: "cascade",
|
||||||
}),
|
onUpdate: "cascade",
|
||||||
|
})
|
||||||
|
.notNull(),
|
||||||
applicationId: uuid("applicationId").references(() => Applications.id, {
|
applicationId: uuid("applicationId").references(() => Applications.id, {
|
||||||
onDelete: "cascade",
|
onDelete: "cascade",
|
||||||
onUpdate: "cascade",
|
onUpdate: "cascade",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue