@Test
@Contextual
public void testColumnUniquePropertyChange() {

	DbColumnBuilder col = DbColumnBuilder.varchar("col1", 100);
	DbTableBuilder table = new DbTableBuilder("test_unique_change")
							.addColumn(col);
	
	//create table with non-unique column
	db.cmdCreateTable(table.build()).execute();
	//change the column's unique property to true
	col.setUnique(true);
	
	//compares table
	DbTable targetTable = db.getMetadata().tryGetTable(table.getTableName());
	assertNotNull(targetTable);
	
	SchemaChanges changes = db.getComparator().compareTable(table.build(), targetTable);
	assertEquals(1, changes.size());
	assertTrue(changes.get(0) instanceof ColumnDefinitionChange);
	ColumnDefinitionChange change = (ColumnDefinitionChange)changes.get(0);
	assertTrue(change.isUniqueChanged());
	
	//apply the changes
	changes.applyChanges();
	
	targetTable = db.getMetadata().tryGetTable(table.getTableName());
	changes = db.getComparator().compareTable(table.build(), targetTable);
	assertNull(changes.firstOrNull(ColumnDefinitionChange.class));
	
	//drop column
	db.cmdDropTable(table.getTableName()).execute();
}