Package com.onec.schema
Class SchemaUpgrader
java.lang.Object
com.onec.schema.SchemaUpgrader
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 onec_schema_history),
and then acts according to SchemaMode.
Safe changes (create table, add column, rename via previousNames, widening
type changes) are applied automatically. Destructive changes (drops, narrowing types)
are reported and skipped unless allowDestructive is set. Every applied change-set
is recorded in onec_schema_history together with the metadata snapshot, which is
what makes type-change detection and drop detection possible on the next boot.
-
Constructor Summary
ConstructorsConstructorDescriptionSchemaUpgrader(MetadataRegistry registry, SchemaMode mode, boolean allowDestructive) -
Method Summary
-
Constructor Details
-
SchemaUpgrader
-
-
Method Details
-
run
-