added post key route
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- A unique constraint covering the columns `[name]` on the table `ApiKey` will be added. If there are existing duplicate values, this will fail.
|
||||
|
||||
*/
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "ApiKey_name_key" ON "ApiKey"("name");
|
||||
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- A unique constraint covering the columns `[name,userId]` on the table `ApiKey` will be added. If there are existing duplicate values, this will fail.
|
||||
|
||||
*/
|
||||
-- DropIndex
|
||||
DROP INDEX "ApiKey_name_key";
|
||||
|
||||
-- DropIndex
|
||||
DROP INDEX "ApiKey_token_userId_key";
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "ApiKey_name_userId_key" ON "ApiKey"("name", "userId");
|
||||
@@ -144,7 +144,7 @@ model Subscription {
|
||||
|
||||
model ApiKey {
|
||||
id Int @id @default(autoincrement())
|
||||
name String
|
||||
name String
|
||||
user User @relation(fields: [userId], references: [id])
|
||||
userId Int
|
||||
token String @unique
|
||||
@@ -153,5 +153,5 @@ model ApiKey {
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @default(now()) @updatedAt
|
||||
|
||||
@@unique([token, userId])
|
||||
@@unique([name, userId])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user