[RLMObjectStore] Require a migration when changing the nullability of a column

This commit is contained in:
Samuel E. Giddins 2015-04-17 18:12:18 -07:00
parent 80b1642d32
commit e19fcfd67b
1 changed files with 8 additions and 0 deletions

View File

@ -171,6 +171,14 @@ std::vector<std::string> ObjectStore::validate_schema(Group *group, ObjectSchema
validation_errors.push_back("Property '" + current_prop.name + "' has been made a primary key."); validation_errors.push_back("Property '" + current_prop.name + "' has been made a primary key.");
} }
} }
if (current_prop.is_nullable != target_prop->is_nullable) {
if (current_prop.is_nullable) {
validation_errors.push_back("Property '" + current_prop.name + "' is no longer optional.");
}
else {
validation_errors.push_back("Property '" + current_prop.name + "' has been made optional.");
}
}
// create new property with aligned column // create new property with aligned column
target_prop->table_column = current_prop.table_column; target_prop->table_column = current_prop.table_column;