export const base = {
id: text()
.primaryKey()
.$defaultFn(() => Crypto.randomUUID()),
local_created_at: integer({ mode: "timestamp_ms" })
.notNull()
.$defaultFn(() => new Date()),
local_updated_at: integer({ mode: "timestamp_ms" })
.notNull()
.$defaultFn(() => new Date())
.$onUpdateFn(() => new Date()),
is_deleted: integer({ mode: "boolean" }).notNull().default(false),
synched: integer({ mode: "boolean" }).notNull(),
}
export const table1 = {
...base,
some_custom_fields...
}
export const table2 = {
...base,
some_custom_fields...
}
export const base = {
id: text()
.primaryKey()
.$defaultFn(() => Crypto.randomUUID()),
local_created_at: integer({ mode: "timestamp_ms" })
.notNull()
.$defaultFn(() => new Date()),
local_updated_at: integer({ mode: "timestamp_ms" })
.notNull()
.$defaultFn(() => new Date())
.$onUpdateFn(() => new Date()),
is_deleted: integer({ mode: "boolean" }).notNull().default(false),
synched: integer({ mode: "boolean" }).notNull(),
}
export const table1 = {
...base,
some_custom_fields...
}
export const table2 = {
...base,
some_custom_fields...
}