auth/migrations.ts

Auth schema migrations.

Single v0 migration for the fuz identity system tables. Consumed by run_migrations with namespace 'fuz_auth'.

Collapsed to a single v0 for the 0.1.0 release — no production databases exist, so the prior v0–v6 development iterations are consolidated. Post-0.1.0, each new migration appends as v1, v2, etc.

To add a migration, append a new entry to AUTH_MIGRATIONS:

// v1: add display_name to account { name: 'account_display_name', up: async (db) => { await db.query('ALTER TABLE account ADD COLUMN display_name TEXT'); }, },

Migrations are forward-only (no down). Use IF NOT EXISTS / IF EXISTS for DDL safety. Named migrations ({name, up}) are preferred for debuggability — the name appears in error messages on failure.

Declarations
#

3 declarations

view source

AUTH_MIGRATION_NAMESPACE
#

AUTH_MIGRATION_NS
#

AUTH_MIGRATIONS
#

auth/migrations.ts view source

Migration[]

Auth schema migrations in order.

- v0: Full auth schema — account (with email_verified), actor, permit, auth_session, api_token, audit_log (with seq), bootstrap_lock, invite, app_settings, plus all indexes and seeds.

Depends on
#

Imported by
#