diff options
| author | ivar <i@oiee.no> | 2026-06-22 00:46:09 +0200 |
|---|---|---|
| committer | ivar <i@oiee.no> | 2026-06-22 00:46:09 +0200 |
| commit | b8b6e229281be13258715870ddd0c2e1866dee12 (patch) | |
| tree | cc136a2d0c2d9c031ec0b21f62c8a9f302e0ff57 /app/src/lib/server/db/schema.ts | |
| parent | 1aa60ed7f0b0af6c55df4a32bf2620934df63e6d (diff) | |
| download | sparebank1-actualbudget-b8b6e229281be13258715870ddd0c2e1866dee12.tar.xz sparebank1-actualbudget-b8b6e229281be13258715870ddd0c2e1866dee12.zip | |
Diffstat (limited to 'app/src/lib/server/db/schema.ts')
| -rw-r--r-- | app/src/lib/server/db/schema.ts | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/app/src/lib/server/db/schema.ts b/app/src/lib/server/db/schema.ts deleted file mode 100644 index dbff3a2..0000000 --- a/app/src/lib/server/db/schema.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { relations, sql } from 'drizzle-orm'; -import { numeric, text, pgTable, uuid, jsonb } from "drizzle-orm/pg-core"; -import type { SessionLogType } from '../session-log'; -import type { Sb1Tokens, Sb1Transaction, Sb1TransactionDetails } from '$lib/shared'; - -export const SyncSessionTable = pgTable("session", { - id: uuid('id').primaryKey().default(sql`uuidv7()`), - authzState: text("authzState"), - accessTokenCreated: numeric("accessTokenCreated"), - refreshTokenCreated: numeric("refreshTokenCreated"), - tokens: jsonb("tokens").$type<Sb1Tokens>() -}) - -export const SyncLogTable = pgTable("session_log", { - id: uuid('id').primaryKey().default(sql`uuidv7()`), - sessionId: text("session_id"), - dateTime: text("date_time"), - type: text("type").$type<SessionLogType>(), - msg: text("msg") -}) - -export const TransactionsTable = pgTable("transactions", { - transaction: jsonb("transaction").$type<Sb1Transaction>(), - details: jsonb("details").$type<Sb1TransactionDetails>() -}) - -export const SyncLogRelation = relations(SyncLogTable, ({ one }) => ({ - author: one(SyncSessionTable, { - fields: [SyncLogTable.sessionId], - references: [SyncSessionTable.id], - }) -})) - -export const SyncSessionLogRelation = relations(SyncSessionTable, ({ many }) => ({ - logs: many(SyncLogTable) -})) |
