mirror of
https://github.com/haexhub/haex-hub.git
synced 2025-12-16 14:10:52 +01:00
27 lines
838 B
TypeScript
27 lines
838 B
TypeScript
import { integer, sqliteTable, text } from 'drizzle-orm/sqlite-core'
|
|
|
|
export const haexCrdtLogs = sqliteTable('haex_crdt_logs', {
|
|
hlc_timestamp: text().primaryKey(),
|
|
table_name: text(),
|
|
row_pks: text({ mode: 'json' }),
|
|
op_type: text({ enum: ['INSERT', 'UPDATE', 'DELETE'] }),
|
|
column_name: text(),
|
|
new_value: text({ mode: 'json' }),
|
|
old_value: text({ mode: 'json' }),
|
|
})
|
|
export type InsertHaexCrdtLogs = typeof haexCrdtLogs.$inferInsert
|
|
export type SelectHaexCrdtLogs = typeof haexCrdtLogs.$inferSelect
|
|
|
|
export const haexCrdtSnapshots = sqliteTable('haex_crdt_snapshots', {
|
|
snapshot_id: text().primaryKey(),
|
|
created: text(),
|
|
epoch_hlc: text(),
|
|
location_url: text(),
|
|
file_size_bytes: integer(),
|
|
})
|
|
|
|
export const haexCrdtSettings = sqliteTable('haex_crdt_settings', {
|
|
type: text().primaryKey(),
|
|
value: text(),
|
|
})
|