Project

General

Profile

Bug #2783

db:convert:prod2dev fails on table 'architectures_operatingsystems'

Added by Scuba Floyd over 9 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Category:
DB migrations
Target version:
Difficulty:
Triaged:
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:
Red Hat JIRA:

Description

When converting MySQL to Postgres on Foreman1.2, I get the following error (full trace attached):

Converting architectures_operatingsystems...rake aborted!
PG::Error: ERROR: column "id" does not exist
LINE 1: ...re_id", "operatingsystem_id") VALUES ($1, $2) RETURNING "id"
^
: INSERT INTO "architectures_operatingsystems" ("architecture_id", "operatingsystem_id") VALUES ($1, $2) RETURNING "id"

The schemas are consistent on both DBs.

prod2dev.trace prod2dev.trace 7.97 KB Scuba Floyd, 07/14/2013 06:29 AM

Related issues

Related to Foreman - Bug #3268: defer postgresql foreign key constraints for rake db:convert:prod2devClosed2013-10-08

Associated revisions

Revision f2cddb6b (diff)
Added by Greg Sutcliffe over 9 years ago

fixes #3268, #2783 - Update prod2dev to handle fkeys in psql

Revision ae72d2b7 (diff)
Added by Greg Sutcliffe over 9 years ago

fixes #3268, #2783 - Update prod2dev to handle fkeys in psql

(cherry picked from commit f2cddb6be2e68958350081c72068c79ca26a656b)

History

#1 Updated by Joseph Magen over 9 years ago

I also got this bug about a month ago and was not successful to fix it quickly. I ended up using the taps gem to manually migrate my database from MySQL to Postgres. Not the best method. I hope someone volunteers to look at this bug. If not, I will look at it again.

#2 Updated by Scuba Floyd over 9 years ago

My knowledge about Ruby and Rails is quite limited, but there's a boolean switch 'insert_returning' in ActiveRecord::ConnectionAdapters::PostgreSQLAdapter which defaults true. Maybe that is causing the trouble.

#3 Updated by Andy Bohne over 9 years ago

I'm also experiencing this issue, however I'm migrating from sqlite3 to pgsql.

#4 Updated by Dominic Cleal over 9 years ago

  • Related to Bug #3268: defer postgresql foreign key constraints for rake db:convert:prod2dev added

#5 Updated by Dominic Cleal over 9 years ago

  • Description updated (diff)
  • Status changed from New to Ready For Testing
  • Legacy Backlogs Release (now unused) set to 3

#6 Updated by Dominic Cleal over 9 years ago

  • Assignee set to Greg Sutcliffe
  • Target version set to 1.10.0

#7 Updated by Greg Sutcliffe over 9 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF