
com.whiteclarkegroup.liquibaselinter.linters.AddPrimaryKeyChangeLinter 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.Linter;
import com.whiteclarkegroup.liquibaselinter.config.rules.RuleRunner;
import com.whiteclarkegroup.liquibaselinter.config.rules.RuleType;
import liquibase.change.core.AddPrimaryKeyChange;
import liquibase.exception.ChangeLogParseException;
public class AddPrimaryKeyChangeLinter implements Linter {
private static final ObjectNameLinter objectNameLinter = new ObjectNameLinter();
@Override
public void lint(AddPrimaryKeyChange change, RuleRunner ruleRunner) throws ChangeLogParseException {
getObjectNameLinter().lintObjectNameLength(change.getConstraintName(), change, ruleRunner);
ruleRunner.forChange(change)
.run(RuleType.PRIMARY_KEY_MUST_BE_NAMED, change.getConstraintName())
.run(RuleType.PRIMARY_KEY_MUST_USE_TABLE_NAME, change.getConstraintName());
}
ObjectNameLinter getObjectNameLinter() {
return objectNameLinter;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy