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
}),
);