Skip to content

Support versioning and rollback for view definitions #35

@niteshpurohit

Description

@niteshpurohit

Feature Request

Description:

Implement a versioning system for MatViewDefinition. Every time a view's SQL is changed, a new version should be saved, allowing users to view the history of changes and roll back to a previous version.

Use Case:

If a change to a view's SQL introduces an error or performance regression, developers need an easy way to revert to a previously known good version.

Proposed Solution:

  • Integrate a gem like paper_trail with the MatViewDefinition model.
  • In the Admin UI, add a 'History' tab to the view's page that shows the version history.
  • Add a 'Rollback' button to restore a previous version.

RSpec Tests:

  • Update a MatViewDefinition and verify that a new version is created in paper_trail.
  • Test the rollback mechanism, ensuring that the model's attributes are restored to the previous version's state.
  • (UI) Visit the history tab and verify the list of versions. Click rollback and verify the main definition is updated.

Checklist:

  • I have searched for a similar feature request and didn't find any duplicates.
  • I have included all the required information.
  • I have tagged the issue with the label "enhancement".

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions