README.md in lhm-2.1.0 vs README.md in lhm-2.2.0

- old
+ new

@@ -43,19 +43,17 @@ ## Requirements Lhm currently only works with MySQL databases and requires an established ActiveRecord or DataMapper connection. -It is compatible and [continuously tested][4] with MRI 1.9.x, +It is compatible and [continuously tested][4] with MRI 1.9.x, 2.0.x, 2.1.x, ActiveRecord 2.3.x and 3.x (mysql and mysql2 adapters), as well as DataMapper 1.2 (dm-mysql-adapter). Lhm also works with dm-master-slave-adapter, it'll bind to the master before running the migrations. -The test suite is also run against MRI 2.0.0 in Continuous Integration, but -there are a few bugs left to fix. ## Limitations Lhm requires a monotonically increasing numeric Primary Key on the table, due to how the Chunker works. @@ -139,10 +137,27 @@ ``` **Note:** Lhm won't delete the old, leftover table. This is on purpose, in order to prevent accidental data loss. +## Throttler + +Lhm is using a throttle mecanism to read data in your original table. + +By default, 40000 rows are read each 0.1 second. + +If you want to change that behiavour, you can pass an instance of a throttler with the `throttler` option. + +In this example, 1000 rows will be read with a 10 seconds delay between each processing: +```ruby +my_throttler = Lhm::Throttler::Time.new(stride: 1000, delay: 10) + +Lhm.change_table :users, throttler: my_throttler do |m| + # +end +``` + ## Table rename strategies There are two different table rename strategies available: LockedSwitcher and AtomicSwitcher. @@ -194,9 +209,21 @@ ``` To remove any Lhm tables/triggers found: ```ruby Lhm.cleanup(true) +``` + +Optionally only remove tables up to a specific Time, if you want to retain previous migrations. + +Rails: +```ruby +Lhm.cleanup(true, until: 1.day.ago) +``` + +Ruby: +```ruby +Lhm.cleanup(true, until: Time.now - 86400) ``` ## Contributing First, get set up for local development: