-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Support for Spanner DB schema migrations #2082
Support for Spanner DB schema migrations #2082
Comments
@SargisPlusPlus we (the Cloud Spanner team) was just looking into this because we think we shouldn't destroy any resources for DDL updates. Recently, we have been working on schema migration tool support lately (e.g. Flyway, Liquibase, etc). We also discussed whether Terraform is a good place for this but given provisioning is not always in the path of development and Terraform itself doesn't have the sophisticated capabilities that you mention, we were thinking about sticking to get the migration tool integrations right. How does that sound? |
I wrote: https://github.com/GoogleCloudPlatform/spanner-schema-diff-tool as a way of generating non-destructive alter statements to migrate schemas... |
@rakyll I noticed you're now proposing that people not manage their schema in TF at all. I think this is probably smart- writing ALTER statements isn't really a great fit for a declarative tool, since it means the same config can't be applied to a blank slate to create the same environment. We'll probably still want to have update support for these statements anyway though so that people who wish to perform updates through Terraform can do so and also so people who aren't paying attention don't accidentally delete their databases. That work is allocated for our next sprint (Aug 17-31) |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
Community Note
Description
We use google_spanner_database DDL functionality to define schema for our database. When schema changes, new tables are added or removed, entire database has to be destroyed and recreated for the new changes to be applied. It would be nice not to destroy entire database when schema changes are introduced but instead run migrations to change schema accordingly.
New or Affected Resource(s)
The text was updated successfully, but these errors were encountered: