thoughtbot / parity

Shell commands for development, staging, and production parity for Heroku apps
https://thoughtbot.com
MIT License
895 stars 57 forks source link

Update ar_internal_metadata after remote restore #157

Closed geoffharcourt closed 6 years ago

geoffharcourt commented 6 years ago

This change updates the local development restore operation to update the ar_internal_metadata table if it's present, setting the environment value to development.

Previously, failing to update the environment metadata would result in a potentially alarming error that might cause users to believe they were about to perform a destructive operation against their production database when what was actually happening was that the development database was a snapshot taken from production.

If the table is not present (either for older Rails applications or non-Rails applications), this anonymous PG function will no-op.

Fix #147

geoffharcourt commented 6 years ago

@seanpdoyle if we land this, I'll cut Parity 3.0.0.beta!