refactor: remove unused file, update timestamps on query views and views

- Deleted the unused file `src/auth/drizzle/one.ts`.
- Modified `updatedAt` field in `src/db/drizzle/schema.ts` to automatically update on record changes.
- Added `updatedAt` field to the response in `src/routes/query-views/list.ts` and `src/routes/views/list.ts` to ensure it reflects the current timestamp.
This commit is contained in:
2026-03-05 13:32:56 +08:00
parent 2518f6bba3
commit 42957af179
6 changed files with 310 additions and 143 deletions

View File

@@ -477,7 +477,7 @@ export const queryViews = pgTable("query_views", {
data: jsonb().default({}),
createdAt: timestamp('createdAt').notNull().defaultNow(),
updatedAt: timestamp('updatedAt').notNull().defaultNow(),
updatedAt: timestamp('updatedAt').notNull().defaultNow().$onUpdate(() => new Date()),
}, (table) => [
index('query_views_uid_idx').using('btree', table.uid.asc().nullsLast()),
index('query_title_idx').using('btree', table.title.asc().nullsLast()),