db:convert:prod2dev fails on table 'architectures_operatingsystems'
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.
#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
Applied in changeset f2cddb6be2e68958350081c72068c79ca26a656b.
fixes #3268, #2783 - Update prod2dev to handle fkeys in psql