[MXS-3722] Schema time machine Created: 2021-08-12  Updated: 2022-09-08  Resolved: 2022-09-08

Status: Closed
Project: MariaDB MaxScale
Component/s: N/A
Affects Version/s: None
Fix Version/s: N/A

Type: New Feature Priority: Major
Reporter: Manjot Singh (Inactive) Assignee: markus makela
Resolution: Won't Do Votes: 1
Labels: None

Sprint: MXS-SPRINT-153, MXS-SPRINT-154, MXS-SPRINT-155

 Description   

The existing ALTER TABLE editor in the GUI can be extended to also generate the inverse ALTER TABLE operation. These inverse operations would then be stored and tracked by MaxScale, possibly by storing them in the database itself. The GUI can then provide a reversible history of a particular table by fetching the stored changes.

A reversion of a change is done by executing the inverse operations until the given version is reached. These "rollbacks" would then be recorded by swapping the operations around and incrementing a version counter, similar to how git revert creates a new commit for each reverted commit.

There are limitations in some operations that cannot be reverted without losing data. An obvious example of this is DROP COLUMN: you can't revert this and regain the lost data. Doing this would require support in MariaDB itself and is outside the scope of this issue.


Old description:

At configurable times (or before ALTER, CREATE OR REPLACE, DROP statements are executed), Maxscale should snapshot (dump) all DDL.

Schema time machine could allow for versioning of schema based on date or when changes are made and the gui should allow browsing by these versions and provide reversion scripts.

CLI could allow browsing with a git CLI or perhaps with a mariadb client type of interface.



 Comments   
Comment by markus makela [ 2022-03-28 ]

Added the ddl_only mode to the binlogrouter that only logs DDL query events into the binlog.

Generated at Thu Feb 08 04:23:29 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.