If I revert/backout database changes, how do I safely remove the changes from Change history?

Let’s say I’ve decided I no longer want the changes in orange. Using Delete in the context menu has been pointless because it’s led to corruption in the migration process, so what’s the correct way to get rid of them?

In this instance where you have a continuous sequence of unapplied changes (orange), you could safely delete them using the context menu, and it shouldn’t cause a corruption

If a corruption does happen, the wappler_migrations table needs to be edited using a third-party DB viewer (or a fix by Wappler team), assuming you deleted a continuous sequence exactly in the same format as shown in the screenshot

1 Like

The changes in orange are unapplied and if you don’t need them you can safely delete them.

Only the changes that are already applied ( in green) can’t be deleted because this can lead to database history corruption. That is why we also prohibit it in the last update so you will get an alert that is not allowed now.

2 Likes

Just to add make sure these changes aren’t applied on any remote targets if you have any if they are also unapply them there not just development otherwise things will get out of sync.

Another thing to keep in mind is the current database backup let’s say you added a new table in development and then created a database backup, this now stores the change in the backup to be reapplied when next run. So if you was to delete the change to create this table this can also cause issues as the backup looks for a change that no longer exists so make sure to create a new backup after the rollback (if you made a backup with the applied changes). This should then prevent it looking for the deleted change when stopped and started.

3 Likes

Gold tip!

1 Like