![JAR search and dependency download from the Maven repository](/logo.png)
com.whiteclarkegroup.liquibaselinter.linters.ColumnConfigLinter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of liquibase-linter Show documentation
Show all versions of liquibase-linter Show documentation
Liquibase extension to add configurable script linting
package com.whiteclarkegroup.liquibaselinter.linters;
import com.whiteclarkegroup.liquibaselinter.config.rules.RuleRunner;
import com.whiteclarkegroup.liquibaselinter.config.rules.RuleType;
import liquibase.change.Change;
import liquibase.change.ChangeWithColumns;
import liquibase.change.ColumnConfig;
import liquibase.change.ConstraintsConfig;
import liquibase.exception.ChangeLogParseException;
class ColumnConfigLinter {
void lintColumnConfig(ChangeWithColumns extends ColumnConfig> change, RuleRunner ruleRunner) throws ChangeLogParseException {
for (ColumnConfig columnConfig : change.getColumns()) {
final ConstraintsConfig constraints = columnConfig.getConstraints();
ruleRunner.forChange((Change) change)
.run(RuleType.CREATE_COLUMN_REMARKS, columnConfig.getRemarks())
.run(RuleType.CREATE_COLUMN_NULLABLE_CONSTRAINT, constraints)
.run(RuleType.CREATE_COLUMN_NO_DEFINE_PRIMARY_KEY, constraints);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy