Automatic database update after deployment

Hi,

I have searched for it but I cannot find how to do it. Maybe it is not possible.

When I change a project in SC and also change the database tables in my development enviroment after I deployed the project I still have to change the database tables manually. It there a way that the deployment feature updates the tables for me automatically.

Thanks
Andre

Afaik that’s not possible, although there are 3rd party tools who can, depending on the used database. What you can do is dump you database table with the integrated database tool and import it into your deploy environment, but you loose data of course. If you export the table data into some ‘insert into’ (ie. with phpMyAdmin for MySQL) then you can follow this procedure and re-import the data. Then new fields will stay empty. If you have changes in your tablekey structure then you might run into trouble…

Hi andre,
Let me explain how do i, solve that problem. I have a scriptcase software, with multi company/users, every company use the same software in my server, that software connects to the company database that is located in other server, so each client has different database to store their information. I need to update all that databases automatically, this is how i solve that.

[SIZE=5]Example to update database automatically[/SIZE]
First you need a central database, to store all SQL sentences of changes. And in your client database you need table to store the current client version.

  1. User login using their account
  2. Software check the current client patch version vs the central id_patch version
    Lets suppose that the current client version is 2 and the central version is 3 like in the example.
    3.Then you need to execute all the sql sentence of central starting from id_patch> current client version
    3.1 and Finally update the client version to the latest version
    and redirect to welcome app
  3. Welcome app.

With multiple databases, you can save a lot of time. The same user when logins update their database to the current version.

Yes, that’s a great way. But it requires you to keep track of changes in the database which is applicable if you deploy to a lot of different customers. A lot of us create an app and deploy once.

We use oracle and a tool which detects differences in datamodal and then generates the required sql for changes. That way you develop and afterwards when you want to deploy you can change the db in acceptance and production environment. But I’m not aware of such a tool for MySQL.

Check this screencast from Adminer … Klick!

Thank you all for your quick reply.
Our application will be one php source but every customer gets his own database. So a little automation would be nice.
I like the solution of Hirambq, but you have be sure that all updates go 100% correct. Because users always logs in at a time which is not convinient to you when a problem occurs.
Our customers are located worldwide, and our customers give access to the application to their customers without telling us. So if they login and something goes wrong or takes a long time our customer looks foolish.

Maybe we keep updating the database and then Adminer looks great.
At this moment we do not have all our customers switch over to our new product. So we do not have to many database we have to update.

Maybe it would be a nice feature voor SC 7.1 to have something like this built into SC.

Thanks everyone
Andre