Hi Nathan, > The new data upgrade functionality is available in revision 826. This > adds sqlalchemy-migrate as a dependency. > > Sqlalchemy-migrate uses a version table in the DB to keep track of the > schema version. Each time Pytrainer starts, the upgrade mechanism will > check this version number, adding it if missing, and run any upgrade > scripts that have been added to the upgrade repository. > > >From now on, any database schema change should be accompanied with an > sqlalchemy-migrate upgrade script. Data or configuration modifications > can also be achieved with upgrade scripts. Upgrade scripts can be > written as SQL or as Python. They can be targeted at a specific RDBMS > or be generic. Upgrade scripts are located in the migrate repository > at pytrainer/upgrade/versions. > > The new upgrade mechanism provides an alternative to the data cleanup > logic in DDBB#checkDBIntegrity. This method still can be invoked by > providing the "--check" startup parameter but in time this logic > should be entirely replaced with upgrade scripts.
Congratulations Nathan for great work. I was about to give it a try, but it seems I miss something: 1.- When executing from source code (actually my second option, explanation below at #2) I get the following: $ ./bin/pytrainer running pytrainer from source path data_path: /home/david/pytrainer/working/ gettext_path: /home/david/pytrainer/working/locale site_path: /home/david/pytrainer/working Traceback (most recent call last): File "./bin/pytrainer", line 96, in <module> from pytrainer.main import pyTrainer File "/home/david/pytrainer/working/pytrainer/main.py", line 36, in <module> from upgrade.data import initialize_data File "/home/david/pytrainer/working/pytrainer/upgrade/data.py", line 23, in <module> from pytrainer.upgrade.migratedb import MigratableDb File "/home/david/pytrainer/working/pytrainer/upgrade/migratedb.py", line 19, in <module> from migrate.versioning.api import db_version, upgrade, version, version_control ImportError: No module named migrate.versioning.api $ When I saw "migrate" in the path I remember first you added files under this path and then moved under "upgrade", but "pytrainer/migrate/versions/" is still under version control: $ ls -latr pytrainer/migrate/versions/.svn/ total 32 drwxrwxr-x 2 david david 4096 jul 23 18:56 prop-base drwxrwxr-x 2 david david 4096 jul 23 18:56 props drwxrwxr-x 2 david david 4096 jul 27 17:04 text-base drwxrwxr-x 3 david david 4096 jul 27 17:04 .. -r--r--r-- 1 david david 115 jul 27 17:04 all-wcprops drwxrwxr-x 5 david david 4096 jul 29 17:09 tmp -r--r--r-- 1 david david 263 jul 29 17:09 entries drwxrwxr-x 6 david david 4096 jul 29 17:41 . $ So it makes me think that maybe some files are just on your local installation and not under version control yet, am I right? 2.- My first approach is often running from installed egg file, but It was strange it wasn't working after last update: $ pytrainer running pytrainer from egg installation data_path: /usr/share/pytrainer/ gettext_path: /usr/share/locale site_path: /usr/lib/python2.7/site-packages Traceback (most recent call last): File "/usr/bin/pytrainer", line 96, in <module> from pytrainer.main import pyTrainer File "/usr/lib/python2.7/site-packages/pytrainer/main.py", line 36, in <module> from upgrade.data import initialize_data ImportError: No module named upgrade.data $ After some investigation I have seen that no files from upgrade process have been copied in the build process ruled by setup.py file. Unfortunately we need to describe there where to copy files from and to, not a fully automated process o:) I didn't make any change myself waiting for your feedback, please let me know if I can support you. As said at the beginning of current email, thanks very much for your contribution, I look forward to checking this process ;) Cheers, David ------------------------------------------------------------------------------ Got Input? Slashdot Needs You. Take our quick survey online. Come on, we don't ask for help often. Plus, you'll get a chance to win $100 to spend on ThinkGeek. http://p.sf.net/sfu/slashdot-survey _______________________________________________ Pytrainer-devel mailing list Pytrainer-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pytrainer-devel