README.md in pg_ha_migrations-1.2.3 vs README.md in pg_ha_migrations-1.2.4

- old
+ new

@@ -53,11 +53,11 @@ - Database safety (e.g., long-held locks) - Application safety (e.g., dropping columns the app uses) We rename migration methods with prefixes denoting their safety level: -- `safe_*`: These methods check for both application and database safety concerns prefer concurrent operations where available, set low lock timeouts where appropriate, and decompose operations into multiple safe steps. +- `safe_*`: These methods check for both application and database safety concerns, prefer concurrent operations where available, set low lock timeouts where appropriate, and decompose operations into multiple safe steps. - `unsafe_*`: These methods are generally a direct dispatch to the native ActiveRecord migration method. Calling the original migration methods without a prefix will raise an error. The API is designed to be explicit yet remain flexible. There may be situations where invoking the `unsafe_*` method is preferred (or the only option available for definitionally unsafe operations). @@ -104,10 +104,22 @@ ```ruby safe_add_enum_value :enum, "value" ``` +#### unsafe\_rename\_enum\_value + +Unsafely change the value of an enum type entry. + +```ruby +unsafe_rename_enum_value(:enum, "old_value", "new_value") +``` + +Note: + +Changing an enum value does not issue any long-running scans or acquire locks on usages of the enum type. Therefore multiple queries within a transaction concurrent with the change may see both the old and new values. To highlight these potential pitfalls no `safe_rename_enum_value` equivalent exists. Before modifying an enum type entry you should verify that no concurrently executing queries will attempt to write the old value and that read queries understand the new value. + #### safe\_add\_column Safely add a column. ```ruby @@ -281,10 +293,10 @@ ``` ## Development -After checking out the repo, run `bin/setup` to install dependencies and start a postgres docker container. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. +After checking out the repo, run `bin/setup` to install dependencies and start a postgres docker container. Then, run `bundle exec rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. This project uses Appraisal to test against multiple versions of ActiveRecord; you can run the tests against all supported version with `bundle exec appraisal rspec`. Running tests will automatically create a test database in the locally running Postgres server. You can find the connection parameters in `spec/spec_helper.rb`, but setting the environment variables `PGHOST`, `PGPORT`, `PGUSER`, and `PGPASSWORD` will override the defaults. To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).