From e19fcfd67bcff0689962b9eac9b0099996860680 Mon Sep 17 00:00:00 2001 From: "Samuel E. Giddins" Date: Fri, 17 Apr 2015 18:12:18 -0700 Subject: [PATCH] [RLMObjectStore] Require a migration when changing the nullability of a column --- object_store.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/object_store.cpp b/object_store.cpp index e5261694..7e4c0490 100644 --- a/object_store.cpp +++ b/object_store.cpp @@ -171,6 +171,14 @@ std::vector ObjectStore::validate_schema(Group *group, ObjectSchema 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 target_prop->table_column = current_prop.table_column;