Skip to content
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

Incorrect index drop/remove syntax #230

Open
dmwyatt opened this issue Dec 13, 2023 · 0 comments
Open

Incorrect index drop/remove syntax #230

dmwyatt opened this issue Dec 13, 2023 · 0 comments

Comments

@dmwyatt
Copy link

dmwyatt commented Dec 13, 2023

I'm getting auto-generated migrations with lines like this:

migrator.drop_index('schoolsport', 'school', 'sport')

migrator.add_index('schoolsport', <Model: School>, 'sport', unique=True)

Note the <Model: School>...the default repr generated by peewee. It's not even wrapped in quotes, it's just this text making these migration files invalid python.

Because this only started happening after I refactored my models into multiple modules in a package rather than all in one module, I'm guessing it's somehow related to model discovery? The other thing is, is that there's no reason for it to be dropping these indexes...I haven't changed them.

I don't mind working on a PR if anyone can give me some pointers to where the likely culprit of this is. I don't have time at this very moment to work on a repro, but I will soon if no one has an idea of what's going on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant