1

From Ruby on Rails I've learned about a comfortable and very manageable way to do database migrations.

How would one handle such cases in Qt4? It does not need to be that elaborated as Rails' solution. I'd be fine with running SQL and code snippets to go up or down the version list of my data.

I googled a little bit but there seems to be no standard solution. There even seems to be no one who scratched his head before. It looks like everybody implements their own idea of how to do that.

Is there anyone interested or working on a standard solution and like to share efforts? Or maybe even has a working implementation? I'm thinking of the idea to have something similar like the information_schema table in Rails and let the application run a wizard to up- or downgrade the database (and maybe offer to do a backup/dump first), or as another option just run the migration without wizard, maybe just a handy progressbar.

hurikhan77
  • 5,881
  • 3
  • 32
  • 47
  • What is the reason you want to stick to Qt? The only reason I could imagine is embedding the schema migration and/or initial database bootstrapping into a Qt-based application as bonus feature. Otherwise I see no reason to require a Qt-only based solution. – Ihor Kaharlichenko Aug 20 '10 at 07:33
  • @Ihor So what are the suggested alternatives? – hurikhan77 Aug 20 '10 at 08:03
  • That depends on what exactly do you need: schema migration, data migration or both? You can take a look at tools suggested in http://stackoverflow.com/questions/2051340/how-the-schema-migration-tools-work and http://stackoverflow.com/questions/2454815/database-migration. Though if you really want a solution you can embed into your existing Qt application with a nice GUI, I'm interested in contributing/creation of an Open Source project. – Ihor Kaharlichenko Aug 20 '10 at 08:25
  • @Ihor I'm thinking of something like how Ruby on Rails does it, just wrapped in Qt. On application start, the app should detect pending migrations and show a progress bar and do the schema and data migrations. If you'd like to start an open source project with me: Cool. :-) – hurikhan77 Aug 20 '10 at 13:48

1 Answers1

0

QDjango may you like, it's mimic of django database ORM

Update:

Unfortunately QDjango doesn't support migrations. – @Riateche

Alireza Savand
  • 3,462
  • 3
  • 26
  • 36