Closed phacops closed 9 years ago
Simple table alteration:
Lhm.change_table :shopping_carts do |m| m.add_column :created_at, "datetime" end
I run the script and go to my database to see if the original table is locked:
mysql> SHOW OPEN TABLES where `Table` = 'shopping_carts'; +----------------------+----------------+--------+-------------+ | Database | Table | In_use | Name_locked | +----------------------+----------------+--------+-------------+ | inventory_production | shopping_carts | 1 | 0 | +----------------------+----------------+--------+-------------+
The table is locked. Isn't LHM supposed to prevent this? I assume I missed something obvious but don't see what.
Gemfile:
source 'https://rubygems.org' gem 'activerecord' gem 'mysql2' gem 'lhm'
Nothing was wrong with lhm, maybe my database was not strong enough to support default values. I used a throttler to change the behaviour and add some documentation for the next guy struggling with this.
https://github.com/soundcloud/lhm/pull/80
Simple table alteration:
I run the script and go to my database to see if the original table is locked:
The table is locked. Isn't LHM supposed to prevent this? I assume I missed something obvious but don't see what.
Gemfile: