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
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 does generate the schema in the migration file - but for whatever reason db:push doesn't want to do it.
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server