4 ms·
The article covers only Rails 4.
by ricny046 13y ago
The article covers only Rails 4.
- losvedir 13y agoAh, bummer. Anyone have any luck getting partial indexes to work in Rails 3.2?
- netghost 13y agoYou can always execute arbitrary SQL in migrations. For instance: def up execute('ALTER TABLE people ADD INDEX ...') end The one thing to keep in mind though is that if you use ruby schema format, your tests won't pick up those execute statements. In that case it's best to either use the sql format or re-run migrations in the test environment to set up the test db.
- lobster_johnson 13y agoYou could just do it manually: execute %{ create index index_users_on_name on users (name) where state = 'NY'; }
- srgpqt 13y agoUpgrading from Rails 3.2 to Rails 4.0 takes very little time, assuming the gems you depend on are compatible (which they should be, by now, or you might want to look for replacement gems..)