From 189865fd80433377a561794d46767f63fa3c3a6c Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Mon, 6 May 2019 20:56:19 +0100 Subject: [PATCH] Make stock locations backorderable_default false. This is required because when the default stock location is created, the backorderable_default column doesnt exist and when this column is created, the initial default is true. This is why we need to force it to false here. This column is the default value for on_demand which must be false. --- ...506194625_update_stock_locations_backorderable_default.rb | 5 +++++ db/schema.rb | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20190506194625_update_stock_locations_backorderable_default.rb diff --git a/db/migrate/20190506194625_update_stock_locations_backorderable_default.rb b/db/migrate/20190506194625_update_stock_locations_backorderable_default.rb new file mode 100644 index 0000000000..a95aae6eea --- /dev/null +++ b/db/migrate/20190506194625_update_stock_locations_backorderable_default.rb @@ -0,0 +1,5 @@ +class UpdateStockLocationsBackorderableDefault < ActiveRecord::Migration + def change + Spree::StockLocation.update_all(backorderable_default: false) + end +end diff --git a/db/schema.rb b/db/schema.rb index aa295d937b..a6daa27963 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20190504151144) do +ActiveRecord::Schema.define(:version => 20190506194625) do create_table "adjustment_metadata", :force => true do |t| t.integer "adjustment_id"