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

Chapter 4: Problem with 'flask db downgrade base' #397

Open
DRuyters opened this issue Aug 31, 2024 · 1 comment
Open

Chapter 4: Problem with 'flask db downgrade base' #397

DRuyters opened this issue Aug 31, 2024 · 1 comment
Labels

Comments

@DRuyters
Copy link

Hello,

When trying to downgrade the database, I get the following error:

"Cannot drop index 'ix_post_user_id': needed in a foreign key constraint"

I assume that I need to change something in one of the migrations files to solve this problem. I am running a local MySQL server so it might be related to that

@DRuyters DRuyters changed the title Chapter 4: Problem with slask db downgrade Chapter 4: Problem with 'flask db downgrade base' Aug 31, 2024
@miguelgrinberg
Copy link
Owner

If this happens with the "posts table" migration included in this project, then my guess is that there is some small difference between sqlite (which is what I used when the migrations were generated) and MySQL. You can try moving the drop table call to the top to see if that helps.

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

No branches or pull requests

2 participants