Package: python-migrate
Version: 0.6-3
Severity: important
Tags: upstream

In Lenny, the schema for postgres was postgres://... and files in the db
respository was called xxx_postgres_upgrade.sql and so forth.

But in Squeeze, SQLAlchemy have renamed the dialect to postgresql. The
dialects.postgres.py works fine, but the upgrade scripts does not seem
to work.

It seems like the engine's name is postgresql, where the self.sql in
migrate.versioning.version still is called postgres.

Traceback (most recent call last):
  File "/usr/bin/migrate", line 6, in <module>
    sys.exit(main())
  File "/usr/lib/pymodules/python2.6/migrate/versioning/shell.py", line 205, in 
main
    ret = command_func(**kwargs)
  File "/usr/lib/pymodules/python2.6/migrate/versioning/api.py", line 185, in 
upgrade
    return _migrate(url, repository, version, upgrade=True, err=err, **opts)
  File "<string>", line 2, in _migrate
  File "/usr/lib/pymodules/python2.6/migrate/versioning/util/__init__.py", line 
161, in with_engine
    return f(*a, **kw)
  File "/usr/lib/pymodules/python2.6/migrate/versioning/api.py", line 343, in 
_migrate
    changeset = schema.changeset(version)
  File "/usr/lib/pymodules/python2.6/migrate/versioning/schema.py", line 74, in 
changeset
    changeset = self.repository.changeset(database, start_ver, version)
  File "/usr/lib/pymodules/python2.6/migrate/versioning/repository.py", line 
213, in changeset
    changes = [self.version(v).script(database, op) for v in versions]
  File "/usr/lib/pymodules/python2.6/migrate/versioning/version.py", line 175, 
in script
    "There is no script for %d version" % self.version
AssertionError: There is no script for 1 version

self.sql = {'default': {'upgrade': ...},
            'postgres': {'downgrade': ...}}

Renaming the files to xxx_postgres works, but to maintain compatibility
with lenny I used xxx_default.

It would be quite trivial to add a mapping from postgres to postgresql
for these filenames.

Regards,
Örjan

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (990, 'testing'), (600, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/1 CPU core)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash



--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to