3 ms·
> I'll never be comfortable with any tool for that automatically generates schema changes, as I'm just never sure at what point it decides to delete parts of my
by parhamn 5y ago
> I'll never be comfortable with any tool for that automatically generates schema changes, as I'm just never sure at what point it decides to delete parts of my prod db.
To be fair, they analogized themselves to Terraform, which can go as far as deleting the database itself (and all the other infra that goes with it). As with anything a good dry-mode and a good process around review is how you minimize the risk.
- sverhagen 5y agoThat's why we try to set our databases to deletion_protection=true, and make it hard to delete them. But your point still largely stands!
- paulgb 5y agoInterestingly, that's the default for GCP but not AWS, even though both providers are developed by Hashicorp. I was pleasantly surprised by how difficult it was to (even intentionally) delete my GCP database when I was starting to use terraform.
- nijave 5y agoTerraform usually use cloud provider defaults if they're applicable. There's also 2 deletion protection mechanisms for RDS (and maybe GCP DBs). AWS has built in deletion protection which is an attribute on the resource and Terraform has lifecycle protection which is a meta attribute you can put on any resource type. The former disables the delete API (returns an error) on the AWS side and the latter prevents Terraform from running the destroy event (which includes replaces)
- rotemtam 5y agoHi parhamn, One of Atlas's creators here. To be precise, we never analogized Atlas to Terraform :-) We said the existing HCL DDL is terraform like (which it is). As far as I know, there are no heavily used terraform plugins for handling database migrations - and not because it's not possible. The CLI currently exposes a declarative workflow (atlas schema apply), but we our analysis of the problem is that that declarative is not robust enough for many projects. For this reason, the Go API already support "versioned migrations" or "migration authoring" which means Atlas will generate migration files (SQL) and maintain the directory for you in the format that you like (Flyway, go-migrate etc). In the very near future we will publish the migration authoring functionality to the CLI (you can already play with it via the Go package if you like).