// Minimal schema. Auth users + sessions live in the `memoryUserStore()` // (in-process), NOT in these tables — so there's no users table here. These // are the framework core tables every app declares. // // When you switch to `postgresUserStore({ sql })`, that store manages its own // `_voltro_auth_*` tables (auto-migrated); you still keep these core tables for // your own domain data. import { databaseHandle, id, table, text, timestamp } from '@voltro/database' // The universal audit subject (user / serviceAccount / apiKey / system). export const actors = table('actors', { id: id(), kind: text().oneOf(['user', 'serviceAccount', 'apiKey', 'system']), displayName: text().nullable(), createdAt: timestamp().default('now'), }) // The multi-tenancy boundary. New sign-ups land in `defaultTenantId` (see // app.config.ts → authRoutesPlugin). export const tenants = table('tenants', { id: id(), name: text(), createdAt: timestamp().default('now'), }) export const database = databaseHandle({ actors, tenants })