mirror of
https://github.com/aditama-labs/nest-autocrud.git
synced 2024-11-24 12:56:22 +00:00
wip: sample with prisma
This commit is contained in:
parent
ac3260895a
commit
a1576273bd
0
libs/prisma/src/prisma-crud.controller.ts
Normal file
0
libs/prisma/src/prisma-crud.controller.ts
Normal file
10
prisma/migrations/20241026125933_init/migration.sql
Normal file
10
prisma/migrations/20241026125933_init/migration.sql
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
-- CreateExtension
|
||||||
|
CREATE EXTENSION IF NOT EXISTS "pgcrypto";
|
||||||
|
|
||||||
|
-- CreateTable
|
||||||
|
CREATE TABLE "account" (
|
||||||
|
"id" UUID NOT NULL DEFAULT gen_random_uuid(),
|
||||||
|
"name" TEXT NOT NULL,
|
||||||
|
|
||||||
|
CONSTRAINT "account_pkey" PRIMARY KEY ("id")
|
||||||
|
);
|
3
prisma/migrations/migration_lock.toml
Normal file
3
prisma/migrations/migration_lock.toml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# Please do not edit this file manually
|
||||||
|
# It should be added in your version-control system (i.e. Git)
|
||||||
|
provider = "postgresql"
|
@ -5,10 +5,19 @@
|
|||||||
// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init
|
// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init
|
||||||
|
|
||||||
generator client {
|
generator client {
|
||||||
provider = "prisma-client-js"
|
provider = "prisma-client-js"
|
||||||
|
previewFeatures = ["postgresqlExtensions"]
|
||||||
}
|
}
|
||||||
|
|
||||||
datasource db {
|
datasource db {
|
||||||
provider = "postgresql"
|
provider = "postgresql"
|
||||||
url = env("DATABASE_URL")
|
url = env("DATABASE_URL")
|
||||||
|
extensions = [pgcrypto]
|
||||||
|
}
|
||||||
|
|
||||||
|
model User {
|
||||||
|
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
|
||||||
|
name String
|
||||||
|
|
||||||
|
@@map("account")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user