Spree init works when database has not been created, remove duplicate FK from db/schema.rb

This commit is contained in:
Rohan Mitchell
2015-03-12 11:29:01 +11:00
parent 381bfd383b
commit 1e5e009735
2 changed files with 6 additions and 5 deletions

View File

@@ -14,8 +14,12 @@ Spree.config do |config|
config.checkout_zone = ENV["CHECKOUT_ZONE"]
config.address_requires_state = true
country = Spree::Country.find_by_name(ENV["DEFAULT_COUNTRY"])
config.default_country_id = country.id if country.present?
if Spree::Country.table_exists?
country = Spree::Country.find_by_name(ENV["DEFAULT_COUNTRY"])
config.default_country_id = country.id if country.present?
else
config.default_country_id = 12 # Australia
end
# -- spree_paypal_express
# Auto-capture payments. Without this option, payments must be manually captured in the paypal interface.

View File

@@ -1096,9 +1096,6 @@ ActiveRecord::Schema.define(:version => 20150225232938) do
add_foreign_key "enterprise_groups", "spree_addresses", name: "enterprise_groups_address_id_fk", column: "address_id"
add_foreign_key "enterprise_groups", "spree_users", name: "enterprise_groups_owner_id_fk", column: "owner_id"
add_foreign_key "enterprise_groups", "spree_addresses", name: "enterprise_groups_address_id_fk", column: "address_id"
add_foreign_key "enterprise_groups", "spree_users", name: "enterprise_groups_owner_id_fk", column: "owner_id"
add_foreign_key "enterprise_groups_enterprises", "enterprise_groups", name: "enterprise_groups_enterprises_enterprise_group_id_fk"
add_foreign_key "enterprise_groups_enterprises", "enterprises", name: "enterprise_groups_enterprises_enterprise_id_fk"