__drizzle_migrations table

Hi! I need some help finding out what I'm doing wrong or if there's a bug causing my issue? Drizzle doesn't seem to generate a migrations table for me. I've tried using both the drizzle-kit generate/push commands and going through the migrate function via drizzle-orm. The other tables specified in my schemas are being created and I can interact with the DB with queries etc. Here's my setup drizzle-kit: 0.21.1 drizzle-orm: 0.30.10
// drizzle.config.js
import 'dotenv/config'
import { defineConfig } from 'drizzle-kit'

/** @type { import("drizzle-kit").Config } */
export default defineConfig({
schema: 'src/db/schema.*',
out: 'src/db/migrations',
dialect: 'postgresql',
dbCredentials: {
url: process.env.DATABASE_URL,
},
verbose: true,
strict: false,
schemaFilter: ['public'],
})

// src/db/index.ts
import { drizzle } from 'drizzle-orm/node-postgres'
import { Client } from 'pg'
import * as schema from './schema'

export const client = new Client(process.env.DATABASE_URL)
export const db = drizzle(client, { schema })

// src/db/migrate.ts
import 'dotenv/config'
import { resolve } from 'path'
import { client, db } from './'
import { migrate } from 'drizzle-orm/node-postgres/migrator'
export default async () => {
await client.connect()
await migrate(db, { migrationsFolder: resolve(__dirname, './migrations') })
await client.end()
// drizzle.config.js
import 'dotenv/config'
import { defineConfig } from 'drizzle-kit'

/** @type { import("drizzle-kit").Config } */
export default defineConfig({
schema: 'src/db/schema.*',
out: 'src/db/migrations',
dialect: 'postgresql',
dbCredentials: {
url: process.env.DATABASE_URL,
},
verbose: true,
strict: false,
schemaFilter: ['public'],
})

// src/db/index.ts
import { drizzle } from 'drizzle-orm/node-postgres'
import { Client } from 'pg'
import * as schema from './schema'

export const client = new Client(process.env.DATABASE_URL)
export const db = drizzle(client, { schema })

// src/db/migrate.ts
import 'dotenv/config'
import { resolve } from 'path'
import { client, db } from './'
import { migrate } from 'drizzle-orm/node-postgres/migrator'
export default async () => {
await client.connect()
await migrate(db, { migrationsFolder: resolve(__dirname, './migrations') })
await client.end()
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server