Discount.validProducts causing case-significance issues in database tables

Create issue
Issue #769 resolved
Former user created an issue

This patch just changes all occurrences of "validProducts" to "valid_products".

Reported by davis

Comments (11)

  1. Former user Account Deleted

    I forgot to mention that for the backwards incompatible changes the fix would be to rename the "product_discount_validProducts" table to "product_discount_valid_products". In MySQL:

    ALTER TABLE product_discount_validProducts RENAME TO product_discount_valid_products;
    
  2. Tay Ray Chuan

    I've published a fix as 1466:a8082eb6d5db.

    In addition to the code, I've changed the the sqlite databases for the sample projects too; see the commit message for the exact commands used.

  3. manofphysics

    hi, if I use SQL command {{{

    1. !sql

    ALTER TABLE product_discount_validProducts RENAME TO product_discount_valid_products; }}}

    why the postgresql give me "ERROR: relation "product_discount_validproducts" does not exist".

  4. Chris Moffitt repo owner

    Another option is to just drop the table and do a syncdb. I'm not sure why your command doesn't work.

  5. Tay Ray Chuan

    manofphysics: what does psql \d give? Also, you should try double-quoting the table name, ie:

    ALTER TABLE "product_discount_validProducts" RENAME TO product_discount_valid_products;
    

    Alternatively, you could try using South. It'll take care of all the ghastly SQL. See this wiki entry for more.

  6. Log in to comment