Fix Oracle long table name migrations

#155 Open

Bitbucket cannot automatically merge this request.

The commits that make up this pull request have been removed.

Bitbucket cannot automatically merge this request due to conflicts.

Review the conflicts on the Overview tab. You can then either decline the request or merge it manually on your local system using the following commands:

hg update default
hg pull -r default
hg merge 860a7a6b2071
hg commit -m 'Merged in cmayor/south (pull request #155)'
  1. cmayor

This patch fixes Oracle migrations for table names > 30 characters. Django isn't consistent when it truncates object names to fit in Oracle's 30 char limit. Columns are converted to upper case before hashing but table names are not.

Comments (1)

  1. Shai Berger


    Does this fix actual problems for you, or is it just based on a reading of sources? Migrations work quite well on Oracle, including with long table names -- in my day job, I help develop a large Django project which has quite a few of those, managed by migrations.

    The truncation behavior you describe is inaccurate -- Django does convert table name to uppercase before hashing, when "main" tables are involved. The hashing on lowercase only happens for automatic many-to-many tables; South already takes care of this in the generation of migrations -- for such tables, it includes special name-truncation logic in the migration file.

    South's test-suite currently passes on Oracle, as far as I can see, from Django 1.4 to 1.6 (at least against Python 2.7). Can you demonstrate a problem with a test?