6

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

mjn
  • 36,362
  • 28
  • 176
  • 378
Jlouro
  • 4,515
  • 9
  • 60
  • 91
  • 3
    Ensure that the patches are applied in the correct order? You shouldn't have any problems at all then. – Ben May 06 '12 at 16:16
  • 1
    Agree with @Ben, if your user skip some of the updates, once he perform it, install all previous updates in a sequence before you apply the latest one. It's IMHO the most painless way to do so. – TLama May 06 '12 at 16:26
  • 3
    I didn't know anybody actually used BlackFish SQL. – Warren P May 06 '12 at 21:22
  • Now you know ... I use it for small projects, with few users. It's nice, good performance, easy to install. I am switching to FireBird late this year, but till then I need to simplify database versioning. – Jlouro May 07 '12 at 13:12

3 Answers3

5

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.

Vladislav Rastrusny
  • 29,378
  • 23
  • 95
  • 156
0

Side note:

Another appealing alternative to it also for small project is Component ACE Absolute Database.


Now direct to the point:

The personnal edition (Free) comes with a custom utility named DBManager (along with its source code).

enter image description here

It can serve as starting point to how to manage database structure change programmatically (the Delphi way!).

Why not port it to BlackFish?

menjaraz
  • 7,551
  • 4
  • 41
  • 81
0

I very rarely change Databases but just add a table or sometimes a colunm. When I startup my program it checks for the existance of said column or table and if it's not there it just tries to make it.

Pieter B
  • 1,874
  • 10
  • 22