-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
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
Alter column with added default results in invalid PSQL query #135
Comments
Here are the tracebacks in case thats helpful:
|
The SQL that is being created is: The word TYPE is being attached in the wrong place. (see this part of the code for Postgres.) |
I can still reproduce this issue with |
If you have a model with some field that does not have a default value, and you then modify that model to include a default value, the generated migration for that will fail.
It fails because the resulting PSQL query is an invalid
ALTER
statement.Following the formatting in #87
Steps
models.py
:models.py
so that the name field now has a default:Result: the generated PSQL query will be this invalid statement:
Something like this PSQL statement would work and is would be more appropriate.
Version:
Thanks!
The text was updated successfully, but these errors were encountered: