Package su.onno.schema


package su.onno.schema
  • Class
    Description
    Desired state of a single column, derived from metadata.
    Reads the live database structure (tables and their columns) from INFORMATION_SCHEMA, which both H2 and PostgreSQL expose.
    Live tables and columns, keyed by upper-cased table name.
    The ordered set of changes that would bring the database in line with the metadata.
    One change in a MigrationPlan: what it is, the SQL that performs it, and whether it can lose data (destructive changes are skipped unless onno.schema.allow-destructive=true).
     
    Computes the MigrationPlan that brings the live database in line with the metadata-derived SchemaModel.
    Renders CREATE TABLE IF NOT EXISTS DDL for everything in the metadata registry.
    Persistence for onno_schema_history: one row per applied schema change-set (kind SCHEMA, carrying the metadata snapshot and the DDL that was executed) and one row per executed AppMigration (kind MIGRATION, claimed via a unique constraint so concurrent instances run each migration exactly once).
    How the framework treats schema differences at startup (onno.schema.mode).
    The full desired database state derived from the MetadataRegistry: framework tables (sequences, outbox) plus one TableModel per catalog, document, tabular section, register, enumeration and the constants table.
    Builds the desired SchemaModel from the metadata registry.
    A point-in-time record of the metadata-derived schema, persisted as JSON in onno_schema_history.
     
     
    Startup schema lifecycle: scans nothing itself — it takes the already-built MetadataRegistry, derives the desired SchemaModel, diffs it against the live database (and the previous SchemaSnapshot from onno_schema_history), and then acts according to SchemaMode.
    Identifies the target database so upsert helpers can emit portable SQL.
    Desired state of a single table, derived from metadata.