This commit is contained in:
Ari Lazier 2016-01-04 16:37:07 -08:00
parent 4c7d6d8b2f
commit 3e45625748
2 changed files with 7 additions and 5 deletions

View File

@ -324,9 +324,9 @@ Results Results::filter(Query&& q) const
}
Results::UnsupportedColumnTypeException::UnsupportedColumnTypeException(size_t column, const Table* table)
: column_index(column)
: std::runtime_error((std::string)"Operation not supported on '" + table->get_column_name(column).data() + "' columns")
, column_index(column)
, column_name(table->get_column_name(column))
, column_type(table->get_column_type(column))
, std::runtime_error((std::string)"Operation not supported on '" + table->get_column_name(column).data() + "' columns")
{
}

View File

@ -212,6 +212,9 @@ bool Realm::update_schema(std::unique_ptr<Schema> schema, uint64_t version)
old_config.read_only = true;
old_config.schema = std::move(old_schema);
m_config.schema = std::move(schema);
m_config.schema_version = version;
auto migration_function = [&](Group*, Schema&) {
SharedRealm old_realm(new Realm(old_config));
auto updated_realm = shared_from_this();
@ -224,9 +227,8 @@ bool Realm::update_schema(std::unique_ptr<Schema> schema, uint64_t version)
// update and migrate
begin_transaction();
bool changed = ObjectStore::update_realm_with_schema(read_group(), *old_config.schema,
version, const_cast<Schema &>(*schema), migration_function);
m_config.schema = std::move(schema);
m_config.schema_version = version;
version, *m_config.schema,
migration_function);
commit_transaction();
return changed;
}