Search in sources :

Example 56 with ValidationErrors

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

the class FindForeignKeyConstraintsGeneratorMySQL method validate.

@Override
public ValidationErrors validate(FindForeignKeyConstraintsStatement findForeignKeyConstraintsStatement, Database database, SqlGeneratorChain sqlGeneratorChain) {
    ValidationErrors validationErrors = new ValidationErrors();
    validationErrors.checkRequiredField("baseTableName", findForeignKeyConstraintsStatement.getBaseTableName());
    return validationErrors;
}
Also used : ValidationErrors(liquibase.exception.ValidationErrors)

Example 57 with ValidationErrors

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

the class FindForeignKeyConstraintsGeneratorOracle method validate.

@Override
public ValidationErrors validate(FindForeignKeyConstraintsStatement findForeignKeyConstraintsStatement, Database database, SqlGeneratorChain sqlGeneratorChain) {
    ValidationErrors validationErrors = new ValidationErrors();
    validationErrors.checkRequiredField("baseTableName", findForeignKeyConstraintsStatement.getBaseTableName());
    return validationErrors;
}
Also used : ValidationErrors(liquibase.exception.ValidationErrors)

Example 58 with ValidationErrors

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

the class DropDefaultValueGenerator method validate.

@Override
public ValidationErrors validate(DropDefaultValueStatement dropDefaultValueStatement, Database database, SqlGeneratorChain sqlGeneratorChain) {
    ValidationErrors validationErrors = new ValidationErrors();
    validationErrors.checkRequiredField("tableName", dropDefaultValueStatement.getTableName());
    validationErrors.checkRequiredField("columnName", dropDefaultValueStatement.getColumnName());
    if (database instanceof InformixDatabase) {
        validationErrors.checkRequiredField("columnDataType", dropDefaultValueStatement.getColumnDataType());
    }
    return validationErrors;
}
Also used : ValidationErrors(liquibase.exception.ValidationErrors)

Example 59 with ValidationErrors

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

the class DropIndexGenerator method validate.

@Override
public ValidationErrors validate(DropIndexStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) {
    ValidationErrors validationErrors = new ValidationErrors();
    validationErrors.checkRequiredField("indexName", statement.getIndexName());
    if (database instanceof MySQLDatabase || database instanceof MSSQLDatabase) {
        validationErrors.checkRequiredField("tableName", statement.getTableName());
    }
    return validationErrors;
}
Also used : ValidationErrors(liquibase.exception.ValidationErrors)

Example 60 with ValidationErrors

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

the class DropPrimaryKeyGenerator method validate.

@Override
public ValidationErrors validate(DropPrimaryKeyStatement dropPrimaryKeyStatement, Database database, SqlGeneratorChain sqlGeneratorChain) {
    ValidationErrors validationErrors = new ValidationErrors();
    validationErrors.checkRequiredField("tableName", dropPrimaryKeyStatement.getTableName());
    if (database instanceof FirebirdDatabase || database instanceof InformixDatabase) {
        validationErrors.checkRequiredField("constraintName", dropPrimaryKeyStatement.getConstraintName());
    }
    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