Hi,
2011/10/23 Nathan Jones <[email protected]>:
> Thanks guys for the sample data files. I have now verified the upgrade
> to version 1.9.0 works from 1.7.1, 1.7.2 and 1.8.0 with records
> containing laps.
>
> There's a couple of significant changes I have just committed related
> to the data upgrade functionality:
>
> 1. I have deleted the "check" start up option and removed the
> checkDBIntegrity function (r903). This is redundant now that we have a
> proper data upgrade mechanism.
> 2. Upgrading from version 1.7.0 or earlier will fail cleanly (r904).
> Previously the behaviour was likely to leave the DB in a corrupt
> state.
> 3. I have split the "add column" and "populate data" stages of two of
> the upgrade scripts to minimise the chance of a user ending up with a
> corrupt database if an upgrade fails (r906). I wanted to use
> transactions to achieve this but I suspect you cannot rollback
> executed DDL statements.
>
> This last change meant the DB version numbering had to change -
> version 12 has been renumbered to version 14. Normally when this
> happens you you would need to change the migrate_version value from 12
> to 14 in your DB to avoid an upgrade failure the first time you launch
> after updating. In this case though the last two upgrade scripts are
> safe to run twice so you won't need to do anything.
>
> With these changes I am happy for 1.9.0 to be released.
Thanks Nathan for your work ;)
> Shall we organise some smoke testing?
Yep. I have just updated from svn to see last changes, but pytrainer
refuses to start:
$ 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 102, in <module>
main()
File "/usr/bin/pytrainer", line 99, in main
pytrainer = pyTrainer(None, data_path)
File "/usr/lib/python2.7/site-packages/pytrainer/main.py", line 79,
in __init__
initialize_data(self.ddbb, self.environment.conf_dir)
File "/usr/lib/python2.7/site-packages/pytrainer/upgrade/data.py",
line 31, in initialize_data
InstalledData(migratable_db, ddbb,
LegacyVersionProvider(conf_dir),
UpgradeContext(conf_dir)).update_to_current()
File "/usr/lib/python2.7/site-packages/pytrainer/upgrade/data.py",
line 63, in update_to_current
data_state = self.get_state()
File "/usr/lib/python2.7/site-packages/pytrainer/upgrade/data.py",
line 73, in get_state
version = self.get_version()
File "/usr/lib/python2.7/site-packages/pytrainer/upgrade/data.py",
line 99, in get_version
if self.is_versioned():
File "/usr/lib/python2.7/site-packages/pytrainer/upgrade/data.py",
line 132, in is_versioned
return self._migratable_db.is_versioned()
File "/usr/lib/python2.7/site-packages/pytrainer/upgrade/migratedb.py",
line 59, in is_versioned
self.get_version()
File "/usr/lib/python2.7/site-packages/pytrainer/upgrade/migratedb.py",
line 68, in get_version
return db_version(self._db_url, self._repository_path)
File "<string>", line 2, in db_version
File "/usr/lib/python2.7/site-packages/migrate/versioning/util/__init__.py",
line 160, in with_engine
return f(*a, **kw)
File "/usr/lib/python2.7/site-packages/migrate/versioning/api.py",
line 147, in db_version
schema = ControlledSchema(engine, repository)
File "/usr/lib/python2.7/site-packages/migrate/versioning/schema.py",
line 26, in __init__
repository = Repository(repository)
File "/usr/lib/python2.7/site-packages/migrate/versioning/repository.py",
line 80, in __init__
self._versions))
File "/usr/lib/python2.7/site-packages/migrate/versioning/version.py",
line 83, in __init__
self.versions[VerNum(num)] = Version(num, path, files)
File "/usr/lib/python2.7/site-packages/migrate/versioning/version.py",
line 153, in __init__
self.add_script(os.path.join(path, script))
File "/usr/lib/python2.7/site-packages/migrate/versioning/version.py",
line 174, in add_script
self._add_script_py(path)
File "/usr/lib/python2.7/site-packages/migrate/versioning/version.py",
line 197, in _add_script_py
'per version, but you have: %s and %s' % (self.python, path))
migrate.versioning.exceptions.ScriptError: You can only have one
Python script per version, but you have:
/usr/lib/python2.7/site-packages/pytrainer/upgrade/versions/011_populate_lap_details.py
and
/usr/lib/python2.7/site-packages/pytrainer/upgrade/versions/011_remove_db_version.py
$
It looks like we should merge both scripts or named them as different
versions, right?
Regards,
David
------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn
about Cisco certifications, training, and career opportunities.
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
Pytrainer-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pytrainer-devel