Describe the bug
migration 0013_alter_application_authorization_grant_type_device.py fails with error:
oracledb.exceptions.DatabaseError: ORA-02261: such unique or primary key already exists in the table
The cause seems to be that in the DeviceGrant, device_code is defined as:
('device_code', models.CharField(max_length=100, unique=True)),
and then there is a separate constraint defined on the same column:
'constraints': [models.UniqueConstraint(fields=('device_code',), name='oauth2_provider_devicegrant_unique_device_code')],
which causes the Oracle db to throw the above error.
( with PostgreSQL, the code works as expected, this seems to be specific to Oracle )
To Reproduce
env:
Python: 3.12
Django: 5.2
python-oracledb: 3.4.2
Oracle db version: 19c
run manage.py migrate
--> gives stack trace with above error
Expected behavior
the migration should be applied successfully ;)
Version
3.2.0
Additional context
Describe the bug
migration 0013_alter_application_authorization_grant_type_device.py fails with error:
oracledb.exceptions.DatabaseError: ORA-02261: such unique or primary key already exists in the tableThe cause seems to be that in the DeviceGrant, device_code is defined as:
('device_code', models.CharField(max_length=100, unique=True)),and then there is a separate constraint defined on the same column:
'constraints': [models.UniqueConstraint(fields=('device_code',), name='oauth2_provider_devicegrant_unique_device_code')],which causes the Oracle db to throw the above error.
( with PostgreSQL, the code works as expected, this seems to be specific to Oracle )
To Reproduce
env:
Python: 3.12
Django: 5.2
python-oracledb: 3.4.2
Oracle db version: 19c
run manage.py migrate
--> gives stack trace with above error
Expected behavior
the migration should be applied successfully ;)
Version
3.2.0
Additional context