Skip to content

Commit

Permalink
Merge pull request #151 from fogbender/feat/update-drizzle
Browse files Browse the repository at this point in the history
move from src/db/migrations to src/db
  • Loading branch information
JLarky authored Aug 12, 2024
2 parents e4bc15d + d571f8f commit 426d47c
Show file tree
Hide file tree
Showing 8 changed files with 175 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
dist
.vscode
.vercel
src/db/migrations
src/db/meta/
6 changes: 3 additions & 3 deletions drizzle.config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { defineConfig } from 'drizzle-kit';

export const migrationsFolder = './src/db/migrations';
export const dbFolder = './src/db';

export default defineConfig({
dialect: 'postgresql', // supports "sqlite" | "mysql"
schema: './src/db',
out: migrationsFolder,
schema: `${dbFolder}/schema.ts`,
out: dbFolder,
dbCredentials: {
// used by "push" and "pull" commands
url: process.env.DATABASE_URL!,
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"jotai": "^2.2.2",
"js-cookie": "^3.0.5",
"jsonwebtoken": "^9.0.1",
"postgres": "^3.3.4",
"postgres": "^3.4.4",
"posthog-js": "^1.69.0",
"posthog-node": "^3.1.1",
"prettier": "^3.0.3",
Expand All @@ -69,7 +69,7 @@
"satori": "^0.10.1",
"solid-js": "^1.7.6",
"stripe": "^12.12.0",
"tsx": "^3.12.7",
"tsx": "^4.17.0",
"typescript": "^5.2.2",
"unthunk": "^0.0.1",
"vite-plugin-checker": "^0.6.2",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/db/scripts/migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// `drizzle-kit generate` but moving it to src/db/scripts seems to fix the issue
import { migrate } from 'drizzle-orm/postgres-js/migrator';

import { migrationsFolder } from '../../../drizzle.config';
import { dbFolder as migrationsFolder } from '../../../drizzle.config';
import { db } from '../db';

console.log('Migrating database using', migrationsFolder, 'folder');
Expand Down
188 changes: 168 additions & 20 deletions yarn.lock

Large diffs are not rendered by default.

0 comments on commit 426d47c

Please sign in to comment.