nakofum
nakofum
DTDrizzle Team
Created by nakofum on 11/22/2024 in #help
indexes with pgTable deprecated
Using drizzle-orm: 0.36.0 I followed the docs creating indexes: https://orm.drizzle.team/docs/indexes-constraints#indexes--constraints However i'm getting a warning concerning a deprecated use of pgTable. Here's my code:
export const steps = pgTable(
"steps",
{
id: uuid("id").primaryKey().defaultRandom(),
//...
createdAt: timestamp("created_at", defaultTimestampOpts).defaultNow().notNull(),
updatedAt: timestamp("updated_at", defaultTimestampOpts).defaultNow().notNull(),
},
(table) => ({
stepsGuideIdIndex: index("...").on(table.<..>),
}),
);
export const steps = pgTable(
"steps",
{
id: uuid("id").primaryKey().defaultRandom(),
//...
createdAt: timestamp("created_at", defaultTimestampOpts).defaultNow().notNull(),
updatedAt: timestamp("updated_at", defaultTimestampOpts).defaultNow().notNull(),
},
(table) => ({
stepsGuideIdIndex: index("...").on(table.<..>),
}),
);
6 replies