Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IS there any Tool or API to auto update a database structure

In an application that I am supporting, lately I have made several changes to the DB structure.

I send the update to the users, but its very hard to keep them all up-to-date.

Is there any simple way to do this ?

Something that enables users to skip versions, but still do the update in the next version they install.

I use BlackFish database.

Thanks

like image 282
Jlouro Avatar asked May 06 '12 15:05

Jlouro


1 Answers

Just store database version number in the database and write migration scripts like this:

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

Check database version number on every application startup and apply needed migration scripts.

like image 68
Vladislav Rastrusny Avatar answered Nov 20 '22 22:11

Vladislav Rastrusny