Search in sources :

Example 46 with ValidationErrors

use of liquibase.exception.ValidationErrors in project liquibase by liquibase.

the class RenameTableGenerator method validate.

@Override
public ValidationErrors validate(RenameTableStatement renameTableStatement, Database database, SqlGeneratorChain sqlGeneratorChain) {
    ValidationErrors validationErrors = new ValidationErrors();
    validationErrors.checkRequiredField("newTableName", renameTableStatement.getNewTableName());
    validationErrors.checkRequiredField("oldTableName", renameTableStatement.getOldTableName());
    return validationErrors;
}
Also used : ValidationErrors(liquibase.exception.ValidationErrors)

Example 47 with ValidationErrors

use of liquibase.exception.ValidationErrors in project liquibase by liquibase.

the class ReorganizeTableGeneratorDB2 method validate.

@Override
public ValidationErrors validate(ReorganizeTableStatement reorganizeTableStatement, Database database, SqlGeneratorChain sqlGeneratorChain) {
    ValidationErrors validationErrors = new ValidationErrors();
    validationErrors.checkRequiredField("tableName", reorganizeTableStatement.getTableName());
    return validationErrors;
}
Also used : ValidationErrors(liquibase.exception.ValidationErrors)

Example 48 with ValidationErrors

use of liquibase.exception.ValidationErrors in project liquibase by liquibase.

the class SelectFromDatabaseChangeLogGenerator method validate.

@Override
public ValidationErrors validate(SelectFromDatabaseChangeLogStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) {
    ValidationErrors errors = new ValidationErrors();
    errors.checkRequiredField("columnToSelect", statement.getColumnsToSelect());
    return errors;
}
Also used : ValidationErrors(liquibase.exception.ValidationErrors)

Example 49 with ValidationErrors

use of liquibase.exception.ValidationErrors in project liquibase by liquibase.

the class SelectFromDatabaseChangeLogLockGenerator method validate.

@Override
public ValidationErrors validate(SelectFromDatabaseChangeLogLockStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) {
    ValidationErrors errors = new ValidationErrors();
    errors.checkRequiredField("columnToSelect", statement.getColumnsToSelect());
    return errors;
}
Also used : ValidationErrors(liquibase.exception.ValidationErrors)

Example 50 with ValidationErrors

use of liquibase.exception.ValidationErrors in project liquibase by liquibase.

the class CreateSequenceGenerator method validate.

@Override
public ValidationErrors validate(CreateSequenceStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) {
    ValidationErrors validationErrors = new ValidationErrors();
    validationErrors.checkRequiredField("sequenceName", statement.getSequenceName());
    validationErrors.checkDisallowedField("startValue", statement.getStartValue(), database, FirebirdDatabase.class);
    validationErrors.checkDisallowedField("incrementBy", statement.getIncrementBy(), database, FirebirdDatabase.class);
    validationErrors.checkDisallowedField("minValue", statement.getMinValue(), database, FirebirdDatabase.class, H2Database.class, HsqlDatabase.class);
    validationErrors.checkDisallowedField("maxValue", statement.getMaxValue(), database, FirebirdDatabase.class, H2Database.class, HsqlDatabase.class);
    validationErrors.checkDisallowedField("ordered", statement.getOrdered(), database, DB2Database.class, HsqlDatabase.class, PostgresDatabase.class);
    return validationErrors;
}
Also used : ValidationErrors(liquibase.exception.ValidationErrors)

Aggregations

ValidationErrors (liquibase.exception.ValidationErrors)89 Test (org.junit.Test)11 MockDatabase (liquibase.sdk.database.MockDatabase)9 Database (liquibase.database.Database)6 MockSqlStatement (liquibase.statement.core.MockSqlStatement)6 TreeSet (java.util.TreeSet)5 ArrayList (java.util.ArrayList)2 Change (liquibase.change.Change)2 ChangeFactory (liquibase.change.ChangeFactory)2 ChangeMetaData (liquibase.change.ChangeMetaData)2 ChangeParameterMetaData (liquibase.change.ChangeParameterMetaData)2 CreateTableChange (liquibase.change.core.CreateTableChange)2 DatabaseChangeLog (liquibase.changelog.DatabaseChangeLog)2 RanChangeSet (liquibase.changelog.RanChangeSet)2 UnexpectedLiquibaseException (liquibase.exception.UnexpectedLiquibaseException)2 SqlStatement (liquibase.statement.SqlStatement)2 AddColumnStatement (liquibase.statement.core.AddColumnStatement)2 JUnitResourceAccessor (liquibase.test.JUnitResourceAccessor)2 AbstractVerifyTest (liquibase.verify.AbstractVerifyTest)2 Ignore (org.junit.Ignore)2