Depricated pgTable function

export const gp_data = pgTable(
  'gp_data',
  {
    id: uuid('id').defaultRandom().primaryKey(),
    uid: integer('uid').notNull(),
    sid: integer('sid').notNull(),
    f1: jsonb('f1').notNull(), 
    f2: jsonb('f2').notNull(), 
    s1: jsonb('s1').notNull(), 
    s2: jsonb('s2').notNull(),
    b1: jsonb('b1'),          
    b2: jsonb('b2'),          
    e1: jsonb('e1'),           
    created: timestamp('created').$default(() => new Date()).notNull(),
    updated: timestamp('updated').$onUpdate(() => new Date()),
  },
  (t) => ({
    uid_sid_unique: unique().on(t.uid, t.sid),
  }),
);

when i use the 2nd argument my pgTable function show its depricated. what is the current way of doing it?

#this part

(t) => ({
    uid_sid_unique: unique().on(t.uid, t.sid),
}),
Was this page helpful?