#14: add timestamp for inserted & updated

This commit is contained in:
Your Name
2025-01-29 17:38:35 +01:00
parent 2f35648264
commit 9f25253ade
8 changed files with 311 additions and 25 deletions

View File

@@ -1,3 +1,4 @@
import { sql } from 'drizzle-orm';
import * as t from 'drizzle-orm/sqlite-core';
import { integer, real, sqliteTable as table, text } from 'drizzle-orm/sqlite-core';
@@ -20,6 +21,8 @@ export const Deck = table(
lapses: integer('lapses'),
isGraduated: integer('isGraduated'),
user: text('user').notNull(),
inserted: text().default(sql`(CURRENT_TIMESTAMP)`), // Neue Spalte
updated: text().default(sql`(CURRENT_TIMESTAMP)`), // Neue Spalte
},
table => {
return {