use of horse.wtf.nzyme.reporting.db.ExecutionLogEntryMapper in project nzyme by lennartkoopmann.
the class Database method initializeAndMigrate.
public void initializeAndMigrate() throws LiquibaseException {
this.jdbi = Jdbi.create("jdbc:" + configuration.databasePath()).installPlugin(new PostgresPlugin()).installPlugin(new JodaTimePlugin()).registerRowMapper(new MeasurementMapper()).registerRowMapper(new BeaconRateMapper()).registerRowMapper(new SignalIndexHistogramHistoryDBEntryMapper()).registerRowMapper(new AlertDatabaseEntryMapper()).registerRowMapper(new BanditMapper()).registerRowMapper(new BanditIdentifierMapper()).registerRowMapper(new ContactMapper()).registerRowMapper(new SentrySSIDMapper()).registerRowMapper(new DeauthenticationMonitorRecordingMapper()).registerRowMapper(new EventRecordMapper()).registerRowMapper(new ScheduledReportEntryMapper()).registerRowMapper(new ExecutionLogEntryMapper()).registerRowMapper(new ContactRecordMapper()).registerRowMapper(new ContactRecordValueAggregationMapper()).registerRowMapper(new ContactRecorderHistogramEntryMapper());
// Run migrations against underlying JDBC connection.
JdbcConnection connection = new JdbcConnection(jdbi.open().getConnection());
try {
liquibase.database.Database database = DatabaseFactory.getInstance().findCorrectDatabaseImplementation(connection);
Liquibase liquibase = new liquibase.Liquibase("db/migrations.xml", new ClassLoaderResourceAccessor(), database);
liquibase.update(new Contexts(), new LabelExpression());
} finally {
connection.close();
}
}
Aggregations