wip: sample with prisma

This commit is contained in:
Supan Adit Pratama 2024-10-26 20:01:34 +07:00
parent ac3260895a
commit a1576273bd
4 changed files with 25 additions and 3 deletions

View 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")
);

View 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"

View File

@ -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")
} }