Rep.
Rep.
Explore posts from servers
DTDrizzle Team
Created by Rep. on 4/22/2024 in #help
Supabase branching w/ Drizzle?
Does anyone know if it is possible to get Supabase branching working with Drizzle migrations? (https://supabase.com/docs/guides/platform/branching)
1 replies
DTDrizzle Team
Created by Rep. on 12/18/2023 in #help
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.
1 replies