lfs_migrate issues with Postgres

Issue #177 new
Matuschek
created an issue

Upgrading from 0.5 to 0.6 or 0.7 using Postgres 8.4/9.1 and postgresql_psycopg2

lfs_migrate.py - lines 50/51 should be (I think): db.execute("update voucher_voucher set used_amount = 1 where used = 't'") db.execute("update voucher_voucher set used_amount = 0 where used = 'f'") otherwise it fails with: LINE 1: update voucher_voucher set used_amount = 1 where used = 1 ^ HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.

The migration also tries to add columns to voucher_voucher which already exist (added by syncdb): used_amount last_used_date limit

Comments (2)

  1. Kai Diefenbach repo owner

    Hi Matuschek,

    "The migration also tries to add columns to voucher_voucher which already exist (added by syncdb): used_amount last_used_date limit"

    This would be strange as the voucher_voucher table already exists and syncdb shouldn't add columns, should it? Are you sure about that?

    Thanks Kai

  2. Matuschek reporter
    • changed status to new

    You are, of course, correct. It isn't syncdb adding the columns. Running the migration on a fresh install, but, using data from a real site the "bin/django lfs_migrate" step fails at: django.db.utils.DatabaseError: cannot ALTER TABLE "voucher_voucher" because it has pending trigger events However, the additional columns have now been added. When re-running lfs_migrate it encounters the now existing columns and fails.

  3. Log in to comment