mirror of
https://github.com/status-im/realm-js.git
synced 2025-02-18 17:47:32 +00:00
pr fixes
This commit is contained in:
parent
4c7d6d8b2f
commit
3e45625748
@ -324,9 +324,9 @@ Results Results::filter(Query&& q) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
Results::UnsupportedColumnTypeException::UnsupportedColumnTypeException(size_t column, const Table* table)
|
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_name(table->get_column_name(column))
|
||||||
, column_type(table->get_column_type(column))
|
, column_type(table->get_column_type(column))
|
||||||
, std::runtime_error((std::string)"Operation not supported on '" + table->get_column_name(column).data() + "' columns")
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -212,6 +212,9 @@ bool Realm::update_schema(std::unique_ptr<Schema> schema, uint64_t version)
|
|||||||
old_config.read_only = true;
|
old_config.read_only = true;
|
||||||
old_config.schema = std::move(old_schema);
|
old_config.schema = std::move(old_schema);
|
||||||
|
|
||||||
|
m_config.schema = std::move(schema);
|
||||||
|
m_config.schema_version = version;
|
||||||
|
|
||||||
auto migration_function = [&](Group*, Schema&) {
|
auto migration_function = [&](Group*, Schema&) {
|
||||||
SharedRealm old_realm(new Realm(old_config));
|
SharedRealm old_realm(new Realm(old_config));
|
||||||
auto updated_realm = shared_from_this();
|
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
|
// update and migrate
|
||||||
begin_transaction();
|
begin_transaction();
|
||||||
bool changed = ObjectStore::update_realm_with_schema(read_group(), *old_config.schema,
|
bool changed = ObjectStore::update_realm_with_schema(read_group(), *old_config.schema,
|
||||||
version, const_cast<Schema &>(*schema), migration_function);
|
version, *m_config.schema,
|
||||||
m_config.schema = std::move(schema);
|
migration_function);
|
||||||
m_config.schema_version = version;
|
|
||||||
commit_transaction();
|
commit_transaction();
|
||||||
return changed;
|
return changed;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user