api: add first version of export api
This commit is contained in:
committed by
Carl-Gerhard Lindesvärd
parent
7ea95afe16
commit
7f8d857508
@@ -0,0 +1,12 @@
|
||||
-- CreateEnum
|
||||
CREATE TYPE "ClientType" AS ENUM ('read', 'write', 'root');
|
||||
|
||||
-- DropForeignKey
|
||||
ALTER TABLE "clients" DROP CONSTRAINT "clients_projectId_fkey";
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "clients" ADD COLUMN "type" "ClientType" NOT NULL DEFAULT 'read',
|
||||
ALTER COLUMN "projectId" DROP NOT NULL;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "clients" ADD CONSTRAINT "clients_projectId_fkey" FOREIGN KEY ("projectId") REFERENCES "projects"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
@@ -0,0 +1,2 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "clients" ALTER COLUMN "type" SET DEFAULT 'write';
|
||||
@@ -90,14 +90,21 @@ model Profile {
|
||||
@@map("profiles")
|
||||
}
|
||||
|
||||
enum ClientType {
|
||||
read
|
||||
write
|
||||
root
|
||||
}
|
||||
|
||||
model Client {
|
||||
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
|
||||
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
|
||||
name String
|
||||
secret String?
|
||||
projectId String
|
||||
project Project @relation(fields: [projectId], references: [id])
|
||||
type ClientType @default(write)
|
||||
projectId String?
|
||||
project Project? @relation(fields: [projectId], references: [id])
|
||||
organizationSlug String
|
||||
cors String @default("*")
|
||||
cors String @default("*")
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @default(now()) @updatedAt
|
||||
|
||||
Reference in New Issue
Block a user