assertEquals(ChangeSeverity.EXTENSION, schemaChange.getSubChange(TableCreation.class, "referee").getSeverity());
assertEquals(ChangeSeverity.RESTRICTION, schemaChange.getSubChange(ForeignKeyConstraintCreation.class, "new_fk").getSeverity());
}
private SchemaChange createSchemaChange(boolean nullableFk) {
SchemaChange schemaChange = new SchemaChange(new ComparisonConfig(null, null, null));
DBTable refereeTable = new DBTable("referee");
DBTable refererTable = new DBTable("referer");
DBColumn fkColumn = new DBColumn("ref", refererTable, DBDataType.getInstance(Types.INTEGER, "int"));
fkColumn.setNullable(nullableFk);
refereeTable.addColumn(fkColumn);
schemaChange.addSubChange(new TableCreation(refereeTable));
DBForeignKeyConstraint fk = new DBForeignKeyConstraint("new_fk", true, refererTable, new String[] { "ref" }, refereeTable, new String[] { "id" });
schemaChange.addSubChange(new ForeignKeyConstraintCreation(fk));
return schemaChange;
}