Skip to content

Instantly share code, notes, and snippets.

@aaronrussell
Created August 14, 2012 12:25
Show Gist options
  • Save aaronrussell/3348921 to your computer and use it in GitHub Desktop.
Save aaronrussell/3348921 to your computer and use it in GitHub Desktop.

Every time I run the migrations, a particular migration fails. This is the error:

bundle exec rake db:migrate

.... a bunch of successful migrations, then...

rake aborted!
An error has occurred, all later migrations canceled:

Mysql2::Error: Unknown column 'meta_keywords' in 'field list': INSERT INTO `pages` (`draft`, `meta_keywords`, `depth`, `link_url`, `lft`, `parent_id`, `meta_description`, `menu_match`, `rgt`, `show_in_menu`, `skip_to_first_child`, `custom_title_type`, `title`, `path`, `custom_title`, `deletable`, `created_at`, `browser_title`, `position`, `updated_at`) VALUES (0, NULL, NULL, '/vehicle_manufacturers', 7, NULL, NULL, '^/vehicle_manufacturers(\\/|\\/.+?|)$', 8, 1, 0, 'none', 'Vehicle Manufacturers', NULL, NULL, 0, '2012-08-14 12:15:44', NULL, 2, '2012-08-14 12:15:44')

The plot thickens

... because every time I run the migration, it fails at the same place but the unknown column it whines about changes every time! I have had the following columns: meta_keywords, title, browser_title

The Page table

Is pretty simple - it's only columns are a bunch of timestamps and integers.

However, there are other tables which DO contain those missing columns: PagePart and PageTranslation both contain title, and SeoMeta contains browser_title and meta_keywords.

So I'm pretty sure the Page model is doing some voodoo and automatically saving certain attributes in related tables, but is failing for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment