Feature Request
Description:
Add functionality to export all materialized view definitions to a JSON or YAML file, and to import them from such a file.
Use Case:
This is useful for backing up definitions, migrating them between environments (e.g., staging to production), and keeping them in version control.
Proposed Solution:
- Create two new rake tasks:
mat_views:export[format] and mat_views:import[file_path].
- The export task will serialize all
MatViewDefinition records.
- The import task will read the file, and then create or update definitions in the database.
RSpec Tests:
- Create several view definitions.
- Run
mat_views:export and verify the output file is created and has the correct content.
- Delete the definitions from the database.
- Run
mat_views:import with the exported file.
- Verify that all definitions are restored correctly in the database.
Checklist:
Feature Request
Description:
Add functionality to export all materialized view definitions to a JSON or YAML file, and to import them from such a file.
Use Case:
This is useful for backing up definitions, migrating them between environments (e.g., staging to production), and keeping them in version control.
Proposed Solution:
mat_views:export[format]andmat_views:import[file_path].MatViewDefinitionrecords.RSpec Tests:
mat_views:exportand verify the output file is created and has the correct content.mat_views:importwith the exported file.Checklist: