Skip to content

run get_app before checking for schema updates#5345

Closed
tartansandal wants to merge 1 commit intoreflex-dev:mainfrom
tartansandal:kjh/fix-spurious-migrations
Closed

run get_app before checking for schema updates#5345
tartansandal wants to merge 1 commit intoreflex-dev:mainfrom
tartansandal:kjh/fix-spurious-migrations

Conversation

@tartansandal
Copy link
Copy Markdown
Contributor

@tartansandal tartansandal commented May 27, 2025

This change ensures prerequisites has access to the application models before checking for schema changes.

Since version 0.7.9, I've been getting spurious "Detected database changes..." warnings when starting up my app, However, when I run reflex db makemigrations, nothing is produced. I tweaked the code to show the phantom migration it was warning me and, to my surprise, it wanted to delete all the objects in my database. I believe this is because the prerequisites code could not see the app's models when checking for migrations. This PR resolve that, but it may not be the most sensible approach. πŸ˜…

This may be related to and fix #5301

@adhami3310
Copy link
Copy Markdown
Member

i understand now πŸ˜… you are correct in that it's not where we need to do particularly but it does give me a clue on how to do it, thanks for the contribution!

@masenf
Copy link
Copy Markdown
Collaborator

masenf commented May 29, 2025

fixed in #5348

@masenf masenf closed this May 29, 2025
@tartansandal tartansandal deleted the kjh/fix-spurious-migrations branch June 7, 2025 08:04
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

Successfully merging this pull request may close these issues.

[Alembic] Creates migrations of tables that's migrations already exist

3 participants