Serverpod: Lot of problems when uploading to google cloud as instructions

28 Views Asked by At

using flutter 3.16.

after working project in local, used all instructions and created database as sql postgres 14 successfull, but when i deploy in cloud run, it starts throwing errors like table 1,2,3 etc not available. continuesly. i am not able to perform anything in cloud shell commands idk if it is possible to do. It wants me to perform migration things at production level may be, but how can i fix that? i can do it in local level only. Please help me understand things, I have read documents. but nothing to solve regarding this.

i tied checkig all my configurations and tried again and again even though they were fine.

  • tried flutter clean.
  • create-migration --force
  • run with apply migrations and then deploy
  • deleted local docker images manytimes and created again
1

There are 1 best solutions below

0
On

The local database is different from the one hosted in the cloud. The migrations are not automatically transferred between databases, so you must manage each database/environment independently.

To apply the migrations in your hosted environment, first configure access to the production database as described in the official documentation here: https://docs.serverpod.dev/deployments/deploying-to-gcr-console.

Then you can run the following command to apply the migrations against the production database, ideally in your CI/CD.

dart bin/main.dart --mode production --role maintenance --apply-migrations