Object literal may only specify known properties, and isActive does not exist in type

Some columns are not allowed on update. What am I doing wrong? Schema:
export const prices = pgTable('prices', {
id: varchar('id')
.primaryKey()
.$defaultFn(() => createId()),
price: integer('price').notNull(),
currency: varchar('currency').notNull(),
createdAt: timestamp('created_at').notNull().defaultNow(),
updatedAt: timestamp('updated_at').notNull().defaultNow(),
isActive: boolean('is_active').notNull().default(true),
});
export const prices = pgTable('prices', {
id: varchar('id')
.primaryKey()
.$defaultFn(() => createId()),
price: integer('price').notNull(),
currency: varchar('currency').notNull(),
createdAt: timestamp('created_at').notNull().defaultNow(),
updatedAt: timestamp('updated_at').notNull().defaultNow(),
isActive: boolean('is_active').notNull().default(true),
});
Code:
const markPricesAsInactive = async (priceIds: string[]) => {
await db
.update(t.prices)
.set({ isActive: false })
.where(inArray(t.prices.id, priceIds));
};
const markPricesAsInactive = async (priceIds: string[]) => {
await db
.update(t.prices)
.set({ isActive: false })
.where(inArray(t.prices.id, priceIds));
};
ts error:
Object literal may only specify known properties, and 'isActive' does not exist in type '{ price?: number | SQL<unknown>; currency?: string | SQL<unknown>; }'.
Object literal may only specify known properties, and 'isActive' does not exist in type '{ price?: number | SQL<unknown>; currency?: string | SQL<unknown>; }'.
No description
No description
No description
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server