We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UUIDField with the option of primary_key=False got reverted to primary_key=True in generated migrations or SQL.
primary_key=False
primary_key=True
Including a UUIDField with primary_key=False in a model:
test = model_utils.fields.UUIDField(primary_key=False, default=uuid.uuid4, editable=False, serialize=False)
Surprisingly, when running migration it becomes primary_key=True:
field=model_utils.fields.UUIDField(primary_key=True, default=uuid.uuid4, editable=False, serialize=False)
as well as generated SQL:
CREATE TABLE table_name ("test" uuid NOT NULL PRIMARY KEY ....
If the model already got primary key column, it's a headache to find workaround.
UUIDField with the option of primary_key=False should keep primary_key=False in generated migrations or SQL.
The text was updated successfully, but these errors were encountered:
Can confirm - I'm getting the same problem
Sorry, something went wrong.
No branches or pull requests
Problem
UUIDField with the option of
primary_key=False
got reverted toprimary_key=True
in generated migrations or SQL.Environment
Code examples
Including a UUIDField with
primary_key=False
in a model:Surprisingly, when running migration it becomes
primary_key=True
:as well as generated SQL:
If the model already got primary key column, it's a headache to find workaround.
Expectation
UUIDField with the option of
primary_key=False
should keepprimary_key=False
in generated migrations or SQL.The text was updated successfully, but these errors were encountered: