You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Embed DB addressing in sys_environment; add org/env scoping
Merge physical database mapping into sys_environment and introduce organizationId/environmentId scoping across metadata and control-plane code. sys_environment_database object/table removed; environment rows now store database_url, database_driver, storage_limit_mb and provisioned_at. DatabaseLoader, MetadataManager, plugin and history cleanup updated to use organization_id + env_id (env_id = null = platform-global). sys_metadata/sys_metadata_history schemas and indexes updated to include organization_id/env_id; sys_database_credential now references environment_id and its indexes updated. HTTP dispatcher, provisioning service, migration, and tests adjusted to the new model to simplify lookups, reduce joins, and support per-environment isolation.
@@ -68,8 +75,8 @@ Switching environments ⇒ swapping DB connections. There is no in-process filte
68
75
`EnvironmentProvisioningService` (new) exposes:
69
76
70
77
-`provisionOrganization(req)` — atomically creates the org's **default** environment and its physical DB (replaces `provisionTenant`).
71
-
-`provisionEnvironment(req)` — allocates any subsequent `dev` / `test` / `sandbox` / `preview` environment, each with its own DB and credential row.
72
-
-`rotateCredential(envDbId, plaintext)` — issues a new `active` credential and revokes the previous one.
78
+
-`provisionEnvironment(req)` — allocates any subsequent `dev` / `test` / `sandbox` / `preview` environment, each with its own DB and credential row. DB addressing fields are written directly onto the `sys_environment` row.
79
+
-`rotateCredential(environmentId, plaintext)` — issues a new `active` credential and revokes the previous one.
73
80
74
81
Physical-DB allocation is delegated to pluggable `EnvironmentDatabaseAdapter` implementations (initially `turso`; `libsql` / `sqlite` / `postgres` drop in without core changes).
75
82
@@ -117,7 +124,7 @@ The migration is **non-destructive** and **idempotent**: each legacy org's datab
0 commit comments