Project

General

Profile

Actions

Refactor #28620

closed

db:migrate fails with SQLite on Rails 6

Added by Anonymous over 4 years ago. Updated almost 4 years ago.

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

Description

== 20140910153654 MoveHostNicsToInterfaces: migrating =========================
-- add_column(:nics, :primary, :boolean, {:default=>false})
   -> 0.0015s
-- add_column(:nics, :provision, :boolean, {:default=>false})
   -> 0.0012s
-- Migrating Host interfaces to standalone Interfaces
-- remove_column(:hosts, :ip)
   -> 0.0594s
-- remove_column(:hosts, :mac)
   -> 0.0626s
-- remove_column(:hosts, :primary_interface)
   -> 0.0668s
-- remove_foreign_key(:hosts, {:name=>"hosts_subnet_id_fk"})
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:

Table 'hosts' has no foreign key for {}
/home/mmoll/mystuff/gitrepos/theforeman/foreman/vendor/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/sqlite3/schema_statements.rb:75:in `remove_foreign_key'
/home/mmoll/mystuff/gitrepos/theforeman/foreman/vendor/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/migration.rb:890:in `block in method_missing'
/home/mmoll/mystuff/gitrepos/theforeman/foreman/vendor/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/migration.rb:858:in `block in say_with_time'
/home/mmoll/mystuff/gitrepos/theforeman/foreman/vendor/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/migration.rb:858:in `say_with_time'
/home/mmoll/mystuff/gitrepos/theforeman/foreman/vendor/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/migration.rb:879:in `method_missing'
/home/mmoll/mystuff/gitrepos/theforeman/foreman/db/migrate/20140910153654_move_host_nics_to_interfaces.rb:42:in `up'

Probably related to https://blog.bigbinary.com/2019/09/24/rails-6-adds-add_foreign_key-and-remove_foreign_key-for-sqlite3.html


Related issues 1 (0 open1 closed)

Blocks Foreman - Tracker #24837: Rails 6.0 TrackerClosed

Actions
Actions #1

Updated by Anonymous over 4 years ago

Actions #2

Updated by Tomer Brisker about 4 years ago

  • Assignee set to Ondřej Ezr
Actions #3

Updated by The Foreman Bot about 4 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/7552 added
Actions #4

Updated by Ondřej Ezr about 4 years ago

  • Status changed from Ready For Testing to Closed
Actions #5

Updated by Tomer Brisker almost 4 years ago

  • Fixed in Releases 2.1.0 added
Actions

Also available in: Atom PDF