return;
}
Database database = getDatabase();
Executor executor = ExecutorService.getInstance().getExecutor(database);
Table changeLogTable = null;
try {
changeLogTable = SnapshotGeneratorFactory.getInstance().getDatabaseChangeLogTable(new SnapshotControl(database, Table.class, Column.class), database);
} catch (LiquibaseException e) {
throw new UnexpectedLiquibaseException(e);
}
List<SqlStatement> statementsToExecute = new ArrayList<SqlStatement>();
boolean changeLogCreateAttempted = false;
if (changeLogTable != null) {
boolean hasDescription = changeLogTable.getColumn("DESCRIPTION") != null;
boolean hasComments = changeLogTable.getColumn("COMMENTS") != null;
boolean hasTag = changeLogTable.getColumn("TAG") != null;
boolean hasLiquibase = changeLogTable.getColumn("LIQUIBASE") != null;
boolean liquibaseColumnNotRightSize = false;
if (!(this.getDatabase() instanceof SQLiteDatabase)) {
Integer columnSize = changeLogTable.getColumn("LIQUIBASE").getType().getColumnSize();
liquibaseColumnNotRightSize = columnSize != null && columnSize != 20;
}
boolean hasOrderExecuted = changeLogTable.getColumn("ORDEREXECUTED") != null;
boolean checksumNotRightSize = false;
if (!this.getDatabase().getConnection().getDatabaseProductName().equals("SQLite")) {
Integer columnSize = changeLogTable.getColumn("MD5SUM").getType().getColumnSize();
checksumNotRightSize = columnSize != null && columnSize != 35;
}
boolean hasExecTypeColumn = changeLogTable.getColumn("EXECTYPE") != null;
if (!hasDescription) {
executor.comment("Adding missing databasechangelog.description column");
statementsToExecute.add(new AddColumnStatement(getLiquibaseCatalogName(), getLiquibaseSchemaName(), getDatabaseChangeLogTableName(), "DESCRIPTION", "VARCHAR(255)", null));
}