mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Perform migrations of Grist schema using only metadata tables when possible.
Summary: Loading all user data to run a migration is risky (creates more than usual memory pressure), and almost never needed (only one migration requires it). This diff attempts to run migrations using only metadata (_grist_* tables), but retries if the sandbox tells it that all data is needed. The intent is for new migrations to avoid needing all data. Test Plan: Added a somewhat contrived unittest. Reviewers: paulfitz Reviewed By: paulfitz Differential Revision: https://phab.getgrist.com/D2659
This commit is contained in:
@@ -97,9 +97,9 @@ def main():
|
||||
return eng.load_table(table_data_from_db(table_name, table_data))
|
||||
|
||||
@export
|
||||
def create_migrations(all_tables):
|
||||
def create_migrations(all_tables, metadata_only=False):
|
||||
doc_actions = migrations.create_migrations(
|
||||
{t: table_data_from_db(t, data) for t, data in all_tables.iteritems()})
|
||||
{t: table_data_from_db(t, data) for t, data in all_tables.iteritems()}, metadata_only)
|
||||
return map(actions.get_action_repr, doc_actions)
|
||||
|
||||
@export
|
||||
|
||||
Reference in New Issue
Block a user