Is there any Tool or API for automatically updating the database structure

In the application that I support, recently I made several changes to the database structure.

I am sending updates to users, but it’s very difficult to keep them up to date.

Is there an easy way to do this?

Something that allows users to skip versions, but still does an update in the next version that they install.

I am using a BlackFish database.

thanks

+6
source share
3 answers

Just save the database version number in the database and write the migration scripts as follows:

  • database_10.sql - initial db structure
  • database_10_15.sql - migration script to go from 1.0 to 1.5
  • database_10_17.sql - migration script to go from 1.5 to 1.7

Check the database version number each time the application starts and apply the necessary migration scripts.

+5
source

Side note:

Another attractive alternative to this also for a small project is the ACE Absolute Database component.


Now straight to the point:

The personal version (Free) comes with a custom utility called DBManager (along with its source code).

enter image description here

It can serve as a starting point for managing programmatically changing the database structure (Delphi path!).

Why not migrate it to BlackFish?

0
source

I very rarely change databases, but just add a table or sometimes a column. When I run my program, it checks for the existence of a column or table, and if it's not there, it just tries to do it.

0
source

Source: https://habr.com/ru/post/915022/


All Articles