spree/spree — Issue #1147: "Login preference not defined" Error when migrating application preferences, spree 1-0 stable
Author: melcher
Created: 2012-02-13 06:39:40+00:00
State: open

I received an error when attempting to migrate our production data to spree 1-0 stable. I'm not sure what this is referring to or if it is important. Is there a short-term fix?
As a side note, it would be nice if the migrations did not fail unless absolutely necessary, as it makes a bit of a mess with the data half-migrated from a migration hidden in a gem. Sorry that this does not have the stacktrace, but it looks like it came from Preferable#has_preference!(name), which was called in the PreferenceRescue.try loop.

== NewPreferences: migrating =================================================
-- add_column(:spree_preferences, :key, :string)
-> 0.0306s
-- add_column(:spree_preferences, :value_type, :string)
-> 0.0037s
-- add_index(:spree_preferences, :key, {:unique=>true})
-> 0.0400s
-- remove_index(:spree_preferences, {:name=>"ix_prefs_on_owner_attr_pref"})
-> 0.0085s
-- change_column(:spree_preferences, :name, :string, {:null=>true})
-> 0.0203s
-- change_column(:spree_preferences, :owner_id, :integer, {:null=>true})
-> 0.0215s
-- change_column(:spree_preferences, :owner_type, :string, {:null=>true})
-> 0.0232s
-- change_column(:spree_preferences, :group_id, :integer, {:null=>true})
-> 0.0714s
-- change_column(:spree_preferences, :group_type, :string, {:null=>true})
-> 0.0207s
-- execute("select id, type from spree_configurations")
-> 0.0303s
-- execute("select id, owner_id, name from spree_preferences where owner_type = 'Spree::Configuration'")
-> 0.0039s
Migrating Preference: spree/calculator/per_item/amount/2
Migrating Preference: spree/calculator/per_item/amount/3
Migrating Preference: spree/calculator/per_item/amount/4
Migrating Preference: spree/calculator/per_item/amount/5
Migrating Preference: spree/calculator/per_item/amount/6
Migrating Preference: spree/mail_method/enable_mail_delivery/1
Migrating Preference: spree/mail_method/mails_from/1
Migrating Preference: spree/mail_method/intercept_email/1
Migrating Preference: spree/mail_method/mail_domain/1
Migrating Preference: spree/mail_method/mail_host/1
Migrating Preference: spree/mail_method/mail_port/1
Migrating Preference: spree/mail_method/secure_connection_type/1
Migrating Preference: spree/mail_method/mail_auth_type/1
Migrating Preference: spree/mail_method/mail_bcc/1
Migrating Preference: spree/mail_method/smtp_username/1
Migrating Preference: spree/mail_method/smtp_password/1
Migrating Preference: spree/gateway/braintree/test_mode/1
rake aborted!
An error has occurred, this and all later migrations canceled:

login preference not defined

Tasks: TOP => db:migrate