soundcloud/lhm — pull request #49 by hornairs (2013-07-19 19:55:34+00:00)
Title: Make the primary key to use for the migration configurable

This adds a new option to `Lhm.change_table` called `order_column`. It allows the specification of a primary key column other than `id` to use during the migration, or a to specify what column should be used in the absence of a primary key. At Shopify we're moving a whole bunch of tables over to `BIGINT(20)` sized IDs and some of our freakier tables don't have primary keys or have weird ones, so at least we need this.

Implementation wise the kind of uncomfortable state about what column to use now needs to be given to everyone. I think an appropriate place is the migration, since most objects in the system have access to it and they all need to agree on the value. This required passing the options down a couple more objects for the Migrator creating the Migration to have access, but I think thats acceptable for this increase in functionality.

/cc @dylanahsmith @arthurnn