© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•3y ago
Rep.

push:pg not creating table schema (pgSchema)

Running a local Supabase instance, regular tables and all that work as expected.

Just now trying to move things around into table schemas.

I've got the following
schema.ts
schema.ts


import {
  pgSchema,
  pgTable,
  serial,
  text,
  timestamp,
  uniqueIndex,
} from "drizzle-orm/pg-core";

export const exampleSchema = pgSchema("exampleSchema");

export const exampleWaitlist = exampleSchema.table(
  "exampleWaitlist",
  {
    id: serial("id").primaryKey(), // auto-incrementing primary key, so we know who signed up first
    email: text("email").notNull(), // email address (uniqueness enforced via index)
    signupDate: timestamp("signup_date").notNull(), // exact date/time of signup (UTC)
  },
  (table) => ({
    emailIndex: uniqueIndex("email_index").on(table.email), // index on email column to allow quick lookups and prevent duplicates
  }),
);
import {
  pgSchema,
  pgTable,
  serial,
  text,
  timestamp,
  uniqueIndex,
} from "drizzle-orm/pg-core";

export const exampleSchema = pgSchema("exampleSchema");

export const exampleWaitlist = exampleSchema.table(
  "exampleWaitlist",
  {
    id: serial("id").primaryKey(), // auto-incrementing primary key, so we know who signed up first
    email: text("email").notNull(), // email address (uniqueness enforced via index)
    signupDate: timestamp("signup_date").notNull(), // exact date/time of signup (UTC)
  },
  (table) => ({
    emailIndex: uniqueIndex("email_index").on(table.email), // index on email column to allow quick lookups and prevent duplicates
  }),
);


Running
db:generate
db:generate
does generate the schema in the migration file - but for whatever reason
db:push
db:push
doesn't want to do it.
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 not working with pgSchema
Drizzle TeamDTDrizzle Team / help
14mo ago
Pgschema
Drizzle TeamDTDrizzle Team / help
16mo ago
Drizzle-kit push:pg not working
Drizzle TeamDTDrizzle Team / help
3y ago
Unchanged schema, `db:push:pg` generates faulty `ALTER` statements
Drizzle TeamDTDrizzle Team / help
3y ago