Class SQLSchemaUpdater

Direct Known Subclasses:
SpringSQLSchemaUpdater

public class SQLSchemaUpdater extends AbstractSchemaUpdater<DataSource,Connection>
Concrete extension of AbstractSchemaUpdater for SQL databases.

Required properties are the database initialization, update table initialization, and the updates themselves.

Applied updates are recorded in a special update table, which contains two columns: one for the unique update name and one for a timestamp. The update table and column names are configurable via setUpdateTableName(), setUpdateTableNameColumn(), and setUpdateTableTimeColumn().

By default, this class detects a completely uninitialized database by the absence of the update table itself in the schema (see databaseNeedsInitialization()). When an uninitialized database is encountered, the configured database initialization and update table initialization actions are applied first to initialize the database schema.

  • Field Details

    • DEFAULT_UPDATE_TABLE_NAME

      public static final String DEFAULT_UPDATE_TABLE_NAME
      Default name of the table that tracks schema updates, "SchemaUpdate".
      See Also:
    • DEFAULT_UPDATE_TABLE_NAME_COLUMN

      public static final String DEFAULT_UPDATE_TABLE_NAME_COLUMN
      Default name of the column in the updates table holding the unique update name, "updateName".
      See Also:
    • DEFAULT_UPDATE_TABLE_TIME_COLUMN

      public static final String DEFAULT_UPDATE_TABLE_TIME_COLUMN
      Default name of the column in the updates table holding the update's time applied, "updateTime".
      See Also:
  • Constructor Details

    • SQLSchemaUpdater

      public SQLSchemaUpdater()
  • Method Details