ยฉ 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Teamโ€ข15mo agoโ€ข
5 replies
nakofum

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
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.<..>),
  }),
);
Drizzle ORM - Indexes & Constraints
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
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

Deprecated pgTable signature
Drizzle TeamDTDrizzle Team / help
16mo ago
pgTable This overload is deprecated. Use the other method overload instead.
Drizzle TeamDTDrizzle Team / help
16mo ago
Depricated pgTable function
Drizzle TeamDTDrizzle Team / help
8mo ago
pgTable - raw sql
Drizzle TeamDTDrizzle Team / help
3y ago