Class SchemaMigrator

java.lang.Object
com.onec.schema.SchemaMigrator

public class SchemaMigrator extends Object
Additive-only schema evolution: adds columns that exist in the metadata model but not in the live database. Never renames, retypes or drops anything — for that, see SchemaUpgrader, which subsumes this as part of its plan.

A column declared required is added nullable, backfilled with a neutral value, and only then constrained NOT NULL — adding it constrained in one step would fail on any table that already has rows (see DdlRenderer.addColumn(java.lang.String, com.onec.schema.ColumnModel)).

  • Constructor Details

  • Method Details

    • generateAdditiveDDL

      public List<String> generateAdditiveDDL(org.jdbi.v3.core.Jdbi jdbi)
    • executeAdditive

      public void executeAdditive(org.jdbi.v3.core.Jdbi jdbi)