-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add a tool to easily permit the upgrade of a database version to an other #26
Comments
Hi, I need such tool and I'm willing to work on it. I think that it should work like Doctrine migration tool. Let's say that we have files in app/sql/ : If we execute cppcmsskel_upgradedb with empty database, than:
CREATE TABLE IF NOT EXISTS
If we want to migrate database to version 20130415170210, than 20130416090314_down.sql is executed and we perform If we execute cppcmsskel_upgradedb with existng database, than:
Versioning with timestamps is a lot better scheme if many peoples works on application. What do you think about that? I'm mainly interested in postresql and mysql if it comes to SQL databases - I think that we need some configuration support for that. Do you have any code for it or should I start looking at code and start coding? :) Best regards, |
for the last point you're refering to do something like solving issue #36 ? for the rest I'm gonna check doctrine, but yep certainly something like that :) |
Yes, we need to solve issue #36 before this. I'll take a look at it and try to write something. Doctrine is a PHP ORM. For version 2.x there is a separate migration tool http://docs.doctrine-project.org/projects/doctrine-migrations/en/latest/index.html . What I would like to have for cppcms is a simple tool that can:
From my POV most simple and clean method to achieve this will be use of separate scripts named after this convention {timestamp}{myslq,pgsql,sqlite}{down,up}.sql Other way to achieve this is to create some migration file format postgresql: But I'm a huge fan of first solution here. The other problem that I would like your opinion on is how to connect to database from cppcmsskel_upgradedb (I assume that you want this to be writen in python like other cppcmsskel tools). So we have a two options here:
The second solution is simple and will not add additional dependencies, so I think that it will be better. What do you think about it? Best regards, |
When we update the database schema of a cppcms application, we may want to have an easy and safe way to
basically it should be an external tool that can work like this
for example
updates containing
last_version.txt
containing the last version number in itfrom_X_to_Y.sql
permitting to upgrade from the version X to the version Y of the database , so that the script will first compare the version in the application database, and then will execute it for examplefrom_13_to_15.sql
andfrom_15_to_16.sql
The text was updated successfully, but these errors were encountered: