1

thanks everybody, I have a django project, this is my enviroment:

Database: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production

Python: Python 3.5.1rc1 cx-Oracle==6.3 Django==2.0.4

I am trying this:

 python manage.py test

I am getting this error:

django.db.utils.DatabaseError: ORA-30673: column to be modified is not an identity column

Thanks.

ceduard0
  • 11
  • 1

1 Answers1

4

It appears that you are trying to set a column to be the identity column, using the ALTER TABLE command. Oracle, however, tells you that you can't do that.

An example:

Create a table:

create table test (id number);

This command raises the ORA-30673:

alter table test modify id number generated by default on null as identity;

You should create a new identity column:

alter table test add id_new number generated by default on null as identity;

Then copy data into a new column, if necessary:

update test set id_new = id;

Drop the old ID column:

alter table test drop column id;

Rename the new column to the old name:

alter table test rename column id_new to id;

Expect problems if the old ID column was a primary key, used in enforcing foreign key constraint(s).

Littlefoot
  • 131,892
  • 15
  • 35
  • 57
  • hi!!, thanks for your answer, I did the example that do you show me, I understand the exception from database perspective but I don´t know if the problem is from django. I created a new project but I can´t do the migrate step. Regards – ceduard0 Apr 29 '18 at 02:30