﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
25049	Oracle constraints case sensitivity	Pogsquog	nobody	"When using Oracle, migrations which alter the unique constraints of a model do not migrate correctly. This appears to be due to a case sensitivity difference in Oracle vs other databases.

Tested on Django 1.8 and 1.7 with Oracle 12c

example: models.py

from django.db import models

class DoorCount(models.Model):
    Day = models.DateField()
    MinuteOfTheDay = models.PositiveIntegerField()
    DoorId = models.PositiveIntegerField(null=False, blank=False)
    LineId = models.PositiveIntegerField(null=False, blank=False, default=0)
    Count = models.PositiveIntegerField(default=0)

    class Meta:
        # unique_together = (""Day"", ""MinuteOfTheDay"", ""DoorId"", ""LineId"") # migration initial 0001
        unique_together = (""Day"", ""MinuteOfTheDay"", ""DoorId"", ""LineId"")  # migration 0002

run makemigration with initial
run makemigration with 0002
run migrate
gets ""Found wrong number (0) of constraints for TestApp_doorcount(Day, MinuteOfTheDay, DoorId)""

Problem appears to be case sensitivity when looking for field names, so it does not find the relevant constraint in the database.

Currently I have a workaround to patch site-packages/django/db/schema.py with a .lower() on constraints, but this is very annoying for deploying, and is probably better fixed in the oracle specific code."	Bug	new	Database layer (models, ORM)	1.8	Normal		Oracle constraints migration case		Unreviewed	0	0	0	0	1	0
