diff --git a/src/credits/credits.ts b/src/credits/credits.ts index c82ce45..d78b03f 100644 --- a/src/credits/credits.ts +++ b/src/credits/credits.ts @@ -147,7 +147,6 @@ export async function addCredits({ .update(userCredit) .set({ currentCredits: newBalance, - // lastRefreshAt: new Date(), // NOTE: we can not update this field here updatedAt: new Date(), }) .where(eq(userCredit.userId, userId)); @@ -158,7 +157,6 @@ export async function addCredits({ id: randomUUID(), userId, currentCredits: newBalance, - // lastRefreshAt: new Date(), // NOTE: we can not update this field here createdAt: new Date(), updatedAt: new Date(), }); diff --git a/src/db/schema.ts b/src/db/schema.ts index 81e0df1..ad8c17e 100644 --- a/src/db/schema.ts +++ b/src/db/schema.ts @@ -94,7 +94,7 @@ export const userCredit = pgTable("user_credit", { id: text("id").primaryKey(), userId: text("user_id").notNull().references(() => user.id, { onDelete: 'cascade' }), currentCredits: integer("current_credits").notNull().default(0), - lastRefreshAt: timestamp("last_refresh_at"), + lastRefreshAt: timestamp("last_refresh_at"), // deprecated createdAt: timestamp("created_at").notNull().defaultNow(), updatedAt: timestamp("updated_at").notNull().defaultNow(), }, (table) => ({