-
-
Notifications
You must be signed in to change notification settings - Fork 103
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
New migration file on migrate for Indexes defined on a Model. #258
New migration file on migrate for Indexes defined on a Model. #258
Comments
Any updates on this? |
Kinda wanna bump this too, I got all my indexes commented out after the initial migration as a work around. It'd be nice to atleast understand if it's a known issue / compromise with the initial implementation. |
@alexf-bond @VladOsiichuk |
@fullonic pulled down the branch and added back in my indexes and successfully migrated and upgraded. Upon running migrate again a new file was still generated with a subset of the indexes being dropped and recreated. Also it looks like the indexes being dropped didn't actually exist causing the second upgrade to fail:
Not sure if the hashing / hash detection is working perfectly with these changes. Happy to share the list of indexes / table structure we're using if it'll help debug. Also is there any possiblity of back porting this to 0.6.2? We haven't upgraded to the new .py version of migrations files just yet. |
Does anyone have solution for this? |
Thanks for bumping this @FelipeBarrosCruz. I ended up just running migrate with the indexes defined and then just commenting them out with a link to the issue. I tried digging through the code to see why hashes aren't generated correctly with them a while back but maybe i'll revisit again soon :/ |
Steps to reproduce:
My suspicion is that by not providing a name to the index and relying on Tortoise to generate a random one, the code in migrate is always detecting them as new.Tested this theory by giving the index a name and still got thet same result. New migration was created again for the same index first with a
DROP INDEX
and then aCREATE INDEX
Maybe the index hash in the json snapshot for the model isn't unique each time you run migrate?
The text was updated successfully, but these errors were encountered: