// Schema for the {{projectName}} rate-limited backend — a tiny `notes` domain // to throttle. `actors` + `tenants` are the framework core tables. import { databaseHandle, id, table, text, timestamp, type InferRow, } from '@voltro/database' import { tenant } from '@voltro/plugin-multitenancy' export const actors = table('actors', { id: id(), kind: text().oneOf(['user', 'serviceAccount', 'apiKey', 'system']), displayName: text().nullable(), createdAt: timestamp().default('now'), }) export const tenants = table('tenants', { id: id(), name: text(), createdAt: timestamp().default('now'), }) export const notes = table('notes', { id: id({ prefix: 'note' }), title: text(), body: text(), }) .with(tenant()) export type Note = InferRow export const database = databaseHandle({ actors, tenants, notes })