Skip to content

Commit

Permalink
feat: ✨ migrate to drizzle (#24)
Browse files Browse the repository at this point in the history
* feat: ✨ migrate to drizzle

* fix: 🐛 postgres and count issues

* fix: 🐛 schema and lucia auth v2 tables

* fix: 🐛 lucia postgres setup

* fix: 🐛 api endpoints

* fix: 🐛 contacts list api endpoint

---------

Co-authored-by: Eddy Chen <[email protected]>
  • Loading branch information
alexanderl19 and ecxyzzy authored Mar 6, 2024
1 parent 5188870 commit 9166365
Show file tree
Hide file tree
Showing 18 changed files with 792 additions and 553 deletions.
18 changes: 18 additions & 0 deletions drizzle.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { defineConfig } from "drizzle-kit";
import "dotenv/config";

if (!process.env.DATABASE_URL) {
throw new Error("DATABASE_URL environment variable is required");
}

export default defineConfig({
schema: "./src/lib/db/schema.ts",
out: "./drizzle",
driver: "pg",
dbCredentials: {
connectionString: process.env.DATABASE_URL,
},
schemaFilter: ["dev"],
verbose: true,
strict: true,
});
15 changes: 9 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"dev": "vite dev",
"format": "prettier --write .",
"postinstall": "husky install && prisma generate && svelte-kit sync",
"postinstall": "husky install && svelte-kit sync",
"lint": "eslint --quiet --fix .",
"preview": "vite preview",
"sst:deploy": "sst deploy",
Expand All @@ -19,15 +19,16 @@
"test:unit": "vitest"
},
"dependencies": {
"@lucia-auth/adapter-prisma": "3.0.2",
"@lucia-auth/adapter-postgresql": "2.0.2",
"@lucia-auth/oauth": "3.5.0",
"@melt-ui/svelte": "^0.61.1",
"@prisma/client": "5.5.2",
"@melt-ui/svelte": "0.61.1",
"@tanstack/svelte-query": "5.8.2",
"drizzle-orm": "^0.29.3",
"googleapis": "128.0.0",
"lucia": "2.7.4",
"lucide-svelte": "0.292.0",
"mimetext": "^3.0.16",
"mimetext": "3.0.16",
"postgres": "3.4.3",
"zod": "3.22.4"
},
"devDependencies": {
Expand All @@ -49,17 +50,19 @@
"constructs": "10.3.0",
"cz-conventional-changelog": "3.3.0",
"devmoji": "2.3.0",
"dotenv": "^16.4.5",
"drizzle-kit": "0.20.14",
"eslint": "8.53.0",
"eslint-config-prettier": "9.0.0",
"eslint-plugin-import": "2.29.0",
"eslint-plugin-svelte": "2.35.0",
"husky": "8.0.3",
"lint-staged": "15.1.0",
"pg": "8.11.3",
"prettier": "3.1.0",
"prettier-plugin-packagejson": "2.4.6",
"prettier-plugin-prisma": "5.0.0",
"prettier-plugin-svelte": "3.1.0",
"prisma": "5.5.2",
"sass": "1.69.5",
"sst": "2.36.1",
"svelte": "4.2.3",
Expand Down
Loading

0 comments on commit 9166365

Please sign in to comment.