Finalize template
This commit is contained in:
15
prisma/migrations/20260326110513_init/migration.sql
Normal file
15
prisma/migrations/20260326110513_init/migration.sql
Normal file
@@ -0,0 +1,15 @@
|
||||
-- CreateEnum
|
||||
CREATE TYPE "PostStatus" AS ENUM ('DRAFT', 'PUBLISHED', 'ARCHIVED');
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "posts" (
|
||||
"id" TEXT NOT NULL,
|
||||
"title" TEXT NOT NULL,
|
||||
"content" TEXT,
|
||||
"status" "PostStatus" NOT NULL DEFAULT 'DRAFT',
|
||||
"authorName" TEXT NOT NULL,
|
||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" TIMESTAMP(3) NOT NULL,
|
||||
|
||||
CONSTRAINT "posts_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 (e.g., Git)
|
||||
provider = "postgresql"
|
||||
@@ -1,8 +1,6 @@
|
||||
// This is your Prisma schema file,
|
||||
// learn more about it in the docs: https://pris.ly/d/prisma-schema
|
||||
|
||||
// Get a free hosted Postgres database in seconds: `npx create-db`
|
||||
|
||||
generator client {
|
||||
provider = "prisma-client"
|
||||
output = "../libs/prisma-generated/src/lib/generated"
|
||||
|
||||
5
prisma/seed.sql
Normal file
5
prisma/seed.sql
Normal file
@@ -0,0 +1,5 @@
|
||||
INSERT INTO "posts" ("id","title","content","status","authorName","createdAt","updatedAt")
|
||||
VALUES
|
||||
('post_1','Hello Prisma','First seeded post','DRAFT','Alice',NOW(),NOW()),
|
||||
('post_2','Published post','Seeded and published','PUBLISHED','Bob',NOW(),NOW())
|
||||
ON CONFLICT ("id") DO NOTHING;
|
||||
Reference in New Issue
Block a user