theforeman/foreman — pull request #93 by Telmo (2012-06-28 22:43:30+00:00)
Title: Fixed migrations for mysql2

Fixes migration issues with CreateMessages and CreateSources

the issue stems from the fact that there is a check to see if the adapter is mysql but not if it is mysql2 which causes mysql2 to fail:

== CreateSources: migrating ==================================================
-- create_table(:sources)
-> 0.0025s
-- add_index(:sources, :value)
rake aborted!
An error has occurred, all later migrations canceled:

Mysql2::Error: BLOB/TEXT column 'value' used in key specification without a key length: CREATE INDEX `index_sources_on_value` ON `sources` (`value`)

Tasks: TOP => db:migrate
(See full trace by running task with --trace)

I considered using a regex to match mysql and mysql2 but I decided to take the simple route instead