OneEnv

Database structure management

Governing the shape of a database that several services read.

By the OneEnv team · Last updated

What it is

DB Master models a database as database → table → column. A column has a key, a description, a secret flag, an optional SQL type and an optional validation rule. It has no value: OneEnv governs structure, not data. Services can inherit a whole database, a single table, or a single column.

Why it matters

When several services read the same tables, adding or dropping a column affects all of them. Recording who inherits what turns 'who reads this table?' into a lookup, and gives each reader a say.

What is governed and what is not

  • Governed (branch, review, per-service decision): adding a column, removing a column, assigning or changing a column's validation.
  • Immediate and silent: creating a database or table, renaming anything, archiving a database or table, documentation-only table relations.

Inheritance behaviour

  • Inheriting a database or table copies membership for every column that exists at that moment. A column added later is not picked up silently; it arrives as a pending decision.
  • Approving 'column added' gives the service the column. Approving 'column removed' removes it from the service; rejecting keeps it.
  • Archiving a whole database or table cascades to its children and cleans up relations and inheritance in one step.

Step by step: add a column under review

  1. Select or create a branch.
  2. In DB Master, open the table and add the column. It is staged on the branch.
  3. Submit the branch; an Owner or Admin approves and merges.
  4. Every service that inherits that database or table receives a pending decision to take the column.

Propose from a service

A service that already inherits a database can propose a new table or column itself. The row exists immediately for that service but is invisible to everyone else until the branch containing it is reviewed and merged. If the branch is rejected, the proposal stays private to the proposing service.

Import

  • .sql import reads CREATE TABLE statements, creates missing tables, turns foreign keys into documentation-only relations, and stages each new column on the branch. SQL types are stored on the column.
  • Cross-database import copies the structure of one database onto another once. It is a snapshot, not a live link. A rename appears as one removal plus one addition.

Migration preview

A column can show generated ALTER TABLE SQL based on its stored type, with a heuristic fallback if the type is missing. OneEnv does not run migrations; this is text for you to review.

Limitations

  • OneEnv does not connect to your live database or detect drift between it and DB Master.
  • Table relations are documentation only.
  • No migration execution.