Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use prisma ORM #10

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.0.1",
"private": true,
"scripts": {
"predev":"prisma migrate dev",
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
Expand All @@ -14,6 +15,7 @@
"@sveltejs/kit": "next",
"autoprefixer": "^10.4.12",
"postcss": "^8.4.18",
"prisma": "^4.5.0",
"svelte": "^3.44.0",
"svelte-check": "^2.7.1",
"svelte-preprocess": "^4.10.7",
Expand All @@ -24,6 +26,7 @@
},
"type": "module",
"dependencies": {
"@prisma/client": "^4.5.0",
"daisyui": "^2.31.0",
"svelte-material-icons": "^2.0.4"
}
Expand Down
8 changes: 8 additions & 0 deletions prisma/migrations/20221022172752_init/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
-- CreateTable
CREATE TABLE "Todo" (
"id" TEXT NOT NULL,
"text" TEXT NOT NULL,
"completed" BOOLEAN NOT NULL,

CONSTRAINT "Todo_pkey" PRIMARY KEY ("id")
);
3 changes: 3 additions & 0 deletions prisma/migrations/migration_lock.toml
Original file line number Diff line number Diff line change
@@ -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"
15 changes: 15 additions & 0 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}

generator client {
provider = "prisma-client-js"
binaryTargets = ["native"]
}

model Todo {
id String @id @default(cuid())
text String
completed Boolean
}