-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Can't DROP 'product_grade_' #1287
Comments
I had also faced this error. this error raise due to there is no column name
|
Thanks for the tip.
|
it means in your database has already column name
|
Yes. I was looking if there was a way in django to do a "if not exist", but nothing in the AddField() method anyways. |
hehe and now I guess a collateral:
|
After clearing again everything (
I am guessing the uwsgi error could be related:
|
So it works OK from a clean slate. This means this does not work when trying to upgrade from a previous version, unless tweaking the migration file knowing what you're doing... :-/ |
can u plz tell the impact |
I've been struggling to understand why this is happening as well. Notice when applying migrations, dojo 0001-0005 are not applied. That product_grade_ column is added in 0001 but then removed in 0006. I can only assume they are not applied because they already have been on a previous/current build. In that case, there should not be any issue with removing a column that already exists. Very aggravating. |
I believe you can do --fake to skip over it. One of the test cases I had thought about awhile ago is that we should have a database at a prior version in the repo and then attempt to apply the migration to that database. This check would have caught this issue. There is more robust testing now in migrations but I think this last test would be worthwhile. |
I think during the python3 migration all stings with a 'b' in front like b'Pacific/Truk' were replaced to 'Pacific/Truk' because with the 'b' in front there are not python3 compatible. If this was done automatically 'product_grade_b' results in product_grade_'. I will provide a PR where 'product_grade_' is renamed in 'product_grade_b' again. Just like before the python3 migration. |
Bug description
Pulling from
dev
, and doing a docker-compose up out of fresh checkout and docker image local build.Steps to reproduce
Steps to reproduce the behavior:
git checkout dev
Expected behavior
A clear and concise description of what you expected to happen.
Deployment method (select with an
X
)The text was updated successfully, but these errors were encountered: