© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•8mo ago•
1 reply
araguma

drizzle-kit push ignores SQL schema

I'm trying to create a Postgres schema using the method mentioned in https://orm.drizzle.team/docs/schemas, but when I run
drizzle-kit push
drizzle-kit push
, nothing is added to the database.

It works fine when I just use
pgTable
pgTable
to declare the tables, and
drizzle-kit generate
drizzle-kit generate
creates the Postgres schemas as well.

My current
src/schemas/auth.ts
src/schemas/auth.ts
file looks like this:
import { boolean, pgSchema, text, timestamp } from 'drizzle-orm/pg-core'

export const authSchema = pgSchema('auth')

export const users = authSchema.table('users', {
    id: text('id').primaryKey(),
    name: text('name').notNull(),
    email: text('email').notNull().unique(),
    emailVerified: boolean('email_verified')
        .$defaultFn(() => false)
        .notNull(),
    image: text('image'),
    createdAt: timestamp('created_at')
        .$defaultFn(() => /* @__PURE__ */ new Date())
        .notNull(),
    updatedAt: timestamp('updated_at')
        .$defaultFn(() => /* @__PURE__ */ new Date())
        .notNull(),
})
import { boolean, pgSchema, text, timestamp } from 'drizzle-orm/pg-core'

export const authSchema = pgSchema('auth')

export const users = authSchema.table('users', {
    id: text('id').primaryKey(),
    name: text('name').notNull(),
    email: text('email').notNull().unique(),
    emailVerified: boolean('email_verified')
        .$defaultFn(() => false)
        .notNull(),
    image: text('image'),
    createdAt: timestamp('created_at')
        .$defaultFn(() => /* @__PURE__ */ new Date())
        .notNull(),
    updatedAt: timestamp('updated_at')
        .$defaultFn(() => /* @__PURE__ */ new Date())
        .notNull(),
})

and my drizzle.config.ts looks like this:
import { defineConfig } from 'drizzle-kit'
import { requireEnv } from 'env'

export default defineConfig({
    dialect: 'postgresql',
    schema: 'src/schemas',
    out: 'drizzle',
    dbCredentials: {
        url: requireEnv('POSTGRES_URL'),
    },
})
import { defineConfig } from 'drizzle-kit'
import { requireEnv } from 'env'

export default defineConfig({
    dialect: 'postgresql',
    schema: 'src/schemas',
    out: 'drizzle',
    dbCredentials: {
        url: requireEnv('POSTGRES_URL'),
    },
})
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Drizzle-kit push - pgPolicy ignores using configuration
Drizzle TeamDTDrizzle Team / help
16mo ago
drizzle-kit migration schema push error
Drizzle TeamDTDrizzle Team / help
2y ago
drizzle-kit push
Drizzle TeamDTDrizzle Team / help
5mo ago
drizzle-kit push:pg and sql commands
Drizzle TeamDTDrizzle Team / help
2y ago