Monday, July 8, 2019

[google-cloud-sql-discuss] Modify database schema and data as a part of deployment process

I got used to the idea that a database migrations (scripts to change the schema or data) are shipped as a part of deployment process.


Gcloud platform doesn't have a recommended way to run migrations.


However, this will cause migrations to be run multiple times for each instance of the server being launched.

That can cause problems if the migration takes more than 10 seconds to run and performs non-trivial data changes.

Is there a way to plug `migrate` command into the deployment process  so that it is being executed only once per deployment?


Also, I would be great to perform migrations as close as possible to service restart because in some cases old deployed version can be incompatible to the new DB schema.

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/20930d07-25c1-4848-b89c-aae0e5becf56%40googlegroups.com.

No comments:

Post a Comment