Project

General

Profile

Actions

Bug #4518

open

DB migrations: Can't DROP 'role_id'; check that column/key exists

Added by Dominic Cleal about 10 years ago. Updated almost 10 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
DB migrations
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Between 1.3 to 1.4, the following error occurs:

$ /usr/sbin/foreman-rake db:migrate
==  RemoveUnusedRoleFields: migrating =========================================
-- remove_column(:users, :role_id)
rake aborted!
An error has occurred, all later migrations canceled:

Mysql2::Error: Can't DROP 'role_id'; check that column/key exists: ALTER TABLE `users` DROP `role_id`
Tasks: TOP => db:migrate
(See full trace by running task with --trace)

It might also be the second column removal in the migration causing it on the first run.

Workaround: comment out lines 3 and 4 in /usr/share/foreman/db/migrate/20130924145800_remove_unused_role_fields.rb, run foreman-rake db:migrate; foreman-rake db:seed and restart Apache/Foreman.


Related issues 1 (0 open1 closed)

Has duplicate Foreman - Bug #4523: DB migration fails while upgrading theforeman from 1.3 to 1.4 Duplicate03/03/2014Actions
Actions

Also available in: Atom PDF