Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.8k
Cannot create and apply migrations#1225
-
First Check
Commit to Help
Example CodeDescriptionI have downloaded and setup the project and it runs well in docker and locally for the frontend. However, when I make changes to a model, e.g. removing the UserBase full_name column and adding first_name and last_name columns, the backend service then stops running with |
BetaWas this translation helpful?Give feedback.
All reactions
You need to start backend container without starting the fastapi app, then runalembic revision --autogenerate -m "...." andalembic upgrade head (as described in thedocs).
Then you can start fastapi app.
Seethis answer to make backend container run without running fastapi app
Replies: 2 comments 1 reply
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
@TJPain I believe this issue might be coincidental, and there are two potential scenarios to consider: Scenario One: You are running the frontend and attempting to log in after making changes to the model file, but you have not performed any database migration. Scenario Two: You are running both the frontend and backend, and you already logged into client using the admin email, as indicated in the error message you mentioned. Frontend making calls to backend to verify logged in identity The error you are encountering is not directly related to updating the model but occurs when making an API call to retrieve user details without migrating changes to DB. This can happen either from the frontend or through the Swagger documentation. Suggestion / Correct Sequence of Actions:
Following these steps should resolve the issue. |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
You need to start backend container without starting the fastapi app, then run Seethis answer to make backend container run without running fastapi app |
BetaWas this translation helpful?Give feedback.
All reactions
-
Or, simpler, you can install backend dependencies and run |
BetaWas this translation helpful?Give feedback.