Changing Primary Key from BigAutoField to BigIntegerField not working

59 views
Skip to first unread message

Amiganer

unread,
Jan 20, 2020, 1:26:43 PM1/20/20
to Django users
Hello.

I'm using postgresql 12 and psycopg2, Python 3.7, Django 3.0.2 (actual stable branch)

I declared first my Model with a BigAutoField as Primary_key, later i menchend that the ID field is unique, the id's are predefined and unique.
I tried to change the id to a BigIntegerField, done a migration, a look at the database nothing has changes, the id is still a autogenerated sequence (postgresql uses sequences as primary key).
the "nexval(...seq)" is in it too.
I does the manually: "ALTER TABLE xyz ALTER id DROP DEFAULT" and that worked. Now the id (=primary-key) key is as wished a normal BigIntegerField.

Have I done something wrong?

Bye, Christian

Reply all
Reply to author
Forward
0 new messages