// Schema for the {{projectName}} observability backend — a minimal tenant-scoped // `notes` domain. The point of this template is what surrounds it: Prometheus // metrics, Sentry error tracking, tracing, and a unit test (see tests/). import { boolean, databaseHandle, id, table, text, type InferRow, } from '@voltro/database' import { tenant } from '@voltro/plugin-multitenancy' // ---------- Core tables ---------- export const actors = table('actors', { id: id(), kind: text().oneOf(['user', 'serviceAccount', 'apiKey', 'system']), displayName: text().nullable(), }) export const tenants = table('tenants', { id: id(), name: text() }) // ---------- Application table ---------- export const notes = table('notes', { id: id({ prefix: 'note' }), title: text(), body: text(), done: boolean().default(false), }) .with(tenant()) // tenantId + audit columns, auto-stamped export type Note = InferRow export const database = databaseHandle({ actors, tenants, notes })