From 5e1ecdf19e49512734940604548a441f03eeec0e Mon Sep 17 00:00:00 2001 From: Ari Lazier Date: Wed, 19 Oct 2016 09:59:20 -0700 Subject: [PATCH] default the schema version to 0 when a schema is provided --- src/js_realm.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/js_realm.hpp b/src/js_realm.hpp index f1e37fc9..df164677 100644 --- a/src/js_realm.hpp +++ b/src/js_realm.hpp @@ -351,6 +351,9 @@ void RealmClass::constructor(ContextType ctx, ObjectType this_object, size_t if (!Value::is_undefined(ctx, version_value)) { config.schema_version = Value::validated_to_number(ctx, version_value, "schemaVersion"); } + else if (schema_updated) { + config.schema_version = 0; + } static const String migration_string = "migration"; ValueType migration_value = Object::get_property(ctx, object, migration_string);