public interface CustomMigrationValidator
Custom migration validator.
Applications may enforce extra rules on the migration. The validators must be annotated with the
Applications may enforce extra rules on the migration. The validators must be annotated with the
Service-annotation as follows:
@Service(CustomMigrationValidator.class)
public class MyMigrationValidator implements CustomMigrationValidator {
@Override
public void validate(TableMigrator migrator, TableMigrator.Result result) throws ModelException {
...
}
...
}
-
Method Summary
Modifier and TypeMethodDescriptionstatic Collection<CustomMigrationValidator>Gets all custom model validators.voidvalidate(TableMigrator migrator, TableMigrator.Result result) Validates a migration.
-
Method Details
-
validate
Validates a migration.- Parameters:
migrator- the table migratorresult- the generated sql- Throws:
ModelException- if validation failed
-
loadValidators
Gets all custom model validators.- Returns:
- the validators, never null
-