Well, I've seen some plugins to create a versions table to keep track of modifications on specific models, but cant do easily like quora shows
What I have so far is a table like that:
Someone could give me some help and guidelines with this design? Im worried about performance, wrong columns, missing columns, etc
id | item_type | item_id | event | who | column | new | old | revision_rel | date
________________________________________________________________________________________________________
1 | Topic | 2 | edit | Luccas | photo | pic.png | oldpic.png | null | m:d:y
2 | Topic | 2 | revert | Chris | photo | oldpic.png | pic.png | 1 | m:d:y
Version control enables multiple people to simultaneously work on a single project. Each person edits his or her own copy of the files and chooses when to share those changes with the rest of the team. Thus, temporary or partial edits by one person do not interfere with another person's work.
A Version Control System is a system that records all the changes made to a set of files or single file. A VCS allows you to call a specific version of a file whenever it is required. This helps in making sure that all the team members of a team are working on the most recent version of the file.
Database version control is the practice of tracking every change made to the database by every team member. Like application version control, database version control acts as a single source of truth. It empowers you with complete visibility, traceability, and continuous monitoring of the changes in your database.
The types of VCS are: Local Version Control System. Centralized Version Control System. Distributed Version Control System.
There are some gems available that already do what you are looking for. Have you looked into:
Take a looks at existing gems: https://www.ruby-toolbox.com/categories/Active_Record_Versioning
I am using audited (previously acts_as_audited) for something very similar: https://github.com/collectiveidea/audited
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With