Drizzle TeamDT
Drizzle Team2y ago
2 replies
Bram

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


Code:
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>; }'.
image.png
image.png
image.png
Was this page helpful?