mirror of
https://github.com/BetterCorp/BetterFrame.git
synced 2026-05-26 20:16:35 +00:00
Adds tenant management for PostgreSQL deployments. Each tenant gets its own PG schema (tenant_<slug>) with a full set of BetterFrame tables. SQLite deployments stay single-tenant with no behavior change. Key changes: - Run PUBLIC_MIGRATIONS (tenants + global_admins tables) during PG init - Auto-create "default" tenant (schema=public) on first boot - createTenantSchema() runs TENANT_MIGRATIONS in a new PG schema - DbAdapter.setSearchPath() for per-request schema switching (PG) - Tenant CRUD in Repository (listTenants, create, update, delete) - Middleware resolves bf_tenant cookie and sets search_path per request - Admin UI: /admin/tenants with CRUD + tenant switching via cookie - Tenant dropdown in topbar (Layout) when >1 tenant exists - Tenant nav item in sidebar Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| config.ts | ||
| db-adapter.ts | ||
| init.ts | ||
| mappers.ts | ||
| migrations-pg.ts | ||
| migrations.ts | ||
| pg-adapter.ts | ||
| repository.ts | ||
| sqlite-adapter.ts | ||
| util.ts | ||