diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..82701fe --- /dev/null +++ b/.gitignore @@ -0,0 +1,19 @@ +# See https://help.github.com/articles/ignoring-files for more about ignoring files. +# +# If you find yourself ignoring temporary files generated by your text editor +# or operating system, you probably want to add a global ignore instead: +# git config --global core.excludesfile '~/.gitignore_global' + +# Ignore bundler config. +/.bundle + +# Ignore all logfiles and tempfiles. +/log/* +/tmp/* +!/log/.keep +!/tmp/.keep + +/node_modules +/yarn-error.log + +.byebug_history diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..db52d18 --- /dev/null +++ b/Gemfile @@ -0,0 +1,58 @@ +source 'https://rubygems.org' + +git_source(:github) do |repo_name| + repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/") + "https://github.com/#{repo_name}.git" +end + + +# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' +gem 'rails', '~> 5.1.3' +# Use postgresql as the database for Active Record +gem 'pg', '~> 0.18' +# Use Puma as the app server +gem 'puma', '~> 3.7' +# Use SCSS for stylesheets +gem 'sass-rails', '~> 5.0' +# Use Uglifier as compressor for JavaScript assets +gem 'uglifier', '>= 1.3.0' +# See https://github.com/rails/execjs#readme for more supported runtimes +# gem 'therubyracer', platforms: :ruby + +# Use CoffeeScript for .coffee assets and views +gem 'coffee-rails', '~> 4.2' +# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks +gem 'turbolinks', '~> 5' +# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder +gem 'jbuilder', '~> 2.5' +# Use Redis adapter to run Action Cable in production +# gem 'redis', '~> 3.0' +# Use ActiveModel has_secure_password +# gem 'bcrypt', '~> 3.1.7' + +# Use Capistrano for deployment +# gem 'capistrano-rails', group: :development + +group :development, :test do + # Call 'byebug' anywhere in the code to stop execution and get a debugger console + gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] + # Adds support for Capybara system testing and selenium driver + gem 'capybara', '~> 2.13' + gem 'selenium-webdriver' +end + +group :development do + # Access an IRB console on exception pages or by using <%= console %> anywhere in the code. + gem 'web-console', '>= 3.3.0' + gem 'listen', '>= 3.0.5', '< 3.2' + # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring + gem 'spring' + gem 'spring-watcher-listen', '~> 2.0.0' +end + +# Windows does not include zoneinfo files, so bundle the tzinfo-data gem +gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] + +gem 'spree', '~> 3.5.0' +gem 'spree_auth_devise', '~> 3.3' +gem 'spree_gateway', '~> 3.3' diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..7c42df4 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,385 @@ +GEM + remote: https://rubygems.org/ + specs: + actioncable (5.1.6) + actionpack (= 5.1.6) + nio4r (~> 2.0) + websocket-driver (~> 0.6.1) + actionmailer (5.1.6) + actionpack (= 5.1.6) + actionview (= 5.1.6) + activejob (= 5.1.6) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 2.0) + actionpack (5.1.6) + actionview (= 5.1.6) + activesupport (= 5.1.6) + rack (~> 2.0) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + actionview (5.1.6) + activesupport (= 5.1.6) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.0.3) + activejob (5.1.6) + activesupport (= 5.1.6) + globalid (>= 0.3.6) + activemerchant (1.86.0) + activesupport (>= 4.2, < 6.x) + builder (>= 2.1.2, < 4.0.0) + i18n (>= 0.6.9) + nokogiri (~> 1.4) + activemodel (5.1.6) + activesupport (= 5.1.6) + activerecord (5.1.6) + activemodel (= 5.1.6) + activesupport (= 5.1.6) + arel (~> 8.0) + activesupport (5.1.6) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) + minitest (~> 5.1) + tzinfo (~> 1.1) + acts-as-taggable-on (5.0.0) + activerecord (>= 4.2.8) + acts_as_list (0.9.17) + activerecord (>= 3.0) + addressable (2.5.2) + public_suffix (>= 2.0.2, < 4.0) + arel (8.0.0) + autoprefixer-rails (9.3.1) + execjs + awesome_nested_set (3.1.4) + activerecord (>= 4.0.0, < 5.3) + bcrypt (3.1.12) + bindex (0.5.0) + bootstrap-sass (3.3.7) + autoprefixer-rails (>= 5.2.1) + sass (>= 3.3.4) + builder (3.2.3) + byebug (10.0.2) + camertron-eprun (1.1.1) + cancancan (2.3.0) + canonical-rails (0.2.4) + rails (>= 4.1, < 5.3) + capybara (2.18.0) + addressable + mini_mime (>= 0.1.3) + nokogiri (>= 1.3.3) + rack (>= 1.0.0) + rack-test (>= 0.5.4) + xpath (>= 2.0, < 4.0) + carmen (1.0.2) + activesupport (>= 3.0.0) + childprocess (0.9.0) + ffi (~> 1.0, >= 1.0.11) + cldr-plurals-runtime-rb (1.0.1) + climate_control (0.2.0) + coffee-rails (4.2.2) + coffee-script (>= 2.2.0) + railties (>= 4.0.0) + coffee-script (2.4.1) + coffee-script-source + execjs + coffee-script-source (1.12.2) + concurrent-ruby (1.1.3) + crass (1.0.4) + css_parser (1.6.0) + addressable + deface (1.3.2) + nokogiri (>= 1.6) + polyglot + rails (>= 4.1) + rainbow (>= 2.1.0) + devise (4.4.3) + bcrypt (~> 3.0) + orm_adapter (~> 0.1) + railties (>= 4.1.0, < 6.0) + responders + warden (~> 1.2.3) + devise-encryptable (0.2.0) + devise (>= 2.1.0) + erubi (1.7.1) + execjs (2.7.0) + ffaker (2.10.0) + ffi (1.9.25) + friendly_id (5.2.4) + activerecord (>= 4.0.0) + globalid (0.4.1) + activesupport (>= 4.2.0) + highline (1.6.21) + htmlentities (4.3.4) + i18n (1.1.1) + concurrent-ruby (~> 1.0) + jbuilder (2.8.0) + activesupport (>= 4.2.0) + multi_json (>= 1.2) + jquery-rails (4.3.3) + rails-dom-testing (>= 1, < 3) + railties (>= 4.2.0) + thor (>= 0.14, < 2.0) + jquery-ui-rails (6.0.1) + railties (>= 3.2.16) + kaminari (1.0.1) + activesupport (>= 4.1.0) + kaminari-actionview (= 1.0.1) + kaminari-activerecord (= 1.0.1) + kaminari-core (= 1.0.1) + kaminari-actionview (1.0.1) + actionview + kaminari-core (= 1.0.1) + kaminari-activerecord (1.0.1) + activerecord + kaminari-core (= 1.0.1) + kaminari-core (1.0.1) + listen (3.1.5) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + ruby_dep (~> 1.2) + loofah (2.2.3) + crass (~> 1.0.2) + nokogiri (>= 1.5.9) + mail (2.7.1) + mini_mime (>= 0.1.1) + method_source (0.9.2) + mime-types (3.2.2) + mime-types-data (~> 3.2015) + mime-types-data (3.2018.0812) + mimemagic (0.3.2) + mini_mime (1.0.1) + mini_portile2 (2.3.0) + minitest (5.11.3) + monetize (1.9.0) + money (~> 6.12) + money (6.13.1) + i18n (>= 0.6.4, <= 2) + multi_json (1.13.1) + nio4r (2.3.1) + nokogiri (1.8.5) + mini_portile2 (~> 2.3.0) + orm_adapter (0.5.0) + paperclip (6.0.0) + activemodel (>= 4.2.0) + activesupport (>= 4.2.0) + mime-types + mimemagic (~> 0.3.0) + terrapin (~> 0.6.0) + paranoia (2.4.1) + activerecord (>= 4.0, < 5.3) + pg (0.21.0) + polyamorous (1.3.3) + activerecord (>= 3.0) + polyglot (0.3.5) + premailer (1.11.1) + addressable + css_parser (>= 1.6.0) + htmlentities (>= 4.0.0) + premailer-rails (1.10.2) + actionmailer (>= 3, < 6) + premailer (~> 1.7, >= 1.7.9) + public_suffix (3.0.3) + puma (3.12.0) + rabl (0.13.1) + activesupport (>= 2.3.14) + rack (2.0.6) + rack-test (1.1.0) + rack (>= 1.0, < 3) + rails (5.1.6) + actioncable (= 5.1.6) + actionmailer (= 5.1.6) + actionpack (= 5.1.6) + actionview (= 5.1.6) + activejob (= 5.1.6) + activemodel (= 5.1.6) + activerecord (= 5.1.6) + activesupport (= 5.1.6) + bundler (>= 1.3.0) + railties (= 5.1.6) + sprockets-rails (>= 2.0.0) + rails-dom-testing (2.0.3) + activesupport (>= 4.2.0) + nokogiri (>= 1.6) + rails-html-sanitizer (1.0.4) + loofah (~> 2.2, >= 2.2.2) + railties (5.1.6) + actionpack (= 5.1.6) + activesupport (= 5.1.6) + method_source + rake (>= 0.8.7) + thor (>= 0.18.1, < 2.0) + rainbow (3.0.0) + rake (12.3.1) + ransack (1.8.8) + actionpack (>= 3.0) + activerecord (>= 3.0) + activesupport (>= 3.0) + i18n + polyamorous (~> 1.3.2) + rb-fsevent (0.10.3) + rb-inotify (0.9.10) + ffi (>= 0.5.0, < 2) + responders (2.4.0) + actionpack (>= 4.2.0, < 5.3) + railties (>= 4.2.0, < 5.3) + ruby_dep (1.5.0) + rubyzip (1.2.2) + sass (3.7.2) + sass-listen (~> 4.0.0) + sass-listen (4.0.0) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + sass-rails (5.0.7) + railties (>= 4.0.0, < 6) + sass (~> 3.1) + sprockets (>= 2.8, < 4.0) + sprockets-rails (>= 2.0, < 4.0) + tilt (>= 1.1, < 3) + select2-rails (3.5.9.1) + thor (~> 0.14) + selenium-webdriver (3.141.0) + childprocess (~> 0.5) + rubyzip (~> 1.2, >= 1.2.2) + spree (3.5.0) + spree_api (= 3.5.0) + spree_backend (= 3.5.0) + spree_cmd (= 3.5.0) + spree_core (= 3.5.0) + spree_frontend (= 3.5.0) + spree_sample (= 3.5.0) + spree_api (3.5.0) + rabl (~> 0.13.1) + spree_core (= 3.5.0) + versioncake (~> 3.3.0) + spree_auth_devise (3.4.2) + devise (~> 4.4.0) + devise-encryptable (= 0.2.0) + spree_core (>= 3.1.0, < 4.0) + spree_extension + spree_backend (3.5.0) + bootstrap-sass (~> 3.3) + jquery-rails (~> 4.3) + jquery-ui-rails (~> 6.0.1) + select2-rails (= 3.5.9.1) + spree_api (= 3.5.0) + spree_core (= 3.5.0) + spree_cmd (3.5.0) + thor (~> 0.14) + spree_core (3.5.0) + activemerchant (~> 1.67) + acts-as-taggable-on (~> 5.0) + acts_as_list (~> 0.8) + awesome_nested_set (~> 3.1.3) + cancancan (~> 2.0) + carmen (~> 1.0.0) + deface (~> 1.0) + ffaker (~> 2.2) + friendly_id (~> 5.2.1) + highline (~> 1.6.18) + kaminari (~> 1.0.1) + monetize (~> 1.1) + paperclip (~> 6.0.0) + paranoia (~> 2.4.1) + premailer-rails + rails (~> 5.1.5) + ransack (~> 1.8.0) + responders + sprockets-rails + state_machines-activerecord (~> 0.5) + stringex + twitter_cldr (~> 4.3) + spree_extension (0.0.5) + activerecord (>= 4.2) + spree_frontend (3.5.0) + bootstrap-sass (>= 3.3.5.1, < 3.4) + canonical-rails (~> 0.2.0) + jquery-rails (~> 4.3) + spree_api (= 3.5.0) + spree_core (= 3.5.0) + spree_gateway (3.3.3) + spree_core (>= 3.1.0, < 4.0) + spree_extension + spree_sample (3.5.0) + spree_core (= 3.5.0) + spring (2.0.2) + activesupport (>= 4.2) + spring-watcher-listen (2.0.1) + listen (>= 2.7, < 4.0) + spring (>= 1.2, < 3.0) + sprockets (3.7.2) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.2.1) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) + state_machines (0.5.0) + state_machines-activemodel (0.5.1) + activemodel (>= 4.1, < 6.0) + state_machines (>= 0.5.0) + state_machines-activerecord (0.5.2) + activerecord (>= 4.1, < 6.0) + state_machines-activemodel (>= 0.5.0) + stringex (2.8.5) + terrapin (0.6.0) + climate_control (>= 0.0.3, < 1.0) + thor (0.20.3) + thread_safe (0.3.6) + tilt (2.0.8) + turbolinks (5.2.0) + turbolinks-source (~> 5.2) + turbolinks-source (5.2.0) + twitter_cldr (4.4.3) + camertron-eprun + cldr-plurals-runtime-rb (~> 1.0) + tzinfo + tzinfo (1.2.5) + thread_safe (~> 0.1) + uglifier (4.1.20) + execjs (>= 0.3.0, < 3) + versioncake (3.3.0) + actionpack (>= 3.2) + activesupport (>= 3.2) + railties (>= 3.2) + tzinfo + warden (1.2.8) + rack (>= 2.0.6) + web-console (3.7.0) + actionview (>= 5.0) + activemodel (>= 5.0) + bindex (>= 0.4.0) + railties (>= 5.0) + websocket-driver (0.6.5) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.3) + xpath (3.2.0) + nokogiri (~> 1.8) + +PLATFORMS + ruby + +DEPENDENCIES + byebug + capybara (~> 2.13) + coffee-rails (~> 4.2) + jbuilder (~> 2.5) + listen (>= 3.0.5, < 3.2) + pg (~> 0.18) + puma (~> 3.7) + rails (~> 5.1.3) + sass-rails (~> 5.0) + selenium-webdriver + spree (~> 3.5.0) + spree_auth_devise (~> 3.3) + spree_gateway (~> 3.3) + spring + spring-watcher-listen (~> 2.0.0) + turbolinks (~> 5) + tzinfo-data + uglifier (>= 1.3.0) + web-console (>= 3.3.0) + +BUNDLED WITH + 1.17.1 diff --git a/README.md b/README.md new file mode 100644 index 0000000..7db80e4 --- /dev/null +++ b/README.md @@ -0,0 +1,24 @@ +# README + +This README would normally document whatever steps are necessary to get the +application up and running. + +Things you may want to cover: + +* Ruby version + +* System dependencies + +* Configuration + +* Database creation + +* Database initialization + +* How to run the test suite + +* Services (job queues, cache servers, search engines, etc.) + +* Deployment instructions + +* ... diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..e85f913 --- /dev/null +++ b/Rakefile @@ -0,0 +1,6 @@ +# Add your own tasks in files placed in lib/tasks ending in .rake, +# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. + +require_relative 'config/application' + +Rails.application.load_tasks diff --git a/app/assets/config/manifest.js b/app/assets/config/manifest.js new file mode 100644 index 0000000..b16e53d --- /dev/null +++ b/app/assets/config/manifest.js @@ -0,0 +1,3 @@ +//= link_tree ../images +//= link_directory ../javascripts .js +//= link_directory ../stylesheets .css diff --git a/app/assets/images/.keep b/app/assets/images/.keep new file mode 100644 index 0000000..e69de29 diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js new file mode 100644 index 0000000..46b2035 --- /dev/null +++ b/app/assets/javascripts/application.js @@ -0,0 +1,15 @@ +// This is a manifest file that'll be compiled into application.js, which will include all the files +// listed below. +// +// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, or any plugin's +// vendor/assets/javascripts directory can be referenced here using a relative path. +// +// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the +// compiled file. JavaScript code in this file should be added after the last require_* statement. +// +// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details +// about supported directives. +// +//= require rails-ujs +//= require turbolinks +//= require_tree . diff --git a/app/assets/javascripts/cable.js b/app/assets/javascripts/cable.js new file mode 100644 index 0000000..739aa5f --- /dev/null +++ b/app/assets/javascripts/cable.js @@ -0,0 +1,13 @@ +// Action Cable provides the framework to deal with WebSockets in Rails. +// You can generate new channels where WebSocket features live using the `rails generate channel` command. +// +//= require action_cable +//= require_self +//= require_tree ./channels + +(function() { + this.App || (this.App = {}); + + App.cable = ActionCable.createConsumer(); + +}).call(this); diff --git a/app/assets/javascripts/channels/.keep b/app/assets/javascripts/channels/.keep new file mode 100644 index 0000000..e69de29 diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css new file mode 100644 index 0000000..d05ea0f --- /dev/null +++ b/app/assets/stylesheets/application.css @@ -0,0 +1,15 @@ +/* + * This is a manifest file that'll be compiled into application.css, which will include all the files + * listed below. + * + * Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's + * vendor/assets/stylesheets directory can be referenced here using a relative path. + * + * You're free to add application-wide styles to this file and they'll appear at the bottom of the + * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS + * files in this directory. Styles in this file should be added after the last require_* statement. + * It is generally better to create a new file per style scope. + * + *= require_tree . + *= require_self + */ diff --git a/app/channels/application_cable/channel.rb b/app/channels/application_cable/channel.rb new file mode 100644 index 0000000..d672697 --- /dev/null +++ b/app/channels/application_cable/channel.rb @@ -0,0 +1,4 @@ +module ApplicationCable + class Channel < ActionCable::Channel::Base + end +end diff --git a/app/channels/application_cable/connection.rb b/app/channels/application_cable/connection.rb new file mode 100644 index 0000000..0ff5442 --- /dev/null +++ b/app/channels/application_cable/connection.rb @@ -0,0 +1,4 @@ +module ApplicationCable + class Connection < ActionCable::Connection::Base + end +end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb new file mode 100644 index 0000000..1c07694 --- /dev/null +++ b/app/controllers/application_controller.rb @@ -0,0 +1,3 @@ +class ApplicationController < ActionController::Base + protect_from_forgery with: :exception +end diff --git a/app/controllers/concerns/.keep b/app/controllers/concerns/.keep new file mode 100644 index 0000000..e69de29 diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb new file mode 100644 index 0000000..de6be79 --- /dev/null +++ b/app/helpers/application_helper.rb @@ -0,0 +1,2 @@ +module ApplicationHelper +end diff --git a/app/jobs/application_job.rb b/app/jobs/application_job.rb new file mode 100644 index 0000000..a009ace --- /dev/null +++ b/app/jobs/application_job.rb @@ -0,0 +1,2 @@ +class ApplicationJob < ActiveJob::Base +end diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb new file mode 100644 index 0000000..286b223 --- /dev/null +++ b/app/mailers/application_mailer.rb @@ -0,0 +1,4 @@ +class ApplicationMailer < ActionMailer::Base + default from: 'from@example.com' + layout 'mailer' +end diff --git a/app/models/application_record.rb b/app/models/application_record.rb new file mode 100644 index 0000000..10a4cba --- /dev/null +++ b/app/models/application_record.rb @@ -0,0 +1,3 @@ +class ApplicationRecord < ActiveRecord::Base + self.abstract_class = true +end diff --git a/app/models/concerns/.keep b/app/models/concerns/.keep new file mode 100644 index 0000000..e69de29 diff --git a/app/views/kaminari/twitter-bootstrap-3/_first_page.html.erb b/app/views/kaminari/twitter-bootstrap-3/_first_page.html.erb new file mode 100644 index 0000000..42125d6 --- /dev/null +++ b/app/views/kaminari/twitter-bootstrap-3/_first_page.html.erb @@ -0,0 +1,13 @@ +<%# Link to the "First" page + - available local variables + url: url to the first page + current_page: a page object for the currently displayed page + total_pages: total number of pages + per_page: number of items to fetch per page + remote: data-remote +-%> +<% unless current_page.first? %> +
  • + <%= link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, remote: remote %> +
  • +<% end %> diff --git a/app/views/kaminari/twitter-bootstrap-3/_gap.html.erb b/app/views/kaminari/twitter-bootstrap-3/_gap.html.erb new file mode 100644 index 0000000..ef550b7 --- /dev/null +++ b/app/views/kaminari/twitter-bootstrap-3/_gap.html.erb @@ -0,0 +1,8 @@ +<%# Non-link tag that stands for skipped pages... + - available local variables + current_page: a page object for the currently displayed page + total_pages: total number of pages + per_page: number of items to fetch per page + remote: data-remote +-%> +
  • <%= raw(t 'views.pagination.truncate') %>
  • \ No newline at end of file diff --git a/app/views/kaminari/twitter-bootstrap-3/_last_page.html.erb b/app/views/kaminari/twitter-bootstrap-3/_last_page.html.erb new file mode 100644 index 0000000..4a5c434 --- /dev/null +++ b/app/views/kaminari/twitter-bootstrap-3/_last_page.html.erb @@ -0,0 +1,13 @@ +<%# Link to the "Last" page + - available local variables + url: url to the last page + current_page: a page object for the currently displayed page + total_pages: total number of pages + per_page: number of items to fetch per page + remote: data-remote +-%> +<% unless current_page.last? %> + +<% end %> diff --git a/app/views/kaminari/twitter-bootstrap-3/_next_page.html.erb b/app/views/kaminari/twitter-bootstrap-3/_next_page.html.erb new file mode 100644 index 0000000..be785d3 --- /dev/null +++ b/app/views/kaminari/twitter-bootstrap-3/_next_page.html.erb @@ -0,0 +1,13 @@ +<%# Link to the "Next" page + - available local variables + url: url to the next page + current_page: a page object for the currently displayed page + total_pages: total number of pages + per_page: number of items to fetch per page + remote: data-remote +-%> +<% unless current_page.last? %> +
  • + <%= link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, rel: 'next', remote: remote %> +
  • +<% end %> diff --git a/app/views/kaminari/twitter-bootstrap-3/_page.html.erb b/app/views/kaminari/twitter-bootstrap-3/_page.html.erb new file mode 100644 index 0000000..de555d1 --- /dev/null +++ b/app/views/kaminari/twitter-bootstrap-3/_page.html.erb @@ -0,0 +1,12 @@ +<%# Link showing page number + - available local variables + page: a page object for "this" page + url: url to this page + current_page: a page object for the currently displayed page + total_pages: total number of pages + per_page: number of items to fetch per page + remote: data-remote +-%> +
  • + <%= link_to page, url, opts = {remote: remote, rel: page.next? ? 'next' : page.prev? ? 'prev' : nil} %> +
  • diff --git a/app/views/kaminari/twitter-bootstrap-3/_paginator.html.erb b/app/views/kaminari/twitter-bootstrap-3/_paginator.html.erb new file mode 100644 index 0000000..f2e1233 --- /dev/null +++ b/app/views/kaminari/twitter-bootstrap-3/_paginator.html.erb @@ -0,0 +1,25 @@ +<%# The container tag + - available local variables + current_page: a page object for the currently displayed page + total_pages: total number of pages + per_page: number of items to fetch per page + remote: data-remote + paginator: the paginator that renders the pagination tags inside +-%> +<% pagination_class ||= '' %> + +<%= paginator.render do %> + +<% end %> diff --git a/app/views/kaminari/twitter-bootstrap-3/_prev_page.html.erb b/app/views/kaminari/twitter-bootstrap-3/_prev_page.html.erb new file mode 100644 index 0000000..d57e271 --- /dev/null +++ b/app/views/kaminari/twitter-bootstrap-3/_prev_page.html.erb @@ -0,0 +1,13 @@ +<%# Link to the "Previous" page + - available local variables + url: url to the previous page + current_page: a page object for the currently displayed page + total_pages: total number of pages + per_page: number of items to fetch per page + remote: data-remote +-%> +<% unless current_page.first? %> + +<% end %> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb new file mode 100644 index 0000000..a9ebf97 --- /dev/null +++ b/app/views/layouts/application.html.erb @@ -0,0 +1,14 @@ + + + + Spreeshop + <%= csrf_meta_tags %> + + <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> + <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %> + + + + <%= yield %> + + diff --git a/app/views/layouts/mailer.html.erb b/app/views/layouts/mailer.html.erb new file mode 100644 index 0000000..cbd34d2 --- /dev/null +++ b/app/views/layouts/mailer.html.erb @@ -0,0 +1,13 @@ + + + + + + + + + <%= yield %> + + diff --git a/app/views/layouts/mailer.text.erb b/app/views/layouts/mailer.text.erb new file mode 100644 index 0000000..37f0bdd --- /dev/null +++ b/app/views/layouts/mailer.text.erb @@ -0,0 +1 @@ +<%= yield %> diff --git a/app/views/spree/address/_form.html.erb b/app/views/spree/address/_form.html.erb new file mode 100644 index 0000000..b2ab31f --- /dev/null +++ b/app/views/spree/address/_form.html.erb @@ -0,0 +1,91 @@ +<% address_id = address_type.chars.first %> + +
    > +

    > + <%= form.label :firstname do %> + <%= Spree.t(:first_name) %>* + <% end %> + <%= form.text_field :firstname, class: 'form-control', required: true %> +

    +

    > + <%= form.label :lastname do %> + <%= Spree.t(:last_name) %>* + <% end %> + <%= form.text_field :lastname, class: 'form-control', required: true %> +

    + <% if Spree::Config[:company] %> +

    > + <%= form.label :company, Spree.t(:company) %> + <%= form.text_field :company, class: 'form-control' %> +

    + <% end %> +

    > + <%= form.label :address1 do %> + <%= Spree.t(:street_address) %>* + <% end %> + <%= form.text_field :address1, class: 'form-control required' %> +

    +

    > + <%= form.label :address2, Spree.t(:street_address_2) %> + <%= form.text_field :address2, class: 'form-control' %> +

    +

    > + <%= form.label :city do %> + <%= Spree.t(:city) %>* + <% end %> + <%= form.text_field :city, class: 'form-control', required: true %> +

    +

    > + <%= form.label :country_id do %> + <%= Spree.t(:country) %>* + <% end %> + > + <%= form.collection_select :country_id, available_countries, :id, :name, {}, { class: 'form-control', required: true } %> + +

    + + <% if Spree::Config[:address_requires_state] %> +

    > + <% have_states = !address.country.states.empty? %> + <%= form.label :state do %> + <%= Spree.t(:state) %>>* + <% end %> + + <%== state_elements = [ + form.collection_select(:state_id, address.country.states, + :id, :name, + {include_blank: true}, + {class: have_states ? 'form-control' : 'form-control hidden', + required: have_states, + disabled: !have_states}) + + form.text_field(:state_name, + class: !have_states ? 'form-control' : 'form-control hidden', + required: !have_states, + disabled: have_states) + ].join.gsub('"', "'").gsub("\n", "") + %> +

    + + <% end %> + +

    > + <%= form.label :zipcode do %> + <%= Spree.t(:zip) %><% if address.require_zipcode? %>*<% end %> + <% end %> + <%= form.text_field :zipcode, class: 'form-control', required: address.require_zipcode? %> +

    +

    > + <%= form.label :phone do %> + <%= Spree.t(:phone) %><% if address.require_phone? %>*<% end %> + <% end %> + <%= form.phone_field :phone, class: 'form-control', required: address.require_phone? %> +

    + <% if Spree::Config[:alternative_shipping_phone] %> +

    > + <%= form.label :alternative_phone, Spree.t(:alternative_phone) %> + <%= form.phone_field :alternative_phone, class: 'form-control' %> +

    + <% end %> +
    diff --git a/app/views/spree/checkout/_address.html.erb b/app/views/spree/checkout/_address.html.erb new file mode 100644 index 0000000..0d3c697 --- /dev/null +++ b/app/views/spree/checkout/_address.html.erb @@ -0,0 +1,44 @@ +
    +
    +
    + <%= form.fields_for :bill_address do |bill_form| %> +
    +

    <%= Spree.t(:billing_address) %>

    +
    +
    + <%= render partial: 'spree/address/form', locals: { form: bill_form, address_type: 'billing', address: @order.bill_address } %> +
    + <% end %> +
    +
    + +
    +
    + <%= form.fields_for :ship_address do |ship_form| %> +
    +

    <%= Spree.t(:shipping_address) %>

    +
    +
    +

    + <%= label_tag :order_use_billing, id: 'use_billing' do %> + <%= check_box_tag 'order[use_billing]', '1', @order.shipping_eq_billing_address? %> + <%= Spree.t(:use_billing_address) %> + <% end %> +

    + <%= render partial: 'spree/address/form', locals: { form: ship_form, address_type: 'shipping', address: @order.ship_address } %> +
    + <% end %> +
    +
    +
    + +
    + <%= submit_tag Spree.t(:save_and_continue), class: 'btn btn-lg btn-success' %> + <% if try_spree_current_user %> + +     + <%= check_box_tag 'save_user_address', '1', try_spree_current_user.respond_to?(:persist_order_address) %> + <%= label_tag :save_user_address, Spree.t(:save_my_address) %> + + <% end %> +
    diff --git a/app/views/spree/checkout/_confirm.html.erb b/app/views/spree/checkout/_confirm.html.erb new file mode 100644 index 0000000..0b0d41a --- /dev/null +++ b/app/views/spree/checkout/_confirm.html.erb @@ -0,0 +1,16 @@ +
    +
    +

    <%= Spree.t(:confirm) %>

    +
    +
    + <%= render partial: 'spree/shared/order_details', locals: { order: @order } %> +
    +
    + +
    + <% if @order.using_store_credit? %> + <%= button_tag Spree.t('store_credit.remove'), name: 'remove_store_credit', class: 'continue btn' %> + <% end %> + <%= submit_tag Spree.t(:place_order), class: 'btn btn-lg btn-success' %> + +
    diff --git a/app/views/spree/checkout/_delivery.html.erb b/app/views/spree/checkout/_delivery.html.erb new file mode 100644 index 0000000..f19eee4 --- /dev/null +++ b/app/views/spree/checkout/_delivery.html.erb @@ -0,0 +1,103 @@ +
    +
    +

    <%= Spree.t(:delivery) %>

    +
    +
    +
    + <%= form.fields_for :shipments do |ship_form| %> +
    +

    + <%= Spree.t(:package_from) %> + <%= ship_form.object.stock_location.name %> +

    + + + + + + + + + + + + + + + + + + <% ship_form.object.manifest.each do |item| %> + + + + + + + <% end %> + +
    <%= Spree.t(:item) %><%= Spree.t(:qty) %><%= Spree.t(:price) %>
    <%= mini_image(item.variant) %><%= item.variant.name %><%= item.quantity %><%= display_price(item.variant) %>
    + +

    <%= Spree.t(:shipping_method) %>

    +
      + <% ship_form.object.shipping_rates.each do |rate| %> +
    • + +
    • + <% end %> +
    +
    + <% end %> + + <% if @differentiator.try(:missing?) %> +
    +

    + <%= Spree.t(:unshippable_items) %> +

    + + + + + + + + + + + + + + + <% @differentiator.missing.each do |variant, quantity| %> + + + + + + + <% end %> + +
    <%= Spree.t(:item) %><%= Spree.t(:qty) %><%= Spree.t(:price) %>
    <%= mini_image(variant) %><%= variant.name %><%= quantity %><%= display_price(variant) %>
    +
    + <% end %> +
    + <% if Spree::Config[:shipping_instructions] %> +

    +

    <%= Spree.t(:shipping_instructions) %>

    + <%= form.text_area :special_instructions, cols: 40, rows: 4, class: "form-control" %> +

    + <% end %> +
    +
    + +
    + +
    + <%= submit_tag Spree.t(:save_and_continue), class: 'btn btn-lg btn-success' %> +
    + +<%= javascript_include_tag 'spree/frontend/checkout/shipment' %> diff --git a/app/views/spree/checkout/_payment.html.erb b/app/views/spree/checkout/_payment.html.erb new file mode 100644 index 0000000..8a77526 --- /dev/null +++ b/app/views/spree/checkout/_payment.html.erb @@ -0,0 +1,74 @@ +
    +
    +

    <%= Spree.t(:payment_information) %>

    +
    +
    + <% if @payment_sources.present? %> +
    + <%= radio_button_tag 'use_existing_card', 'yes', true %> + + <%= radio_button_tag 'use_existing_card', 'no' %> + +
    + +
    +

    + + + <% @payment_sources.each do |card| %> + + + + + + + <% end %> + +
    <%= card.name %><%= card.display_number %><%= card.month %> / <%= card.year %> + <%= radio_button_tag "order[existing_card]", card.id, (card == @payment_sources.first), { class: "existing-cc-radio" } %> +
    +

    +
    + <% end %> + + <%= render partial: 'spree/checkout/payment/storecredit' %> + + + + + + + <% if Spree::Frontend::Config[:coupon_codes_enabled] %> +

    + <%= form.label :coupon_code %> + <%= form.text_field :coupon_code, class: 'form-control' %> +

    + <% end %> +
    +
    + +
    + <%= submit_tag Spree.t(:save_and_continue), class: 'btn btn-lg btn-success primary' %> + +
    diff --git a/app/views/spree/checkout/_summary.html.erb b/app/views/spree/checkout/_summary.html.erb new file mode 100644 index 0000000..1bef386 --- /dev/null +++ b/app/views/spree/checkout/_summary.html.erb @@ -0,0 +1,73 @@ +

    <%= Spree.t(:order_summary) %>

    + + + + + + + + + <% if order.line_item_adjustments.nonzero.exists? %> + + <% order.line_item_adjustments.nonzero.promotion.eligible.group_by(&:label).each do |label, adjustments| %> + + + + + <% end %> + + <% end %> + + + <% order.all_adjustments.nonzero.tax.eligible.group_by(&:label).each do |label, adjustments| %> + + + + + <% end %> + + + <% if order.passed_checkout_step?("address") && order.shipments.any? %> + + + <% shipping_total = Spree::Money.new(order.shipments.to_a.sum(&:cost), currency: order.currency) %> + + + + <% if order.shipment_adjustments.nonzero.exists? %> + + <% order.shipment_adjustments.nonzero.promotion.eligible.group_by(&:label).each do |label, adjustments| %> + + + + + <% end %> + + <% end %> + <% end %> + + <% if order.adjustments.nonzero.eligible.exists? %> + + <% order.adjustments.nonzero.eligible.each do |adjustment| %> + <% next if (adjustment.source_type == 'Spree::TaxRate') and (adjustment.amount == 0) %> + + + + + <% end %> + + <% end %> + + + + + + + <% if order.using_store_credit? %> + + + + + <% end %> + +
    <%= Spree.t(:item_total) %>:<%= order.display_item_total.to_html %>
    <%= label %><%= Spree::Money.new(adjustments.sum(&:amount), currency: order.currency).to_html %>
    <%= label %><%= Spree::Money.new(adjustments.sum(&:amount), currency: order.currency).to_html %>
    <%= Spree.t(:shipping_total) %>:<%= shipping_total.to_html %>
    <%= label %>:<%= Spree::Money.new(adjustments.sum(&:amount), currency: order.currency).to_html %>
    <%= adjustment.label %>:<%= adjustment.display_amount.to_html %>
    <%= Spree.t(:order_total) %>:><%= order.display_total.to_html %>
    <%= Spree.t(:store_credit_name) %>:<%= order.display_total_applied_store_credit.to_html %>
    diff --git a/app/views/spree/checkout/edit.html.erb b/app/views/spree/checkout/edit.html.erb new file mode 100644 index 0000000..248f372 --- /dev/null +++ b/app/views/spree/checkout/edit.html.erb @@ -0,0 +1,43 @@ +<% @body_id = 'checkout-page' %> + +
    + <%= render partial: 'spree/shared/error_messages', locals: { target: @order } %> + +
    +
    +

    <%= Spree.t(:checkout) %>

    +
    +
    + <%= checkout_progress %> +
    +
    + +
    +
    + <%= form_for @order, url: update_checkout_path(@order.state), html: { id: "checkout_form_#{@order.state}" } do |form| %> + <% if @order.state == 'address' || !@order.email? %> +
    +
    +
    + <%= form.label :email %> + <%= form.email_field :email, class: 'form-control', required: true %> +
    +
    +
    + <% end %> + <%= form.hidden_field :state_lock_version %> + <%= render @order.state, form: form %> + <% end %> +
    + <% if @order.state != 'confirm' %> +
    + <%= render partial: 'summary', locals: { order: @order } %> +
    + <% end %> +
    +
    + + diff --git a/app/views/spree/checkout/payment/_check.html.erb b/app/views/spree/checkout/payment/_check.html.erb new file mode 100644 index 0000000..e69de29 diff --git a/app/views/spree/checkout/payment/_gateway.html.erb b/app/views/spree/checkout/payment/_gateway.html.erb new file mode 100644 index 0000000..9651cbf --- /dev/null +++ b/app/views/spree/checkout/payment/_gateway.html.erb @@ -0,0 +1,42 @@ +
    + <%= image_tag 'credit_cards/credit_card.gif', id: 'credit-card-image', class: 'pull-right', width: '170', height: '28' %> + <% param_prefix = "payment_source[#{payment_method.id}]" %> + +

    + <%= label_tag "name_on_card_#{payment_method.id}" do %> + <%= Spree.t(:name_on_card) %>* + <% end %> + <%= text_field_tag "#{param_prefix}[name]", "#{@order.bill_address_firstname} #{@order.bill_address_lastname}", { id: "name_on_card_#{payment_method.id}", class: 'form-control required'} %> +

    + +

    + <%= label_tag "card_number" do %> + <%= Spree.t(:card_number) %>* + <% end %> + <% options_hash = Rails.env.production? ? {autocomplete: 'off'} : {} %> + <%= text_field_tag "#{param_prefix}[number]", '', options_hash.merge(id: 'card_number', class: 'form-control required cardNumber', size: 19, maxlength: 19, autocomplete: "off") %> +   + +

    +
    +
    + <%= label_tag "card_expiry" do %> + <%= Spree.t(:expiration) %>* + <% end %> + <%= text_field_tag "#{param_prefix}[expiry]", '', id: 'card_expiry', class: "form-control required cardExpiry", placeholder: "MM / YY" %> +
    +
    + <%= label_tag "card_code" do %> + <%= Spree.t(:card_code) %>* + <% end %> + <%= text_field_tag "#{param_prefix}[verification_value]", '', options_hash.merge(id: 'card_code', class: 'form-control required cardCode', size: 5) %> + <%= link_to Spree.t(:what_is_this), spree.cvv_path, target: :blank, "data-hook" => "cvv_link", id: "cvv_link" %> +
    +
    + + <%= hidden_field_tag "#{param_prefix}[cc_type]", '', id: "cc_type", class: 'ccType' %> +
    diff --git a/app/views/spree/checkout/payment/_storecredit.html.erb b/app/views/spree/checkout/payment/_storecredit.html.erb new file mode 100644 index 0000000..188f733 --- /dev/null +++ b/app/views/spree/checkout/payment/_storecredit.html.erb @@ -0,0 +1,17 @@ +<% if @order.using_store_credit? %> +
    +

    <%= Spree.t('store_credit.applicable_amount', amount: Spree::Money.new(@order.total_applicable_store_credit, { currency: @order.currency })) %>

    + <% if @order.covered_by_store_credit? %> +

    <%= Spree.t('store_credit.remaining_amount', amount: @order.display_store_credit_remaining_after_capture) %>

    + <% else %> +

    <%= Spree.t('store_credit.additional_payment_needed', amount: @order.display_order_total_after_store_credit) %>

    + <%= button_tag Spree.t('store_credit.remove'), name: 'remove_store_credit', class: 'continue btn' %> + <% end %> +
    + +<% elsif @order.could_use_store_credit? %> +
    +

    <%= Spree.t('store_credit.available_amount', amount: @order.display_total_available_store_credit) %>

    + <%= button_tag Spree.t('store_credit.apply'), name: 'apply_store_credit', class: 'continue btn btn-lg btn-primary' %> +
    +<% end %> diff --git a/app/views/spree/content/cvv.html.erb b/app/views/spree/content/cvv.html.erb new file mode 100644 index 0000000..bd063cc --- /dev/null +++ b/app/views/spree/content/cvv.html.erb @@ -0,0 +1,13 @@ +
    +

    <%= Spree.t(:what_is_a_cvv) %>

    +

    For Visa, MasterCard, and Discover cards, the card code is the last 3 digit number located on the back of your card on or above your signature line. For an American Express card, it is the 4 digits on the FRONT above the end of your card number.

    +

    To help reduce fraud in the card-not-present environment, credit card companies have introduced a card code program. Visa calls this code Card Verification Value (CVV); MasterCard calls it Card Validation Code (CVC); Discover calls it Card ID (CID). The card code is a three- or four- digit security code that is printed on the back of cards. The number typically appears at the end of the signature panel.

    +
    Visa
    + <%= image_tag 'credit_cards/visa_cid.gif' %> +
    Master Card
    + <%= image_tag 'credit_cards/master_cid.jpg' %> +
    American Express
    + <%= image_tag 'credit_cards/amex_cid.gif' %> +
    Discover
    + <%= image_tag 'credit_cards/discover_cid.gif' %> +
    diff --git a/app/views/spree/content/test.html.erb b/app/views/spree/content/test.html.erb new file mode 100644 index 0000000..1588c8c --- /dev/null +++ b/app/views/spree/content/test.html.erb @@ -0,0 +1 @@ +Nothing to see here. Move along now. \ No newline at end of file diff --git a/app/views/spree/home/index.html.erb b/app/views/spree/home/index.html.erb new file mode 100644 index 0000000..255607a --- /dev/null +++ b/app/views/spree/home/index.html.erb @@ -0,0 +1,13 @@ +<% @body_id = 'home-page' %> +<% content_for :sidebar do %> +
    + <%= render partial: 'spree/shared/taxonomies' %> +
    +<% end %> + +
    + <% cache(cache_key_for_products) do %> + <%= render partial: 'spree/shared/products', locals: { products: @products } %> + <% end %> +
    + diff --git a/app/views/spree/layouts/spree_application.html.erb b/app/views/spree/layouts/spree_application.html.erb new file mode 100644 index 0000000..a9ec030 --- /dev/null +++ b/app/views/spree/layouts/spree_application.html.erb @@ -0,0 +1,28 @@ + + + + + + + + <%= render partial: 'spree/shared/head' %> + + + <%= render partial: 'spree/shared/header' %> + +
    +
    + <%= spree_breadcrumbs(@taxon) %> + + <%= render partial: 'spree/shared/sidebar' if content_for? :sidebar %> + +
    " data-hook> + <%= flash_messages %> + <%= yield %> +
    + + <%= yield :templates %> +
    +
    + + diff --git a/app/views/spree/orders/_adjustment_row.html.erb b/app/views/spree/orders/_adjustment_row.html.erb new file mode 100644 index 0000000..4986372 --- /dev/null +++ b/app/views/spree/orders/_adjustment_row.html.erb @@ -0,0 +1,8 @@ +<% if adjustments.sum(&:amount) != 0 %> + +
    <%= type %>: <%= label %>
    + +
    <%= Spree::Money.new(adjustments.sum(&:amount), currency: @order.currency) %>
    + + +<% end %> diff --git a/app/views/spree/orders/_adjustments.html.erb b/app/views/spree/orders/_adjustments.html.erb new file mode 100644 index 0000000..28930fb --- /dev/null +++ b/app/views/spree/orders/_adjustments.html.erb @@ -0,0 +1,29 @@ + + + <%= Spree.t(:order_adjustments) %> + + + + <% if @order.line_item_adjustments.exists? %> + <% @order.line_item_adjustments.promotion.eligible.group_by(&:label).each do |label, adjustments| %> + <%= render "spree/orders/adjustment_row", label: label, adjustments: adjustments, type: Spree.t(:promotion) %> + <% end %> + <% end %> + + <% @order.all_adjustments.tax.eligible.group_by(&:label).each do |label, adjustments| %> + <%= render "spree/orders/adjustment_row", label: label, adjustments: adjustments, type: Spree.t(:tax) %> + <% end %> + + <% @order.shipments.each do |shipment| %> + +
    <%= Spree.t(:shipping) %>: <%= shipment.shipping_method.name %>
    + +
    <%= shipment.display_discounted_cost %>
    + + + <% end %> + + <% @order.adjustments.eligible.group_by(&:label).each do |label, adjustments| %> + <%= render "spree/orders/adjustment_row", label: label, adjustments: adjustments, type: Spree.t(:adjustment) %> + <% end %> + diff --git a/app/views/spree/orders/_form.html.erb b/app/views/spree/orders/_form.html.erb new file mode 100644 index 0000000..0634503 --- /dev/null +++ b/app/views/spree/orders/_form.html.erb @@ -0,0 +1,28 @@ +<%= render partial: 'spree/shared/error_messages', locals: { target: @order } %> + + + + + + + + + + + + <%= render partial: 'spree/orders/line_item', collection: order_form.object.line_items, locals: { order_form: order_form } %> + + <% if @order.adjustments.nonzero.exists? || @order.line_item_adjustments.nonzero.exists? || @order.shipment_adjustments.nonzero.exists? || @order.shipments.any? %> + + + + + + <%= render "spree/orders/adjustments" %> + <% end %> + + + + + +
    <%= Spree.t(:item) %><%= Spree.t(:price) %><%= Spree.t(:qty) %><%= Spree.t(:total) %>
    <%= Spree.t(:cart_subtotal, count: @order.line_items.sum(:quantity)) %>
    <%= order_form.object.display_item_total %>
    <%= Spree.t(:total) %>
    <%= order_form.object.display_total %>
    diff --git a/app/views/spree/orders/_line_item.html.erb b/app/views/spree/orders/_line_item.html.erb new file mode 100644 index 0000000..df01f8c --- /dev/null +++ b/app/views/spree/orders/_line_item.html.erb @@ -0,0 +1,37 @@ +<% variant = line_item.variant %> + +<%= order_form.fields_for :line_items, line_item do |item_form| %> + + + <% if variant.images.length == 0 %> + <%= link_to small_image(variant.product), variant.product %> + <% else %> + <%= link_to image_tag(variant.images.first.attachment.url(:small)), variant.product %> + <% end %> + + +

    <%= link_to line_item.name, product_path(variant.product) %>

    + <%= variant.options_text %> + <% if line_item.insufficient_stock? %> + + <%= Spree.t(:out_of_stock) %>  
    +
    + <% end %> + + <%= line_item_description_text(line_item.description) %> + + + + <%= line_item.single_money.to_html %> + + + <%= item_form.number_field :quantity, min: 0, class: "form-control line_item_quantity", size: 5 %> + + + <%= line_item.display_amount.to_html unless line_item.quantity.nil? %> + + + <%= link_to content_tag(:span, '', class: 'glyphicon glyphicon-minus-sign'), '#', class: 'delete', id: "delete_#{dom_id(line_item)}" %> + + +<% end %> diff --git a/app/views/spree/orders/edit.html.erb b/app/views/spree/orders/edit.html.erb new file mode 100644 index 0000000..04d7ac6 --- /dev/null +++ b/app/views/spree/orders/edit.html.erb @@ -0,0 +1,59 @@ +<% @body_id = 'cart' %> + +
    +

    <%= Spree.t(:shopping_cart) %>

    + + <% if @order.line_items.empty? %> +
    +
    <%= Spree.t(:your_cart_is_empty) %>
    +

    <%= link_to Spree.t(:continue_shopping), products_path, class: 'btn btn-default' %>

    +
    + <% else %> +
    + <%= form_for @order, url: update_cart_path, html: { id: 'update-cart' } do |order_form| %> +
    + +
    + <%= render partial: 'form', locals: { order_form: order_form } %> +
    + + + + <% if Spree::Frontend::Config[:coupon_codes_enabled] %> +
    + +
    + <% end %> +
    + <% end %> +
    + +
    + <%= form_tag empty_cart_path, method: :put do %> + + <% end %> +
    + <% end %> +
    + + diff --git a/app/views/spree/orders/show.html.erb b/app/views/spree/orders/show.html.erb new file mode 100644 index 0000000..69a82ae --- /dev/null +++ b/app/views/spree/orders/show.html.erb @@ -0,0 +1,21 @@ +
    +

    <%= accurate_title %>

    + <% if order_just_completed?(@order) %> + <%= Spree.t(:thank_you_for_your_order) %> + <% end %> + +
    + <%= render partial: 'spree/shared/order_details', locals: { order: @order } %> + +
    + +

    + <%= link_to Spree.t(:back_to_store), spree.root_path, class: "button" %> + <% unless order_just_completed?(@order) %> + <% if try_spree_current_user && respond_to?(:account_path) %> + <%= link_to Spree.t(:my_account), account_path, class: "button" %> + <% end %> + <% end %> +

    +
    +
    diff --git a/app/views/spree/products/_cart_form.html.erb b/app/views/spree/products/_cart_form.html.erb new file mode 100644 index 0000000..8075f59 --- /dev/null +++ b/app/views/spree/products/_cart_form.html.erb @@ -0,0 +1,76 @@ +<%= form_for :order, url: populate_orders_path do |f| %> +
    + <% if @product.variants_and_option_values(current_currency).any? %> +
    +

    <%= Spree.t(:variants) %>

    + +
    + <% else %> + <%= hidden_field_tag "variant_id", @product.master.id %> + <% end %> + + <% if @product.price_in(current_currency) && !@product.price.nil? %> +
    +
    +
    <%= Spree.t(:price) %>
    +
    + + <%= display_price(@product) %> + + +
    + + <% if @product.master.can_supply? %> + + <% elsif @product.variants.empty? %> +
    + <%= Spree.t(:out_of_stock) %> + <% end %> +
    + + <% if @product.can_supply? %> +
    +
    +
    + <%= number_field_tag :quantity, 1, class: 'title form-control', min: 1 %> + + <%= button_tag class: 'btn btn-success', id: 'add-to-cart-button', type: :submit do %> + <%= Spree.t(:add_to_cart) %> + <% end %> + +
    +
    + <% end %> +
    + <% else %> +
    +
    +
    + + <%= Spree.t('product_not_available_in_this_currency') %> + +
    +
    + <% end %> +
    +<% end %> diff --git a/app/views/spree/products/_product.html.erb b/app/views/spree/products/_product.html.erb new file mode 100644 index 0000000..b0fdc74 --- /dev/null +++ b/app/views/spree/products/_product.html.erb @@ -0,0 +1,22 @@ +<% url = spree.product_path(product, taxon_id: taxon.try(:id)) %> +
    +
    + <% cache(taxon.present? ? [I18n.locale, current_currency, taxon, product] : cache_key_for_product(product)) do %> +
    + <%= link_to url, itemprop: "url" do %> + <%= small_image(product, itemprop: "image") %>
    + <%= content_tag(:span, truncate(product.name, length: 50), class: 'info', itemprop: "name", title: product.name) %> + <% end %> +
    +
    + + <% end %> +
    +
    diff --git a/app/views/spree/products/_promotions.html.erb b/app/views/spree/products/_promotions.html.erb new file mode 100644 index 0000000..dd30bf6 --- /dev/null +++ b/app/views/spree/products/_promotions.html.erb @@ -0,0 +1,20 @@ +<% promotions = @product.possible_promotions %> + +<% if promotions.any? %> +
    +

    <%= Spree.t(:promotions) %>

    + <% promotions.each do |promotion| %> +
    +

    <%= promotion.name %>

    +

    <%= promotion.description %>

    + <% if promotion.products.any? %> + + <% end %> +
    + <% end %> +
    +<% end %> diff --git a/app/views/spree/products/_properties.html.erb b/app/views/spree/products/_properties.html.erb new file mode 100644 index 0000000..bd0048f --- /dev/null +++ b/app/views/spree/products/_properties.html.erb @@ -0,0 +1,15 @@ +<% unless @product_properties.empty? %> +

    <%= Spree.t('properties')%>

    + + + <% @product_properties.each do |product_property| %> + <% css_class = cycle('even', 'odd', name: "properties") %> + + + + + <% end %> + <% reset_cycle('properties') %> + +
    <%= product_property.property.presentation %><%= product_property.value %>
    +<% end %> diff --git a/app/views/spree/products/_taxons.html.erb b/app/views/spree/products/_taxons.html.erb new file mode 100644 index 0000000..d2a8d68 --- /dev/null +++ b/app/views/spree/products/_taxons.html.erb @@ -0,0 +1,8 @@ +<% if @product.taxons.present? %> +

    <%= Spree.t(:look_for_similar_items) %>

    + +<% end %> diff --git a/app/views/spree/products/_thumbnails.html.erb b/app/views/spree/products/_thumbnails.html.erb new file mode 100644 index 0000000..02dbe2d --- /dev/null +++ b/app/views/spree/products/_thumbnails.html.erb @@ -0,0 +1,19 @@ +<%# no need for thumbnails unless there is more than one image %> +<% if (@product.images + @product.variant_images).uniq.size > 1 %> + +<% end %> diff --git a/app/views/spree/products/index.html.erb b/app/views/spree/products/index.html.erb new file mode 100644 index 0000000..285c8c9 --- /dev/null +++ b/app/views/spree/products/index.html.erb @@ -0,0 +1,27 @@ +<% if "spree/products" == params[:controller] && @taxon || @taxonomies.present? %> + <% content_for :sidebar do %> +
    + <% if "spree/products" == params[:controller] && @taxon %> + <%= render partial: 'spree/shared/filters' %> + <% else %> + <%= render partial: 'spree/shared/taxonomies' %> + <% end %> +
    + <% end %> +<% end %> + +<% if params[:keywords] %> +
    + <% if @products.empty? %> +
    <%= Spree.t(:no_products_found) %>
    + <% else %> + <%= render partial: 'spree/shared/products', locals: { products: @products, taxon: @taxon } %> + <% end %> +
    +<% else %> +
    + <% cache(cache_key_for_products) do %> + <%= render partial: 'spree/shared/products', locals: { products: @products, taxon: @taxon } %> + <% end %> +
    +<% end %> diff --git a/app/views/spree/products/show.html.erb b/app/views/spree/products/show.html.erb new file mode 100644 index 0000000..e3b8e11 --- /dev/null +++ b/app/views/spree/products/show.html.erb @@ -0,0 +1,48 @@ +<% @body_id = 'product-details' %> + +<% cache cache_key_for_product do %> +
    +
    +
    +
    +
    +
    + <%= product_image(@product, itemprop: "image") %> +
    +
    +
    + <%= render partial: 'thumbnails' %> +
    +
    + +
    + <%= render partial: 'properties' %> +
    + +
    + <%= render partial: 'promotions' %> +
    +
    +
    + +
    +
    +
    +

    <%= @product.name %>

    + +
    + <%= product_description(@product) %> +
    + +
    + <%= render partial: 'cart_form' %> +
    +
    + +
    + <%= render partial: 'taxons' %> +
    +
    +
    +
    +<% end %> diff --git a/app/views/spree/shared/_address.html.erb b/app/views/spree/shared/_address.html.erb new file mode 100644 index 0000000..8d26e41 --- /dev/null +++ b/app/views/spree/shared/_address.html.erb @@ -0,0 +1,40 @@ +
    +
    <%= address.full_name %>
    + <% unless address.company.blank? %> +
    + <%= address.company %> +
    + <% end %> +
    +
    +
    + <%= address.address1 %> +
    + <% unless address.address2.blank? %> +
    + <%= address.address2 %> +
    + <% end %> +
    +
    + <%= address.city %> + <% if Spree::Config[:address_requires_state] %> + <%= address.state_text %> + <% end %> + <%= address.zipcode %> +
    <%= address.country.try(:name) %>
    +
    +
    + <% unless address.phone.blank? %> +
    + <%= Spree.t(:phone) %> + <%= address.phone %> +
    + <% end %> + <% unless address.alternative_phone.blank? %> +
    + <%= Spree.t(:alternative_phone) %> + <%= address.alternative_phone %> +
    + <% end %> +
    diff --git a/app/views/spree/shared/_error_messages.html.erb b/app/views/spree/shared/_error_messages.html.erb new file mode 100644 index 0000000..ed8f296 --- /dev/null +++ b/app/views/spree/shared/_error_messages.html.erb @@ -0,0 +1,12 @@ +<% if target && target.errors.any? %> +
    +

    <%= Spree.t(:errors_prohibited_this_record_from_being_saved, count: target.errors.count) %>:

    +

    <%= Spree.t(:there_were_problems_with_the_following_fields) %>:

    + +
    +
    +<% end %> diff --git a/app/views/spree/shared/_filters.html.erb b/app/views/spree/shared/_filters.html.erb new file mode 100644 index 0000000..fc1661b --- /dev/null +++ b/app/views/spree/shared/_filters.html.erb @@ -0,0 +1,28 @@ +<% filters = @taxon ? @taxon.applicable_filters : [Spree::Core::ProductFilters.all_taxons] %> + +<% unless filters.empty? %> + <%= form_tag '', method: :get, id: 'sidebar_products_search' do %> + <%= hidden_field_tag 'per_page', params[:per_page] %> + <% filters.each do |filter| %> + <% labels = filter[:labels] || filter[:conds].map {|m,c| [m,m]} %> + <% next if labels.empty? %> + + <% end %> + <%= submit_tag Spree.t(:search), name: nil, class: 'btn btn-primary' %> + <% end %> +<% end %> diff --git a/app/views/spree/shared/_head.html.erb b/app/views/spree/shared/_head.html.erb new file mode 100644 index 0000000..437f343 --- /dev/null +++ b/app/views/spree/shared/_head.html.erb @@ -0,0 +1,16 @@ + +<%= title %> + + +<%== meta_data_tags %> +<%= canonical_tag(current_store.url) %> +<%= favicon_link_tag 'favicon.ico' %> +<%= stylesheet_link_tag 'spree/frontend/all', media: 'screen' %> +<%= csrf_meta_tags %> +<%= render 'spree/shared/paths' %> +<%= javascript_include_tag 'spree/frontend/all' %> + +<%= yield :head %> +<%= render 'spree/shared/translations' %> diff --git a/app/views/spree/shared/_header.html.erb b/app/views/spree/shared/_header.html.erb new file mode 100644 index 0000000..e05c7de --- /dev/null +++ b/app/views/spree/shared/_header.html.erb @@ -0,0 +1,15 @@ +
    + +
    + <%= render partial: 'spree/shared/main_nav_bar' %> +
    +
    diff --git a/app/views/spree/shared/_link_to_cart.html.erb b/app/views/spree/shared/_link_to_cart.html.erb new file mode 100644 index 0000000..8b1f86c --- /dev/null +++ b/app/views/spree/shared/_link_to_cart.html.erb @@ -0,0 +1 @@ +<%= link_to_cart %> \ No newline at end of file diff --git a/app/views/spree/shared/_login.html.erb b/app/views/spree/shared/_login.html.erb new file mode 100644 index 0000000..1718944 --- /dev/null +++ b/app/views/spree/shared/_login.html.erb @@ -0,0 +1,19 @@ +<%= form_for Spree::User.new, as: :spree_user, url: spree.create_new_session_path do |f| %> +
    +
    + <%= f.email_field :email, class: 'form-control', tabindex: 1, placeholder: Spree.t(:email) %> +
    +
    + <%= f.password_field :password, class: 'form-control', tabindex: 2, placeholder: Spree.t(:password) %> +
    +
    + +
    +
    + <%= f.submit Spree.t(:login), class: 'btn btn-lg btn-success btn-block', tabindex: 3 %> +
    +
    +<% end %> \ No newline at end of file diff --git a/app/views/spree/shared/_login_bar.html.erb b/app/views/spree/shared/_login_bar.html.erb new file mode 100644 index 0000000..a27a706 --- /dev/null +++ b/app/views/spree/shared/_login_bar.html.erb @@ -0,0 +1,6 @@ +<% if spree_current_user %> +
  • <%= link_to Spree.t(:my_account), spree.account_path %>
  • +
  • <%= link_to Spree.t(:logout), spree.logout_path %>
  • +<% else %> + +<% end %> diff --git a/app/views/spree/shared/_main_nav_bar.html.erb b/app/views/spree/shared/_main_nav_bar.html.erb new file mode 100644 index 0000000..709211d --- /dev/null +++ b/app/views/spree/shared/_main_nav_bar.html.erb @@ -0,0 +1,16 @@ + diff --git a/app/views/spree/shared/_nav_bar.html.erb b/app/views/spree/shared/_nav_bar.html.erb new file mode 100644 index 0000000..4c863c8 --- /dev/null +++ b/app/views/spree/shared/_nav_bar.html.erb @@ -0,0 +1,7 @@ + diff --git a/app/views/spree/shared/_order_details.html.erb b/app/views/spree/shared/_order_details.html.erb new file mode 100644 index 0000000..fc9ebdd --- /dev/null +++ b/app/views/spree/shared/_order_details.html.erb @@ -0,0 +1,133 @@ +
    + <% if order.has_step?("address") %> +
    +

    <%= Spree.t(:billing_address) %> <%= link_to "(#{Spree.t(:edit)})", checkout_state_path(:address) unless order.completed? %>

    + <%= render 'spree/shared/address', address: order.bill_address %> +
    + + <% if order.has_step?("delivery") %> +
    +

    <%= Spree.t(:shipping_address) %> <%= link_to "(#{Spree.t(:edit)})", checkout_state_path(:address) unless order.completed? %>

    + <%= render 'spree/shared/address', address: order.ship_address %> +
    + +
    +

    <%= Spree.t(:shipments) %> <%= link_to "(#{Spree.t(:edit)})", checkout_state_path(:delivery) unless order.completed? %>

    +
    + <% order.shipments.each do |shipment| %> +
    + <%= Spree.t(:shipment_details, stock_location: shipment.stock_location.name, shipping_method: shipment.selected_shipping_rate.name) %> +
    + <% end %> +
    + <%= render 'spree/shared/shipment_tracking', order: order if order.shipped? %> +
    + <% end %> + <% end %> + + <% if order.has_step?("payment") %> +
    +

    <%= Spree.t(:payment_information) %> <%= link_to "(#{Spree.t(:edit)})", checkout_state_path(:payment) unless order.completed? %>

    +
    + <%= render collection: order.payments.valid, partial: 'spree/shared/payment' %> +
    +
    + <% end %> +
    + +
    + + + + + + + + + + + + + + + + + + + <% order.line_items.each do |item| %> + + + + + + + + <% end %> + + + + + + + + + + + + + + + + <% if order.line_item_adjustments.exists? %> + <% if order.line_item_adjustments.promotion.eligible.exists? %> + + <% order.line_item_adjustments.promotion.eligible.group_by(&:label).each do |label, adjustments| %> + + + + + <% end %> + + <% end %> + <% end %> + + + <% order.shipments.group_by { |s| s.selected_shipping_rate.name }.each do |name, shipments| %> + + + + + <% end %> + + + <% if order.all_adjustments.tax.exists? %> + + <% order.all_adjustments.tax.group_by(&:label).each do |label, adjustments| %> + + + + + <% end %> + + <% end %> + + + <% order.adjustments.eligible.each do |adjustment| %> + <% next if (adjustment.source_type == 'Spree::TaxRate') and (adjustment.amount == 0) %> + + + + + <% end %> + +
    <%= Spree.t(:item) %><%= Spree.t(:price) %><%= Spree.t(:qty) %><%= Spree.t(:total) %>
    + <% if item.variant.images.length == 0 %> + <%= link_to small_image(item.variant.product), item.variant.product %> + <% else %> + <%= link_to image_tag(item.variant.images.first.attachment.url(:small)), item.variant.product %> + <% end %> + +

    <%= item.name %>

    + <%= truncate(item.description, length: 100) %> + <%= "(" + item.variant.options_text + ")" unless item.variant.option_values.empty? %> +
    <%= item.single_money.to_html %><%= item.quantity %><%= item.display_amount.to_html %>
    <%= Spree.t(:order_total) %>:<%= order.display_total.to_html %>
    <%= Spree.t(:subtotal) %>:<%= order.display_item_total.to_html %>
    <%= Spree.t(:promotion) %>: <%= label %><%= Spree::Money.new(adjustments.sum(&:amount), currency: order.currency) %>
    <%= Spree.t(:shipping) %>: <%= name %><%= Spree::Money.new(shipments.sum(&:discounted_cost), currency: order.currency).to_html %>
    <%= Spree.t(:tax) %>: <%= label %><%= Spree::Money.new(adjustments.sum(&:amount), currency: order.currency) %>
    <%= adjustment.label %><%= adjustment.display_amount.to_html %>
    diff --git a/app/views/spree/shared/_payment.html.erb b/app/views/spree/shared/_payment.html.erb new file mode 100644 index 0000000..bc9e187 --- /dev/null +++ b/app/views/spree/shared/_payment.html.erb @@ -0,0 +1,20 @@ +<% source = payment.source %> + +<% if source.is_a?(Spree::CreditCard) %> + + <% unless (cc_type = source.cc_type).blank? %> + <%= image_tag "credit_cards/icons/#{cc_type}.png" %> + <% end %> + <% if source.last_digits %> + <%= Spree.t(:ending_in) %> <%= source.last_digits %> + <% end %> + +
    + <%= source.name %> +<% else %> + <%= content_tag(:span, payment.payment_method.name) %> +<% end %> + +(<%= payment.display_amount %>) + +
    diff --git a/app/views/spree/shared/_products.html.erb b/app/views/spree/shared/_products.html.erb new file mode 100644 index 0000000..22f959a --- /dev/null +++ b/app/views/spree/shared/_products.html.erb @@ -0,0 +1,27 @@ +<% content_for :head do %> + <% if products.respond_to?(:total_pages) %> + <%= rel_next_prev_link_tags products %> + <% end %> +<% end %> + +
    + <% if products.empty? %> +
    + <%= Spree.t(:no_products_found) %> +
    + <% elsif params.key?(:keywords) %> +
    +
    <%= Spree.t(:search_results, keywords: h(params[:keywords])) %>
    +
    + <% end %> +
    + +<% if products.any? %> +
    + <%= render partial: 'spree/products/product', collection: products, locals: { taxon: @taxon } %> +
    +<% end %> + +<% if products.respond_to?(:total_pages) %> + <%= paginate products, theme: 'twitter-bootstrap-3' %> +<% end %> diff --git a/app/views/spree/shared/_search.html.erb b/app/views/spree/shared/_search.html.erb new file mode 100644 index 0000000..64e08d9 --- /dev/null +++ b/app/views/spree/shared/_search.html.erb @@ -0,0 +1,15 @@ +<% @taxons = @taxon && @taxon.parent ? @taxon.parent.children : Spree::Taxon.roots %> +<%= form_tag spree.products_path, method: :get, class: "navbar-form" do %> +
    + <% cache [I18n.locale, @taxons] do %> + <%= select_tag :taxon, + options_for_select([[Spree.t(:all_departments), '']] + + @taxons.map {|t| [t.name, t.id]}, + @taxon ? @taxon.id : params[:taxon]), 'aria-label' => 'Taxon', class: "form-control" %> + <% end %> +
    +
    + <%= search_field_tag :keywords, params[:keywords], placeholder: Spree.t(:search), class: "form-control" %> +
    + <%= submit_tag Spree.t(:search), name: nil, class: "btn btn-success" %> +<% end %> diff --git a/app/views/spree/shared/_shipment_tracking.html.erb b/app/views/spree/shared/_shipment_tracking.html.erb new file mode 100644 index 0000000..93056bc --- /dev/null +++ b/app/views/spree/shared/_shipment_tracking.html.erb @@ -0,0 +1,10 @@ +<% shipments = order.shipments.trackable %> + +<% if shipments.any? %> +
    <%= Spree.t(:tracking) %>
    +
    + <% shipments.each do |shipment| %> + <%= link_to_tracking(shipment) %> + <% end %> +
    +<% end %> diff --git a/app/views/spree/shared/_sidebar.html.erb b/app/views/spree/shared/_sidebar.html.erb new file mode 100644 index 0000000..b051cb9 --- /dev/null +++ b/app/views/spree/shared/_sidebar.html.erb @@ -0,0 +1,3 @@ + diff --git a/app/views/spree/shared/_taxonomies.html.erb b/app/views/spree/shared/_taxonomies.html.erb new file mode 100644 index 0000000..8ba08a7 --- /dev/null +++ b/app/views/spree/shared/_taxonomies.html.erb @@ -0,0 +1,12 @@ +<% max_level = Spree::Config[:max_level_in_taxons_menu] || 1 %> + + diff --git a/app/views/spree/shared/_translations.html.erb b/app/views/spree/shared/_translations.html.erb new file mode 100644 index 0000000..2a0595e --- /dev/null +++ b/app/views/spree/shared/_translations.html.erb @@ -0,0 +1,7 @@ + diff --git a/app/views/spree/shared/forbidden.html.erb b/app/views/spree/shared/forbidden.html.erb new file mode 100644 index 0000000..e69de29 diff --git a/app/views/spree/shared/unauthorized.html.erb b/app/views/spree/shared/unauthorized.html.erb new file mode 100644 index 0000000..e69de29 diff --git a/app/views/spree/taxons/_taxon.html.erb b/app/views/spree/taxons/_taxon.html.erb new file mode 100644 index 0000000..9c3b94d --- /dev/null +++ b/app/views/spree/taxons/_taxon.html.erb @@ -0,0 +1,4 @@ +
    +
    <%= link_to taxon.name, seo_url(taxon), class: 'breadcrumbs' %>
    + <%= render partial: 'spree/shared/products', locals: { products: taxon_preview(taxon), taxon: taxon } %> +
    diff --git a/app/views/spree/taxons/show.html.erb b/app/views/spree/taxons/show.html.erb new file mode 100644 index 0000000..d1c566a --- /dev/null +++ b/app/views/spree/taxons/show.html.erb @@ -0,0 +1,20 @@ +

    <%= @taxon.name %>

    + +<% content_for :sidebar do %> +
    + <%= render partial: 'spree/shared/taxonomies' %> + <%= render partial: 'spree/shared/filters' if @taxon.leaf? %> +
    +<% end %> + +
    + <%= render partial: 'spree/shared/products', locals: { products: @products, taxon: @taxon } %> +
    + +<% unless params[:keywords].present? %> +
    + <% cache [I18n.locale, @taxon] do %> + <%= render partial: 'taxon', collection: @taxon.children %> + <% end %> +
    +<% end %> diff --git a/bin/bundle b/bin/bundle new file mode 100755 index 0000000..66e9889 --- /dev/null +++ b/bin/bundle @@ -0,0 +1,3 @@ +#!/usr/bin/env ruby +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) +load Gem.bin_path('bundler', 'bundle') diff --git a/bin/rails b/bin/rails new file mode 100755 index 0000000..5badb2f --- /dev/null +++ b/bin/rails @@ -0,0 +1,9 @@ +#!/usr/bin/env ruby +begin + load File.expand_path('../spring', __FILE__) +rescue LoadError => e + raise unless e.message.include?('spring') +end +APP_PATH = File.expand_path('../config/application', __dir__) +require_relative '../config/boot' +require 'rails/commands' diff --git a/bin/rake b/bin/rake new file mode 100755 index 0000000..d87d5f5 --- /dev/null +++ b/bin/rake @@ -0,0 +1,9 @@ +#!/usr/bin/env ruby +begin + load File.expand_path('../spring', __FILE__) +rescue LoadError => e + raise unless e.message.include?('spring') +end +require_relative '../config/boot' +require 'rake' +Rake.application.run diff --git a/bin/setup b/bin/setup new file mode 100755 index 0000000..78c4e86 --- /dev/null +++ b/bin/setup @@ -0,0 +1,38 @@ +#!/usr/bin/env ruby +require 'pathname' +require 'fileutils' +include FileUtils + +# path to your application root. +APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) + +def system!(*args) + system(*args) || abort("\n== Command #{args} failed ==") +end + +chdir APP_ROOT do + # This script is a starting point to setup your application. + # Add necessary setup steps to this file. + + puts '== Installing dependencies ==' + system! 'gem install bundler --conservative' + system('bundle check') || system!('bundle install') + + # Install JavaScript dependencies if using Yarn + # system('bin/yarn') + + + # puts "\n== Copying sample files ==" + # unless File.exist?('config/database.yml') + # cp 'config/database.yml.sample', 'config/database.yml' + # end + + puts "\n== Preparing database ==" + system! 'bin/rails db:setup' + + puts "\n== Removing old logs and tempfiles ==" + system! 'bin/rails log:clear tmp:clear' + + puts "\n== Restarting application server ==" + system! 'bin/rails restart' +end diff --git a/bin/spring b/bin/spring new file mode 100755 index 0000000..fb2ec2e --- /dev/null +++ b/bin/spring @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby + +# This file loads spring without using Bundler, in order to be fast. +# It gets overwritten when you run the `spring binstub` command. + +unless defined?(Spring) + require 'rubygems' + require 'bundler' + + lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read) + spring = lockfile.specs.detect { |spec| spec.name == "spring" } + if spring + Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path + gem 'spring', spring.version + require 'spring/binstub' + end +end diff --git a/bin/update b/bin/update new file mode 100755 index 0000000..a8e4462 --- /dev/null +++ b/bin/update @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +require 'pathname' +require 'fileutils' +include FileUtils + +# path to your application root. +APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) + +def system!(*args) + system(*args) || abort("\n== Command #{args} failed ==") +end + +chdir APP_ROOT do + # This script is a way to update your development environment automatically. + # Add necessary update steps to this file. + + puts '== Installing dependencies ==' + system! 'gem install bundler --conservative' + system('bundle check') || system!('bundle install') + + puts "\n== Updating database ==" + system! 'bin/rails db:migrate' + + puts "\n== Removing old logs and tempfiles ==" + system! 'bin/rails log:clear tmp:clear' + + puts "\n== Restarting application server ==" + system! 'bin/rails restart' +end diff --git a/bin/yarn b/bin/yarn new file mode 100755 index 0000000..c2bacef --- /dev/null +++ b/bin/yarn @@ -0,0 +1,11 @@ +#!/usr/bin/env ruby +VENDOR_PATH = File.expand_path('..', __dir__) +Dir.chdir(VENDOR_PATH) do + begin + exec "yarnpkg #{ARGV.join(" ")}" + rescue Errno::ENOENT + $stderr.puts "Yarn executable was not detected in the system." + $stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install" + exit 1 + end +end diff --git a/config.ru b/config.ru new file mode 100644 index 0000000..f7ba0b5 --- /dev/null +++ b/config.ru @@ -0,0 +1,5 @@ +# This file is used by Rack-based servers to start the application. + +require_relative 'config/environment' + +run Rails.application diff --git a/config/application.rb b/config/application.rb new file mode 100644 index 0000000..30ac846 --- /dev/null +++ b/config/application.rb @@ -0,0 +1,31 @@ +require_relative 'boot' + +require 'rails/all' + +# Require the gems listed in Gemfile, including any gems +# you've limited to :test, :development, or :production. +Bundler.require(*Rails.groups) + +module Spreeshop + class Application < Rails::Application + + config.to_prepare do + # Load application's model / class decorators + Dir.glob(File.join(File.dirname(__FILE__), "../app/**/*_decorator*.rb")) do |c| + Rails.configuration.cache_classes ? require(c) : load(c) + end + + # Load application's view overrides + Dir.glob(File.join(File.dirname(__FILE__), "../app/overrides/*.rb")) do |c| + Rails.configuration.cache_classes ? require(c) : load(c) + end + end + + # Initialize configuration defaults for originally generated Rails version. + config.load_defaults 5.1 + + # Settings in config/environments/* take precedence over those specified here. + # Application configuration should go into files in config/initializers + # -- all .rb files in that directory are automatically loaded. + end +end diff --git a/config/boot.rb b/config/boot.rb new file mode 100644 index 0000000..30f5120 --- /dev/null +++ b/config/boot.rb @@ -0,0 +1,3 @@ +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) + +require 'bundler/setup' # Set up gems listed in the Gemfile. diff --git a/config/cable.yml b/config/cable.yml new file mode 100644 index 0000000..9e6c69b --- /dev/null +++ b/config/cable.yml @@ -0,0 +1,10 @@ +development: + adapter: async + +test: + adapter: async + +production: + adapter: redis + url: redis://localhost:6379/1 + channel_prefix: spreeshop_production diff --git a/config/database.yml b/config/database.yml new file mode 100644 index 0000000..02cdbce --- /dev/null +++ b/config/database.yml @@ -0,0 +1,91 @@ +# PostgreSQL. Versions 9.1 and up are supported. +# +# Install the pg driver: +# gem install pg +# On OS X with Homebrew: +# gem install pg -- --with-pg-config=/usr/local/bin/pg_config +# On OS X with MacPorts: +# gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config +# On Windows: +# gem install pg +# Choose the win32 build. +# Install PostgreSQL and put its /bin directory on your path. +# +# Configure Using Gemfile +# gem 'pg' +# +default: &default + adapter: postgresql + encoding: unicode + # For details on connection pooling, see Rails configuration guide + # http://guides.rubyonrails.org/configuring.html#database-pooling + pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> + +development: + <<: *default + host: localhost + database: spreeshop_development + username: spreeshop + password: spreeshop + + # The specified database role being used to connect to postgres. + # To create additional roles in postgres see `$ createuser --help`. + # When left blank, postgres will use the default role. This is + # the same name as the operating system user that initialized the database. + #username: spreeshop + + # The password associated with the postgres role (username). + #password: + + # Connect on a TCP socket. Omitted by default since the client uses a + # domain socket that doesn't need configuration. Windows does not have + # domain sockets, so uncomment these lines. + #host: localhost + + # The TCP port the server listens on. Defaults to 5432. + # If your server runs on a different port number, change accordingly. + #port: 5432 + + # Schema search path. The server defaults to $user,public + #schema_search_path: myapp,sharedapp,public + + # Minimum log levels, in increasing order: + # debug5, debug4, debug3, debug2, debug1, + # log, notice, warning, error, fatal, and panic + # Defaults to warning. + #min_messages: notice + +# Warning: The database defined as "test" will be erased and +# re-generated from your development database when you run "rake". +# Do not set this db to the same as development or production. +test: + <<: *default + host: localhost + database: spreeshop_test + username: spreeshop + password: spreeshop + +# As with config/secrets.yml, you never want to store sensitive information, +# like your database password, in your source code. If your source code is +# ever seen by anyone, they now have access to your database. +# +# Instead, provide the password as a unix environment variable when you boot +# the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database +# for a full rundown on how to provide these environment variables in a +# production deployment. +# +# On Heroku and other platform providers, you may have a full connection URL +# available as an environment variable. For example: +# +# DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase" +# +# You can use this database configuration with: +# +# production: +# url: <%= ENV['DATABASE_URL'] %> +# +production: + <<: *default + database: spreeshop_production + username: spreeshop + password: <%= ENV['SPREESHOP_DATABASE_PASSWORD'] %> diff --git a/config/environment.rb b/config/environment.rb new file mode 100644 index 0000000..426333b --- /dev/null +++ b/config/environment.rb @@ -0,0 +1,5 @@ +# Load the Rails application. +require_relative 'application' + +# Initialize the Rails application. +Rails.application.initialize! diff --git a/config/environments/development.rb b/config/environments/development.rb new file mode 100644 index 0000000..5187e22 --- /dev/null +++ b/config/environments/development.rb @@ -0,0 +1,54 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # In the development environment your application's code is reloaded on + # every request. This slows down response time but is perfect for development + # since you don't have to restart the web server when you make code changes. + config.cache_classes = false + + # Do not eager load code on boot. + config.eager_load = false + + # Show full error reports. + config.consider_all_requests_local = true + + # Enable/disable caching. By default caching is disabled. + if Rails.root.join('tmp/caching-dev.txt').exist? + config.action_controller.perform_caching = true + + config.cache_store = :memory_store + config.public_file_server.headers = { + 'Cache-Control' => "public, max-age=#{2.days.seconds.to_i}" + } + else + config.action_controller.perform_caching = false + + config.cache_store = :null_store + end + + # Don't care if the mailer can't send. + config.action_mailer.raise_delivery_errors = false + + config.action_mailer.perform_caching = false + + # Print deprecation notices to the Rails logger. + config.active_support.deprecation = :log + + # Raise an error on page load if there are pending migrations. + config.active_record.migration_error = :page_load + + # Debug mode disables concatenation and preprocessing of assets. + # This option may cause significant delays in view rendering with a large + # number of complex assets. + config.assets.debug = true + + # Suppress logger output for asset requests. + config.assets.quiet = true + + # Raises error for missing translations + # config.action_view.raise_on_missing_translations = true + + # Use an evented file watcher to asynchronously detect changes in source code, + # routes, locales, etc. This feature depends on the listen gem. + config.file_watcher = ActiveSupport::EventedFileUpdateChecker +end diff --git a/config/environments/production.rb b/config/environments/production.rb new file mode 100644 index 0000000..f6dead4 --- /dev/null +++ b/config/environments/production.rb @@ -0,0 +1,91 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # Code is not reloaded between requests. + config.cache_classes = true + + # Eager load code on boot. This eager loads most of Rails and + # your application in memory, allowing both threaded web servers + # and those relying on copy on write to perform better. + # Rake tasks automatically ignore this option for performance. + config.eager_load = true + + # Full error reports are disabled and caching is turned on. + config.consider_all_requests_local = false + config.action_controller.perform_caching = true + + # Attempt to read encrypted secrets from `config/secrets.yml.enc`. + # Requires an encryption key in `ENV["RAILS_MASTER_KEY"]` or + # `config/secrets.yml.key`. + config.read_encrypted_secrets = true + + # Disable serving static files from the `/public` folder by default since + # Apache or NGINX already handles this. + config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? + + # Compress JavaScripts and CSS. + config.assets.js_compressor = :uglifier + # config.assets.css_compressor = :sass + + # Do not fallback to assets pipeline if a precompiled asset is missed. + config.assets.compile = false + + # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb + + # Enable serving of images, stylesheets, and JavaScripts from an asset server. + # config.action_controller.asset_host = 'http://assets.example.com' + + # Specifies the header that your server uses for sending files. + # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache + # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX + + # Mount Action Cable outside main process or domain + # config.action_cable.mount_path = nil + # config.action_cable.url = 'wss://example.com/cable' + # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ] + + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. + # config.force_ssl = true + + # Use the lowest log level to ensure availability of diagnostic information + # when problems arise. + config.log_level = :debug + + # Prepend all log lines with the following tags. + config.log_tags = [ :request_id ] + + # Use a different cache store in production. + # config.cache_store = :mem_cache_store + + # Use a real queuing backend for Active Job (and separate queues per environment) + # config.active_job.queue_adapter = :resque + # config.active_job.queue_name_prefix = "spreeshop_#{Rails.env}" + config.action_mailer.perform_caching = false + + # Ignore bad email addresses and do not raise email delivery errors. + # Set this to true and configure the email server for immediate delivery to raise delivery errors. + # config.action_mailer.raise_delivery_errors = false + + # Enable locale fallbacks for I18n (makes lookups for any locale fall back to + # the I18n.default_locale when a translation cannot be found). + config.i18n.fallbacks = true + + # Send deprecation notices to registered listeners. + config.active_support.deprecation = :notify + + # Use default logging formatter so that PID and timestamp are not suppressed. + config.log_formatter = ::Logger::Formatter.new + + # Use a different logger for distributed setups. + # require 'syslog/logger' + # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') + + if ENV["RAILS_LOG_TO_STDOUT"].present? + logger = ActiveSupport::Logger.new(STDOUT) + logger.formatter = config.log_formatter + config.logger = ActiveSupport::TaggedLogging.new(logger) + end + + # Do not dump schema after migrations. + config.active_record.dump_schema_after_migration = false +end diff --git a/config/environments/test.rb b/config/environments/test.rb new file mode 100644 index 0000000..8e5cbde --- /dev/null +++ b/config/environments/test.rb @@ -0,0 +1,42 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # The test environment is used exclusively to run your application's + # test suite. You never need to work with it otherwise. Remember that + # your test database is "scratch space" for the test suite and is wiped + # and recreated between test runs. Don't rely on the data there! + config.cache_classes = true + + # Do not eager load code on boot. This avoids loading your whole application + # just for the purpose of running a single test. If you are using a tool that + # preloads Rails for running tests, you may have to set it to true. + config.eager_load = false + + # Configure public file server for tests with Cache-Control for performance. + config.public_file_server.enabled = true + config.public_file_server.headers = { + 'Cache-Control' => "public, max-age=#{1.hour.seconds.to_i}" + } + + # Show full error reports and disable caching. + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + + # Raise exceptions instead of rendering exception templates. + config.action_dispatch.show_exceptions = false + + # Disable request forgery protection in test environment. + config.action_controller.allow_forgery_protection = false + config.action_mailer.perform_caching = false + + # Tell Action Mailer not to deliver emails to the real world. + # The :test delivery method accumulates sent emails in the + # ActionMailer::Base.deliveries array. + config.action_mailer.delivery_method = :test + + # Print deprecation notices to the stderr. + config.active_support.deprecation = :stderr + + # Raises error for missing translations + # config.action_view.raise_on_missing_translations = true +end diff --git a/config/initializers/application_controller_renderer.rb b/config/initializers/application_controller_renderer.rb new file mode 100644 index 0000000..51639b6 --- /dev/null +++ b/config/initializers/application_controller_renderer.rb @@ -0,0 +1,6 @@ +# Be sure to restart your server when you modify this file. + +# ApplicationController.renderer.defaults.merge!( +# http_host: 'example.org', +# https: false +# ) diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb new file mode 100644 index 0000000..4b828e8 --- /dev/null +++ b/config/initializers/assets.rb @@ -0,0 +1,14 @@ +# Be sure to restart your server when you modify this file. + +# Version of your assets, change this if you want to expire all your assets. +Rails.application.config.assets.version = '1.0' + +# Add additional assets to the asset load path. +# Rails.application.config.assets.paths << Emoji.images_path +# Add Yarn node_modules folder to the asset load path. +Rails.application.config.assets.paths << Rails.root.join('node_modules') + +# Precompile additional assets. +# application.js, application.css, and all non-JS/CSS in the app/assets +# folder are already added. +# Rails.application.config.assets.precompile += %w( admin.js admin.css ) diff --git a/config/initializers/backtrace_silencers.rb b/config/initializers/backtrace_silencers.rb new file mode 100644 index 0000000..59385cd --- /dev/null +++ b/config/initializers/backtrace_silencers.rb @@ -0,0 +1,7 @@ +# Be sure to restart your server when you modify this file. + +# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. +# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } + +# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. +# Rails.backtrace_cleaner.remove_silencers! diff --git a/config/initializers/cookies_serializer.rb b/config/initializers/cookies_serializer.rb new file mode 100644 index 0000000..5a6a32d --- /dev/null +++ b/config/initializers/cookies_serializer.rb @@ -0,0 +1,5 @@ +# Be sure to restart your server when you modify this file. + +# Specify a serializer for the signed and encrypted cookie jars. +# Valid options are :json, :marshal, and :hybrid. +Rails.application.config.action_dispatch.cookies_serializer = :json diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb new file mode 100644 index 0000000..4a994e1 --- /dev/null +++ b/config/initializers/filter_parameter_logging.rb @@ -0,0 +1,4 @@ +# Be sure to restart your server when you modify this file. + +# Configure sensitive parameters which will be filtered from the log file. +Rails.application.config.filter_parameters += [:password] diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb new file mode 100644 index 0000000..ac033bf --- /dev/null +++ b/config/initializers/inflections.rb @@ -0,0 +1,16 @@ +# Be sure to restart your server when you modify this file. + +# Add new inflection rules using the following format. Inflections +# are locale specific, and you may define rules for as many different +# locales as you wish. All of these examples are active by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.plural /^(ox)$/i, '\1en' +# inflect.singular /^(ox)en/i, '\1' +# inflect.irregular 'person', 'people' +# inflect.uncountable %w( fish sheep ) +# end + +# These inflection rules are supported but not enabled by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.acronym 'RESTful' +# end diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb new file mode 100644 index 0000000..dc18996 --- /dev/null +++ b/config/initializers/mime_types.rb @@ -0,0 +1,4 @@ +# Be sure to restart your server when you modify this file. + +# Add new mime types for use in respond_to blocks: +# Mime::Type.register "text/richtext", :rtf diff --git a/config/initializers/spree.rb b/config/initializers/spree.rb new file mode 100644 index 0000000..391050f --- /dev/null +++ b/config/initializers/spree.rb @@ -0,0 +1,18 @@ +# Configure Spree Preferences +# +# Note: Initializing preferences available within the Admin will overwrite any changes that were made through the user interface when you restart. +# If you would like users to be able to update a setting with the Admin it should NOT be set here. +# +# Note: If a preference is set here it will be stored within the cache & database upon initialization. +# Just removing an entry from this initializer will not make the preference value go away. +# Instead you must either set a new value or remove entry, clear cache, and remove database entry. +# +# In order to initialize a setting do: +# config.setting_name = 'new value' +Spree.config do |config| + # Example: + # Uncomment to stop tracking inventory levels in the application + # config.track_inventory_levels = false +end + +Spree.user_class = "Spree::LegacyUser" diff --git a/config/initializers/wrap_parameters.rb b/config/initializers/wrap_parameters.rb new file mode 100644 index 0000000..bbfc396 --- /dev/null +++ b/config/initializers/wrap_parameters.rb @@ -0,0 +1,14 @@ +# Be sure to restart your server when you modify this file. + +# This file contains settings for ActionController::ParamsWrapper which +# is enabled by default. + +# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. +ActiveSupport.on_load(:action_controller) do + wrap_parameters format: [:json] +end + +# To enable root element in JSON for ActiveRecord objects. +# ActiveSupport.on_load(:active_record) do +# self.include_root_in_json = true +# end diff --git a/config/locales/en.yml b/config/locales/en.yml new file mode 100644 index 0000000..decc5a8 --- /dev/null +++ b/config/locales/en.yml @@ -0,0 +1,33 @@ +# Files in the config/locales directory are used for internationalization +# and are automatically loaded by Rails. If you want to use locales other +# than English, add the necessary files in this directory. +# +# To use the locales, use `I18n.t`: +# +# I18n.t 'hello' +# +# In views, this is aliased to just `t`: +# +# <%= t('hello') %> +# +# To use a different locale, set it with `I18n.locale`: +# +# I18n.locale = :es +# +# This would use the information in config/locales/es.yml. +# +# The following keys must be escaped otherwise they will not be retrieved by +# the default I18n backend: +# +# true, false, on, off, yes, no +# +# Instead, surround them with single quotes. +# +# en: +# 'true': 'foo' +# +# To learn more, please read the Rails Internationalization guide +# available at http://guides.rubyonrails.org/i18n.html. + +en: + hello: "Hello world" diff --git a/config/puma.rb b/config/puma.rb new file mode 100644 index 0000000..1e19380 --- /dev/null +++ b/config/puma.rb @@ -0,0 +1,56 @@ +# Puma can serve each request in a thread from an internal thread pool. +# The `threads` method setting takes two numbers: a minimum and maximum. +# Any libraries that use thread pools should be configured to match +# the maximum value specified for Puma. Default is set to 5 threads for minimum +# and maximum; this matches the default thread size of Active Record. +# +threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 } +threads threads_count, threads_count + +# Specifies the `port` that Puma will listen on to receive requests; default is 3000. +# +port ENV.fetch("PORT") { 3000 } + +# Specifies the `environment` that Puma will run in. +# +environment ENV.fetch("RAILS_ENV") { "development" } + +# Specifies the number of `workers` to boot in clustered mode. +# Workers are forked webserver processes. If using threads and workers together +# the concurrency of the application would be max `threads` * `workers`. +# Workers do not work on JRuby or Windows (both of which do not support +# processes). +# +# workers ENV.fetch("WEB_CONCURRENCY") { 2 } + +# Use the `preload_app!` method when specifying a `workers` number. +# This directive tells Puma to first boot the application and load code +# before forking the application. This takes advantage of Copy On Write +# process behavior so workers use less memory. If you use this option +# you need to make sure to reconnect any threads in the `on_worker_boot` +# block. +# +# preload_app! + +# If you are preloading your application and using Active Record, it's +# recommended that you close any connections to the database before workers +# are forked to prevent connection leakage. +# +# before_fork do +# ActiveRecord::Base.connection_pool.disconnect! if defined?(ActiveRecord) +# end + +# The code in the `on_worker_boot` will be called if you are using +# clustered mode by specifying a number of `workers`. After each worker +# process is booted, this block will be run. If you are using the `preload_app!` +# option, you will want to use this block to reconnect to any threads +# or connections that may have been created at application boot, as Ruby +# cannot share connections between processes. +# +# on_worker_boot do +# ActiveRecord::Base.establish_connection if defined?(ActiveRecord) +# end +# + +# Allow puma to be restarted by `rails restart` command. +plugin :tmp_restart diff --git a/config/routes.rb b/config/routes.rb new file mode 100644 index 0000000..1f2bd0a --- /dev/null +++ b/config/routes.rb @@ -0,0 +1,12 @@ +Rails.application.routes.draw do + # This line mounts Spree's routes at the root of your application. + # This means, any requests to URLs such as /products, will go to + # Spree::ProductsController. + # If you would like to change where this engine is mounted, simply change the + # :at option to something different. + # + # We ask that you don't use the :as option here, as Spree relies on it being + # the default of "spree". + mount Spree::Core::Engine, at: '/' + # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html +end diff --git a/config/secrets.yml b/config/secrets.yml new file mode 100644 index 0000000..e268262 --- /dev/null +++ b/config/secrets.yml @@ -0,0 +1,32 @@ +# Be sure to restart your server when you modify this file. + +# Your secret key is used for verifying the integrity of signed cookies. +# If you change this key, all old signed cookies will become invalid! + +# Make sure the secret is at least 30 characters and all random, +# no regular words or you'll be exposed to dictionary attacks. +# You can use `rails secret` to generate a secure secret key. + +# Make sure the secrets in this file are kept private +# if you're sharing your code publicly. + +# Shared secrets are available across all environments. + +# shared: +# api_key: a1B2c3D4e5F6 + +# Environmental secrets are only available for that specific environment. + +development: + secret_key_base: 7f85d70698f2a32963210af8558bc677c9ed8a383eae28c29a57d3bd475c3b89ce94c45609f5721491d5ffd6b31c651139a3088f592cd4ac775e41cf2fcab58c + +test: + secret_key_base: f81ac0b96eab47be4e31e36d941e4fac7c7a009b9c9b3a33ec58d8a57c3a3f839fad89b51875e7ae4d4d147c87f0bcc8a5dd151b3ac3b7e149ebe77e0d18625c + +# Do not keep production secrets in the unencrypted secrets file. +# Instead, either read values from the environment. +# Or, use `bin/rails secrets:setup` to configure encrypted secrets +# and move the `production:` environment over there. + +production: + secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> diff --git a/config/spring.rb b/config/spring.rb new file mode 100644 index 0000000..c9119b4 --- /dev/null +++ b/config/spring.rb @@ -0,0 +1,6 @@ +%w( + .ruby-version + .rbenv-vars + tmp/restart.txt + tmp/caching-dev.txt +).each { |path| Spring.watch(path) } diff --git a/db/migrate/20181125224040_spree_one_two.spree.rb b/db/migrate/20181125224040_spree_one_two.spree.rb new file mode 100644 index 0000000..276c4fd --- /dev/null +++ b/db/migrate/20181125224040_spree_one_two.spree.rb @@ -0,0 +1,482 @@ +# This migration comes from spree (originally 20120831092320) +class SpreeOneTwo < ActiveRecord::Migration[4.2] + def up + # This migration is just a compressed version of all the previous + # migrations for spree_core. Do not run it if one of the core tables + # already exists. Assume the best. + return if data_source_exists?(:spree_addresses) + + + create_table :spree_activators do |t| + t.string :description + t.datetime :expires_at + t.datetime :starts_at + t.string :name + t.string :event_name + t.string :type + t.integer :usage_limit + t.string :match_policy, default: 'all' + t.string :code + t.boolean :advertise, default: false + t.string :path + t.timestamps null: false + end + + create_table :spree_addresses do |t| + t.string :firstname + t.string :lastname + t.string :address1 + t.string :address2 + t.string :city + t.string :zipcode + t.string :phone + t.string :state_name + t.string :alternative_phone + t.string :company + t.references :state + t.references :country + t.timestamps null: false + end + + add_index :spree_addresses, [:firstname], name: 'index_addresses_on_firstname' + add_index :spree_addresses, [:lastname], name: 'index_addresses_on_lastname' + + create_table :spree_adjustments do |t| + t.references :source, polymorphic: true + t.references :adjustable, polymorphic: true + t.references :originator, polymorphic: true + t.decimal :amount, precision: 8, scale: 2 + t.string :label + t.boolean :mandatory + t.boolean :locked + t.boolean :eligible, default: true + t.timestamps null: false + end + + add_index :spree_adjustments, [:adjustable_id], name: 'index_adjustments_on_order_id' + + create_table :spree_assets do |t| + t.references :viewable, polymorphic: true + t.integer :attachment_width + t.integer :attachment_height + t.integer :attachment_file_size + t.integer :position + t.string :attachment_content_type + t.string :attachment_file_name + t.string :type, limit: 75 + t.datetime :attachment_updated_at + t.text :alt + end + + add_index :spree_assets, [:viewable_id], name: 'index_assets_on_viewable_id' + add_index :spree_assets, [:viewable_type, :type], name: 'index_assets_on_viewable_type_and_type' + + create_table :spree_calculators do |t| + t.string :type + t.references :calculable, polymorphic: true + t.timestamps null: false + end + + create_table :spree_configurations do |t| + t.string :name + t.string :type, limit: 50 + t.timestamps null: false + end + + add_index :spree_configurations, [:name, :type], name: 'index_spree_configurations_on_name_and_type' + + create_table :spree_countries do |t| + t.string :iso_name + t.string :iso + t.string :iso3 + t.string :name + t.integer :numcode + end + + create_table :spree_credit_cards do |t| + t.string :month + t.string :year + t.string :cc_type + t.string :last_digits + t.string :first_name + t.string :last_name + t.string :start_month + t.string :start_year + t.string :issue_number + t.references :address + t.string :gateway_customer_profile_id + t.string :gateway_payment_profile_id + t.timestamps null: false + end + + create_table :spree_gateways do |t| + t.string :type + t.string :name + t.text :description + t.boolean :active, default: true + t.string :environment, default: 'development' + t.string :server, default: 'test' + t.boolean :test_mode, default: true + t.timestamps null: false + end + + create_table :spree_inventory_units do |t| + t.integer :lock_version, default: 0 + t.string :state + t.references :variant + t.references :order + t.references :shipment + t.references :return_authorization + t.timestamps null: false + end + + add_index :spree_inventory_units, [:order_id], name: 'index_inventory_units_on_order_id' + add_index :spree_inventory_units, [:shipment_id], name: 'index_inventory_units_on_shipment_id' + add_index :spree_inventory_units, [:variant_id], name: 'index_inventory_units_on_variant_id' + + create_table :spree_line_items do |t| + t.references :variant + t.references :order + t.integer :quantity, null: false + t.decimal :price, precision: 8, scale: 2, null: false + t.timestamps null: false + end + + add_index :spree_line_items, [:order_id], name: 'index_spree_line_items_on_order_id' + add_index :spree_line_items, [:variant_id], name: 'index_spree_line_items_on_variant_id' + + create_table :spree_log_entries do |t| + t.references :source, polymorphic: true + t.text :details + t.timestamps null: false + end + + create_table :spree_mail_methods do |t| + t.string :environment + t.boolean :active, default: true + t.timestamps null: false + end + + create_table :spree_option_types do |t| + t.string :name, limit: 100 + t.string :presentation, limit: 100 + t.integer :position, default: 0, null: false + t.timestamps null: false + end + + create_table :spree_option_types_prototypes, id: false do |t| + t.references :prototype + t.references :option_type + end + + create_table :spree_option_values do |t| + t.integer :position + t.string :name + t.string :presentation + t.references :option_type + t.timestamps null: false + end + + create_table :spree_option_values_variants, id: false do |t| + t.references :variant + t.references :option_value + end + + add_index :spree_option_values_variants, [:variant_id, :option_value_id], name: 'index_option_values_variants_on_variant_id_and_option_value_id' + add_index :spree_option_values_variants, [:variant_id], name: 'index_spree_option_values_variants_on_variant_id' + + create_table :spree_orders do |t| + t.string :number, limit: 15 + t.decimal :item_total, precision: 8, scale: 2, default: 0.0, null: false + t.decimal :total, precision: 8, scale: 2, default: 0.0, null: false + t.string :state + t.decimal :adjustment_total, precision: 8, scale: 2, default: 0.0, null: false + t.references :user + t.datetime :completed_at + t.references :bill_address + t.references :ship_address + t.decimal :payment_total, precision: 8, scale: 2, default: 0.0 + t.references :shipping_method + t.string :shipment_state + t.string :payment_state + t.string :email + t.text :special_instructions + t.timestamps null: false + end + + add_index :spree_orders, [:number], name: 'index_spree_orders_on_number' + + create_table :spree_payment_methods do |t| + t.string :type + t.string :name + t.text :description + t.boolean :active, default: true + t.string :environment, default: 'development' + t.datetime :deleted_at + t.string :display_on + t.timestamps null: false + end + + create_table :spree_payments do |t| + t.decimal :amount, precision: 8, scale: 2, default: 0.0, null: false + t.references :order + t.references :source, polymorphic: true + t.references :payment_method + t.string :state + t.string :response_code + t.string :avs_response + t.timestamps null: false + end + + create_table :spree_preferences do |t| + t.string :name, limit: 100 + t.references :owner, polymorphic: true + t.text :value + t.string :key + t.string :value_type + t.timestamps null: false + end + + add_index :spree_preferences, [:key], name: 'index_spree_preferences_on_key', unique: true + + create_table :spree_product_option_types do |t| + t.integer :position + t.references :product + t.references :option_type + t.timestamps null: false + end + + create_table :spree_product_properties do |t| + t.string :value + t.references :product + t.references :property + t.timestamps null: false + end + + add_index :spree_product_properties, [:product_id], name: 'index_product_properties_on_product_id' + + create_table :spree_products do |t| + t.string :name, default: '', null: false + t.text :description + t.datetime :available_on + t.datetime :deleted_at + t.string :permalink + t.string :meta_description + t.string :meta_keywords + t.references :tax_category + t.references :shipping_category + t.integer :count_on_hand, default: 0, null: false + t.timestamps null: false + end + + add_index :spree_products, [:available_on], name: 'index_spree_products_on_available_on' + add_index :spree_products, [:deleted_at], name: 'index_spree_products_on_deleted_at' + add_index :spree_products, [:name], name: 'index_spree_products_on_name' + add_index :spree_products, [:permalink], name: 'index_spree_products_on_permalink' + + create_table :spree_products_taxons, id: false do |t| + t.references :product + t.references :taxon + end + + add_index :spree_products_taxons, [:product_id], name: 'index_spree_products_taxons_on_product_id' + add_index :spree_products_taxons, [:taxon_id], name: 'index_spree_products_taxons_on_taxon_id' + + create_table :spree_properties do |t| + t.string :name + t.string :presentation, null: false + t.timestamps null: false + end + + create_table :spree_properties_prototypes, id: false do |t| + t.references :prototype + t.references :property + end + + create_table :spree_prototypes do |t| + t.string :name + t.timestamps null: false + end + + create_table :spree_return_authorizations do |t| + t.string :number + t.string :state + t.decimal :amount, precision: 8, scale: 2, default: 0.0, null: false + t.references :order + t.text :reason + t.timestamps null: false + end + + create_table :spree_roles do |t| + t.string :name + end + + create_table :spree_roles_users, id: false do |t| + t.references :role + t.references :user + end + + add_index :spree_roles_users, [:role_id], name: 'index_spree_roles_users_on_role_id' + add_index :spree_roles_users, [:user_id], name: 'index_spree_roles_users_on_user_id' + + create_table :spree_shipments do |t| + t.string :tracking + t.string :number + t.decimal :cost, precision: 8, scale: 2 + t.datetime :shipped_at + t.references :order + t.references :shipping_method + t.references :address + t.string :state + t.timestamps null: false + end + + add_index :spree_shipments, [:number], name: 'index_shipments_on_number' + + create_table :spree_shipping_categories do |t| + t.string :name + t.timestamps null: false + end + + create_table :spree_shipping_methods do |t| + t.string :name + t.references :zone + t.string :display_on + t.references :shipping_category + t.boolean :match_none + t.boolean :match_all + t.boolean :match_one + t.datetime :deleted_at + t.timestamps null: false + end + + create_table :spree_state_changes do |t| + t.string :name + t.string :previous_state + t.references :stateful + t.references :user + t.string :stateful_type + t.string :next_state + t.timestamps null: false + end + + create_table :spree_states do |t| + t.string :name + t.string :abbr + t.references :country + end + + create_table :spree_tax_categories do |t| + t.string :name + t.string :description + t.boolean :is_default, default: false + t.datetime :deleted_at + t.timestamps null: false + end + + create_table :spree_tax_rates do |t| + t.decimal :amount, precision: 8, scale: 5 + t.references :zone + t.references :tax_category + t.boolean :included_in_price, default: false + t.timestamps null: false + end + + create_table :spree_taxonomies do |t| + t.string :name, null: false + t.timestamps null: false + end + + create_table :spree_taxons do |t| + t.references :parent + t.integer :position, default: 0 + t.string :name, null: false + t.string :permalink + t.references :taxonomy + t.integer :lft + t.integer :rgt + t.string :icon_file_name + t.string :icon_content_type + t.integer :icon_file_size + t.datetime :icon_updated_at + t.text :description + t.timestamps null: false + end + + add_index :spree_taxons, [:parent_id], name: 'index_taxons_on_parent_id' + add_index :spree_taxons, [:permalink], name: 'index_taxons_on_permalink' + add_index :spree_taxons, [:taxonomy_id], name: 'index_taxons_on_taxonomy_id' + + create_table :spree_tokenized_permissions, force: true do |t| + t.references :permissable, polymorphic: true + t.string :token + t.timestamps null: false + end + + add_index :spree_tokenized_permissions, [:permissable_id, :permissable_type], name: 'index_tokenized_name_and_type' + + create_table :spree_trackers do |t| + t.string :environment + t.string :analytics_id + t.boolean :active, default: true + t.timestamps null: false + end + + create_table :spree_users do |t| + t.string :encrypted_password, limit: 128 + t.string :password_salt, limit: 128 + t.string :email + t.string :remember_token + t.string :persistence_token + t.string :reset_password_token + t.string :perishable_token + t.integer :sign_in_count, default: 0, null: false + t.integer :failed_attempts, default: 0, null: false + t.datetime :last_request_at + t.datetime :current_sign_in_at + t.datetime :last_sign_in_at + t.string :current_sign_in_ip + t.string :last_sign_in_ip + t.string :login + t.references :ship_address + t.references :bill_address + t.string :authentication_token + t.string :unlock_token + t.datetime :locked_at + t.datetime :remember_created_at + t.datetime :reset_password_sent_at + t.timestamps null: false + end + + create_table :spree_variants do |t| + t.string :sku, default: '', null: false + t.decimal :price, precision: 8, scale: 2, null: false + t.decimal :weight, precision: 8, scale: 2 + t.decimal :height, precision: 8, scale: 2 + t.decimal :width, precision: 8, scale: 2 + t.decimal :depth, precision: 8, scale: 2 + t.datetime :deleted_at + t.boolean :is_master, default: false + t.references :product + t.integer :count_on_hand, default: 0, null: false + t.decimal :cost_price, precision: 8, scale: 2 + t.integer :position + end + + add_index :spree_variants, [:product_id], name: 'index_spree_variants_on_product_id' + + create_table :spree_zone_members do |t| + t.references :zoneable, polymorphic: true + t.references :zone + t.timestamps null: false + end + + create_table :spree_zones do |t| + t.string :name + t.string :description + t.boolean :default_tax, default: false + t.integer :zone_members_count, default: 0 + t.timestamps null: false + end + end +end diff --git a/db/migrate/20181125224041_spree_promo_one_two.spree.rb b/db/migrate/20181125224041_spree_promo_one_two.spree.rb new file mode 100644 index 0000000..4ed925e --- /dev/null +++ b/db/migrate/20181125224041_spree_promo_one_two.spree.rb @@ -0,0 +1,46 @@ +# This migration comes from spree (originally 20120831092359) +class SpreePromoOneTwo < ActiveRecord::Migration[4.2] + def up + # This migration is just a compressed migration for all previous versions of spree_promo + return if data_source_exists?(:spree_products_promotion_rules) + + create_table :spree_products_promotion_rules, id: false, force: true do |t| + t.references :product + t.references :promotion_rule + end + + add_index :spree_products_promotion_rules, [:product_id], name: 'index_products_promotion_rules_on_product_id' + add_index :spree_products_promotion_rules, [:promotion_rule_id], name: 'index_products_promotion_rules_on_promotion_rule_id' + + create_table :spree_promotion_action_line_items, force: true do |t| + t.references :promotion_action + t.references :variant + t.integer :quantity, default: 1 + end + + create_table :spree_promotion_actions, force: true do |t| + t.references :activator + t.integer :position + t.string :type + end + + create_table :spree_promotion_rules, force: true do |t| + t.references :activator + t.references :user + t.references :product_group + t.string :type + t.timestamps null: false + end + + add_index :spree_promotion_rules, [:product_group_id], name: 'index_promotion_rules_on_product_group_id' + add_index :spree_promotion_rules, [:user_id], name: 'index_promotion_rules_on_user_id' + + create_table :spree_promotion_rules_users, id: false, force: true do |t| + t.references :user + t.references :promotion_rule + end + + add_index :spree_promotion_rules_users, [:promotion_rule_id], name: 'index_promotion_rules_users_on_promotion_rule_id' + add_index :spree_promotion_rules_users, [:user_id], name: 'index_promotion_rules_users_on_user_id' + end +end diff --git a/db/migrate/20181125224042_add_tax_rate_label.spree.rb b/db/migrate/20181125224042_add_tax_rate_label.spree.rb new file mode 100644 index 0000000..121adec --- /dev/null +++ b/db/migrate/20181125224042_add_tax_rate_label.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20120905145253) +class AddTaxRateLabel < ActiveRecord::Migration[4.2] + def change + add_column :spree_tax_rates, :name, :string + end +end diff --git a/db/migrate/20181125224043_add_toggle_tax_rate_display.spree.rb b/db/migrate/20181125224043_add_toggle_tax_rate_display.spree.rb new file mode 100644 index 0000000..ee1dc3c --- /dev/null +++ b/db/migrate/20181125224043_add_toggle_tax_rate_display.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20120905151823) +class AddToggleTaxRateDisplay < ActiveRecord::Migration[4.2] + def change + add_column :spree_tax_rates, :show_rate_in_label, :boolean, default: true + end +end diff --git a/db/migrate/20181125224044_remove_unused_preference_columns.spree.rb b/db/migrate/20181125224044_remove_unused_preference_columns.spree.rb new file mode 100644 index 0000000..e29f378 --- /dev/null +++ b/db/migrate/20181125224044_remove_unused_preference_columns.spree.rb @@ -0,0 +1,9 @@ +# This migration comes from spree (originally 20120929093553) +class RemoveUnusedPreferenceColumns < ActiveRecord::Migration[4.2] + def change + # Columns have already been removed if the application was upgraded from an older version, but must be removed from new apps. + remove_column :spree_preferences, :name if ApplicationRecord.connection.column_exists?(:spree_preferences, :name) + remove_column :spree_preferences, :owner_id if ApplicationRecord.connection.column_exists?(:spree_preferences, :owner_id) + remove_column :spree_preferences, :owner_type if ApplicationRecord.connection.column_exists?(:spree_preferences, :owner_type) + end +end diff --git a/db/migrate/20181125224045_add_lock_version_to_variant.spree.rb b/db/migrate/20181125224045_add_lock_version_to_variant.spree.rb new file mode 100644 index 0000000..6fc41a7 --- /dev/null +++ b/db/migrate/20181125224045_add_lock_version_to_variant.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20121009142519) +class AddLockVersionToVariant < ActiveRecord::Migration[4.2] + def change + add_column :spree_variants, :lock_version, :integer, default: 0 + end +end diff --git a/db/migrate/20181125224046_add_states_required_to_countries.spree.rb b/db/migrate/20181125224046_add_states_required_to_countries.spree.rb new file mode 100644 index 0000000..a97f817 --- /dev/null +++ b/db/migrate/20181125224046_add_states_required_to_countries.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20121010142909) +class AddStatesRequiredToCountries < ActiveRecord::Migration[4.2] + def change + add_column :spree_countries, :states_required, :boolean, default: true + end +end diff --git a/db/migrate/20181125224047_add_on_demand_to_product_and_variant.spree.rb b/db/migrate/20181125224047_add_on_demand_to_product_and_variant.spree.rb new file mode 100644 index 0000000..257a0e4 --- /dev/null +++ b/db/migrate/20181125224047_add_on_demand_to_product_and_variant.spree.rb @@ -0,0 +1,7 @@ +# This migration comes from spree (originally 20121012071449) +class AddOnDemandToProductAndVariant < ActiveRecord::Migration[4.2] + def change + add_column :spree_products, :on_demand, :boolean, default: false + add_column :spree_variants, :on_demand, :boolean, default: false + end +end diff --git a/db/migrate/20181125224048_remove_not_null_constraint_from_products_on_hand.spree.rb b/db/migrate/20181125224048_remove_not_null_constraint_from_products_on_hand.spree.rb new file mode 100644 index 0000000..53744c8 --- /dev/null +++ b/db/migrate/20181125224048_remove_not_null_constraint_from_products_on_hand.spree.rb @@ -0,0 +1,12 @@ +# This migration comes from spree (originally 20121017010007) +class RemoveNotNullConstraintFromProductsOnHand < ActiveRecord::Migration[4.2] + def up + change_column :spree_products, :count_on_hand, :integer, null: true + change_column :spree_variants, :count_on_hand, :integer, null: true + end + + def down + change_column :spree_products, :count_on_hand, :integer, null: false + change_column :spree_variants, :count_on_hand, :integer, null: false + end +end diff --git a/db/migrate/20181125224049_split_prices_from_variants.spree.rb b/db/migrate/20181125224049_split_prices_from_variants.spree.rb new file mode 100644 index 0000000..74a20f0 --- /dev/null +++ b/db/migrate/20181125224049_split_prices_from_variants.spree.rb @@ -0,0 +1,32 @@ +# This migration comes from spree (originally 20121031162139) +class SplitPricesFromVariants < ActiveRecord::Migration[4.2] + def up + create_table :spree_prices do |t| + t.integer :variant_id, null: false + t.decimal :amount, precision: 8, scale: 2, null: false + t.string :currency + end + + Spree::Variant.all.each do |variant| + Spree::Price.create!( + variant_id: variant.id, + amount: variant[:price], + currency: Spree::Config[:currency] + ) + end + + remove_column :spree_variants, :price + end + + def down + prices = ApplicationRecord.connection.execute("select variant_id, amount from spree_prices") + add_column :spree_variants, :price, :decimal, after: :sku, scale: 2, precision: 8 + + prices.each do |price| + ApplicationRecord.connection.execute("update spree_variants set price = #{price['amount']} where id = #{price['variant_id']}") + end + + change_column :spree_variants, :price, :decimal, after: :sku, scale: 2, precision: 8, null: false + drop_table :spree_prices + end +end diff --git a/db/migrate/20181125224050_remove_not_null_from_spree_prices_amount.spree.rb b/db/migrate/20181125224050_remove_not_null_from_spree_prices_amount.spree.rb new file mode 100644 index 0000000..f323413 --- /dev/null +++ b/db/migrate/20181125224050_remove_not_null_from_spree_prices_amount.spree.rb @@ -0,0 +1,10 @@ +# This migration comes from spree (originally 20121107003422) +class RemoveNotNullFromSpreePricesAmount < ActiveRecord::Migration[4.2] + def up + change_column :spree_prices, :amount, :decimal, precision: 8, scale: 2, null: true + end + + def down + change_column :spree_prices, :amount, :decimal, precision: 8, scale: 2, null: false + end +end diff --git a/db/migrate/20181125224051_add_currency_to_line_items.spree.rb b/db/migrate/20181125224051_add_currency_to_line_items.spree.rb new file mode 100644 index 0000000..76d4bad --- /dev/null +++ b/db/migrate/20181125224051_add_currency_to_line_items.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20121107184631) +class AddCurrencyToLineItems < ActiveRecord::Migration[4.2] + def change + add_column :spree_line_items, :currency, :string + end +end diff --git a/db/migrate/20181125224052_add_currency_to_orders.spree.rb b/db/migrate/20181125224052_add_currency_to_orders.spree.rb new file mode 100644 index 0000000..cb7d51e --- /dev/null +++ b/db/migrate/20181125224052_add_currency_to_orders.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20121107194006) +class AddCurrencyToOrders < ActiveRecord::Migration[4.2] + def change + add_column :spree_orders, :currency, :string + end +end diff --git a/db/migrate/20181125224053_add_cost_currency_to_variants.spree.rb b/db/migrate/20181125224053_add_cost_currency_to_variants.spree.rb new file mode 100644 index 0000000..6e56a00 --- /dev/null +++ b/db/migrate/20181125224053_add_cost_currency_to_variants.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20121109173623) +class AddCostCurrencyToVariants < ActiveRecord::Migration[4.2] + def change + add_column :spree_variants, :cost_currency, :string, after: :cost_price + end +end diff --git a/db/migrate/20181125224054_remove_display_on_from_payment_methods.spree.rb b/db/migrate/20181125224054_remove_display_on_from_payment_methods.spree.rb new file mode 100644 index 0000000..e27115e --- /dev/null +++ b/db/migrate/20181125224054_remove_display_on_from_payment_methods.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20121111231553) +class RemoveDisplayOnFromPaymentMethods < ActiveRecord::Migration[4.2] + def up + remove_column :spree_payment_methods, :display_on + end +end diff --git a/db/migrate/20181125224055_add_position_to_taxonomies.spree.rb b/db/migrate/20181125224055_add_position_to_taxonomies.spree.rb new file mode 100644 index 0000000..ceee97c --- /dev/null +++ b/db/migrate/20181125224055_add_position_to_taxonomies.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20121124203911) +class AddPositionToTaxonomies < ActiveRecord::Migration[4.2] + def change + add_column :spree_taxonomies, :position, :integer, default: 0 + end +end diff --git a/db/migrate/20181125224056_add_last_ip_to_spree_orders.spree.rb b/db/migrate/20181125224056_add_last_ip_to_spree_orders.spree.rb new file mode 100644 index 0000000..191a0e9 --- /dev/null +++ b/db/migrate/20181125224056_add_last_ip_to_spree_orders.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20121126040517) +class AddLastIpToSpreeOrders < ActiveRecord::Migration[4.2] + def change + add_column :spree_orders, :last_ip_address, :string + end +end diff --git a/db/migrate/20181125224057_add_state_to_spree_adjustments.spree.rb b/db/migrate/20181125224057_add_state_to_spree_adjustments.spree.rb new file mode 100644 index 0000000..493f275 --- /dev/null +++ b/db/migrate/20181125224057_add_state_to_spree_adjustments.spree.rb @@ -0,0 +1,7 @@ +# This migration comes from spree (originally 20121213162028) +class AddStateToSpreeAdjustments < ActiveRecord::Migration[4.2] + def change + add_column :spree_adjustments, :state, :string + remove_column :spree_adjustments, :locked + end +end diff --git a/db/migrate/20181125224058_add_display_on_to_spree_payment_methods.spree.rb b/db/migrate/20181125224058_add_display_on_to_spree_payment_methods.spree.rb new file mode 100644 index 0000000..4a4e0aa --- /dev/null +++ b/db/migrate/20181125224058_add_display_on_to_spree_payment_methods.spree.rb @@ -0,0 +1,10 @@ +# This migration comes from spree (originally 20130114053446) +class AddDisplayOnToSpreePaymentMethods < ActiveRecord::Migration[4.2] + def self.up + add_column :spree_payment_methods, :display_on, :string + end + + def self.down + remove_column :spree_payment_methods, :display_on + end +end diff --git a/db/migrate/20181125224059_add_position_to_product_properties.spree.rb b/db/migrate/20181125224059_add_position_to_product_properties.spree.rb new file mode 100644 index 0000000..4477281 --- /dev/null +++ b/db/migrate/20181125224059_add_position_to_product_properties.spree.rb @@ -0,0 +1,7 @@ +# This migration comes from spree (originally 20130120201805) +class AddPositionToProductProperties < ActiveRecord::Migration[4.2] + def change + add_column :spree_product_properties, :position, :integer, default: 0 + end +end + diff --git a/db/migrate/20181125224060_add_identifier_to_spree_payments.spree.rb b/db/migrate/20181125224060_add_identifier_to_spree_payments.spree.rb new file mode 100644 index 0000000..44df67a --- /dev/null +++ b/db/migrate/20181125224060_add_identifier_to_spree_payments.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20130203232234) +class AddIdentifierToSpreePayments < ActiveRecord::Migration[4.2] + def change + add_column :spree_payments, :identifier, :string + end +end diff --git a/db/migrate/20181125224061_add_order_id_index_to_payments.spree.rb b/db/migrate/20181125224061_add_order_id_index_to_payments.spree.rb new file mode 100644 index 0000000..b5e168b --- /dev/null +++ b/db/migrate/20181125224061_add_order_id_index_to_payments.spree.rb @@ -0,0 +1,10 @@ +# This migration comes from spree (originally 20130207155350) +class AddOrderIdIndexToPayments < ActiveRecord::Migration[4.2] + def self.up + add_index :spree_payments, :order_id + end + + def self.down + remove_index :spree_payments, :order_id + end +end diff --git a/db/migrate/20181125224062_add_primary_to_spree_products_taxons.spree.rb b/db/migrate/20181125224062_add_primary_to_spree_products_taxons.spree.rb new file mode 100644 index 0000000..d1b7cf5 --- /dev/null +++ b/db/migrate/20181125224062_add_primary_to_spree_products_taxons.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20130208032954) +class AddPrimaryToSpreeProductsTaxons < ActiveRecord::Migration[4.2] + def change + add_column :spree_products_taxons, :id, :primary_key + end +end diff --git a/db/migrate/20181125224063_create_spree_stock_items.spree.rb b/db/migrate/20181125224063_create_spree_stock_items.spree.rb new file mode 100644 index 0000000..49f5a85 --- /dev/null +++ b/db/migrate/20181125224063_create_spree_stock_items.spree.rb @@ -0,0 +1,15 @@ +# This migration comes from spree (originally 20130211190146) +class CreateSpreeStockItems < ActiveRecord::Migration[4.2] + def change + create_table :spree_stock_items do |t| + t.belongs_to :stock_location + t.belongs_to :variant + t.integer :count_on_hand, null: false, default: 0 + t.integer :lock_version + + t.timestamps null: false + end + add_index :spree_stock_items, :stock_location_id + add_index :spree_stock_items, [:stock_location_id, :variant_id], name: 'stock_item_by_loc_and_var_id' + end +end diff --git a/db/migrate/20181125224064_create_spree_stock_locations.spree.rb b/db/migrate/20181125224064_create_spree_stock_locations.spree.rb new file mode 100644 index 0000000..d52e72b --- /dev/null +++ b/db/migrate/20181125224064_create_spree_stock_locations.spree.rb @@ -0,0 +1,12 @@ +# This migration comes from spree (originally 20130211191120) +class CreateSpreeStockLocations < ActiveRecord::Migration[4.2] + def change + create_table :spree_stock_locations do |t| + t.string :name + t.belongs_to :address + + t.timestamps null: false + end + add_index :spree_stock_locations, :address_id + end +end diff --git a/db/migrate/20181125224065_create_default_stock.spree.rb b/db/migrate/20181125224065_create_default_stock.spree.rb new file mode 100644 index 0000000..6397100 --- /dev/null +++ b/db/migrate/20181125224065_create_default_stock.spree.rb @@ -0,0 +1,34 @@ +# This migration comes from spree (originally 20130213191427) +class CreateDefaultStock < ActiveRecord::Migration[4.2] + def up + unless column_exists? :spree_stock_locations, :default + add_column :spree_stock_locations, :default, :boolean, null: false, default: false + end + + Spree::StockLocation.skip_callback(:create, :after, :create_stock_items) + Spree::StockLocation.skip_callback(:save, :after, :ensure_one_default) + location = Spree::StockLocation.new(name: 'default') + location.save(validate: false) + + Spree::Variant.find_each do |variant| + stock_item = Spree::StockItem.unscoped.build(stock_location: location, variant: variant) + stock_item.send(:count_on_hand=, variant.count_on_hand) + # Avoid running default_scope defined by acts_as_paranoid, related to #3805, + # validations would run a query with a delete_at column that might not be present yet + stock_item.save! validate: false + end + + remove_column :spree_variants, :count_on_hand + end + + def down + add_column :spree_variants, :count_on_hand, :integer + + Spree::StockItem.find_each do |stock_item| + stock_item.variant.update_column :count_on_hand, stock_item.count_on_hand + end + + Spree::StockLocation.delete_all + Spree::StockItem.delete_all + end +end diff --git a/db/migrate/20181125224066_add_order_id_index_to_shipments.spree.rb b/db/migrate/20181125224066_add_order_id_index_to_shipments.spree.rb new file mode 100644 index 0000000..1b80d05 --- /dev/null +++ b/db/migrate/20181125224066_add_order_id_index_to_shipments.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20130222032153) +class AddOrderIdIndexToShipments < ActiveRecord::Migration[4.2] + def change + add_index :spree_shipments, :order_id + end +end diff --git a/db/migrate/20181125224067_change_meta_description_on_spree_products_to_text.spree.rb b/db/migrate/20181125224067_change_meta_description_on_spree_products_to_text.spree.rb new file mode 100644 index 0000000..fa228e2 --- /dev/null +++ b/db/migrate/20181125224067_change_meta_description_on_spree_products_to_text.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20130226032817) +class ChangeMetaDescriptionOnSpreeProductsToText < ActiveRecord::Migration[4.2] + def change + change_column :spree_products, :meta_description, :text, limit: nil + end +end diff --git a/db/migrate/20181125224068_add_stock_location_id_to_spree_shipments.spree.rb b/db/migrate/20181125224068_add_stock_location_id_to_spree_shipments.spree.rb new file mode 100644 index 0000000..66df6e1 --- /dev/null +++ b/db/migrate/20181125224068_add_stock_location_id_to_spree_shipments.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20130226191231) +class AddStockLocationIdToSpreeShipments < ActiveRecord::Migration[4.2] + def change + add_column :spree_shipments, :stock_location_id, :integer + end +end diff --git a/db/migrate/20181125224069_add_pending_to_inventory_unit.spree.rb b/db/migrate/20181125224069_add_pending_to_inventory_unit.spree.rb new file mode 100644 index 0000000..d2137be --- /dev/null +++ b/db/migrate/20181125224069_add_pending_to_inventory_unit.spree.rb @@ -0,0 +1,7 @@ +# This migration comes from spree (originally 20130227143905) +class AddPendingToInventoryUnit < ActiveRecord::Migration[4.2] + def change + add_column :spree_inventory_units, :pending, :boolean, default: true + Spree::InventoryUnit.update_all(pending: false) + end +end diff --git a/db/migrate/20181125224070_remove_on_demand_from_product_and_variant.spree.rb b/db/migrate/20181125224070_remove_on_demand_from_product_and_variant.spree.rb new file mode 100644 index 0000000..83c27a4 --- /dev/null +++ b/db/migrate/20181125224070_remove_on_demand_from_product_and_variant.spree.rb @@ -0,0 +1,7 @@ +# This migration comes from spree (originally 20130228164411) +class RemoveOnDemandFromProductAndVariant < ActiveRecord::Migration[4.2] + def change + remove_column :spree_products, :on_demand + remove_column :spree_variants, :on_demand + end +end diff --git a/db/migrate/20181125224071_create_shipping_method_zone.spree.rb b/db/migrate/20181125224071_create_shipping_method_zone.spree.rb new file mode 100644 index 0000000..10ac904 --- /dev/null +++ b/db/migrate/20181125224071_create_shipping_method_zone.spree.rb @@ -0,0 +1,22 @@ +# This migration comes from spree (originally 20130228210442) +class CreateShippingMethodZone < ActiveRecord::Migration[4.2] + class ShippingMethodZone < ApplicationRecord + self.table_name = 'shipping_methods_zones' + end + def up + create_table :shipping_methods_zones, id: false do |t| + t.integer :shipping_method_id + t.integer :zone_id + end + Spree::ShippingMethod.all.each do |sm| + ShippingMethodZone.create!(zone_id: sm.zone_id, shipping_method_id: sm.id) + end + + remove_column :spree_shipping_methods, :zone_id + end + + def down + drop_table :shipping_methods_zones + add_column :spree_shipping_methods, :zone_id, :integer + end +end diff --git a/db/migrate/20181125224072_remove_shipping_category_id_from_shipping_method.spree.rb b/db/migrate/20181125224072_remove_shipping_category_id_from_shipping_method.spree.rb new file mode 100644 index 0000000..8f6aeaf --- /dev/null +++ b/db/migrate/20181125224072_remove_shipping_category_id_from_shipping_method.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20130301162745) +class RemoveShippingCategoryIdFromShippingMethod < ActiveRecord::Migration[4.2] + def change + remove_column :spree_shipping_methods, :shipping_category_id + end +end diff --git a/db/migrate/20181125224073_create_shipping_method_categories.spree.rb b/db/migrate/20181125224073_create_shipping_method_categories.spree.rb new file mode 100644 index 0000000..33b4c97 --- /dev/null +++ b/db/migrate/20181125224073_create_shipping_method_categories.spree.rb @@ -0,0 +1,14 @@ +# This migration comes from spree (originally 20130301162924) +class CreateShippingMethodCategories < ActiveRecord::Migration[4.2] + def change + create_table :spree_shipping_method_categories do |t| + t.integer :shipping_method_id, null: false + t.integer :shipping_category_id, null: false + + t.timestamps null: false + end + + add_index :spree_shipping_method_categories, :shipping_method_id + add_index :spree_shipping_method_categories, :shipping_category_id + end +end diff --git a/db/migrate/20181125224074_add_tracking_url_to_spree_shipping_methods.spree.rb b/db/migrate/20181125224074_add_tracking_url_to_spree_shipping_methods.spree.rb new file mode 100644 index 0000000..16ac6fe --- /dev/null +++ b/db/migrate/20181125224074_add_tracking_url_to_spree_shipping_methods.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20130301205200) +class AddTrackingUrlToSpreeShippingMethods < ActiveRecord::Migration[4.2] + def change + add_column :spree_shipping_methods, :tracking_url, :string + end +end diff --git a/db/migrate/20181125224075_create_spree_shipping_rates.spree.rb b/db/migrate/20181125224075_create_spree_shipping_rates.spree.rb new file mode 100644 index 0000000..f25d2fe --- /dev/null +++ b/db/migrate/20181125224075_create_spree_shipping_rates.spree.rb @@ -0,0 +1,25 @@ +# This migration comes from spree (originally 20130304162240) +class CreateSpreeShippingRates < ActiveRecord::Migration[4.2] + def up + create_table :spree_shipping_rates do |t| + t.belongs_to :shipment + t.belongs_to :shipping_method + t.boolean :selected, default: false + t.decimal :cost, precision: 8, scale: 2 + t.timestamps null: false + end + add_index(:spree_shipping_rates, [:shipment_id, :shipping_method_id], + name: 'spree_shipping_rates_join_index', + unique: true) + + # Spree::Shipment.all.each do |shipment| + # shipping_method = Spree::ShippingMethod.find(shipment.shipment_method_id) + # shipment.add_shipping_method(shipping_method, true) + # end + end + + def down + # add_column :spree_shipments, :shipping_method_id, :integer + drop_table :spree_shipping_rates + end +end diff --git a/db/migrate/20181125224076_remove_category_match_attributes_from_shipping_method.spree.rb b/db/migrate/20181125224076_remove_category_match_attributes_from_shipping_method.spree.rb new file mode 100644 index 0000000..9c62e3d --- /dev/null +++ b/db/migrate/20181125224076_remove_category_match_attributes_from_shipping_method.spree.rb @@ -0,0 +1,8 @@ +# This migration comes from spree (originally 20130304192936) +class RemoveCategoryMatchAttributesFromShippingMethod < ActiveRecord::Migration[4.2] + def change + remove_column :spree_shipping_methods, :match_none + remove_column :spree_shipping_methods, :match_one + remove_column :spree_shipping_methods, :match_all + end +end diff --git a/db/migrate/20181125224077_create_stock_movements.spree.rb b/db/migrate/20181125224077_create_stock_movements.spree.rb new file mode 100644 index 0000000..8867e0b --- /dev/null +++ b/db/migrate/20181125224077_create_stock_movements.spree.rb @@ -0,0 +1,13 @@ +# This migration comes from spree (originally 20130305143310) +class CreateStockMovements < ActiveRecord::Migration[4.2] + def change + create_table :spree_stock_movements do |t| + t.belongs_to :stock_item + t.integer :quantity + t.string :action + + t.timestamps null: false + end + add_index :spree_stock_movements, :stock_item_id + end +end diff --git a/db/migrate/20181125224078_add_address_fields_to_stock_location.spree.rb b/db/migrate/20181125224078_add_address_fields_to_stock_location.spree.rb new file mode 100644 index 0000000..927a1a4 --- /dev/null +++ b/db/migrate/20181125224078_add_address_fields_to_stock_location.spree.rb @@ -0,0 +1,23 @@ +# This migration comes from spree (originally 20130306181701) +class AddAddressFieldsToStockLocation < ActiveRecord::Migration[4.2] + def change + remove_column :spree_stock_locations, :address_id + + add_column :spree_stock_locations, :address1, :string + add_column :spree_stock_locations, :address2, :string + add_column :spree_stock_locations, :city, :string + add_column :spree_stock_locations, :state_id, :integer + add_column :spree_stock_locations, :state_name, :string + add_column :spree_stock_locations, :country_id, :integer + add_column :spree_stock_locations, :zipcode, :string + add_column :spree_stock_locations, :phone, :string + + + usa = Spree::Country.where(iso: 'US').first + # In case USA isn't found. + # See #3115 + country = usa || Spree::Country.first + Spree::Country.reset_column_information + Spree::StockLocation.update_all(country_id: country) + end +end diff --git a/db/migrate/20181125224079_add_active_field_to_stock_locations.spree.rb b/db/migrate/20181125224079_add_active_field_to_stock_locations.spree.rb new file mode 100644 index 0000000..120fd33 --- /dev/null +++ b/db/migrate/20181125224079_add_active_field_to_stock_locations.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20130306191917) +class AddActiveFieldToStockLocations < ActiveRecord::Migration[4.2] + def change + add_column :spree_stock_locations, :active, :boolean, default: true + end +end diff --git a/db/migrate/20181125224080_add_backorderable_to_stock_item.spree.rb b/db/migrate/20181125224080_add_backorderable_to_stock_item.spree.rb new file mode 100644 index 0000000..49b5324 --- /dev/null +++ b/db/migrate/20181125224080_add_backorderable_to_stock_item.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20130306195650) +class AddBackorderableToStockItem < ActiveRecord::Migration[4.2] + def change + add_column :spree_stock_items, :backorderable, :boolean, default: true + end +end diff --git a/db/migrate/20181125224081_add_default_quantity_to_stock_movement.spree.rb b/db/migrate/20181125224081_add_default_quantity_to_stock_movement.spree.rb new file mode 100644 index 0000000..bac5896 --- /dev/null +++ b/db/migrate/20181125224081_add_default_quantity_to_stock_movement.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20130307161754) +class AddDefaultQuantityToStockMovement < ActiveRecord::Migration[4.2] + def change + change_column :spree_stock_movements, :quantity, :integer, default: 0 + end +end diff --git a/db/migrate/20181125224082_add_source_and_destination_to_stock_movements.spree.rb b/db/migrate/20181125224082_add_source_and_destination_to_stock_movements.spree.rb new file mode 100644 index 0000000..f22f110 --- /dev/null +++ b/db/migrate/20181125224082_add_source_and_destination_to_stock_movements.spree.rb @@ -0,0 +1,9 @@ +# This migration comes from spree (originally 20130318151756) +class AddSourceAndDestinationToStockMovements < ActiveRecord::Migration[4.2] + def change + change_table :spree_stock_movements do |t| + t.references :source, polymorphic: true + t.references :destination, polymorphic: true + end + end +end diff --git a/db/migrate/20181125224083_change_orders_total_precision.spree.rb b/db/migrate/20181125224083_change_orders_total_precision.spree.rb new file mode 100644 index 0000000..cda5ba8 --- /dev/null +++ b/db/migrate/20181125224083_change_orders_total_precision.spree.rb @@ -0,0 +1,9 @@ +# This migration comes from spree (originally 20130319062004) +class ChangeOrdersTotalPrecision < ActiveRecord::Migration[4.2] + def change + change_column :spree_orders, :item_total, :decimal, precision: 10, scale: 2, default: 0.0, null: false + change_column :spree_orders, :total, :decimal, precision: 10, scale: 2, default: 0.0, null: false + change_column :spree_orders, :adjustment_total, :decimal, precision: 10, scale: 2, default: 0.0, null: false + change_column :spree_orders, :payment_total, :decimal, precision: 10, scale: 2, default: 0.0 + end +end diff --git a/db/migrate/20181125224084_change_spree_payments_amount_precision.spree.rb b/db/migrate/20181125224084_change_spree_payments_amount_precision.spree.rb new file mode 100644 index 0000000..0524ed9 --- /dev/null +++ b/db/migrate/20181125224084_change_spree_payments_amount_precision.spree.rb @@ -0,0 +1,8 @@ +# This migration comes from spree (originally 20130319063911) +class ChangeSpreePaymentsAmountPrecision < ActiveRecord::Migration[4.2] + def change + + change_column :spree_payments, :amount, :decimal, precision: 10, scale: 2, default: 0.0, null: false + + end +end diff --git a/db/migrate/20181125224085_change_spree_return_authorization_amount_precision.spree.rb b/db/migrate/20181125224085_change_spree_return_authorization_amount_precision.spree.rb new file mode 100644 index 0000000..60923c2 --- /dev/null +++ b/db/migrate/20181125224085_change_spree_return_authorization_amount_precision.spree.rb @@ -0,0 +1,8 @@ +# This migration comes from spree (originally 20130319064308) +class ChangeSpreeReturnAuthorizationAmountPrecision < ActiveRecord::Migration[4.2] + def change + + change_column :spree_return_authorizations, :amount, :decimal, precision: 10, scale: 2, default: 0.0, null: false + + end +end diff --git a/db/migrate/20181125224086_change_adjustments_amount_precision.spree.rb b/db/migrate/20181125224086_change_adjustments_amount_precision.spree.rb new file mode 100644 index 0000000..064a578 --- /dev/null +++ b/db/migrate/20181125224086_change_adjustments_amount_precision.spree.rb @@ -0,0 +1,8 @@ +# This migration comes from spree (originally 20130319082943) +class ChangeAdjustmentsAmountPrecision < ActiveRecord::Migration[4.2] + def change + + change_column :spree_adjustments, :amount, :decimal, precision: 10, scale: 2 + + end +end diff --git a/db/migrate/20181125224087_add_originator_to_stock_movement.spree.rb b/db/migrate/20181125224087_add_originator_to_stock_movement.spree.rb new file mode 100644 index 0000000..ab33f8c --- /dev/null +++ b/db/migrate/20181125224087_add_originator_to_stock_movement.spree.rb @@ -0,0 +1,8 @@ +# This migration comes from spree (originally 20130319183250) +class AddOriginatorToStockMovement < ActiveRecord::Migration[4.2] + def change + change_table :spree_stock_movements do |t| + t.references :originator, polymorphic: true + end + end +end diff --git a/db/migrate/20181125224088_drop_source_and_destination_from_stock_movement.spree.rb b/db/migrate/20181125224088_drop_source_and_destination_from_stock_movement.spree.rb new file mode 100644 index 0000000..0a79d47 --- /dev/null +++ b/db/migrate/20181125224088_drop_source_and_destination_from_stock_movement.spree.rb @@ -0,0 +1,16 @@ +# This migration comes from spree (originally 20130319190507) +class DropSourceAndDestinationFromStockMovement < ActiveRecord::Migration[4.2] + def up + change_table :spree_stock_movements do |t| + t.remove_references :source, polymorphic: true + t.remove_references :destination, polymorphic: true + end + end + + def down + change_table :spree_stock_movements do |t| + t.references :source, polymorphic: true + t.references :destination, polymorphic: true + end + end +end diff --git a/db/migrate/20181125224089_migrate_inventory_unit_sold_to_on_hand.spree.rb b/db/migrate/20181125224089_migrate_inventory_unit_sold_to_on_hand.spree.rb new file mode 100644 index 0000000..095a0d1 --- /dev/null +++ b/db/migrate/20181125224089_migrate_inventory_unit_sold_to_on_hand.spree.rb @@ -0,0 +1,10 @@ +# This migration comes from spree (originally 20130325163316) +class MigrateInventoryUnitSoldToOnHand < ActiveRecord::Migration[4.2] + def up + Spree::InventoryUnit.where(state: 'sold').update_all(state: 'on_hand') + end + + def down + Spree::InventoryUnit.where(state: 'on_hand').update_all(state: 'sold') + end +end diff --git a/db/migrate/20181125224090_add_stock_location_to_rma.spree.rb b/db/migrate/20181125224090_add_stock_location_to_rma.spree.rb new file mode 100644 index 0000000..d9c85d8 --- /dev/null +++ b/db/migrate/20181125224090_add_stock_location_to_rma.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20130326175857) +class AddStockLocationToRma < ActiveRecord::Migration[4.2] + def change + add_column :spree_return_authorizations, :stock_location_id, :integer + end +end diff --git a/db/migrate/20181125224091_update_shipment_state_for_canceled_orders.spree.rb b/db/migrate/20181125224091_update_shipment_state_for_canceled_orders.spree.rb new file mode 100644 index 0000000..8d9e5ba --- /dev/null +++ b/db/migrate/20181125224091_update_shipment_state_for_canceled_orders.spree.rb @@ -0,0 +1,16 @@ +# This migration comes from spree (originally 20130328130308) +class UpdateShipmentStateForCanceledOrders < ActiveRecord::Migration[4.2] + def up + shipments = Spree::Shipment.joins(:order). + where("spree_orders.state = 'canceled'") + case Spree::Shipment.connection.adapter_name + when "SQLite3" + shipments.update_all("state = 'cancelled'") + when "MySQL" || "PostgreSQL" + shipments.update_all("spree_shipments.state = 'cancelled'") + end + end + + def down + end +end diff --git a/db/migrate/20181125224092_add_seo_metas_to_taxons.spree.rb b/db/migrate/20181125224092_add_seo_metas_to_taxons.spree.rb new file mode 100644 index 0000000..bbcb8b5 --- /dev/null +++ b/db/migrate/20181125224092_add_seo_metas_to_taxons.spree.rb @@ -0,0 +1,10 @@ +# This migration comes from spree (originally 20130328195253) +class AddSeoMetasToTaxons < ActiveRecord::Migration[4.2] + def change + change_table :spree_taxons do |t| + t.string :meta_title + t.string :meta_description + t.string :meta_keywords + end + end +end diff --git a/db/migrate/20181125224093_remove_stock_item_and_variant_lock.spree.rb b/db/migrate/20181125224093_remove_stock_item_and_variant_lock.spree.rb new file mode 100644 index 0000000..c9ba659 --- /dev/null +++ b/db/migrate/20181125224093_remove_stock_item_and_variant_lock.spree.rb @@ -0,0 +1,15 @@ +# This migration comes from spree (originally 20130329134939) +class RemoveStockItemAndVariantLock < ActiveRecord::Migration[4.2] + def up + # we are moving to pessimistic locking on stock_items + remove_column :spree_stock_items, :lock_version + + # variants no longer manage their count_on_hand so we are removing their lock + remove_column :spree_variants, :lock_version + end + + def down + add_column :spree_stock_items, :lock_version, :integer + add_column :spree_variants, :lock_version, :integer + end +end diff --git a/db/migrate/20181125224094_add_name_to_spree_credit_cards.spree.rb b/db/migrate/20181125224094_add_name_to_spree_credit_cards.spree.rb new file mode 100644 index 0000000..70f5ec7 --- /dev/null +++ b/db/migrate/20181125224094_add_name_to_spree_credit_cards.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20130413230529) +class AddNameToSpreeCreditCards < ActiveRecord::Migration[4.2] + def change + add_column :spree_credit_cards, :name, :string + end +end diff --git a/db/migrate/20181125224095_update_name_fields_on_spree_credit_cards.spree.rb b/db/migrate/20181125224095_update_name_fields_on_spree_credit_cards.spree.rb new file mode 100644 index 0000000..2e1a41a --- /dev/null +++ b/db/migrate/20181125224095_update_name_fields_on_spree_credit_cards.spree.rb @@ -0,0 +1,14 @@ +# This migration comes from spree (originally 20130414000512) +class UpdateNameFieldsOnSpreeCreditCards < ActiveRecord::Migration[4.2] + def up + if ApplicationRecord.connection.adapter_name.downcase.include? "mysql" + execute "UPDATE spree_credit_cards SET name = CONCAT(first_name, ' ', last_name)" + else + execute "UPDATE spree_credit_cards SET name = first_name || ' ' || last_name" + end + end + + def down + execute "UPDATE spree_credit_cards SET name = NULL" + end +end diff --git a/db/migrate/20181125224096_add_index_to_source_columns_on_adjustments.spree.rb b/db/migrate/20181125224096_add_index_to_source_columns_on_adjustments.spree.rb new file mode 100644 index 0000000..f8d7fec --- /dev/null +++ b/db/migrate/20181125224096_add_index_to_source_columns_on_adjustments.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20130417120034) +class AddIndexToSourceColumnsOnAdjustments < ActiveRecord::Migration[4.2] + def change + add_index :spree_adjustments, [:source_type, :source_id] + end +end diff --git a/db/migrate/20181125224097_update_adjustment_states.spree.rb b/db/migrate/20181125224097_update_adjustment_states.spree.rb new file mode 100644 index 0000000..0e40ac5 --- /dev/null +++ b/db/migrate/20181125224097_update_adjustment_states.spree.rb @@ -0,0 +1,17 @@ +# This migration comes from spree (originally 20130417120035) +class UpdateAdjustmentStates < ActiveRecord::Migration[4.2] + def up + Spree::Order.complete.find_each do |order| + order.adjustments.update_all(state: 'closed') + end + + Spree::Shipment.shipped.includes(:adjustment).find_each do |shipment| + shipment.adjustment.update_column(:state, 'finalized') if shipment.adjustment + end + + Spree::Adjustment.where(state: nil).update_all(state: 'open') + end + + def down + end +end diff --git a/db/migrate/20181125224098_add_shipping_rates_to_shipments.spree.rb b/db/migrate/20181125224098_add_shipping_rates_to_shipments.spree.rb new file mode 100644 index 0000000..8e1a12e --- /dev/null +++ b/db/migrate/20181125224098_add_shipping_rates_to_shipments.spree.rb @@ -0,0 +1,16 @@ +# This migration comes from spree (originally 20130417123427) +class AddShippingRatesToShipments < ActiveRecord::Migration[4.2] + def up + Spree::Shipment.find_each do |shipment| + shipment.shipping_rates.create(shipping_method_id: shipment.shipping_method_id, + cost: shipment.cost, + selected: true) + end + + remove_column :spree_shipments, :shipping_method_id + end + + def down + add_column :spree_shipments, :shipping_method_id, :integer + end +end diff --git a/db/migrate/20181125224099_create_spree_stock_transfers.spree.rb b/db/migrate/20181125224099_create_spree_stock_transfers.spree.rb new file mode 100644 index 0000000..171d489 --- /dev/null +++ b/db/migrate/20181125224099_create_spree_stock_transfers.spree.rb @@ -0,0 +1,15 @@ +# This migration comes from spree (originally 20130418125341) +class CreateSpreeStockTransfers < ActiveRecord::Migration[4.2] + def change + create_table :spree_stock_transfers do |t| + t.string :type + t.string :reference_number + t.integer :source_location_id + t.integer :destination_location_id + t.timestamps null: false + end + + add_index :spree_stock_transfers, :source_location_id + add_index :spree_stock_transfers, :destination_location_id + end +end diff --git a/db/migrate/20181125224100_drop_products_count_on_hand.spree.rb b/db/migrate/20181125224100_drop_products_count_on_hand.spree.rb new file mode 100644 index 0000000..a5fdc46 --- /dev/null +++ b/db/migrate/20181125224100_drop_products_count_on_hand.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20130423110707) +class DropProductsCountOnHand < ActiveRecord::Migration[4.2] + def up + remove_column :spree_products, :count_on_hand + end +end diff --git a/db/migrate/20181125224101_set_default_shipping_rate_cost.spree.rb b/db/migrate/20181125224101_set_default_shipping_rate_cost.spree.rb new file mode 100644 index 0000000..141b395 --- /dev/null +++ b/db/migrate/20181125224101_set_default_shipping_rate_cost.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20130423223847) +class SetDefaultShippingRateCost < ActiveRecord::Migration[4.2] + def change + change_column :spree_shipping_rates, :cost, :decimal, default: 0, precision: 8, scale: 2 + end +end diff --git a/db/migrate/20181125224102_add_number_to_stock_transfer.spree.rb b/db/migrate/20181125224102_add_number_to_stock_transfer.spree.rb new file mode 100644 index 0000000..1fb83e2 --- /dev/null +++ b/db/migrate/20181125224102_add_number_to_stock_transfer.spree.rb @@ -0,0 +1,24 @@ +# This migration comes from spree (originally 20130509115210) +class AddNumberToStockTransfer < ActiveRecord::Migration[4.2] + def up + remove_index :spree_stock_transfers, :source_location_id + remove_index :spree_stock_transfers, :destination_location_id + + rename_column :spree_stock_transfers, :reference_number, :reference + add_column :spree_stock_transfers, :number, :string + + Spree::StockTransfer.find_each do |transfer| + transfer.send(:generate_stock_transfer_number) + transfer.save! + end + + add_index :spree_stock_transfers, :number + add_index :spree_stock_transfers, :source_location_id + add_index :spree_stock_transfers, :destination_location_id + end + + def down + rename_column :spree_stock_transfers, :reference, :reference_number + remove_column :spree_stock_transfers, :number, :string + end +end diff --git a/db/migrate/20181125224103_add_sku_index_to_spree_variants.spree.rb b/db/migrate/20181125224103_add_sku_index_to_spree_variants.spree.rb new file mode 100644 index 0000000..1d5b78a --- /dev/null +++ b/db/migrate/20181125224103_add_sku_index_to_spree_variants.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20130514151929) +class AddSkuIndexToSpreeVariants < ActiveRecord::Migration[4.2] + def change + add_index :spree_variants, :sku + end +end diff --git a/db/migrate/20181125224104_add_backorderable_default_to_spree_stock_location.spree.rb b/db/migrate/20181125224104_add_backorderable_default_to_spree_stock_location.spree.rb new file mode 100644 index 0000000..5408ef1 --- /dev/null +++ b/db/migrate/20181125224104_add_backorderable_default_to_spree_stock_location.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20130515180736) +class AddBackorderableDefaultToSpreeStockLocation < ActiveRecord::Migration[4.2] + def change + add_column :spree_stock_locations, :backorderable_default, :boolean, default: true + end +end diff --git a/db/migrate/20181125224105_add_propage_all_variants_to_spree_stock_location.spree.rb b/db/migrate/20181125224105_add_propage_all_variants_to_spree_stock_location.spree.rb new file mode 100644 index 0000000..7211952 --- /dev/null +++ b/db/migrate/20181125224105_add_propage_all_variants_to_spree_stock_location.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20130516151222) +class AddPropageAllVariantsToSpreeStockLocation < ActiveRecord::Migration[4.2] + def change + add_column :spree_stock_locations, :propagate_all_variants, :boolean, default: true + end +end diff --git a/db/migrate/20181125224106_rename_shipping_methods_zones_to_spree_shipping_methods_zones.spree.rb b/db/migrate/20181125224106_rename_shipping_methods_zones_to_spree_shipping_methods_zones.spree.rb new file mode 100644 index 0000000..243375f --- /dev/null +++ b/db/migrate/20181125224106_rename_shipping_methods_zones_to_spree_shipping_methods_zones.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20130611054351) +class RenameShippingMethodsZonesToSpreeShippingMethodsZones < ActiveRecord::Migration[4.2] + def change + rename_table :shipping_methods_zones, :spree_shipping_methods_zones + end +end diff --git a/db/migrate/20181125224107_add_user_id_index_to_spree_orders.spree.rb b/db/migrate/20181125224107_add_user_id_index_to_spree_orders.spree.rb new file mode 100644 index 0000000..0993e96 --- /dev/null +++ b/db/migrate/20181125224107_add_user_id_index_to_spree_orders.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20130611185927) +class AddUserIdIndexToSpreeOrders < ActiveRecord::Migration[4.2] + def change + add_index :spree_orders, :user_id + end +end diff --git a/db/migrate/20181125224108_add_updated_at_to_spree_countries.spree.rb b/db/migrate/20181125224108_add_updated_at_to_spree_countries.spree.rb new file mode 100644 index 0000000..fdc7c20 --- /dev/null +++ b/db/migrate/20181125224108_add_updated_at_to_spree_countries.spree.rb @@ -0,0 +1,10 @@ +# This migration comes from spree (originally 20130618041418) +class AddUpdatedAtToSpreeCountries < ActiveRecord::Migration[4.2] + def up + add_column :spree_countries, :updated_at, :datetime + end + + def down + remove_column :spree_countries, :updated_at + end +end diff --git a/db/migrate/20181125224109_add_updated_at_to_spree_states.spree.rb b/db/migrate/20181125224109_add_updated_at_to_spree_states.spree.rb new file mode 100644 index 0000000..d9eaa65 --- /dev/null +++ b/db/migrate/20181125224109_add_updated_at_to_spree_states.spree.rb @@ -0,0 +1,10 @@ +# This migration comes from spree (originally 20130619012236) +class AddUpdatedAtToSpreeStates < ActiveRecord::Migration[4.2] + def up + add_column :spree_states, :updated_at, :datetime + end + + def down + remove_column :spree_states, :updated_at + end +end diff --git a/db/migrate/20181125224110_add_cvv_result_code_and_cvv_result_message_to_spree_payments.spree.rb b/db/migrate/20181125224110_add_cvv_result_code_and_cvv_result_message_to_spree_payments.spree.rb new file mode 100644 index 0000000..5bdea3d --- /dev/null +++ b/db/migrate/20181125224110_add_cvv_result_code_and_cvv_result_message_to_spree_payments.spree.rb @@ -0,0 +1,7 @@ +# This migration comes from spree (originally 20130626232741) +class AddCvvResultCodeAndCvvResultMessageToSpreePayments < ActiveRecord::Migration[4.2] + def change + add_column :spree_payments, :cvv_response_code, :string + add_column :spree_payments, :cvv_response_message, :string + end +end diff --git a/db/migrate/20181125224111_add_unique_index_to_permalink_on_spree_products.spree.rb b/db/migrate/20181125224111_add_unique_index_to_permalink_on_spree_products.spree.rb new file mode 100644 index 0000000..43bd037 --- /dev/null +++ b/db/migrate/20181125224111_add_unique_index_to_permalink_on_spree_products.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20130628021056) +class AddUniqueIndexToPermalinkOnSpreeProducts < ActiveRecord::Migration[4.2] + def change + add_index "spree_products", ["permalink"], name: "permalink_idx_unique", unique: true + end +end diff --git a/db/migrate/20181125224112_add_unique_index_to_orders_shipments_and_stock_transfers.spree.rb b/db/migrate/20181125224112_add_unique_index_to_orders_shipments_and_stock_transfers.spree.rb new file mode 100644 index 0000000..18955f9 --- /dev/null +++ b/db/migrate/20181125224112_add_unique_index_to_orders_shipments_and_stock_transfers.spree.rb @@ -0,0 +1,8 @@ +# This migration comes from spree (originally 20130628022817) +class AddUniqueIndexToOrdersShipmentsAndStockTransfers < ActiveRecord::Migration[4.2] + def add + add_index "spree_orders", ["number"], name: "number_idx_unique", unique: true + add_index "spree_shipments", ["number"], name: "number_idx_unique", unique: true + add_index "spree_stock_transfers", ["number"], name: "number_idx_unique", unique: true + end +end diff --git a/db/migrate/20181125224113_add_deleted_at_to_spree_tax_rates.spree.rb b/db/migrate/20181125224113_add_deleted_at_to_spree_tax_rates.spree.rb new file mode 100644 index 0000000..e742f76 --- /dev/null +++ b/db/migrate/20181125224113_add_deleted_at_to_spree_tax_rates.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20130708052307) +class AddDeletedAtToSpreeTaxRates < ActiveRecord::Migration[4.2] + def change + add_column :spree_tax_rates, :deleted_at, :datetime + end +end diff --git a/db/migrate/20181125224114_remove_lock_version_from_inventory_units.spree.rb b/db/migrate/20181125224114_remove_lock_version_from_inventory_units.spree.rb new file mode 100644 index 0000000..cac6f7a --- /dev/null +++ b/db/migrate/20181125224114_remove_lock_version_from_inventory_units.spree.rb @@ -0,0 +1,7 @@ +# This migration comes from spree (originally 20130711200933) +class RemoveLockVersionFromInventoryUnits < ActiveRecord::Migration[4.2] + def change + # we are moving to pessimistic locking on stock_items + remove_column :spree_inventory_units, :lock_version + end +end diff --git a/db/migrate/20181125224115_add_cost_price_to_line_item.spree.rb b/db/migrate/20181125224115_add_cost_price_to_line_item.spree.rb new file mode 100644 index 0000000..ff33d37 --- /dev/null +++ b/db/migrate/20181125224115_add_cost_price_to_line_item.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20130718042445) +class AddCostPriceToLineItem < ActiveRecord::Migration[4.2] + def change + add_column :spree_line_items, :cost_price, :decimal, precision: 8, scale: 2 + end +end diff --git a/db/migrate/20181125224116_set_backorderable_to_default_to_false.spree.rb b/db/migrate/20181125224116_set_backorderable_to_default_to_false.spree.rb new file mode 100644 index 0000000..6e1edea --- /dev/null +++ b/db/migrate/20181125224116_set_backorderable_to_default_to_false.spree.rb @@ -0,0 +1,7 @@ +# This migration comes from spree (originally 20130718233855) +class SetBackorderableToDefaultToFalse < ActiveRecord::Migration[4.2] + def change + change_column :spree_stock_items, :backorderable, :boolean, default: false + change_column :spree_stock_locations, :backorderable_default, :boolean, default: false + end +end diff --git a/db/migrate/20181125224117_add_created_by_id_to_spree_orders.spree.rb b/db/migrate/20181125224117_add_created_by_id_to_spree_orders.spree.rb new file mode 100644 index 0000000..287ed57 --- /dev/null +++ b/db/migrate/20181125224117_add_created_by_id_to_spree_orders.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20130725031716) +class AddCreatedByIdToSpreeOrders < ActiveRecord::Migration[4.2] + def change + add_column :spree_orders, :created_by_id, :integer + end +end diff --git a/db/migrate/20181125224118_index_completed_at_on_spree_orders.spree.rb b/db/migrate/20181125224118_index_completed_at_on_spree_orders.spree.rb new file mode 100644 index 0000000..ac0ba38 --- /dev/null +++ b/db/migrate/20181125224118_index_completed_at_on_spree_orders.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20130729214043) +class IndexCompletedAtOnSpreeOrders < ActiveRecord::Migration[4.2] + def change + add_index :spree_orders, :completed_at + end +end diff --git a/db/migrate/20181125224119_add_tax_category_id_to_spree_line_items.spree.rb b/db/migrate/20181125224119_add_tax_category_id_to_spree_line_items.spree.rb new file mode 100644 index 0000000..fded241 --- /dev/null +++ b/db/migrate/20181125224119_add_tax_category_id_to_spree_line_items.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20130802014537) +class AddTaxCategoryIdToSpreeLineItems < ActiveRecord::Migration[4.2] + def change + add_column :spree_line_items, :tax_category_id, :integer + end +end diff --git a/db/migrate/20181125224120_migrate_tax_categories_to_line_items.spree.rb b/db/migrate/20181125224120_migrate_tax_categories_to_line_items.spree.rb new file mode 100644 index 0000000..38b3c0c --- /dev/null +++ b/db/migrate/20181125224120_migrate_tax_categories_to_line_items.spree.rb @@ -0,0 +1,11 @@ +# This migration comes from spree (originally 20130802022321) +class MigrateTaxCategoriesToLineItems < ActiveRecord::Migration[4.2] + def change + Spree::LineItem.find_each do |line_item| + next if line_item.variant.nil? + next if line_item.variant.product.nil? + next if line_item.product.nil? + line_item.update_column(:tax_category_id, line_item.product.tax_category_id) + end + end +end diff --git a/db/migrate/20181125224121_drop_spree_mail_methods.spree.rb b/db/migrate/20181125224121_drop_spree_mail_methods.spree.rb new file mode 100644 index 0000000..3fdc655 --- /dev/null +++ b/db/migrate/20181125224121_drop_spree_mail_methods.spree.rb @@ -0,0 +1,13 @@ +# This migration comes from spree (originally 20130806022521) +class DropSpreeMailMethods < ActiveRecord::Migration[4.2] + def up + drop_table :spree_mail_methods + end + + def down + create_table(:spree_mail_methods) do |t| + t.string :environment + t.boolean :active + end + end +end diff --git a/db/migrate/20181125224122_set_default_stock_location_on_shipments.spree.rb b/db/migrate/20181125224122_set_default_stock_location_on_shipments.spree.rb new file mode 100644 index 0000000..6a4d6d6 --- /dev/null +++ b/db/migrate/20181125224122_set_default_stock_location_on_shipments.spree.rb @@ -0,0 +1,9 @@ +# This migration comes from spree (originally 20130806145853) +class SetDefaultStockLocationOnShipments < ActiveRecord::Migration[4.2] + def change + if Spree::Shipment.where('stock_location_id IS NULL').count > 0 + location = Spree::StockLocation.find_by(name: 'default') || Spree::StockLocation.first + Spree::Shipment.where('stock_location_id IS NULL').update_all(stock_location_id: location.id) + end + end +end diff --git a/db/migrate/20181125224123_upgrade_adjustments.spree.rb b/db/migrate/20181125224123_upgrade_adjustments.spree.rb new file mode 100644 index 0000000..895ed65 --- /dev/null +++ b/db/migrate/20181125224123_upgrade_adjustments.spree.rb @@ -0,0 +1,47 @@ +# This migration comes from spree (originally 20130807024301) +class UpgradeAdjustments < ActiveRecord::Migration[4.2] + def up + # Add Temporary index + add_index :spree_adjustments, :originator_type unless index_exists?(:spree_adjustments, :originator_type) + + # Temporarily make originator association available + Spree::Adjustment.class_eval do + belongs_to :originator, polymorphic: true + end + # Shipping adjustments are now tracked as fields on the object + Spree::Adjustment.where(source_type: "Spree::Shipment").find_each do |adjustment| + # Account for possible invalid data + next if adjustment.source.nil? + adjustment.source.update_column(:cost, adjustment.amount) + adjustment.destroy! + end + + # Tax adjustments have their sources altered + Spree::Adjustment.where(originator_type: "Spree::TaxRate").find_each do |adjustment| + adjustment.source_id = adjustment.originator_id + adjustment.source_type = "Spree::TaxRate" + adjustment.save! + end + + # Promotion adjustments have their source altered also + Spree::Adjustment.where(originator_type: "Spree::PromotionAction").find_each do |adjustment| + next if adjustment.originator.nil? + adjustment.source = adjustment.originator + begin + if adjustment.source.calculator_type == "Spree::Calculator::FreeShipping" + # Previously this was a Spree::Promotion::Actions::CreateAdjustment + # And it had a calculator to work out FreeShipping + # In Spree 2.2, the "calculator" is now the action itself. + adjustment.source.becomes(Spree::Promotion::Actions::FreeShipping) + end + rescue + # Fail silently. This is primarily in instances where the calculator no longer exists + end + + adjustment.save! + end + + # Remove Temporary index + remove_index :spree_adjustments, :originator_type if index_exists?(:spree_adjustments, :originator_type) + end +end diff --git a/db/migrate/20181125224124_rename_adjustment_fields.spree.rb b/db/migrate/20181125224124_rename_adjustment_fields.spree.rb new file mode 100644 index 0000000..885810f --- /dev/null +++ b/db/migrate/20181125224124_rename_adjustment_fields.spree.rb @@ -0,0 +1,21 @@ +# This migration comes from spree (originally 20130807024302) +class RenameAdjustmentFields < ActiveRecord::Migration[4.2] + def up + # Add Temporary index + add_index :spree_adjustments, :adjustable_type unless index_exists?(:spree_adjustments, :adjustable_type) + + remove_column :spree_adjustments, :originator_id + remove_column :spree_adjustments, :originator_type + + add_column :spree_adjustments, :order_id, :integer unless column_exists?(:spree_adjustments, :order_id) + + # This enables the Spree::Order#all_adjustments association to work correctly + Spree::Adjustment.reset_column_information + Spree::Adjustment.where(adjustable_type: "Spree::Order").find_each do |adjustment| + adjustment.update_column(:order_id, adjustment.adjustable_id) + end + + # Remove Temporary index + remove_index :spree_adjustments, :adjustable_type if index_exists?(:spree_adjustments, :adjustable_type) + end +end diff --git a/db/migrate/20181125224125_add_admin_name_column_to_spree_shipping_methods.spree.rb b/db/migrate/20181125224125_add_admin_name_column_to_spree_shipping_methods.spree.rb new file mode 100644 index 0000000..bbf68a0 --- /dev/null +++ b/db/migrate/20181125224125_add_admin_name_column_to_spree_shipping_methods.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20130809164245) +class AddAdminNameColumnToSpreeShippingMethods < ActiveRecord::Migration[4.2] + def change + add_column :spree_shipping_methods, :admin_name, :string + end +end diff --git a/db/migrate/20181125224126_add_admin_name_column_to_spree_stock_locations.spree.rb b/db/migrate/20181125224126_add_admin_name_column_to_spree_stock_locations.spree.rb new file mode 100644 index 0000000..aeba3be --- /dev/null +++ b/db/migrate/20181125224126_add_admin_name_column_to_spree_stock_locations.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20130809164330) +class AddAdminNameColumnToSpreeStockLocations < ActiveRecord::Migration[4.2] + def change + add_column :spree_stock_locations, :admin_name, :string + end +end diff --git a/db/migrate/20181125224127_add_shipment_total_to_spree_orders.spree.rb b/db/migrate/20181125224127_add_shipment_total_to_spree_orders.spree.rb new file mode 100644 index 0000000..4c9fa88 --- /dev/null +++ b/db/migrate/20181125224127_add_shipment_total_to_spree_orders.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20130813004002) +class AddShipmentTotalToSpreeOrders < ActiveRecord::Migration[4.2] + def change + add_column :spree_orders, :shipment_total, :decimal, precision: 10, scale: 2, default: 0.0, null: false + end +end diff --git a/db/migrate/20181125224128_expand_order_number_size.spree.rb b/db/migrate/20181125224128_expand_order_number_size.spree.rb new file mode 100644 index 0000000..56640de --- /dev/null +++ b/db/migrate/20181125224128_expand_order_number_size.spree.rb @@ -0,0 +1,10 @@ +# This migration comes from spree (originally 20130813140619) +class ExpandOrderNumberSize < ActiveRecord::Migration[4.2] + def up + change_column :spree_orders, :number, :string, limit: 32 + end + + def down + change_column :spree_orders, :number, :string, limit: 15 + end +end diff --git a/db/migrate/20181125224129_rename_activators_to_promotions.spree.rb b/db/migrate/20181125224129_rename_activators_to_promotions.spree.rb new file mode 100644 index 0000000..92c7ac8 --- /dev/null +++ b/db/migrate/20181125224129_rename_activators_to_promotions.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20130813232134) +class RenameActivatorsToPromotions < ActiveRecord::Migration[4.2] + def change + rename_table :spree_activators, :spree_promotions + end +end diff --git a/db/migrate/20181125224130_add_adjustment_total_to_line_items.spree.rb b/db/migrate/20181125224130_add_adjustment_total_to_line_items.spree.rb new file mode 100644 index 0000000..ae500e2 --- /dev/null +++ b/db/migrate/20181125224130_add_adjustment_total_to_line_items.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20130815000406) +class AddAdjustmentTotalToLineItems < ActiveRecord::Migration[4.2] + def change + add_column :spree_line_items, :adjustment_total, :decimal, precision: 10, scale: 2, default: 0.0 + end +end diff --git a/db/migrate/20181125224131_add_adjustment_total_to_shipments.spree.rb b/db/migrate/20181125224131_add_adjustment_total_to_shipments.spree.rb new file mode 100644 index 0000000..1d753f0 --- /dev/null +++ b/db/migrate/20181125224131_add_adjustment_total_to_shipments.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20130815024413) +class AddAdjustmentTotalToShipments < ActiveRecord::Migration[4.2] + def change + add_column :spree_shipments, :adjustment_total, :decimal, precision: 10, scale: 2, default: 0.0 + end +end diff --git a/db/migrate/20181125224132_add_depth_to_spree_taxons.spree.rb b/db/migrate/20181125224132_add_depth_to_spree_taxons.spree.rb new file mode 100644 index 0000000..edabe29 --- /dev/null +++ b/db/migrate/20181125224132_add_depth_to_spree_taxons.spree.rb @@ -0,0 +1,17 @@ +# This migration comes from spree (originally 20130826062534) +class AddDepthToSpreeTaxons < ActiveRecord::Migration[4.2] + def up + if !Spree::Taxon.column_names.include?('depth') + add_column :spree_taxons, :depth, :integer + + say_with_time 'Update depth on all taxons' do + Spree::Taxon.reset_column_information + Spree::Taxon.all.each { |t| t.save } + end + end + end + + def down + remove_column :spree_taxons, :depth + end +end diff --git a/db/migrate/20181125224133_add_tax_total_to_line_items_shipments_and_orders.spree.rb b/db/migrate/20181125224133_add_tax_total_to_line_items_shipments_and_orders.spree.rb new file mode 100644 index 0000000..2518bd2 --- /dev/null +++ b/db/migrate/20181125224133_add_tax_total_to_line_items_shipments_and_orders.spree.rb @@ -0,0 +1,9 @@ +# This migration comes from spree (originally 20130828234942) +class AddTaxTotalToLineItemsShipmentsAndOrders < ActiveRecord::Migration[4.2] + def change + add_column :spree_line_items, :tax_total, :decimal, precision: 10, scale: 2, default: 0.0 + add_column :spree_shipments, :tax_total, :decimal, precision: 10, scale: 2, default: 0.0 + # This column may already be here from a 2.1.x migration + add_column :spree_orders, :tax_total, :decimal, precision: 10, scale: 2, default: 0.0 unless column_exists? :spree_orders, :tax_total, :decimal + end +end diff --git a/db/migrate/20181125224134_add_shipping_category_to_shipping_methods_and_products.spree.rb b/db/migrate/20181125224134_add_shipping_category_to_shipping_methods_and_products.spree.rb new file mode 100644 index 0000000..050bb5c --- /dev/null +++ b/db/migrate/20181125224134_add_shipping_category_to_shipping_methods_and_products.spree.rb @@ -0,0 +1,16 @@ +# This migration comes from spree (originally 20130830001033) +class AddShippingCategoryToShippingMethodsAndProducts < ActiveRecord::Migration[4.2] + def up + default_category = Spree::ShippingCategory.first + default_category ||= Spree::ShippingCategory.create!(name: "Default") + + Spree::ShippingMethod.all.each do |method| + method.shipping_categories << default_category if method.shipping_categories.blank? + end + + Spree::Product.where(shipping_category_id: nil).update_all(shipping_category_id: default_category.id) + end + + def down + end +end diff --git a/db/migrate/20181125224135_migrate_old_shipping_calculators.spree.rb b/db/migrate/20181125224135_migrate_old_shipping_calculators.spree.rb new file mode 100644 index 0000000..4037cb7 --- /dev/null +++ b/db/migrate/20181125224135_migrate_old_shipping_calculators.spree.rb @@ -0,0 +1,20 @@ +# This migration comes from spree (originally 20130830001159) +class MigrateOldShippingCalculators < ActiveRecord::Migration[4.2] + def up + Spree::ShippingMethod.all.each do |shipping_method| + old_calculator = shipping_method.calculator + next if old_calculator.class < Spree::ShippingCalculator # We don't want to mess with new shipping calculators + new_calculator = eval(old_calculator.class.name.sub("::Calculator::", "::Calculator::Shipping::")).new + new_calculator.preferences.keys.each do |pref| + # Preferences can't be read/set by name, you have to prefix preferred_ + pref_method = "preferred_#{pref}" + new_calculator.send("#{pref_method}=", old_calculator.send(pref_method)) + end + new_calculator.calculable = old_calculator.calculable + new_calculator.save + end + end + + def down + end +end diff --git a/db/migrate/20181125224136_add_code_to_spree_promotion_rules.spree.rb b/db/migrate/20181125224136_add_code_to_spree_promotion_rules.spree.rb new file mode 100644 index 0000000..b9ff423 --- /dev/null +++ b/db/migrate/20181125224136_add_code_to_spree_promotion_rules.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20130903183026) +class AddCodeToSpreePromotionRules < ActiveRecord::Migration[4.2] + def change + add_column :spree_promotion_rules, :code, :string + end +end diff --git a/db/migrate/20181125224137_change_states_required_for_countries.spree.rb b/db/migrate/20181125224137_change_states_required_for_countries.spree.rb new file mode 100644 index 0000000..4f74d35 --- /dev/null +++ b/db/migrate/20181125224137_change_states_required_for_countries.spree.rb @@ -0,0 +1,10 @@ +# This migration comes from spree (originally 20130909115621) +class ChangeStatesRequiredForCountries < ActiveRecord::Migration[4.2] + def up + change_column_default :spree_countries, :states_required, false + end + + def down + change_column_default :spree_countries, :states_required, true + end +end diff --git a/db/migrate/20181125224138_add_deleted_at_to_spree_stock_items.spree.rb b/db/migrate/20181125224138_add_deleted_at_to_spree_stock_items.spree.rb new file mode 100644 index 0000000..57bdb41 --- /dev/null +++ b/db/migrate/20181125224138_add_deleted_at_to_spree_stock_items.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20130915032339) +class AddDeletedAtToSpreeStockItems < ActiveRecord::Migration[4.2] + def change + add_column :spree_stock_items, :deleted_at, :datetime + end +end diff --git a/db/migrate/20181125224139_remove_promotions_event_name_field.spree.rb b/db/migrate/20181125224139_remove_promotions_event_name_field.spree.rb new file mode 100644 index 0000000..7013858 --- /dev/null +++ b/db/migrate/20181125224139_remove_promotions_event_name_field.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20130917024658) +class RemovePromotionsEventNameField < ActiveRecord::Migration[4.2] + def change + remove_column :spree_promotions, :event_name, :string + end +end diff --git a/db/migrate/20181125224140_add_promo_total_to_line_items_and_shipments_and_orders.spree.rb b/db/migrate/20181125224140_add_promo_total_to_line_items_and_shipments_and_orders.spree.rb new file mode 100644 index 0000000..18ba89d --- /dev/null +++ b/db/migrate/20181125224140_add_promo_total_to_line_items_and_shipments_and_orders.spree.rb @@ -0,0 +1,8 @@ +# This migration comes from spree (originally 20130924040529) +class AddPromoTotalToLineItemsAndShipmentsAndOrders < ActiveRecord::Migration[4.2] + def change + add_column :spree_line_items, :promo_total, :decimal, precision: 10, scale: 2, default: 0.0 + add_column :spree_shipments, :promo_total, :decimal, precision: 10, scale: 2, default: 0.0 + add_column :spree_orders, :promo_total, :decimal, precision: 10, scale: 2, default: 0.0 + end +end diff --git a/db/migrate/20181125224141_remove_unused_credit_card_fields.spree.rb b/db/migrate/20181125224141_remove_unused_credit_card_fields.spree.rb new file mode 100644 index 0000000..ecac20a --- /dev/null +++ b/db/migrate/20181125224141_remove_unused_credit_card_fields.spree.rb @@ -0,0 +1,17 @@ +# This migration comes from spree (originally 20131001013410) +class RemoveUnusedCreditCardFields < ActiveRecord::Migration[4.2] + def up + remove_column :spree_credit_cards, :start_month if column_exists?(:spree_credit_cards, :start_month) + remove_column :spree_credit_cards, :start_year if column_exists?(:spree_credit_cards, :start_year) + remove_column :spree_credit_cards, :issue_number if column_exists?(:spree_credit_cards, :issue_number) + end + def down + add_column :spree_credit_cards, :start_month, :string + add_column :spree_credit_cards, :start_year, :string + add_column :spree_credit_cards, :issue_number, :string + end + + def column_exists?(table, column) + ApplicationRecord.connection.column_exists?(table, column) + end +end diff --git a/db/migrate/20181125224142_add_track_inventory_to_variant.spree.rb b/db/migrate/20181125224142_add_track_inventory_to_variant.spree.rb new file mode 100644 index 0000000..8ec5187 --- /dev/null +++ b/db/migrate/20181125224142_add_track_inventory_to_variant.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20131026154747) +class AddTrackInventoryToVariant < ActiveRecord::Migration[4.2] + def change + add_column :spree_variants, :track_inventory, :boolean, default: true + end +end diff --git a/db/migrate/20181125224143_add_tax_category_to_variants.spree.rb b/db/migrate/20181125224143_add_tax_category_to_variants.spree.rb new file mode 100644 index 0000000..deb415c --- /dev/null +++ b/db/migrate/20181125224143_add_tax_category_to_variants.spree.rb @@ -0,0 +1,7 @@ +# This migration comes from spree (originally 20131107132123) +class AddTaxCategoryToVariants < ActiveRecord::Migration[4.2] + def change + add_column :spree_variants, :tax_category_id, :integer + add_index :spree_variants, :tax_category_id + end +end diff --git a/db/migrate/20181125224144_add_channel_to_spree_orders.spree.rb b/db/migrate/20181125224144_add_channel_to_spree_orders.spree.rb new file mode 100644 index 0000000..af11d70 --- /dev/null +++ b/db/migrate/20181125224144_add_channel_to_spree_orders.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20131113035136) +class AddChannelToSpreeOrders < ActiveRecord::Migration[4.2] + def change + add_column :spree_orders, :channel, :string, default: "spree" + end +end diff --git a/db/migrate/20181125224145_add_included_to_adjustments.spree.rb b/db/migrate/20181125224145_add_included_to_adjustments.spree.rb new file mode 100644 index 0000000..cbcbc5b --- /dev/null +++ b/db/migrate/20181125224145_add_included_to_adjustments.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20131118043959) +class AddIncludedToAdjustments < ActiveRecord::Migration[4.2] + def change + add_column :spree_adjustments, :included, :boolean, default: false unless Spree::Adjustment.column_names.include?("included") + end +end diff --git a/db/migrate/20181125224146_rename_tax_total_fields.spree.rb b/db/migrate/20181125224146_rename_tax_total_fields.spree.rb new file mode 100644 index 0000000..50287a7 --- /dev/null +++ b/db/migrate/20181125224146_rename_tax_total_fields.spree.rb @@ -0,0 +1,12 @@ +# This migration comes from spree (originally 20131118050234) +class RenameTaxTotalFields < ActiveRecord::Migration[4.2] + def change + rename_column :spree_line_items, :tax_total, :additional_tax_total + rename_column :spree_shipments, :tax_total, :additional_tax_total + rename_column :spree_orders, :tax_total, :additional_tax_total + + add_column :spree_line_items, :included_tax_total, :decimal, precision: 10, scale: 2, null: false, default: 0.0 + add_column :spree_shipments, :included_tax_total, :decimal, precision: 10, scale: 2, null: false, default: 0.0 + add_column :spree_orders, :included_tax_total, :decimal, precision: 10, scale: 2, null: false, default: 0.0 + end +end diff --git a/db/migrate/20181125224147_add_line_item_id_to_spree_inventory_units.spree.rb b/db/migrate/20181125224147_add_line_item_id_to_spree_inventory_units.spree.rb new file mode 100644 index 0000000..a1db268 --- /dev/null +++ b/db/migrate/20181125224147_add_line_item_id_to_spree_inventory_units.spree.rb @@ -0,0 +1,22 @@ +# This migration comes from spree (originally 20131118183431) +class AddLineItemIdToSpreeInventoryUnits < ActiveRecord::Migration[4.2] + def change + # Stores running the product-assembly extension already have a line_item_id column + unless column_exists? Spree::InventoryUnit.table_name, :line_item_id + add_column :spree_inventory_units, :line_item_id, :integer + add_index :spree_inventory_units, :line_item_id + + shipments = Spree::Shipment.includes(:inventory_units, :order) + + shipments.find_each do |shipment| + shipment.inventory_units.group_by(&:variant_id).each do |variant_id, units| + + line_item = shipment.order.line_items.find_by(variant_id: variant_id) + next unless line_item + + Spree::InventoryUnit.where(id: units.map(&:id)).update_all(line_item_id: line_item.id) + end + end + end + end +end diff --git a/db/migrate/20181125224148_add_updated_at_to_variants.spree.rb b/db/migrate/20181125224148_add_updated_at_to_variants.spree.rb new file mode 100644 index 0000000..b636468 --- /dev/null +++ b/db/migrate/20181125224148_add_updated_at_to_variants.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20131120234456) +class AddUpdatedAtToVariants < ActiveRecord::Migration[4.2] + def change + add_column :spree_variants, :updated_at, :datetime + end +end diff --git a/db/migrate/20181125224149_add_position_to_classifications.spree.rb b/db/migrate/20181125224149_add_position_to_classifications.spree.rb new file mode 100644 index 0000000..071adb0 --- /dev/null +++ b/db/migrate/20181125224149_add_position_to_classifications.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20131127001002) +class AddPositionToClassifications < ActiveRecord::Migration[4.2] + def change + add_column :spree_products_taxons, :position, :integer + end +end diff --git a/db/migrate/20181125224150_create_spree_orders_promotions.spree.rb b/db/migrate/20181125224150_create_spree_orders_promotions.spree.rb new file mode 100644 index 0000000..5ec87b6 --- /dev/null +++ b/db/migrate/20181125224150_create_spree_orders_promotions.spree.rb @@ -0,0 +1,9 @@ +# This migration comes from spree (originally 20131211112807) +class CreateSpreeOrdersPromotions < ActiveRecord::Migration[4.2] + def change + create_table :spree_orders_promotions, id: false do |t| + t.references :order + t.references :promotion + end + end +end diff --git a/db/migrate/20181125224151_unique_shipping_method_categories.spree.rb b/db/migrate/20181125224151_unique_shipping_method_categories.spree.rb new file mode 100644 index 0000000..9cb0011 --- /dev/null +++ b/db/migrate/20181125224151_unique_shipping_method_categories.spree.rb @@ -0,0 +1,25 @@ +# This migration comes from spree (originally 20131211192741) +class UniqueShippingMethodCategories < ActiveRecord::Migration[4.2] + def change + klass = Spree::ShippingMethodCategory + columns = %w[shipping_category_id shipping_method_id] + + say "Find duplicate #{klass} records" + duplicates = klass. + select((columns + %w[COUNT(*)]).join(',')). + group(columns.join(',')). + having('COUNT(*) > 1'). + map { |row| row.attributes.slice(*columns) } + + say "Delete all but the oldest duplicate #{klass} record" + duplicates.each do |conditions| + klass.where(conditions).order(:created_at).drop(1).each(&:destroy) + end + + say "Add unique index to #{klass.table_name} for #{columns.inspect}" + add_index klass.table_name, columns, unique: true, name: 'unique_spree_shipping_method_categories' + + say "Remove redundant simple index on #{klass.table_name}" + remove_index klass.table_name, name: 'index_spree_shipping_method_categories_on_shipping_category_id' + end +end diff --git a/db/migrate/20181125224152_add_item_count_to_spree_orders.spree.rb b/db/migrate/20181125224152_add_item_count_to_spree_orders.spree.rb new file mode 100644 index 0000000..10bfb29 --- /dev/null +++ b/db/migrate/20181125224152_add_item_count_to_spree_orders.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20131218054603) +class AddItemCountToSpreeOrders < ActiveRecord::Migration[4.2] + def change + add_column :spree_orders, :item_count, :integer, default: 0 + end +end diff --git a/db/migrate/20181125224153_remove_value_type_from_spree_preferences.spree.rb b/db/migrate/20181125224153_remove_value_type_from_spree_preferences.spree.rb new file mode 100644 index 0000000..be6ccc5 --- /dev/null +++ b/db/migrate/20181125224153_remove_value_type_from_spree_preferences.spree.rb @@ -0,0 +1,9 @@ +# This migration comes from spree (originally 20140106065820) +class RemoveValueTypeFromSpreePreferences < ActiveRecord::Migration[4.2] + def up + remove_column :spree_preferences, :value_type + end + def down + raise ActiveRecord::IrreversableMigration + end +end diff --git a/db/migrate/20181125224154_rename_permalink_to_slug_for_products.spree.rb b/db/migrate/20181125224154_rename_permalink_to_slug_for_products.spree.rb new file mode 100644 index 0000000..c94c754 --- /dev/null +++ b/db/migrate/20181125224154_rename_permalink_to_slug_for_products.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20140106224208) +class RenamePermalinkToSlugForProducts < ActiveRecord::Migration[4.2] + def change + rename_column :spree_products, :permalink, :slug + end +end diff --git a/db/migrate/20181125224155_add_index_to_variant_id_and_currency_on_prices.spree.rb b/db/migrate/20181125224155_add_index_to_variant_id_and_currency_on_prices.spree.rb new file mode 100644 index 0000000..bcaeb19 --- /dev/null +++ b/db/migrate/20181125224155_add_index_to_variant_id_and_currency_on_prices.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20140120160805) +class AddIndexToVariantIdAndCurrencyOnPrices < ActiveRecord::Migration[4.2] + def change + add_index :spree_prices, [:variant_id, :currency] + end +end diff --git a/db/migrate/20181125224156_rename_activator_id_in_rules_and_actions_to_promotion_id.spree.rb b/db/migrate/20181125224156_rename_activator_id_in_rules_and_actions_to_promotion_id.spree.rb new file mode 100644 index 0000000..1622c21 --- /dev/null +++ b/db/migrate/20181125224156_rename_activator_id_in_rules_and_actions_to_promotion_id.spree.rb @@ -0,0 +1,7 @@ +# This migration comes from spree (originally 20140124023232) +class RenameActivatorIdInRulesAndActionsToPromotionId < ActiveRecord::Migration[4.2] + def change + rename_column :spree_promotion_rules, :activator_id, :promotion_id + rename_column :spree_promotion_actions, :activator_id, :promotion_id + end +end diff --git a/db/migrate/20181125224157_add_deleted_at_to_spree_prices.spree.rb b/db/migrate/20181125224157_add_deleted_at_to_spree_prices.spree.rb new file mode 100644 index 0000000..5e27097 --- /dev/null +++ b/db/migrate/20181125224157_add_deleted_at_to_spree_prices.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20140129024326) +class AddDeletedAtToSpreePrices < ActiveRecord::Migration[4.2] + def change + add_column :spree_prices, :deleted_at, :datetime + end +end diff --git a/db/migrate/20181125224158_add_approver_id_and_approved_at_to_orders.spree.rb b/db/migrate/20181125224158_add_approver_id_and_approved_at_to_orders.spree.rb new file mode 100644 index 0000000..17a6d74 --- /dev/null +++ b/db/migrate/20181125224158_add_approver_id_and_approved_at_to_orders.spree.rb @@ -0,0 +1,7 @@ +# This migration comes from spree (originally 20140203161722) +class AddApproverIdAndApprovedAtToOrders < ActiveRecord::Migration[4.2] + def change + add_column :spree_orders, :approver_id, :integer + add_column :spree_orders, :approved_at, :datetime + end +end diff --git a/db/migrate/20181125224159_add_confirmation_delivered_to_spree_orders.spree.rb b/db/migrate/20181125224159_add_confirmation_delivered_to_spree_orders.spree.rb new file mode 100644 index 0000000..7cc83de --- /dev/null +++ b/db/migrate/20181125224159_add_confirmation_delivered_to_spree_orders.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20140204115338) +class AddConfirmationDeliveredToSpreeOrders < ActiveRecord::Migration[4.2] + def change + add_column :spree_orders, :confirmation_delivered, :boolean, default: false + end +end diff --git a/db/migrate/20181125224160_add_auto_capture_to_payment_methods.spree.rb b/db/migrate/20181125224160_add_auto_capture_to_payment_methods.spree.rb new file mode 100644 index 0000000..9a158df --- /dev/null +++ b/db/migrate/20181125224160_add_auto_capture_to_payment_methods.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20140204192230) +class AddAutoCaptureToPaymentMethods < ActiveRecord::Migration[4.2] + def change + add_column :spree_payment_methods, :auto_capture, :boolean + end +end diff --git a/db/migrate/20181125224161_create_spree_payment_capture_events.spree.rb b/db/migrate/20181125224161_create_spree_payment_capture_events.spree.rb new file mode 100644 index 0000000..2a5bd9f --- /dev/null +++ b/db/migrate/20181125224161_create_spree_payment_capture_events.spree.rb @@ -0,0 +1,13 @@ +# This migration comes from spree (originally 20140205120320) +class CreateSpreePaymentCaptureEvents < ActiveRecord::Migration[4.2] + def change + create_table :spree_payment_capture_events do |t| + t.decimal :amount, precision: 10, scale: 2, default: 0.0 + t.integer :payment_id + + t.timestamps null: false + end + + add_index :spree_payment_capture_events, :payment_id + end +end diff --git a/db/migrate/20181125224162_add_uncaptured_amount_to_payments.spree.rb b/db/migrate/20181125224162_add_uncaptured_amount_to_payments.spree.rb new file mode 100644 index 0000000..35ab2f0 --- /dev/null +++ b/db/migrate/20181125224162_add_uncaptured_amount_to_payments.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20140205144710) +class AddUncapturedAmountToPayments < ActiveRecord::Migration[4.2] + def change + add_column :spree_payments, :uncaptured_amount, :decimal, precision: 10, scale: 2, default: 0.0 + end +end diff --git a/db/migrate/20181125224163_default_variant_weight_to_zero.spree.rb b/db/migrate/20181125224163_default_variant_weight_to_zero.spree.rb new file mode 100644 index 0000000..4abecc3 --- /dev/null +++ b/db/migrate/20181125224163_default_variant_weight_to_zero.spree.rb @@ -0,0 +1,12 @@ +# This migration comes from spree (originally 20140205181631) +class DefaultVariantWeightToZero < ActiveRecord::Migration[4.2] + def up + Spree::Variant.unscoped.where(weight: nil).update_all("weight = 0.0") + + change_column :spree_variants, :weight, :decimal, precision: 8, scale: 2, default: 0.0 + end + + def down + change_column :spree_variants, :weight, :decimal, precision: 8, scale: 2 + end +end diff --git a/db/migrate/20181125224164_add_tax_category_id_to_shipping_methods.spree.rb b/db/migrate/20181125224164_add_tax_category_id_to_shipping_methods.spree.rb new file mode 100644 index 0000000..38a74b2 --- /dev/null +++ b/db/migrate/20181125224164_add_tax_category_id_to_shipping_methods.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20140207085910) +class AddTaxCategoryIdToShippingMethods < ActiveRecord::Migration[4.2] + def change + add_column :spree_shipping_methods, :tax_category_id, :integer + end +end diff --git a/db/migrate/20181125224165_add_tax_rate_id_to_shipping_rates.spree.rb b/db/migrate/20181125224165_add_tax_rate_id_to_shipping_rates.spree.rb new file mode 100644 index 0000000..caaabbe --- /dev/null +++ b/db/migrate/20181125224165_add_tax_rate_id_to_shipping_rates.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20140207093021) +class AddTaxRateIdToShippingRates < ActiveRecord::Migration[4.2] + def change + add_column :spree_shipping_rates, :tax_rate_id, :integer + end +end diff --git a/db/migrate/20181125224166_add_pre_tax_amount_to_line_items_and_shipments.spree.rb b/db/migrate/20181125224166_add_pre_tax_amount_to_line_items_and_shipments.spree.rb new file mode 100644 index 0000000..47334ba --- /dev/null +++ b/db/migrate/20181125224166_add_pre_tax_amount_to_line_items_and_shipments.spree.rb @@ -0,0 +1,7 @@ +# This migration comes from spree (originally 20140211040159) +class AddPreTaxAmountToLineItemsAndShipments < ActiveRecord::Migration[4.2] + def change + add_column :spree_line_items, :pre_tax_amount, :decimal, precision: 8, scale: 2 + add_column :spree_shipments, :pre_tax_amount, :decimal, precision: 8, scale: 2 + end +end diff --git a/db/migrate/20181125224167_add_more_indexes.spree.rb b/db/migrate/20181125224167_add_more_indexes.spree.rb new file mode 100644 index 0000000..e201e09 --- /dev/null +++ b/db/migrate/20181125224167_add_more_indexes.spree.rb @@ -0,0 +1,14 @@ +# This migration comes from spree (originally 20140213184916) +class AddMoreIndexes < ActiveRecord::Migration[4.2] + def change + add_index :spree_payment_methods, [:id, :type] + add_index :spree_calculators, [:id, :type] + add_index :spree_calculators, [:calculable_id, :calculable_type] + add_index :spree_payments, :payment_method_id + add_index :spree_promotion_actions, [:id, :type] + add_index :spree_promotion_actions, :promotion_id + add_index :spree_promotions, [:id, :type] + add_index :spree_option_values, :option_type_id + add_index :spree_shipments, :stock_location_id + end +end diff --git a/db/migrate/20181125224168_add_considered_risky_to_orders.spree.rb b/db/migrate/20181125224168_add_considered_risky_to_orders.spree.rb new file mode 100644 index 0000000..f4266fc --- /dev/null +++ b/db/migrate/20181125224168_add_considered_risky_to_orders.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20140219060952) +class AddConsideredRiskyToOrders < ActiveRecord::Migration[4.2] + def change + add_column :spree_orders, :considered_risky, :boolean, default: false + end +end diff --git a/db/migrate/20181125224169_add_preference_store_to_everything.spree.rb b/db/migrate/20181125224169_add_preference_store_to_everything.spree.rb new file mode 100644 index 0000000..4ee2793 --- /dev/null +++ b/db/migrate/20181125224169_add_preference_store_to_everything.spree.rb @@ -0,0 +1,9 @@ +# This migration comes from spree (originally 20140227112348) +class AddPreferenceStoreToEverything < ActiveRecord::Migration[4.2] + def change + add_column :spree_calculators, :preferences, :text + add_column :spree_gateways, :preferences, :text + add_column :spree_payment_methods, :preferences, :text + add_column :spree_promotion_rules, :preferences, :text + end +end diff --git a/db/migrate/20181125224170_add_user_id_to_spree_credit_cards.spree.rb b/db/migrate/20181125224170_add_user_id_to_spree_credit_cards.spree.rb new file mode 100644 index 0000000..e31c76a --- /dev/null +++ b/db/migrate/20181125224170_add_user_id_to_spree_credit_cards.spree.rb @@ -0,0 +1,14 @@ +# This migration comes from spree (originally 20140307235515) +class AddUserIdToSpreeCreditCards < ActiveRecord::Migration[4.2] + def change + unless Spree::CreditCard.column_names.include? "user_id" + add_column :spree_credit_cards, :user_id, :integer + add_index :spree_credit_cards, :user_id + end + + unless Spree::CreditCard.column_names.include? "payment_method_id" + add_column :spree_credit_cards, :payment_method_id, :integer + add_index :spree_credit_cards, :payment_method_id + end + end +end diff --git a/db/migrate/20181125224171_migrate_old_preferences.spree.rb b/db/migrate/20181125224171_migrate_old_preferences.spree.rb new file mode 100644 index 0000000..5b4c4dc --- /dev/null +++ b/db/migrate/20181125224171_migrate_old_preferences.spree.rb @@ -0,0 +1,24 @@ +# This migration comes from spree (originally 20140309023735) +class MigrateOldPreferences < ActiveRecord::Migration[4.2] + def up + migrate_preferences(Spree::Calculator) + migrate_preferences(Spree::PaymentMethod) + migrate_preferences(Spree::PromotionRule) + end + + def down + end + + private + def migrate_preferences klass + klass.reset_column_information + klass.find_each do |record| + store = Spree::Preferences::ScopedStore.new(record.class.name.underscore, record.id) + record.defined_preferences.each do |key| + value = store.fetch(key){} + record.preferences[key] = value unless value.nil? + end + record.save! + end + end +end diff --git a/db/migrate/20181125224172_create_spree_stores.spree.rb b/db/migrate/20181125224172_create_spree_stores.spree.rb new file mode 100644 index 0000000..c30ddc3 --- /dev/null +++ b/db/migrate/20181125224172_create_spree_stores.spree.rb @@ -0,0 +1,26 @@ +# This migration comes from spree (originally 20140309024355) +class CreateSpreeStores < ActiveRecord::Migration[4.2] + def change + if data_source_exists?(:spree_stores) + rename_column :spree_stores, :domains, :url + rename_column :spree_stores, :email, :mail_from_address + add_column :spree_stores, :meta_description, :text + add_column :spree_stores, :meta_keywords, :text + add_column :spree_stores, :seo_title, :string + else + create_table :spree_stores do |t| + t.string :name + t.string :url + t.text :meta_description + t.text :meta_keywords + t.string :seo_title + t.string :mail_from_address + t.string :default_currency + t.string :code + t.boolean :default, default: false, null: false + + t.timestamps null: false + end + end + end +end diff --git a/db/migrate/20181125224173_create_store_from_preferences.spree.rb b/db/migrate/20181125224173_create_store_from_preferences.spree.rb new file mode 100644 index 0000000..dd12e29 --- /dev/null +++ b/db/migrate/20181125224173_create_store_from_preferences.spree.rb @@ -0,0 +1,38 @@ +# This migration comes from spree (originally 20140309033438) +class CreateStoreFromPreferences < ActiveRecord::Migration[4.2] + def change + # workaround for spree_i18n and Store translations + Spree::Store.class_eval do + def self.translated?(name) + false + end + end + + preference_store = Spree::Preferences::Store.instance + if store = Spree::Store.where(default: true).first + store.meta_description = preference_store.get('spree/app_configuration/default_meta_description') {} + store.meta_keywords = preference_store.get('spree/app_configuration/default_meta_keywords') {} + store.seo_title = preference_store.get('spree/app_configuration/default_seo_title') {} + store.save! + else + # we set defaults for the things we now require + Spree::Store.new do |s| + s.name = preference_store.get 'spree/app_configuration/site_name' do + 'Spree Demo Site' + end + s.url = preference_store.get 'spree/app_configuration/site_url' do + 'demo.spreecommerce.org' + end + s.mail_from_address = preference_store.get 'spree/app_configuration/mails_from' do + 'spree@example.com' + end + + s.meta_description = preference_store.get('spree/app_configuration/default_meta_description') {} + s.meta_keywords = preference_store.get('spree/app_configuration/default_meta_keywords') {} + s.seo_title = preference_store.get('spree/app_configuration/default_seo_title') {} + s.default_currency = preference_store.get('spree/app_configuration/currency') {} + s.code = 'spree' + end.save! + end + end +end diff --git a/db/migrate/20181125224174_add_timestamps_to_spree_assets.spree.rb b/db/migrate/20181125224174_add_timestamps_to_spree_assets.spree.rb new file mode 100644 index 0000000..5b4a411 --- /dev/null +++ b/db/migrate/20181125224174_add_timestamps_to_spree_assets.spree.rb @@ -0,0 +1,7 @@ +# This migration comes from spree (originally 20140315053743) +class AddTimestampsToSpreeAssets < ActiveRecord::Migration[4.2] + def change + add_column :spree_assets, :created_at, :datetime + add_column :spree_assets, :updated_at, :datetime + end +end diff --git a/db/migrate/20181125224175_create_spree_taxons_promotion_rules.spree.rb b/db/migrate/20181125224175_create_spree_taxons_promotion_rules.spree.rb new file mode 100644 index 0000000..bddc695 --- /dev/null +++ b/db/migrate/20181125224175_create_spree_taxons_promotion_rules.spree.rb @@ -0,0 +1,9 @@ +# This migration comes from spree (originally 20140318191500) +class CreateSpreeTaxonsPromotionRules < ActiveRecord::Migration[4.2] + def change + create_table :spree_taxons_promotion_rules do |t| + t.references :taxon, index: true + t.references :promotion_rule, index: true + end + end +end diff --git a/db/migrate/20181125224176_add_additional_store_fields.spree.rb b/db/migrate/20181125224176_add_additional_store_fields.spree.rb new file mode 100644 index 0000000..df3e9c8 --- /dev/null +++ b/db/migrate/20181125224176_add_additional_store_fields.spree.rb @@ -0,0 +1,9 @@ +# This migration comes from spree (originally 20140331100557) +class AddAdditionalStoreFields < ActiveRecord::Migration[4.2] + def change + add_column :spree_stores, :code, :string unless column_exists?(:spree_stores, :code) + add_column :spree_stores, :default, :boolean, default: false, null: false unless column_exists?(:spree_stores, :default) + add_index :spree_stores, :code + add_index :spree_stores, :default + end +end diff --git a/db/migrate/20181125224177_add_many_missing_indexes.spree.rb b/db/migrate/20181125224177_add_many_missing_indexes.spree.rb new file mode 100644 index 0000000..9359674 --- /dev/null +++ b/db/migrate/20181125224177_add_many_missing_indexes.spree.rb @@ -0,0 +1,19 @@ +# This migration comes from spree (originally 20140410141842) +class AddManyMissingIndexes < ActiveRecord::Migration[4.2] + def change + add_index :spree_adjustments, [:adjustable_id, :adjustable_type] + add_index :spree_adjustments, :eligible + add_index :spree_adjustments, :order_id + add_index :spree_promotions, :code + add_index :spree_promotions, :expires_at + add_index :spree_states, :country_id + add_index :spree_stock_items, :deleted_at + add_index :spree_option_types, :position + add_index :spree_option_values, :position + add_index :spree_product_option_types, :option_type_id + add_index :spree_product_option_types, :product_id + add_index :spree_products_taxons, :position + add_index :spree_promotions, :starts_at + add_index :spree_stores, :url + end +end diff --git a/db/migrate/20181125224178_correct_some_polymorphic_index_and_add_more_missing.spree.rb b/db/migrate/20181125224178_correct_some_polymorphic_index_and_add_more_missing.spree.rb new file mode 100644 index 0000000..0a0564e --- /dev/null +++ b/db/migrate/20181125224178_correct_some_polymorphic_index_and_add_more_missing.spree.rb @@ -0,0 +1,67 @@ +# This migration comes from spree (originally 20140410150358) +class CorrectSomePolymorphicIndexAndAddMoreMissing < ActiveRecord::Migration[4.2] + def change + add_index :spree_addresses, :country_id + add_index :spree_addresses, :state_id + remove_index :spree_adjustments, [:source_type, :source_id] + add_index :spree_adjustments, [:source_id, :source_type] + add_index :spree_credit_cards, :address_id + add_index :spree_gateways, :active + add_index :spree_gateways, :test_mode + add_index :spree_inventory_units, :return_authorization_id + add_index :spree_line_items, :tax_category_id + add_index :spree_log_entries, [:source_id, :source_type] + add_index :spree_orders, :approver_id + add_index :spree_orders, :bill_address_id + add_index :spree_orders, :confirmation_delivered + add_index :spree_orders, :considered_risky + add_index :spree_orders, :created_by_id + add_index :spree_orders, :ship_address_id + add_index :spree_orders, :shipping_method_id + add_index :spree_orders_promotions, [:order_id, :promotion_id] + add_index :spree_payments, [:source_id, :source_type] + add_index :spree_prices, :deleted_at + add_index :spree_product_option_types, :position + add_index :spree_product_properties, :position + add_index :spree_product_properties, :property_id + add_index :spree_products, :shipping_category_id + add_index :spree_products, :tax_category_id + add_index :spree_promotion_action_line_items, :promotion_action_id + add_index :spree_promotion_action_line_items, :variant_id + add_index :spree_promotion_rules, :promotion_id + add_index :spree_promotions, :advertise + add_index :spree_return_authorizations, :number + add_index :spree_return_authorizations, :order_id + add_index :spree_return_authorizations, :stock_location_id + add_index :spree_shipments, :address_id + add_index :spree_shipping_methods, :deleted_at + add_index :spree_shipping_methods, :tax_category_id + add_index :spree_shipping_rates, :selected + add_index :spree_shipping_rates, :tax_rate_id + add_index :spree_state_changes, [:stateful_id, :stateful_type] + add_index :spree_state_changes, :user_id + add_index :spree_stock_items, :backorderable + add_index :spree_stock_locations, :active + add_index :spree_stock_locations, :backorderable_default + add_index :spree_stock_locations, :country_id + add_index :spree_stock_locations, :propagate_all_variants + add_index :spree_stock_locations, :state_id + add_index :spree_tax_categories, :deleted_at + add_index :spree_tax_categories, :is_default + add_index :spree_tax_rates, :deleted_at + add_index :spree_tax_rates, :included_in_price + add_index :spree_tax_rates, :show_rate_in_label + add_index :spree_tax_rates, :tax_category_id + add_index :spree_tax_rates, :zone_id + add_index :spree_taxonomies, :position + add_index :spree_taxons, :position + add_index :spree_trackers, :active + add_index :spree_variants, :deleted_at + add_index :spree_variants, :is_master + add_index :spree_variants, :position + add_index :spree_variants, :track_inventory + add_index :spree_zone_members, :zone_id + add_index :spree_zone_members, [:zoneable_id, :zoneable_type] + add_index :spree_zones, :default_tax + end +end diff --git a/db/migrate/20181125224179_add_user_id_created_by_id_index_to_order.spree.rb b/db/migrate/20181125224179_add_user_id_created_by_id_index_to_order.spree.rb new file mode 100644 index 0000000..21a53f4 --- /dev/null +++ b/db/migrate/20181125224179_add_user_id_created_by_id_index_to_order.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20140415041315) +class AddUserIdCreatedByIdIndexToOrder < ActiveRecord::Migration[4.2] + def change + add_index :spree_orders, [:user_id, :created_by_id] + end +end diff --git a/db/migrate/20181125224180_change_spree_price_amount_precision.spree.rb b/db/migrate/20181125224180_change_spree_price_amount_precision.spree.rb new file mode 100644 index 0000000..9efb43a --- /dev/null +++ b/db/migrate/20181125224180_change_spree_price_amount_precision.spree.rb @@ -0,0 +1,9 @@ +# This migration comes from spree (originally 20140508151342) +class ChangeSpreePriceAmountPrecision < ActiveRecord::Migration[4.2] + def change + change_column :spree_prices, :amount, :decimal, precision: 10, scale: 2 + change_column :spree_line_items, :price, :decimal, precision: 10, scale: 2 + change_column :spree_line_items, :cost_price, :decimal, precision: 10, scale: 2 + change_column :spree_variants, :cost_price, :decimal, precision: 10, scale: 2 + end +end diff --git a/db/migrate/20181125224181_add_token_to_spree_orders.spree.rb b/db/migrate/20181125224181_add_token_to_spree_orders.spree.rb new file mode 100644 index 0000000..ab6066c --- /dev/null +++ b/db/migrate/20181125224181_add_token_to_spree_orders.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20140518174634) +class AddTokenToSpreeOrders < ActiveRecord::Migration[4.2] + def change + add_column :spree_orders, :guest_token, :string + end +end diff --git a/db/migrate/20181125224182_move_order_token_from_tokenized_permission.spree.rb b/db/migrate/20181125224182_move_order_token_from_tokenized_permission.spree.rb new file mode 100644 index 0000000..67f1b9f --- /dev/null +++ b/db/migrate/20181125224182_move_order_token_from_tokenized_permission.spree.rb @@ -0,0 +1,30 @@ +# This migration comes from spree (originally 20140530024945) +class MoveOrderTokenFromTokenizedPermission < ActiveRecord::Migration[4.2] + class Spree::TokenizedPermission < Spree::Base + belongs_to :permissable, polymorphic: true + end + + def up + case Spree::Order.connection.adapter_name + when 'SQLite' + Spree::Order.has_one :tokenized_permission, as: :permissable + Spree::Order.includes(:tokenized_permission).each do |o| + o.update_column :guest_token, o.tokenized_permission.token + end + when 'Mysql2', 'MySQL' + execute "UPDATE spree_orders, spree_tokenized_permissions + SET spree_orders.guest_token = spree_tokenized_permissions.token + WHERE spree_tokenized_permissions.permissable_id = spree_orders.id + AND spree_tokenized_permissions.permissable_type = 'Spree::Order'" + else + execute "UPDATE spree_orders + SET guest_token = spree_tokenized_permissions.token + FROM spree_tokenized_permissions + WHERE spree_tokenized_permissions.permissable_id = spree_orders.id + AND spree_tokenized_permissions.permissable_type = 'Spree::Order'" + end + end + + def down + end +end diff --git a/db/migrate/20181125224183_set_shipment_total_for_users_upgrading.spree.rb b/db/migrate/20181125224183_set_shipment_total_for_users_upgrading.spree.rb new file mode 100644 index 0000000..00cc72c --- /dev/null +++ b/db/migrate/20181125224183_set_shipment_total_for_users_upgrading.spree.rb @@ -0,0 +1,11 @@ +# This migration comes from spree (originally 20140601011216) +class SetShipmentTotalForUsersUpgrading < ActiveRecord::Migration[4.2] + def up + # NOTE You might not need this at all unless you're upgrading from Spree 2.1.x + # or below. For those upgrading this should populate the Order#shipment_total + # for legacy orders + Spree::Order.complete.where('shipment_total = ?', 0).includes(:shipments).find_each do |order| + order.update_column(:shipment_total, order.shipments.sum(:cost)) + end + end +end diff --git a/db/migrate/20181125224184_drop_credit_card_first_name_and_last_name.spree.rb b/db/migrate/20181125224184_drop_credit_card_first_name_and_last_name.spree.rb new file mode 100644 index 0000000..5185ba2 --- /dev/null +++ b/db/migrate/20181125224184_drop_credit_card_first_name_and_last_name.spree.rb @@ -0,0 +1,7 @@ +# This migration comes from spree (originally 20140604135309) +class DropCreditCardFirstNameAndLastName < ActiveRecord::Migration[4.2] + def change + remove_column :spree_credit_cards, :first_name, :string + remove_column :spree_credit_cards, :last_name, :string + end +end diff --git a/db/migrate/20181125224185_add_deleted_at_to_spree_promotion_actions.spree.rb b/db/migrate/20181125224185_add_deleted_at_to_spree_promotion_actions.spree.rb new file mode 100644 index 0000000..c282023 --- /dev/null +++ b/db/migrate/20181125224185_add_deleted_at_to_spree_promotion_actions.spree.rb @@ -0,0 +1,7 @@ +# This migration comes from spree (originally 20140609201656) +class AddDeletedAtToSpreePromotionActions < ActiveRecord::Migration[4.2] + def change + add_column :spree_promotion_actions, :deleted_at, :datetime + add_index :spree_promotion_actions, :deleted_at + end +end diff --git a/db/migrate/20181125224186_remove_uncaptured_amount_from_spree_payments.spree.rb b/db/migrate/20181125224186_remove_uncaptured_amount_from_spree_payments.spree.rb new file mode 100644 index 0000000..d8dab95 --- /dev/null +++ b/db/migrate/20181125224186_remove_uncaptured_amount_from_spree_payments.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20140616202624) +class RemoveUncapturedAmountFromSpreePayments < ActiveRecord::Migration[4.2] + def change + remove_column :spree_payments, :uncaptured_amount + end +end diff --git a/db/migrate/20181125224187_create_spree_refunds.spree.rb b/db/migrate/20181125224187_create_spree_refunds.spree.rb new file mode 100644 index 0000000..cd86c50 --- /dev/null +++ b/db/migrate/20181125224187_create_spree_refunds.spree.rb @@ -0,0 +1,13 @@ +# This migration comes from spree (originally 20140625214618) +class CreateSpreeRefunds < ActiveRecord::Migration[4.2] + def change + create_table :spree_refunds do |t| + t.integer :payment_id + t.integer :return_authorization_id + t.decimal :amount, precision: 10, scale: 2, default: 0.0, null: false + t.string :transaction_id + + t.timestamps null: false + end + end +end diff --git a/db/migrate/20181125224188_create_spree_return_authorization_inventory_unit.spree.rb b/db/migrate/20181125224188_create_spree_return_authorization_inventory_unit.spree.rb new file mode 100644 index 0000000..59a38d2 --- /dev/null +++ b/db/migrate/20181125224188_create_spree_return_authorization_inventory_unit.spree.rb @@ -0,0 +1,13 @@ +# This migration comes from spree (originally 20140702140656) +class CreateSpreeReturnAuthorizationInventoryUnit < ActiveRecord::Migration[4.2] + def change + create_table :spree_return_authorization_inventory_units do |t| + t.integer :return_authorization_id + t.integer :inventory_unit_id + t.integer :exchange_variant_id + t.datetime :received_at + + t.timestamps null: false + end + end +end diff --git a/db/migrate/20181125224189_rename_return_authorization_inventory_unit_to_return_items.spree.rb b/db/migrate/20181125224189_rename_return_authorization_inventory_unit_to_return_items.spree.rb new file mode 100644 index 0000000..e4e4c04 --- /dev/null +++ b/db/migrate/20181125224189_rename_return_authorization_inventory_unit_to_return_items.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20140707125621) +class RenameReturnAuthorizationInventoryUnitToReturnItems < ActiveRecord::Migration[4.2] + def change + rename_table :spree_return_authorization_inventory_units, :spree_return_items + end +end diff --git a/db/migrate/20181125224190_backfill_line_item_pre_tax_amount.spree.rb b/db/migrate/20181125224190_backfill_line_item_pre_tax_amount.spree.rb new file mode 100644 index 0000000..57165c9 --- /dev/null +++ b/db/migrate/20181125224190_backfill_line_item_pre_tax_amount.spree.rb @@ -0,0 +1,11 @@ +# This migration comes from spree (originally 20140709160534) +class BackfillLineItemPreTaxAmount < ActiveRecord::Migration[4.2] + def change + # set pre_tax_amount to discounted_amount - included_tax_total + execute(<<-SQL) + UPDATE spree_line_items + SET pre_tax_amount = ((price * quantity) + promo_total) - included_tax_total + WHERE pre_tax_amount IS NULL; + SQL + end +end diff --git a/db/migrate/20181125224191_recreate_spree_return_authorizations.spree.rb b/db/migrate/20181125224191_recreate_spree_return_authorizations.spree.rb new file mode 100644 index 0000000..d5325d6 --- /dev/null +++ b/db/migrate/20181125224191_recreate_spree_return_authorizations.spree.rb @@ -0,0 +1,56 @@ +# This migration comes from spree (originally 20140710041921) +class RecreateSpreeReturnAuthorizations < ActiveRecord::Migration[4.2] + def up + # If the app has any legacy return authorizations then rename the table & columns and leave them there + # for the spree_legacy_return_authorizations extension to pick up with. + # Otherwise just drop the tables/columns as they are no longer used in stock spree. The spree_legacy_return_authorizations + # extension will recreate these tables for dev environments & etc as needed. + if Spree::ReturnAuthorization.exists? + rename_table :spree_return_authorizations, :spree_legacy_return_authorizations + rename_column :spree_inventory_units, :return_authorization_id, :legacy_return_authorization_id + else + drop_table :spree_return_authorizations + remove_column :spree_inventory_units, :return_authorization_id + end + + Spree::Adjustment.where(source_type: 'Spree::ReturnAuthorization').update_all(source_type: 'Spree::LegacyReturnAuthorization') + + # For now just recreate the table as it was. Future changes to the schema (including dropping "amount") will be coming in a + # separate commit. + create_table :spree_return_authorizations do |t| + t.string "number" + t.string "state" + t.decimal "amount", precision: 10, scale: 2, default: 0.0, null: false + t.integer "order_id" + t.text "reason" + t.datetime "created_at" + t.datetime "updated_at" + t.integer "stock_location_id" + end + + end + + def down + drop_table :spree_return_authorizations + + Spree::Adjustment.where(source_type: 'Spree::LegacyReturnAuthorization').update_all(source_type: 'Spree::ReturnAuthorization') + + if data_source_exists?(:spree_legacy_return_authorizations) + rename_table :spree_legacy_return_authorizations, :spree_return_authorizations + rename_column :spree_inventory_units, :legacy_return_authorization_id, :return_authorization_id + else + create_table :spree_return_authorizations do |t| + t.string "number" + t.string "state" + t.decimal "amount", precision: 10, scale: 2, default: 0.0, null: false + t.integer "order_id" + t.text "reason" + t.datetime "created_at" + t.datetime "updated_at" + t.integer "stock_location_id" + end + add_column :spree_inventory_units, :return_authorization_id, :integer, after: :shipment_id + add_index :spree_inventory_units, :return_authorization_id + end + end +end diff --git a/db/migrate/20181125224192_add_amount_fields_to_return_items.spree.rb b/db/migrate/20181125224192_add_amount_fields_to_return_items.spree.rb new file mode 100644 index 0000000..4de3e51 --- /dev/null +++ b/db/migrate/20181125224192_add_amount_fields_to_return_items.spree.rb @@ -0,0 +1,8 @@ +# This migration comes from spree (originally 20140710181204) +class AddAmountFieldsToReturnItems < ActiveRecord::Migration[4.2] + def change + add_column :spree_return_items, :pre_tax_amount, :decimal, precision: 10, scale: 2, default: 0.0, null: false + add_column :spree_return_items, :included_tax_total, :decimal, precision: 10, scale: 2, default: 0.0, null: false + add_column :spree_return_items, :additional_tax_total, :decimal, precision: 10, scale: 2, default: 0.0, null: false + end +end diff --git a/db/migrate/20181125224193_drop_return_authorization_amount.spree.rb b/db/migrate/20181125224193_drop_return_authorization_amount.spree.rb new file mode 100644 index 0000000..ed64ea2 --- /dev/null +++ b/db/migrate/20181125224193_drop_return_authorization_amount.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20140710190048) +class DropReturnAuthorizationAmount < ActiveRecord::Migration[4.2] + def change + remove_column :spree_return_authorizations, :amount + end +end diff --git a/db/migrate/20181125224194_create_spree_return_authorization_reasons.spree.rb b/db/migrate/20181125224194_create_spree_return_authorization_reasons.spree.rb new file mode 100644 index 0000000..384d3ce --- /dev/null +++ b/db/migrate/20181125224194_create_spree_return_authorization_reasons.spree.rb @@ -0,0 +1,29 @@ +# This migration comes from spree (originally 20140713140455) +class CreateSpreeReturnAuthorizationReasons < ActiveRecord::Migration[4.2] + def change + create_table :spree_return_authorization_reasons do |t| + t.string :name + t.boolean :active, default: true + t.boolean :mutable, default: true + + t.timestamps null: false + end + + reversible do |direction| + direction.up do + Spree::ReturnAuthorizationReason.create!(name: 'Better price available') + Spree::ReturnAuthorizationReason.create!(name: 'Missed estimated delivery date') + Spree::ReturnAuthorizationReason.create!(name: 'Missing parts or accessories') + Spree::ReturnAuthorizationReason.create!(name: 'Damaged/Defective') + Spree::ReturnAuthorizationReason.create!(name: 'Different from what was ordered') + Spree::ReturnAuthorizationReason.create!(name: 'Different from description') + Spree::ReturnAuthorizationReason.create!(name: 'No longer needed/wanted') + Spree::ReturnAuthorizationReason.create!(name: 'Accidental order') + Spree::ReturnAuthorizationReason.create!(name: 'Unauthorized purchase') + end + end + + add_column :spree_return_authorizations, :return_authorization_reason_id, :integer + add_index :spree_return_authorizations, :return_authorization_reason_id, name: 'index_return_authorizations_on_return_authorization_reason_id' + end +end diff --git a/db/migrate/20181125224195_create_spree_refund_reasons.spree.rb b/db/migrate/20181125224195_create_spree_refund_reasons.spree.rb new file mode 100644 index 0000000..194929b --- /dev/null +++ b/db/migrate/20181125224195_create_spree_refund_reasons.spree.rb @@ -0,0 +1,15 @@ +# This migration comes from spree (originally 20140713140527) +class CreateSpreeRefundReasons < ActiveRecord::Migration[4.2] + def change + create_table :spree_refund_reasons do |t| + t.string :name + t.boolean :active, default: true + t.boolean :mutable, default: true + + t.timestamps null: false + end + + add_column :spree_refunds, :refund_reason_id, :integer + add_index :spree_refunds, :refund_reason_id, name: 'index_refunds_on_refund_reason_id' + end +end diff --git a/db/migrate/20181125224196_rename_return_authorization_reason.spree.rb b/db/migrate/20181125224196_rename_return_authorization_reason.spree.rb new file mode 100644 index 0000000..58219b6 --- /dev/null +++ b/db/migrate/20181125224196_rename_return_authorization_reason.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20140713142214) +class RenameReturnAuthorizationReason < ActiveRecord::Migration[4.2] + def change + rename_column :spree_return_authorizations, :reason, :memo + end +end diff --git a/db/migrate/20181125224197_create_spree_promotion_categories.spree.rb b/db/migrate/20181125224197_create_spree_promotion_categories.spree.rb new file mode 100644 index 0000000..cbb31a0 --- /dev/null +++ b/db/migrate/20181125224197_create_spree_promotion_categories.spree.rb @@ -0,0 +1,12 @@ +# This migration comes from spree (originally 20140715182625) +class CreateSpreePromotionCategories < ActiveRecord::Migration[4.2] + def change + create_table :spree_promotion_categories do |t| + t.string :name + t.timestamps null: false + end + + add_column :spree_promotions, :promotion_category_id, :integer + add_index :spree_promotions, :promotion_category_id + end +end diff --git a/db/migrate/20181125224198_drop_received_at_on_return_items.spree.rb b/db/migrate/20181125224198_drop_received_at_on_return_items.spree.rb new file mode 100644 index 0000000..fbb5466 --- /dev/null +++ b/db/migrate/20181125224198_drop_received_at_on_return_items.spree.rb @@ -0,0 +1,10 @@ +# This migration comes from spree (originally 20140716204111) +class DropReceivedAtOnReturnItems < ActiveRecord::Migration[4.2] + def up + remove_column :spree_return_items, :received_at + end + + def down + add_column :spree_return_items, :received_at, :datetime + end +end diff --git a/db/migrate/20181125224199_add_reception_and_acceptance_status_to_return_items.spree.rb b/db/migrate/20181125224199_add_reception_and_acceptance_status_to_return_items.spree.rb new file mode 100644 index 0000000..491399d --- /dev/null +++ b/db/migrate/20181125224199_add_reception_and_acceptance_status_to_return_items.spree.rb @@ -0,0 +1,7 @@ +# This migration comes from spree (originally 20140716212330) +class AddReceptionAndAcceptanceStatusToReturnItems < ActiveRecord::Migration[4.2] + def change + add_column :spree_return_items, :reception_status, :string + add_column :spree_return_items, :acceptance_status, :string + end +end diff --git a/db/migrate/20181125224200_create_default_refund_reason.spree.rb b/db/migrate/20181125224200_create_default_refund_reason.spree.rb new file mode 100644 index 0000000..0a01f7f --- /dev/null +++ b/db/migrate/20181125224200_create_default_refund_reason.spree.rb @@ -0,0 +1,10 @@ +# This migration comes from spree (originally 20140717155155) +class CreateDefaultRefundReason < ActiveRecord::Migration[4.2] + def up + Spree::RefundReason.create!(name: Spree::RefundReason::RETURN_PROCESSING_REASON, mutable: false) + end + + def down + Spree::RefundReason.find_by(name: Spree::RefundReason::RETURN_PROCESSING_REASON, mutable: false).destroy + end +end diff --git a/db/migrate/20181125224201_add_default_to_spree_stock_locations.spree.rb b/db/migrate/20181125224201_add_default_to_spree_stock_locations.spree.rb new file mode 100644 index 0000000..7e5093d --- /dev/null +++ b/db/migrate/20181125224201_add_default_to_spree_stock_locations.spree.rb @@ -0,0 +1,8 @@ +# This migration comes from spree (originally 20140717185932) +class AddDefaultToSpreeStockLocations < ActiveRecord::Migration[4.2] + def change + unless column_exists? :spree_stock_locations, :default + add_column :spree_stock_locations, :default, :boolean, null: false, default: false + end + end +end diff --git a/db/migrate/20181125224202_create_spree_customer_returns.spree.rb b/db/migrate/20181125224202_create_spree_customer_returns.spree.rb new file mode 100644 index 0000000..fd1293a --- /dev/null +++ b/db/migrate/20181125224202_create_spree_customer_returns.spree.rb @@ -0,0 +1,10 @@ +# This migration comes from spree (originally 20140718133010) +class CreateSpreeCustomerReturns < ActiveRecord::Migration[4.2] + def change + create_table :spree_customer_returns do |t| + t.string :number + t.integer :stock_location_id + t.timestamps null: false + end + end +end diff --git a/db/migrate/20181125224203_add_customer_return_id_to_return_item.spree.rb b/db/migrate/20181125224203_add_customer_return_id_to_return_item.spree.rb new file mode 100644 index 0000000..dfa720c --- /dev/null +++ b/db/migrate/20181125224203_add_customer_return_id_to_return_item.spree.rb @@ -0,0 +1,7 @@ +# This migration comes from spree (originally 20140718133349) +class AddCustomerReturnIdToReturnItem < ActiveRecord::Migration[4.2] + def change + add_column :spree_return_items, :customer_return_id, :integer + add_index :spree_return_items, :customer_return_id, name: 'index_return_items_on_customer_return_id' + end +end diff --git a/db/migrate/20181125224204_create_friendly_id_slugs.spree.rb b/db/migrate/20181125224204_create_friendly_id_slugs.spree.rb new file mode 100644 index 0000000..8464fe0 --- /dev/null +++ b/db/migrate/20181125224204_create_friendly_id_slugs.spree.rb @@ -0,0 +1,16 @@ +# This migration comes from spree (originally 20140718195325) +class CreateFriendlyIdSlugs < ActiveRecord::Migration[4.2] + def change + create_table :friendly_id_slugs do |t| + t.string :slug, null: false + t.integer :sluggable_id, null: false + t.string :sluggable_type, limit: 50 + t.string :scope + t.datetime :created_at + end + add_index :friendly_id_slugs, :sluggable_id + add_index :friendly_id_slugs, [:slug, :sluggable_type] + add_index :friendly_id_slugs, [:slug, :sluggable_type, :scope], unique: true + add_index :friendly_id_slugs, :sluggable_type + end +end diff --git a/db/migrate/20181125224205_rename_spree_refund_return_authorization_id.spree.rb b/db/migrate/20181125224205_rename_spree_refund_return_authorization_id.spree.rb new file mode 100644 index 0000000..1b8b4b1 --- /dev/null +++ b/db/migrate/20181125224205_rename_spree_refund_return_authorization_id.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20140723004419) +class RenameSpreeRefundReturnAuthorizationId < ActiveRecord::Migration[4.2] + def change + rename_column :spree_refunds, :return_authorization_id, :customer_return_id + end +end diff --git a/db/migrate/20181125224206_increase_return_item_pre_tax_amount_precision.spree.rb b/db/migrate/20181125224206_increase_return_item_pre_tax_amount_precision.spree.rb new file mode 100644 index 0000000..204bf29 --- /dev/null +++ b/db/migrate/20181125224206_increase_return_item_pre_tax_amount_precision.spree.rb @@ -0,0 +1,14 @@ +# This migration comes from spree (originally 20140723152808) +class IncreaseReturnItemPreTaxAmountPrecision < ActiveRecord::Migration[4.2] + def up + change_column :spree_return_items, :pre_tax_amount, :decimal, precision: 12, scale: 4, default: 0.0, null: false + change_column :spree_return_items, :included_tax_total, :decimal, precision: 12, scale: 4, default: 0.0, null: false + change_column :spree_return_items, :additional_tax_total, :decimal, precision: 12, scale: 4, default: 0.0, null: false + end + + def down + change_column :spree_return_items, :pre_tax_amount, :decimal, precision: 10, scale: 2, default: 0.0, null: false + change_column :spree_return_items, :included_tax_total, :decimal, precision: 10, scale: 2, default: 0.0, null: false + change_column :spree_return_items, :additional_tax_total, :decimal, precision: 10, scale: 2, default: 0.0, null: false + end +end diff --git a/db/migrate/20181125224207_copy_product_slugs_to_slug_history.spree.rb b/db/migrate/20181125224207_copy_product_slugs_to_slug_history.spree.rb new file mode 100644 index 0000000..c65a9fe --- /dev/null +++ b/db/migrate/20181125224207_copy_product_slugs_to_slug_history.spree.rb @@ -0,0 +1,16 @@ +# This migration comes from spree (originally 20140723214541) +class CopyProductSlugsToSlugHistory < ActiveRecord::Migration[4.2] + def change + + # do what sql does best: copy all slugs into history table in a single query + # rather than load potentially millions of products into memory + Spree::Product.connection.execute <<-SQL +INSERT INTO #{FriendlyId::Slug.table_name} (slug, sluggable_id, sluggable_type, created_at) + SELECT slug, id, '#{Spree::Product.to_s}', #{ApplicationRecord.send(:sanitize_sql_array, ['?', Time.current])} + FROM #{Spree::Product.table_name} + WHERE slug IS NOT NULL + ORDER BY id +SQL + + end +end diff --git a/db/migrate/20181125224208_create_spree_reimbursements.spree.rb b/db/migrate/20181125224208_create_spree_reimbursements.spree.rb new file mode 100644 index 0000000..01e709f --- /dev/null +++ b/db/migrate/20181125224208_create_spree_reimbursements.spree.rb @@ -0,0 +1,22 @@ +# This migration comes from spree (originally 20140725131539) +class CreateSpreeReimbursements < ActiveRecord::Migration[4.2] + def change + create_table :spree_reimbursements do |t| + t.string :number + t.string :reimbursement_status + t.integer :customer_return_id + t.integer :order_id + t.decimal :total, precision: 10, scale: 2 + + t.timestamps null: false + end + + add_index :spree_reimbursements, :customer_return_id + add_index :spree_reimbursements, :order_id + + remove_column :spree_refunds, :customer_return_id, :integer + add_column :spree_refunds, :reimbursement_id, :integer + + add_column :spree_return_items, :reimbursement_id, :integer + end +end diff --git a/db/migrate/20181125224209_add_promotionable_to_spree_products.spree.rb b/db/migrate/20181125224209_add_promotionable_to_spree_products.spree.rb new file mode 100644 index 0000000..5b97921 --- /dev/null +++ b/db/migrate/20181125224209_add_promotionable_to_spree_products.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20140728225422) +class AddPromotionableToSpreeProducts < ActiveRecord::Migration[4.2] + def change + add_column :spree_products, :promotionable, :boolean, default: true + end +end diff --git a/db/migrate/20181125224210_add_exchange_inventory_unit_foreign_keys.spree.rb b/db/migrate/20181125224210_add_exchange_inventory_unit_foreign_keys.spree.rb new file mode 100644 index 0000000..beb5fa9 --- /dev/null +++ b/db/migrate/20181125224210_add_exchange_inventory_unit_foreign_keys.spree.rb @@ -0,0 +1,8 @@ +# This migration comes from spree (originally 20140729133613) +class AddExchangeInventoryUnitForeignKeys < ActiveRecord::Migration[4.2] + def change + add_column :spree_return_items, :exchange_inventory_unit_id, :integer + + add_index :spree_return_items, :exchange_inventory_unit_id + end +end diff --git a/db/migrate/20181125224211_add_acceptance_status_errors_to_return_item.spree.rb b/db/migrate/20181125224211_add_acceptance_status_errors_to_return_item.spree.rb new file mode 100644 index 0000000..07b92eb --- /dev/null +++ b/db/migrate/20181125224211_add_acceptance_status_errors_to_return_item.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20140730155938) +class AddAcceptanceStatusErrorsToReturnItem < ActiveRecord::Migration[4.2] + def change + add_column :spree_return_items, :acceptance_status_errors, :text + end +end diff --git a/db/migrate/20181125224212_create_spree_reimbursement_types.spree.rb b/db/migrate/20181125224212_create_spree_reimbursement_types.spree.rb new file mode 100644 index 0000000..cc5842c --- /dev/null +++ b/db/migrate/20181125224212_create_spree_reimbursement_types.spree.rb @@ -0,0 +1,21 @@ +# This migration comes from spree (originally 20140731150017) +class CreateSpreeReimbursementTypes < ActiveRecord::Migration[4.2] + def change + create_table :spree_reimbursement_types do |t| + t.string :name + t.boolean :active, default: true + t.boolean :mutable, default: true + + t.timestamps null: false + end + + reversible do |direction| + direction.up do + Spree::ReimbursementType.create!(name: Spree::ReimbursementType::ORIGINAL) + end + end + + add_column :spree_return_items, :preferred_reimbursement_type_id, :integer + add_column :spree_return_items, :override_reimbursement_type_id, :integer + end +end diff --git a/db/migrate/20181125224213_add_default_to_shipment_cost.spree.rb b/db/migrate/20181125224213_add_default_to_shipment_cost.spree.rb new file mode 100644 index 0000000..6f4c6a3 --- /dev/null +++ b/db/migrate/20181125224213_add_default_to_shipment_cost.spree.rb @@ -0,0 +1,11 @@ +# This migration comes from spree (originally 20140804185157) +class AddDefaultToShipmentCost < ActiveRecord::Migration[4.2] + def up + change_column :spree_shipments, :cost, :decimal, precision: 10, scale: 2, default: 0.0 + Spree::Shipment.where(cost: nil).update_all(cost: 0) + end + + def down + change_column :spree_shipments, :cost, :decimal, precision: 10, scale: 2 + end +end diff --git a/db/migrate/20181125224214_add_default_to_spree_credit_cards.spree.rb b/db/migrate/20181125224214_add_default_to_spree_credit_cards.spree.rb new file mode 100644 index 0000000..17e9f91 --- /dev/null +++ b/db/migrate/20181125224214_add_default_to_spree_credit_cards.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20140805171035) +class AddDefaultToSpreeCreditCards < ActiveRecord::Migration[4.2] + def change + add_column :spree_credit_cards, :default, :boolean, null: false, default: false + end +end diff --git a/db/migrate/20181125224215_make_existing_credit_cards_default.spree.rb b/db/migrate/20181125224215_make_existing_credit_cards_default.spree.rb new file mode 100644 index 0000000..4ce7f70 --- /dev/null +++ b/db/migrate/20181125224215_make_existing_credit_cards_default.spree.rb @@ -0,0 +1,11 @@ +# This migration comes from spree (originally 20140805171219) +class MakeExistingCreditCardsDefault < ActiveRecord::Migration[4.2] + def up + # set the newest credit card for every user to be the default; SQL technique from + # http://stackoverflow.com/questions/121387/fetch-the-row-which-has-the-max-value-for-a-column + Spree::CreditCard.where.not(user_id: nil).joins("LEFT OUTER JOIN spree_credit_cards cc2 ON cc2.user_id = spree_credit_cards.user_id AND spree_credit_cards.created_at < cc2.created_at").where("cc2.user_id IS NULL").update_all(default: true) + end + def down + # do nothing + end +end diff --git a/db/migrate/20181125224216_add_type_to_reimbursement_type.spree.rb b/db/migrate/20181125224216_add_type_to_reimbursement_type.spree.rb new file mode 100644 index 0000000..17b6b7b --- /dev/null +++ b/db/migrate/20181125224216_add_type_to_reimbursement_type.spree.rb @@ -0,0 +1,10 @@ +# This migration comes from spree (originally 20140806144901) +class AddTypeToReimbursementType < ActiveRecord::Migration[4.2] + def change + add_column :spree_reimbursement_types, :type, :string + add_index :spree_reimbursement_types, :type + + Spree::ReimbursementType.reset_column_information + Spree::ReimbursementType.find_by(name: Spree::ReimbursementType::ORIGINAL).update_attributes!(type: 'Spree::ReimbursementType::OriginalPayment') + end +end diff --git a/db/migrate/20181125224217_create_spree_reimbursement_credits.spree.rb b/db/migrate/20181125224217_create_spree_reimbursement_credits.spree.rb new file mode 100644 index 0000000..c49cfac --- /dev/null +++ b/db/migrate/20181125224217_create_spree_reimbursement_credits.spree.rb @@ -0,0 +1,11 @@ +# This migration comes from spree (originally 20140808184039) +class CreateSpreeReimbursementCredits < ActiveRecord::Migration[4.2] + def change + create_table :spree_reimbursement_credits do |t| + t.decimal :amount, precision: 10, scale: 2, default: 0.0, null: false + t.integer :reimbursement_id + t.integer :creditable_id + t.string :creditable_type + end + end +end diff --git a/db/migrate/20181125224218_add_meta_title_to_spree_products.spree.rb b/db/migrate/20181125224218_add_meta_title_to_spree_products.spree.rb new file mode 100644 index 0000000..1719f72 --- /dev/null +++ b/db/migrate/20181125224218_add_meta_title_to_spree_products.spree.rb @@ -0,0 +1,8 @@ +# This migration comes from spree (originally 20140827170513) +class AddMetaTitleToSpreeProducts < ActiveRecord::Migration[4.2] + def change + change_table :spree_products do |t| + t.string :meta_title + end + end +end diff --git a/db/migrate/20181125224219_add_kind_to_zone.spree.rb b/db/migrate/20181125224219_add_kind_to_zone.spree.rb new file mode 100644 index 0000000..9252cf4 --- /dev/null +++ b/db/migrate/20181125224219_add_kind_to_zone.spree.rb @@ -0,0 +1,12 @@ +# This migration comes from spree (originally 20140911173301) +class AddKindToZone < ActiveRecord::Migration[4.2] + def change + add_column :spree_zones, :kind, :string + add_index :spree_zones, :kind + + Spree::Zone.find_each do |zone| + last_type = zone.members.where.not(zoneable_type: nil).pluck(:zoneable_type).last + zone.update_column :kind, last_type.demodulize.underscore if last_type + end + end +end diff --git a/db/migrate/20181125224220_add_code_to_spree_tax_categories.spree.rb b/db/migrate/20181125224220_add_code_to_spree_tax_categories.spree.rb new file mode 100644 index 0000000..2348b93 --- /dev/null +++ b/db/migrate/20181125224220_add_code_to_spree_tax_categories.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20140924164824) +class AddCodeToSpreeTaxCategories < ActiveRecord::Migration[4.2] + def change + add_column :spree_tax_categories, :tax_code, :string + end +end diff --git a/db/migrate/20181125224221_default_pre_tax_amount_should_be_zero.spree.rb b/db/migrate/20181125224221_default_pre_tax_amount_should_be_zero.spree.rb new file mode 100644 index 0000000..247062b --- /dev/null +++ b/db/migrate/20181125224221_default_pre_tax_amount_should_be_zero.spree.rb @@ -0,0 +1,7 @@ +# This migration comes from spree (originally 20140927193717) +class DefaultPreTaxAmountShouldBeZero < ActiveRecord::Migration[4.2] + def change + change_column :spree_line_items, :pre_tax_amount, :decimal, precision: 8, scale: 2, default: 0 + change_column :spree_shipments, :pre_tax_amount, :decimal, precision: 8, scale: 2, default: 0 + end +end diff --git a/db/migrate/20181125224222_add_code_to_spree_shipping_methods.spree.rb b/db/migrate/20181125224222_add_code_to_spree_shipping_methods.spree.rb new file mode 100644 index 0000000..1a85980 --- /dev/null +++ b/db/migrate/20181125224222_add_code_to_spree_shipping_methods.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20141002191113) +class AddCodeToSpreeShippingMethods < ActiveRecord::Migration[4.2] + def change + add_column :spree_shipping_methods, :code, :string + end +end diff --git a/db/migrate/20181125224223_add_cancel_audit_fields_to_spree_orders.spree.rb b/db/migrate/20181125224223_add_cancel_audit_fields_to_spree_orders.spree.rb new file mode 100644 index 0000000..b40092a --- /dev/null +++ b/db/migrate/20181125224223_add_cancel_audit_fields_to_spree_orders.spree.rb @@ -0,0 +1,7 @@ +# This migration comes from spree (originally 20141007230328) +class AddCancelAuditFieldsToSpreeOrders < ActiveRecord::Migration[4.2] + def change + add_column :spree_orders, :canceled_at, :datetime + add_column :spree_orders, :canceler_id, :integer + end +end diff --git a/db/migrate/20181125224224_add_store_id_to_orders.spree.rb b/db/migrate/20181125224224_add_store_id_to_orders.spree.rb new file mode 100644 index 0000000..c3ddd8d --- /dev/null +++ b/db/migrate/20181125224224_add_store_id_to_orders.spree.rb @@ -0,0 +1,9 @@ +# This migration comes from spree (originally 20141009204607) +class AddStoreIdToOrders < ActiveRecord::Migration[4.2] + def change + add_column :spree_orders, :store_id, :integer + if Spree::Store.default.persisted? + Spree::Order.where(store_id: nil).update_all(store_id: Spree::Store.default.id) + end + end +end diff --git a/db/migrate/20181125224225_create_spree_taxons_prototypes.spree.rb b/db/migrate/20181125224225_create_spree_taxons_prototypes.spree.rb new file mode 100644 index 0000000..3111302 --- /dev/null +++ b/db/migrate/20181125224225_create_spree_taxons_prototypes.spree.rb @@ -0,0 +1,9 @@ +# This migration comes from spree (originally 20141012083513) +class CreateSpreeTaxonsPrototypes < ActiveRecord::Migration[4.2] + def change + create_table :spree_taxons_prototypes do |t| + t.belongs_to :taxon, index: true + t.belongs_to :prototype, index: true + end + end +end diff --git a/db/migrate/20181125224226_add_state_lock_version_to_order.spree.rb b/db/migrate/20181125224226_add_state_lock_version_to_order.spree.rb new file mode 100644 index 0000000..c739fbe --- /dev/null +++ b/db/migrate/20181125224226_add_state_lock_version_to_order.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20141021194502) +class AddStateLockVersionToOrder < ActiveRecord::Migration[4.2] + def change + add_column :spree_orders, :state_lock_version, :integer, default: 0, null: false + end +end diff --git a/db/migrate/20181125224227_add_counter_cache_from_spree_variants_to_spree_stock_items.spree.rb b/db/migrate/20181125224227_add_counter_cache_from_spree_variants_to_spree_stock_items.spree.rb new file mode 100644 index 0000000..bf3d2c8 --- /dev/null +++ b/db/migrate/20181125224227_add_counter_cache_from_spree_variants_to_spree_stock_items.spree.rb @@ -0,0 +1,9 @@ +# This migration comes from spree (originally 20141023005240) +class AddCounterCacheFromSpreeVariantsToSpreeStockItems < ActiveRecord::Migration[4.2] + # This was unnecessary and was removed + def up + end + + def down + end +end diff --git a/db/migrate/20181125224228_fix_adjustment_order_presence.spree.rb b/db/migrate/20181125224228_fix_adjustment_order_presence.spree.rb new file mode 100644 index 0000000..82e58e4 --- /dev/null +++ b/db/migrate/20181125224228_fix_adjustment_order_presence.spree.rb @@ -0,0 +1,14 @@ +# This migration comes from spree (originally 20141101231208) +class FixAdjustmentOrderPresence < ActiveRecord::Migration[4.2] + def change + say 'Fixing adjustments without direct order reference' + Spree::Adjustment.where(order: nil).find_each do |adjustment| + adjustable = adjustment.adjustable + if adjustable.is_a? Spree::Order + adjustment.update_attributes!(order_id: adjustable.id) + else + adjustment.update_attributes!(adjustable: adjustable.order) + end + end + end +end diff --git a/db/migrate/20181125224229_update_classifications_positions.spree.rb b/db/migrate/20181125224229_update_classifications_positions.spree.rb new file mode 100644 index 0000000..7c18c51 --- /dev/null +++ b/db/migrate/20181125224229_update_classifications_positions.spree.rb @@ -0,0 +1,10 @@ +# This migration comes from spree (originally 20141105213646) +class UpdateClassificationsPositions < ActiveRecord::Migration[4.2] + def up + Spree::Taxon.all.each do |taxon| + taxon.classifications.each_with_index do |c12n, i| + c12n.set_list_position(i + 1) + end + end + end +end diff --git a/db/migrate/20181125224230_add_guest_token_index_to_spree_orders.spree.rb b/db/migrate/20181125224230_add_guest_token_index_to_spree_orders.spree.rb new file mode 100644 index 0000000..f7cb22f --- /dev/null +++ b/db/migrate/20181125224230_add_guest_token_index_to_spree_orders.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20141120135441) +class AddGuestTokenIndexToSpreeOrders < ActiveRecord::Migration[4.2] + def change + add_index :spree_orders, :guest_token + end +end diff --git a/db/migrate/20181125224231_remove_token_permissions_table.spree.rb b/db/migrate/20181125224231_remove_token_permissions_table.spree.rb new file mode 100644 index 0000000..9f51ceb --- /dev/null +++ b/db/migrate/20181125224231_remove_token_permissions_table.spree.rb @@ -0,0 +1,7 @@ +# This migration comes from spree (originally 20141215232040) +class RemoveTokenPermissionsTable < ActiveRecord::Migration[4.2] + def change + # The MoveOrderTokenFromTokenizedPermission migration never dropped this. + drop_table :spree_tokenized_permissions + end +end diff --git a/db/migrate/20181125224232_remove_extra_products_slug_index.spree.rb b/db/migrate/20181125224232_remove_extra_products_slug_index.spree.rb new file mode 100644 index 0000000..f68a313 --- /dev/null +++ b/db/migrate/20181125224232_remove_extra_products_slug_index.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20141215235502) +class RemoveExtraProductsSlugIndex < ActiveRecord::Migration[4.2] + def change + remove_index :spree_products, name: :permalink_idx_unique + end +end diff --git a/db/migrate/20181125224233_update_product_slug_index.spree.rb b/db/migrate/20181125224233_update_product_slug_index.spree.rb new file mode 100644 index 0000000..4329fc5 --- /dev/null +++ b/db/migrate/20181125224233_update_product_slug_index.spree.rb @@ -0,0 +1,7 @@ +# This migration comes from spree (originally 20141217215630) +class UpdateProductSlugIndex < ActiveRecord::Migration[4.2] + def change + remove_index :spree_products, :slug if index_exists?(:spree_products, :slug) + add_index :spree_products, :slug, unique: true + end +end diff --git a/db/migrate/20181125224234_rename_identifier_to_number_for_payment.spree.rb b/db/migrate/20181125224234_rename_identifier_to_number_for_payment.spree.rb new file mode 100644 index 0000000..1c8bc97 --- /dev/null +++ b/db/migrate/20181125224234_rename_identifier_to_number_for_payment.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20141218025915) +class RenameIdentifierToNumberForPayment < ActiveRecord::Migration[4.2] + def change + rename_column :spree_payments, :identifier, :number + end +end diff --git a/db/migrate/20181125224235_create_spree_store_credits.spree.rb b/db/migrate/20181125224235_create_spree_store_credits.spree.rb new file mode 100644 index 0000000..38ab47c --- /dev/null +++ b/db/migrate/20181125224235_create_spree_store_credits.spree.rb @@ -0,0 +1,25 @@ +# This migration comes from spree (originally 20150118210639) +class CreateSpreeStoreCredits < ActiveRecord::Migration[4.2] + def change + create_table :spree_store_credits do |t| + t.references :user + t.references :category + t.references :created_by + t.decimal :amount, precision: 8, scale: 2, default: 0.0, null: false + t.decimal :amount_used, precision: 8, scale: 2, default: 0.0, null: false + t.text :memo + t.datetime :deleted_at + t.string :currency + t.decimal :amount_authorized, precision: 8, scale: 2, default: 0.0, null: false + t.integer :originator_id + t.string :originator_type + t.integer :type_id + t.timestamps null: false + end + + add_index :spree_store_credits, :deleted_at + add_index :spree_store_credits, :user_id + add_index :spree_store_credits, :type_id + add_index :spree_store_credits, [:originator_id, :originator_type], name: :spree_store_credits_originator + end +end diff --git a/db/migrate/20181125224236_create_spree_store_credit_categories.spree.rb b/db/migrate/20181125224236_create_spree_store_credit_categories.spree.rb new file mode 100644 index 0000000..d482b7c --- /dev/null +++ b/db/migrate/20181125224236_create_spree_store_credit_categories.spree.rb @@ -0,0 +1,9 @@ +# This migration comes from spree (originally 20150118211500) +class CreateSpreeStoreCreditCategories < ActiveRecord::Migration[4.2] + def change + create_table :spree_store_credit_categories do |t| + t.string :name + t.timestamps null: false + end + end +end diff --git a/db/migrate/20181125224237_create_spree_store_credit_events.spree.rb b/db/migrate/20181125224237_create_spree_store_credit_events.spree.rb new file mode 100644 index 0000000..13616ef --- /dev/null +++ b/db/migrate/20181125224237_create_spree_store_credit_events.spree.rb @@ -0,0 +1,18 @@ +# This migration comes from spree (originally 20150118212051) +class CreateSpreeStoreCreditEvents < ActiveRecord::Migration[4.2] + def change + create_table :spree_store_credit_events do |t| + t.integer :store_credit_id, null: false + t.string :action, null: false + t.decimal :amount, precision: 8, scale: 2 + t.string :authorization_code, null: false + t.decimal :user_total_amount, precision: 8, scale: 2, default: 0.0, null: false + t.integer :originator_id + t.string :originator_type + t.datetime :deleted_at + t.timestamps null: false + end + add_index :spree_store_credit_events, :store_credit_id + add_index :spree_store_credit_events, [:originator_id, :originator_type], name: :spree_store_credit_events_originator + end +end diff --git a/db/migrate/20181125224238_create_spree_store_credit_types.spree.rb b/db/migrate/20181125224238_create_spree_store_credit_types.spree.rb new file mode 100644 index 0000000..1ab0d1b --- /dev/null +++ b/db/migrate/20181125224238_create_spree_store_credit_types.spree.rb @@ -0,0 +1,11 @@ +# This migration comes from spree (originally 20150118212101) +class CreateSpreeStoreCreditTypes < ActiveRecord::Migration[4.2] + def change + create_table :spree_store_credit_types do |t| + t.string :name + t.integer :priority + t.timestamps null: false + end + add_index :spree_store_credit_types, :priority + end +end diff --git a/db/migrate/20181125224239_remove_environment_from_payment_method.spree.rb b/db/migrate/20181125224239_remove_environment_from_payment_method.spree.rb new file mode 100644 index 0000000..5f634e2 --- /dev/null +++ b/db/migrate/20181125224239_remove_environment_from_payment_method.spree.rb @@ -0,0 +1,7 @@ +# This migration comes from spree (originally 20150121022521) +class RemoveEnvironmentFromPaymentMethod < ActiveRecord::Migration[4.2] + def up + Spree::PaymentMethod.where('environment != ?', Rails.env).update_all(active: false) + remove_column :spree_payment_methods, :environment + end +end diff --git a/db/migrate/20181125224240_add_resellable_to_return_items.spree.rb b/db/migrate/20181125224240_add_resellable_to_return_items.spree.rb new file mode 100644 index 0000000..78e029b --- /dev/null +++ b/db/migrate/20181125224240_add_resellable_to_return_items.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20150122145607) +class AddResellableToReturnItems < ActiveRecord::Migration[4.2] + def change + add_column :spree_return_items, :resellable, :boolean, default: true, null: false + end +end diff --git a/db/migrate/20181125224241_add_code_to_spree_promotion_categories.spree.rb b/db/migrate/20181125224241_add_code_to_spree_promotion_categories.spree.rb new file mode 100644 index 0000000..d813251 --- /dev/null +++ b/db/migrate/20181125224241_add_code_to_spree_promotion_categories.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20150122202432) +class AddCodeToSpreePromotionCategories < ActiveRecord::Migration[4.2] + def change + add_column :spree_promotion_categories, :code, :string + end +end diff --git a/db/migrate/20181125224242_remove_environment_from_tracker.spree.rb b/db/migrate/20181125224242_remove_environment_from_tracker.spree.rb new file mode 100644 index 0000000..c5dd5e4 --- /dev/null +++ b/db/migrate/20181125224242_remove_environment_from_tracker.spree.rb @@ -0,0 +1,9 @@ +# This migration comes from spree (originally 20150128032538) +class RemoveEnvironmentFromTracker < ActiveRecord::Migration[4.2] + class Spree::Tracker < Spree::Base; end + + def up + Spree::Tracker.where('environment != ?', Rails.env).update_all(active: false) + remove_column :spree_trackers, :environment + end +end diff --git a/db/migrate/20181125224243_remove_spree_configurations.spree.rb b/db/migrate/20181125224243_remove_spree_configurations.spree.rb new file mode 100644 index 0000000..5ce2df7 --- /dev/null +++ b/db/migrate/20181125224243_remove_spree_configurations.spree.rb @@ -0,0 +1,17 @@ +# This migration comes from spree (originally 20150128060325) +class RemoveSpreeConfigurations < ActiveRecord::Migration[4.2] + def up + drop_table "spree_configurations" + end + + def down + create_table "spree_configurations", force: true do |t| + t.string "name" + t.string "type", limit: 50 + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "spree_configurations", ["name", "type"], name: "index_spree_configurations_on_name_and_type" + end +end diff --git a/db/migrate/20181125224244_add_index_to_spree_stock_items_variant_id.spree.rb b/db/migrate/20181125224244_add_index_to_spree_stock_items_variant_id.spree.rb new file mode 100644 index 0000000..f629919 --- /dev/null +++ b/db/migrate/20181125224244_add_index_to_spree_stock_items_variant_id.spree.rb @@ -0,0 +1,14 @@ +# This migration comes from spree (originally 20150216173445) +class AddIndexToSpreeStockItemsVariantId < ActiveRecord::Migration[4.2] + def up + unless index_exists? :spree_stock_items, :variant_id + add_index :spree_stock_items, :variant_id + end + end + + def down + if index_exists? :spree_stock_items, :variant_id + remove_index :spree_stock_items, :variant_id + end + end +end diff --git a/db/migrate/20181125224245_ensure_payments_have_numbers.spree.rb b/db/migrate/20181125224245_ensure_payments_have_numbers.spree.rb new file mode 100644 index 0000000..3bea1c0 --- /dev/null +++ b/db/migrate/20181125224245_ensure_payments_have_numbers.spree.rb @@ -0,0 +1,10 @@ +# This migration comes from spree (originally 20150309161154) +class EnsurePaymentsHaveNumbers < ActiveRecord::Migration[4.2] + def change + add_index :spree_payments, :number unless index_exists?(:spree_payments, :number) + Spree::Payment.where(number: nil).find_each do |payment| + payment.generate_number + payment.update_columns(number: payment.number) + end + end +end diff --git a/db/migrate/20181125224246_add_missing_indexes_on_spree_tables.spree.rb b/db/migrate/20181125224246_add_missing_indexes_on_spree_tables.spree.rb new file mode 100644 index 0000000..b86e526 --- /dev/null +++ b/db/migrate/20181125224246_add_missing_indexes_on_spree_tables.spree.rb @@ -0,0 +1,68 @@ +# This migration comes from spree (originally 20150314013438) +class AddMissingIndexesOnSpreeTables < ActiveRecord::Migration[4.2] + def change + if data_source_exists?(:spree_promotion_rules_users) && !index_exists?(:spree_promotion_rules_users, + [:user_id, :promotion_rule_id], + name: 'index_promotion_rules_users_on_user_id_and_promotion_rule_id') + add_index :spree_promotion_rules_users, + [:user_id, :promotion_rule_id], + name: 'index_promotion_rules_users_on_user_id_and_promotion_rule_id' + end + + if data_source_exists?(:spree_products_promotion_rules) && !index_exists?(:spree_products_promotion_rules, + [:promotion_rule_id, :product_id], + name: 'index_products_promotion_rules_on_promotion_rule_and_product') + add_index :spree_products_promotion_rules, + [:promotion_rule_id, :product_id], + name: 'index_products_promotion_rules_on_promotion_rule_and_product' + end + + unless index_exists? :spree_orders, :canceler_id + add_index :spree_orders, :canceler_id + end + + unless index_exists? :spree_orders, :store_id + add_index :spree_orders, :store_id + end + + if data_source_exists?(:spree_orders_promotions) && !index_exists?(:spree_orders_promotions, [:promotion_id, :order_id]) + add_index :spree_orders_promotions, [:promotion_id, :order_id] + end + + if data_source_exists?(:spree_properties_prototypes) && !index_exists?(:spree_properties_prototypes, :prototype_id) + add_index :spree_properties_prototypes, :prototype_id + end + + if data_source_exists?(:spree_properties_prototypes) && !index_exists?(:spree_properties_prototypes, + [:prototype_id, :property_id], + name: 'index_properties_prototypes_on_prototype_and_property') + add_index :spree_properties_prototypes, + [:prototype_id, :property_id], + name: 'index_properties_prototypes_on_prototype_and_property' + end + + if data_source_exists?(:spree_taxons_prototypes) && !index_exists?(:spree_taxons_prototypes, [:prototype_id, :taxon_id]) + add_index :spree_taxons_prototypes, [:prototype_id, :taxon_id] + end + + if data_source_exists?(:spree_option_types_prototypes) && !index_exists?(:spree_option_types_prototypes, :prototype_id) + add_index :spree_option_types_prototypes, :prototype_id + end + + if data_source_exists?(:spree_option_types_prototypes) && !index_exists?(:spree_option_types_prototypes, + [:prototype_id, :option_type_id], + name: 'index_option_types_prototypes_on_prototype_and_option_type') + add_index :spree_option_types_prototypes, + [:prototype_id, :option_type_id], + name: 'index_option_types_prototypes_on_prototype_and_option_type' + end + + if data_source_exists?(:spree_option_values_variants) && !index_exists?(:spree_option_values_variants, + [:option_value_id, :variant_id], + name: 'index_option_values_variants_on_option_value_and_variant') + add_index :spree_option_values_variants, + [:option_value_id, :variant_id], + name: 'index_option_values_variants_on_option_value_and_variant' + end + end +end diff --git a/db/migrate/20181125224247_remove_duplicated_indexes_from_multi_columns.spree.rb b/db/migrate/20181125224247_remove_duplicated_indexes_from_multi_columns.spree.rb new file mode 100644 index 0000000..deb4011 --- /dev/null +++ b/db/migrate/20181125224247_remove_duplicated_indexes_from_multi_columns.spree.rb @@ -0,0 +1,19 @@ +# This migration comes from spree (originally 20150317174308) +class RemoveDuplicatedIndexesFromMultiColumns < ActiveRecord::Migration[4.2] + def change + remove_index :spree_adjustments, name: "index_adjustments_on_order_id" + remove_index :spree_option_types_prototypes, :prototype_id + add_index :spree_option_types_prototypes, :option_type_id + remove_index :spree_option_values_variants, name: 'index_option_values_variants_on_option_value_and_variant' + remove_index :spree_option_values_variants, :variant_id + add_index :spree_option_values_variants, :option_value_id + remove_index :spree_orders, :user_id + remove_index :spree_orders_promotions, [:order_id, :promotion_id] + add_index :spree_orders_promotions, :order_id + remove_index :spree_products_promotion_rules, name: "index_products_promotion_rules_on_promotion_rule_id" + remove_index :spree_promotion_rules_users, name: "index_promotion_rules_users_on_user_id" + remove_index :spree_properties_prototypes, :prototype_id + remove_index :spree_stock_items, :stock_location_id + remove_index :spree_taxons_prototypes, :prototype_id + end +end diff --git a/db/migrate/20181125224248_remove_user_index_from_spree_state_changes.spree.rb b/db/migrate/20181125224248_remove_user_index_from_spree_state_changes.spree.rb new file mode 100644 index 0000000..f8eee7c --- /dev/null +++ b/db/migrate/20181125224248_remove_user_index_from_spree_state_changes.spree.rb @@ -0,0 +1,15 @@ +# This migration comes from spree (originally 20150324104002) +class RemoveUserIndexFromSpreeStateChanges < ActiveRecord::Migration[4.2] + def up + if index_exists? :spree_state_changes, :user_id + remove_index :spree_state_changes, :user_id + end + + end + + def down + unless index_exists? :spree_state_changes, :user_id + add_index :spree_state_changes, :user_id + end + end +end diff --git a/db/migrate/20181125224249_fix_adjustment_order_id.spree.rb b/db/migrate/20181125224249_fix_adjustment_order_id.spree.rb new file mode 100644 index 0000000..26cc07e --- /dev/null +++ b/db/migrate/20181125224249_fix_adjustment_order_id.spree.rb @@ -0,0 +1,71 @@ +# This migration comes from spree (originally 20150515211137) +class FixAdjustmentOrderId < ActiveRecord::Migration[4.2] + def change + say 'Populate order_id from adjustable_id where appropriate' + execute(<<-SQL.squish) + UPDATE + spree_adjustments + SET + order_id = adjustable_id + WHERE + adjustable_type = 'Spree::Order' + ; + SQL + + # Submitter of change does not care about MySQL, as it is not officially supported. + # Still spree officials decided to provide a working code path for MySQL users, hence + # submitter made a AR code path he could validate on PostgreSQL. + # + # Whoever runs a big enough MySQL installation where the AR solution hurts: + # Will have to write a better MySQL specific equivalent. + if Spree::Order.connection.adapter_name.eql?('MySQL') + Spree::Adjustment.where(adjustable_type: 'Spree::LineItem').find_each do |adjustment| + adjustment.update_columns(order_id: Spree::LineItem.find(adjustment.adjustable_id).order_id) + end + else + execute(<<-SQL.squish) + UPDATE + spree_adjustments + SET + order_id = + (SELECT order_id FROM spree_line_items WHERE spree_line_items.id = spree_adjustments.adjustable_id) + WHERE + adjustable_type = 'Spree::LineItem' + SQL + end + + say 'Fix schema for spree_adjustments order_id column' + change_table :spree_adjustments do |t| + t.change :order_id, :integer, null: false + end + + # Improved schema for postgresql, uncomment if you like it: + # + # # Negated Logical implication. + # # + # # When adjustable_type is 'Spree::Order' (p) the adjustable_id must be order_id (q). + # # + # # When adjustable_type is NOT 'Spree::Order' the adjustable id allowed to be any value (including of order_id in + # # case foreign keys match). XOR does not work here. + # # + # # Postgresql does not have an operator for logical implication. So we need to build the following truth table + # # via AND with OR: + # # + # # p q | CHECK = !(p -> q) + # # ----------- + # # t t | t + # # t f | f + # # f t | t + # # f f | t + # # + # # According to de-morgans law the logical implication q -> p is equivalent to !p || q + # # + # execute(<<-SQL.squish) + # ALTER TABLE ONLY spree_adjustments + # ADD CONSTRAINT fk_spree_adjustments FOREIGN KEY (order_id) + # REFERENCES spree_orders(id) ON UPDATE RESTRICT ON DELETE RESTRICT, + # ADD CONSTRAINT check_spree_adjustments_order_id CHECK + # (adjustable_type <> 'Spree::Order' OR order_id = adjustable_id); + # SQL + end +end diff --git a/db/migrate/20181125224250_add_position_to_spree_payment_methods.spree.rb b/db/migrate/20181125224250_add_position_to_spree_payment_methods.spree.rb new file mode 100644 index 0000000..a1dca8c --- /dev/null +++ b/db/migrate/20181125224250_add_position_to_spree_payment_methods.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20150522071831) +class AddPositionToSpreePaymentMethods < ActiveRecord::Migration[4.2] + def change + add_column :spree_payment_methods, :position, :integer, default: 0 + end +end diff --git a/db/migrate/20181125224251_add_deleted_at_to_friendly_id_slugs.spree.rb b/db/migrate/20181125224251_add_deleted_at_to_friendly_id_slugs.spree.rb new file mode 100644 index 0000000..7e89dbe --- /dev/null +++ b/db/migrate/20181125224251_add_deleted_at_to_friendly_id_slugs.spree.rb @@ -0,0 +1,7 @@ +# This migration comes from spree (originally 20150522181728) +class AddDeletedAtToFriendlyIdSlugs < ActiveRecord::Migration[4.2] + def change + add_column :friendly_id_slugs, :deleted_at, :datetime + add_index :friendly_id_slugs, :deleted_at + end +end diff --git a/db/migrate/20181125224252_increase_scale_on_pre_tax_amounts.spree.rb b/db/migrate/20181125224252_increase_scale_on_pre_tax_amounts.spree.rb new file mode 100644 index 0000000..7b6b613 --- /dev/null +++ b/db/migrate/20181125224252_increase_scale_on_pre_tax_amounts.spree.rb @@ -0,0 +1,17 @@ +# This migration comes from spree (originally 20150609093816) +class IncreaseScaleOnPreTaxAmounts < ActiveRecord::Migration[4.2] + def change + # set pre_tax_amount on shipments to discounted_amount - included_tax_total + # so that the null: false option on the shipment pre_tax_amount doesn't generate + # errors. + # + execute(<<-SQL) + UPDATE spree_shipments + SET pre_tax_amount = (cost + promo_total) - included_tax_total + WHERE pre_tax_amount IS NULL; + SQL + + change_column :spree_line_items, :pre_tax_amount, :decimal, precision: 12, scale: 4, default: 0.0, null: false + change_column :spree_shipments, :pre_tax_amount, :decimal, precision: 12, scale: 4, default: 0.0, null: false + end +end diff --git a/db/migrate/20181125224253_add_taxable_adjustment_total_to_line_item.spree.rb b/db/migrate/20181125224253_add_taxable_adjustment_total_to_line_item.spree.rb new file mode 100644 index 0000000..74598ab --- /dev/null +++ b/db/migrate/20181125224253_add_taxable_adjustment_total_to_line_item.spree.rb @@ -0,0 +1,20 @@ +# This migration comes from spree (originally 20150626181949) +class AddTaxableAdjustmentTotalToLineItem < ActiveRecord::Migration[4.2] + def change + add_column :spree_line_items, :taxable_adjustment_total, :decimal, + precision: 10, scale: 2, default: 0.0, null: false + add_column :spree_line_items, :non_taxable_adjustment_total, :decimal, + precision: 10, scale: 2, default: 0.0, null: false + + add_column :spree_shipments, :taxable_adjustment_total, :decimal, + precision: 10, scale: 2, default: 0.0, null: false + add_column :spree_shipments, :non_taxable_adjustment_total, :decimal, + precision: 10, scale: 2, default: 0.0, null: false + + add_column :spree_orders, :taxable_adjustment_total, :decimal, + precision: 10, scale: 2, default: 0.0, null: false + add_column :spree_orders, :non_taxable_adjustment_total, :decimal, + precision: 10, scale: 2, default: 0.0, null: false + # TODO migration that updates old orders + end +end diff --git a/db/migrate/20181125224254_migrate_payment_methods_display.spree.rb b/db/migrate/20181125224254_migrate_payment_methods_display.spree.rb new file mode 100644 index 0000000..957da5e --- /dev/null +++ b/db/migrate/20181125224254_migrate_payment_methods_display.spree.rb @@ -0,0 +1,13 @@ +# This migration comes from spree (originally 20150627090949) +class MigratePaymentMethodsDisplay < ActiveRecord::Migration[4.2] + def change + Spree::PaymentMethod.all.each do |method| + if method.display_on.blank? + method.display_on = "both" + method.save + end + end + + change_column :spree_payment_methods, :display_on, :string, default: "both" + end +end diff --git a/db/migrate/20181125224255_enable_acts_as_paranoid_on_calculators.spree.rb b/db/migrate/20181125224255_enable_acts_as_paranoid_on_calculators.spree.rb new file mode 100644 index 0000000..b8fca5c --- /dev/null +++ b/db/migrate/20181125224255_enable_acts_as_paranoid_on_calculators.spree.rb @@ -0,0 +1,7 @@ +# This migration comes from spree (originally 20150707204155) +class EnableActsAsParanoidOnCalculators < ActiveRecord::Migration[4.2] + def change + add_column :spree_calculators, :deleted_at, :datetime + add_index :spree_calculators, :deleted_at + end +end diff --git a/db/migrate/20181125224256_spree_payment_method_store_credits.spree.rb b/db/migrate/20181125224256_spree_payment_method_store_credits.spree.rb new file mode 100644 index 0000000..bf5dea2 --- /dev/null +++ b/db/migrate/20181125224256_spree_payment_method_store_credits.spree.rb @@ -0,0 +1,13 @@ +# This migration comes from spree (originally 20150714154102) +class SpreePaymentMethodStoreCredits < ActiveRecord::Migration[4.2] + def up + # Reload to pick up new position column for acts_as_list + Spree::PaymentMethod.reset_column_information + Spree::PaymentMethod::StoreCredit.find_or_create_by(name: 'Store Credit', description: 'Store Credit', + active: true, display_on: 'back_end') + end + + def down + Spree::PaymentMethod.find_by(type: 'Spree::PaymentMethod::StoreCredit', name: 'Store Credit').try(&:destroy) + end +end diff --git a/db/migrate/20181125224257_rename_has_and_belongs_to_associations_to_model_names.spree.rb b/db/migrate/20181125224257_rename_has_and_belongs_to_associations_to_model_names.spree.rb new file mode 100644 index 0000000..4ee2c71 --- /dev/null +++ b/db/migrate/20181125224257_rename_has_and_belongs_to_associations_to_model_names.spree.rb @@ -0,0 +1,19 @@ +# This migration comes from spree (originally 20150726141425) +class RenameHasAndBelongsToAssociationsToModelNames < ActiveRecord::Migration[4.2] + def change + { + 'spree_option_types_prototypes' => 'spree_option_type_prototypes', + 'spree_option_values_variants' => 'spree_option_value_variants', + 'spree_orders_promotions' => 'spree_order_promotions', + 'spree_products_promotion_rules' => 'spree_product_promotion_rules', + 'spree_taxons_promotion_rules' => 'spree_promotion_rule_taxons', + 'spree_promotion_rules_users' => 'spree_promotion_rule_users', + 'spree_properties_prototypes' => 'spree_property_prototypes', + 'spree_taxons_prototypes' => 'spree_prototype_taxons', + 'spree_roles_users' => 'spree_role_users', + 'spree_shipping_methods_zones' => 'spree_shipping_method_zones' + }.each do |old_name, new_name| + rename_table old_name, new_name + end + end +end diff --git a/db/migrate/20181125224258_spree_store_credit_types.spree.rb b/db/migrate/20181125224258_spree_store_credit_types.spree.rb new file mode 100644 index 0000000..74dd3b2 --- /dev/null +++ b/db/migrate/20181125224258_spree_store_credit_types.spree.rb @@ -0,0 +1,12 @@ +# This migration comes from spree (originally 20150727191614) +class SpreeStoreCreditTypes < ActiveRecord::Migration[4.2] + def up + Spree::StoreCreditType.find_or_create_by(name: 'Expiring', priority: 1) + Spree::StoreCreditType.find_or_create_by(name: 'Non-expiring', priority: 2) + end + + def down + Spree::StoreCreditType.find_by(name: 'Expiring').try(&:destroy) + Spree::StoreCreditType.find_by(name: 'Non-expiring').try(&:destroy) + end +end diff --git a/db/migrate/20181125224259_add_discontinued_to_products_and_variants.spree.rb b/db/migrate/20181125224259_add_discontinued_to_products_and_variants.spree.rb new file mode 100644 index 0000000..0e55be5 --- /dev/null +++ b/db/migrate/20181125224259_add_discontinued_to_products_and_variants.spree.rb @@ -0,0 +1,69 @@ +# This migration comes from spree (originally 20150819154308) +class AddDiscontinuedToProductsAndVariants < ActiveRecord::Migration[4.2] + def up + add_column :spree_products, :discontinue_on, :datetime, after: :available_on + add_column :spree_variants, :discontinue_on, :datetime, after: :deleted_at + + add_index :spree_products, :discontinue_on + add_index :spree_variants, :discontinue_on + + puts "Warning: This migration changes the meaning of 'deleted'. Before this change, 'deleted' meant products that were no longer being sold in your store. After this change, you can only delete a product or variant if it has not already been sold to a customer (a model-level check enforces this). Instead, you should use the new field 'discontinue_on' for products or variants which were sold in the past but no longer for sale. This fixes bugs when other objects are attached to deleted products and variants. (Even though acts_as_paranoid gem keeps the records in the database, most associations are automatically scoped to exclude the deleted records.) In thew meaning of 'deleted,' you can still use the delete function on products & variants which are *truly user-error mistakes*, specifically before an order has been placed or the items have gone on sale. You also must use the soft-delete function (which still works after this change) to clean up slug (product) and SKU (variant) duplicates. Otherwise, you should generally over ever need to discontinue products. + +Data Fix: We will attempt to reverse engineer the old meaning of 'deleted' (no longer for sale) to the new database field 'discontinue_on'. However, since Slugs and SKUs cannot be duplicated on Products and Variants, we cannot gaurantee this to be foolproof if you have deteled Products and Variants that have duplicate Slugs or SKUs in non-deleted records. In these cases, we recommend you use the additional rake task to clean up your old records (see rake db:fix_orphan_line_items). If you have such records, this migration will leave them in place, preferring the non-deleted records over the deleted ones. However, since old line items will still be associated with deleted objects, you will still the bugs in your app until you run: + +rake db:fix_orphan_line_items + +We will print out a report of the data we are fixing now: " + + Spree::Product.only_deleted.each do |product| + # determine if there is a slug duplicate + the_dup = Spree::Product.find_by(slug: product.slug) + if the_dup.nil? + # check to see if there are line items attached to any variants + if Spree::Variant.with_deleted.where(product_id: product.id).map(&:line_items).any? + puts "recovering deleted product id #{product.id} ... this will un-delete the record and set it to be discontinued" + + old_deleted = product.deleted_at + product.update_column(:deleted_at, nil) # for some reason .recover doesn't appear to be a method + product.update_column(:discontinue_on, old_deleted) + else + puts "leaving product id #{product.id} deleted because there are no line items attached to it..." + end + else + puts "leaving product id #{product.id} deleted because there is a duplicate slug for '#{product.slug}' (product id #{the_dup.id}) " + if product.variants.map(&:line_items).any? + puts "WARNING: You may still have bugs with product id #{product.id} (#{product.name}) until you run rake db:fix_orphan_line_items" + end + end + end + + Spree::Variant.only_deleted.each do |variant| + # determine if there is a slug duplicate + the_dup = Spree::Variant.find_by(sku: variant.sku) + if the_dup.nil? + # check to see if there are line items attached to any variants + if variant.line_items.any? + puts "recovering deleted variant id #{variant.id} ... this will un-delete the record and set it to be discontinued" + old_deleted = variant.deleted_at + variant.update_column(:deleted_at, nil) # for some reason .recover doesn't appear to be a method + variant.update_column(:discontinue_on, old_deleted) + else + puts "leaving variant id #{variant.id} deleted because there are no line items attached to it..." + end + else + puts "leaving variant id #{variant.id} deleted because there is a duplicate SKU for '#{variant.sku}' (variant id #{the_dup.id}) " + if variant.line_items.any? + puts "WARNING: You may still have bugs with variant id #{variant.id} (#{variant.name}) until you run rake db:fix_orphan_line_items" + end + end + end + end + + def down + execute "UPDATE spree_products SET deleted_at = discontinue_on WHERE deleted_at IS NULL" + execute "UPDATE spree_variants SET deleted_at = discontinue_on WHERE deleted_at IS NULL" + + remove_column :spree_products, :discontinue_on + remove_column :spree_variants, :discontinue_on + end +end diff --git a/db/migrate/20181125224260_remove_shipping_method_id_from_spree_orders.spree.rb b/db/migrate/20181125224260_remove_shipping_method_id_from_spree_orders.spree.rb new file mode 100644 index 0000000..383f9ae --- /dev/null +++ b/db/migrate/20181125224260_remove_shipping_method_id_from_spree_orders.spree.rb @@ -0,0 +1,14 @@ +# This migration comes from spree (originally 20151220072838) +class RemoveShippingMethodIdFromSpreeOrders < ActiveRecord::Migration[4.2] + def up + if column_exists?(:spree_orders, :shipping_method_id, :integer) + remove_column :spree_orders, :shipping_method_id, :integer + end + end + + def down + unless column_exists?(:spree_orders, :shipping_method_id, :integer) + add_column :spree_orders, :shipping_method_id, :integer + end + end +end diff --git a/db/migrate/20181125224261_add_id_column_to_earlier_habtm_tables.spree.rb b/db/migrate/20181125224261_add_id_column_to_earlier_habtm_tables.spree.rb new file mode 100644 index 0000000..ff258a8 --- /dev/null +++ b/db/migrate/20181125224261_add_id_column_to_earlier_habtm_tables.spree.rb @@ -0,0 +1,17 @@ +# This migration comes from spree (originally 20160207191757) +class AddIdColumnToEarlierHabtmTables < ActiveRecord::Migration[4.2] + def up + add_column :spree_option_type_prototypes, :id, :primary_key + add_column :spree_option_value_variants, :id, :primary_key + add_column :spree_order_promotions, :id, :primary_key + add_column :spree_product_promotion_rules, :id, :primary_key + add_column :spree_promotion_rule_users, :id, :primary_key + add_column :spree_property_prototypes, :id, :primary_key + add_column :spree_role_users, :id, :primary_key + add_column :spree_shipping_method_zones, :id, :primary_key + end + + def down + raise ActiveRecord::IrreversibleMigration + end +end diff --git a/db/migrate/20181125224262_add_indexes.spree.rb b/db/migrate/20181125224262_add_indexes.spree.rb new file mode 100644 index 0000000..acd5871 --- /dev/null +++ b/db/migrate/20181125224262_add_indexes.spree.rb @@ -0,0 +1,15 @@ +# This migration comes from spree (originally 20160219165458) +class AddIndexes < ActiveRecord::Migration[4.2] + def change + add_index :spree_assets, :position + add_index :spree_option_types, :name + add_index :spree_option_values, :name + add_index :spree_prices, :variant_id + add_index :spree_properties, :name + add_index :spree_roles, :name + add_index :spree_shipping_categories, :name + add_index :spree_taxons, :lft + add_index :spree_taxons, :rgt + add_index :spree_taxons, :name + end +end diff --git a/db/migrate/20181125224263_remove_counter_cache_from_spree_variants_to_spree_stock_items.spree.rb b/db/migrate/20181125224263_remove_counter_cache_from_spree_variants_to_spree_stock_items.spree.rb new file mode 100644 index 0000000..9f148e4 --- /dev/null +++ b/db/migrate/20181125224263_remove_counter_cache_from_spree_variants_to_spree_stock_items.spree.rb @@ -0,0 +1,11 @@ +# This migration comes from spree (originally 20160509064646) +class RemoveCounterCacheFromSpreeVariantsToSpreeStockItems < ActiveRecord::Migration[4.2] + def up + if column_exists?(:spree_variants, :stock_items_count) + remove_column :spree_variants, :stock_items_count + end + end + + def down + end +end diff --git a/db/migrate/20181125224264_acts_as_taggable_on_spree_migration.spree.rb b/db/migrate/20181125224264_acts_as_taggable_on_spree_migration.spree.rb new file mode 100644 index 0000000..ea99faf --- /dev/null +++ b/db/migrate/20181125224264_acts_as_taggable_on_spree_migration.spree.rb @@ -0,0 +1,41 @@ +# This migration comes from spree (originally 20160511071954) +class ActsAsTaggableOnSpreeMigration < ActiveRecord::Migration[4.2] + def self.up + create_table :spree_tags do |t| + t.string :name + t.integer :taggings_count, default: 0 + end + + create_table :spree_taggings do |t| + t.references :tag + + # You should make sure that the column created is + # long enough to store the required class names. + t.references :taggable, polymorphic: true + t.references :tagger, polymorphic: true + + # Limit is created to prevent MySQL error on index + # length for MyISAM table type: http://bit.ly/vgW2Ql + t.string :context, limit: 128 + + t.datetime :created_at + end + + add_index :spree_tags, :name, unique: true + add_index :spree_taggings, + [ + :tag_id, + :taggable_id, + :taggable_type, + :context, + :tagger_id, + :tagger_type + ], + unique: true, name: "spree_taggings_idx" + end + + def self.down + drop_table :spree_taggings + drop_table :spree_tags + end +end diff --git a/db/migrate/20181125224265_change_collation_for_spree_tag_names.spree.rb b/db/migrate/20181125224265_change_collation_for_spree_tag_names.spree.rb new file mode 100644 index 0000000..0789688 --- /dev/null +++ b/db/migrate/20181125224265_change_collation_for_spree_tag_names.spree.rb @@ -0,0 +1,10 @@ +# This migration comes from spree (originally 20160511072249) +# This migration is added to circumvent issue #623 and have special characters +# work properly +class ChangeCollationForSpreeTagNames < ActiveRecord::Migration[4.2] + def up + if ActsAsTaggableOn::Utils.using_mysql? + execute("ALTER TABLE spree_tags MODIFY name varchar(255) CHARACTER SET utf8 COLLATE utf8_bin;") + end + end +end diff --git a/db/migrate/20181125224266_add_missing_indexes_to_spree_taggings.spree.rb b/db/migrate/20181125224266_add_missing_indexes_to_spree_taggings.spree.rb new file mode 100644 index 0000000..a89e9e6 --- /dev/null +++ b/db/migrate/20181125224266_add_missing_indexes_to_spree_taggings.spree.rb @@ -0,0 +1,15 @@ +# This migration comes from spree (originally 20160511072335) +class AddMissingIndexesToSpreeTaggings < ActiveRecord::Migration[4.2] + def change + add_index :spree_taggings, :tag_id + add_index :spree_taggings, :taggable_id + add_index :spree_taggings, :taggable_type + add_index :spree_taggings, :tagger_id + add_index :spree_taggings, :context + + add_index :spree_taggings, [:tagger_id, :tagger_type] + add_index :spree_taggings, + [:taggable_id, :taggable_type, :tagger_id, :context], + name: "spree_taggings_idy" + end +end diff --git a/db/migrate/20181125224267_add_zipcode_required_to_spree_countries.spree.rb b/db/migrate/20181125224267_add_zipcode_required_to_spree_countries.spree.rb new file mode 100644 index 0000000..83de5a6 --- /dev/null +++ b/db/migrate/20181125224267_add_zipcode_required_to_spree_countries.spree.rb @@ -0,0 +1,8 @@ +# This migration comes from spree (originally 20160608090604) +class AddZipcodeRequiredToSpreeCountries < ActiveRecord::Migration[4.2] + def change + add_column :spree_countries, :zipcode_required, :boolean, default: true + Spree::Country.reset_column_information + Spree::Country.where(iso: Spree::Address::NO_ZIPCODE_ISO_CODES).update_all(zipcode_required: false) + end +end diff --git a/db/migrate/20181125224268_add_created_at_to_variant.spree.rb b/db/migrate/20181125224268_add_created_at_to_variant.spree.rb new file mode 100644 index 0000000..0727fc5 --- /dev/null +++ b/db/migrate/20181125224268_add_created_at_to_variant.spree.rb @@ -0,0 +1,9 @@ +# This migration comes from spree (originally 20161014145148) +class AddCreatedAtToVariant < ActiveRecord::Migration[5.0] + def change + add_column :spree_variants, :created_at, :datetime + Spree::Variant.reset_column_information + Spree::Variant.unscoped.where.not(updated_at: nil).update_all('created_at = updated_at') + Spree::Variant.unscoped.where(updated_at: nil).update_all(created_at: Time.current, updated_at: Time.current) + end +end diff --git a/db/migrate/20181125224269_add_null_false_to_spree_variants_timestamps.spree.rb b/db/migrate/20181125224269_add_null_false_to_spree_variants_timestamps.spree.rb new file mode 100644 index 0000000..c4f81d2 --- /dev/null +++ b/db/migrate/20181125224269_add_null_false_to_spree_variants_timestamps.spree.rb @@ -0,0 +1,7 @@ +# This migration comes from spree (originally 20161014152814) +class AddNullFalseToSpreeVariantsTimestamps < ActiveRecord::Migration[5.0] + def change + change_column_null :spree_variants, :created_at, false + change_column_null :spree_variants, :updated_at, false + end +end diff --git a/db/migrate/20181125224270_add_quantity_to_inventory_units.spree.rb b/db/migrate/20181125224270_add_quantity_to_inventory_units.spree.rb new file mode 100644 index 0000000..23c1f56 --- /dev/null +++ b/db/migrate/20181125224270_add_quantity_to_inventory_units.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20161125065505) +class AddQuantityToInventoryUnits < ActiveRecord::Migration[5.0] + def change + add_column :spree_inventory_units, :quantity, :integer, default: 1 + end +end diff --git a/db/migrate/20181125224271_add_original_return_item_id_to_spree_inventory_units.spree.rb b/db/migrate/20181125224271_add_original_return_item_id_to_spree_inventory_units.spree.rb new file mode 100644 index 0000000..f9e2958 --- /dev/null +++ b/db/migrate/20181125224271_add_original_return_item_id_to_spree_inventory_units.spree.rb @@ -0,0 +1,30 @@ +# This migration comes from spree (originally 20170119122701) +class AddOriginalReturnItemIdToSpreeInventoryUnits < ActiveRecord::Migration[5.0] + def up + add_reference :spree_inventory_units, :original_return_item, references: :spree_return_items, index: true + + Spree::InventoryUnit.reset_column_information + + Spree::ReturnItem.where.not(exchange_inventory_unit_id: nil).find_each do |return_item| + if (inventory_unit = Spree::InventoryUnit.find_by(id: return_item.exchange_inventory_unit_id)).present? + inventory_unit.update_column(:original_return_item_id, return_item.id) + end + end + + remove_column :spree_return_items, :exchange_inventory_unit_id + end + + def down + add_reference :spree_return_items, :exchange_inventory_unit, references: :spree_inventory_units, index: true + + Spree::InventoryUnit.reset_column_information + + Spree::InventoryUnit.where.not(original_return_item_id: nil).find_each do |inventory_unit| + if (return_item = Spree::ReturnItem.find_by(id: inventory_unit.original_return_item_id)).present? + return_item.update_column(:exchange_inventory_unit_id, inventory_unit.id) + end + end + + remove_reference :spree_inventory_units, :original_return_item + end +end diff --git a/db/migrate/20181125224272_add_unique_index_on_number_to_spree_orders.spree.rb b/db/migrate/20181125224272_add_unique_index_on_number_to_spree_orders.spree.rb new file mode 100644 index 0000000..432d8db --- /dev/null +++ b/db/migrate/20181125224272_add_unique_index_on_number_to_spree_orders.spree.rb @@ -0,0 +1,17 @@ +# This migration comes from spree (originally 20170315152755) +class AddUniqueIndexOnNumberToSpreeOrders < ActiveRecord::Migration[5.0] + def change + unless index_exists?(:spree_orders, :number, unique: true) + numbers = Spree::Order.group(:number).having('sum(1) > 1').pluck(:number) + orders = Spree::Order.where(number: numbers) + + orders.find_each do |order| + order.number = order.class.number_generator.method(:generate_permalink).call(order.class) + order.save + end + + remove_index :spree_orders, :number if index_exists?(:spree_orders, :number) + add_index :spree_orders, :number, unique: true + end + end +end diff --git a/db/migrate/20181125224273_add_unique_index_on_number_to_spree_stock_transfer.spree.rb b/db/migrate/20181125224273_add_unique_index_on_number_to_spree_stock_transfer.spree.rb new file mode 100644 index 0000000..0c7bdbd --- /dev/null +++ b/db/migrate/20181125224273_add_unique_index_on_number_to_spree_stock_transfer.spree.rb @@ -0,0 +1,17 @@ +# This migration comes from spree (originally 20170316154338) +class AddUniqueIndexOnNumberToSpreeStockTransfer < ActiveRecord::Migration[5.0] + def change + unless index_exists?(:spree_stock_transfers, :number, unique: true) + numbers = Spree::StockTransfer.group(:number).having('sum(1) > 1').pluck(:number) + transfers = Spree::StockTransfer.where(number: numbers) + + transfers.find_each do |transfer| + transfer.number = transfer.class.number_generator.method(:generate_permalink).call(transfer.class) + transfer.save + end + + remove_index :spree_stock_transfers, :number if index_exists?(:spree_stock_transfers, :number) + add_index :spree_stock_transfers, :number, unique: true + end + end +end diff --git a/db/migrate/20181125224274_add_unique_index_on_number_to_spree_shipment.spree.rb b/db/migrate/20181125224274_add_unique_index_on_number_to_spree_shipment.spree.rb new file mode 100644 index 0000000..fef9469 --- /dev/null +++ b/db/migrate/20181125224274_add_unique_index_on_number_to_spree_shipment.spree.rb @@ -0,0 +1,17 @@ +# This migration comes from spree (originally 20170316205511) +class AddUniqueIndexOnNumberToSpreeShipment < ActiveRecord::Migration[5.0] + def change + unless index_exists?(:spree_shipments, :number, unique: true) + numbers = Spree::Shipment.group(:number).having('sum(1) > 1').pluck(:number) + shipments = Spree::Shipment.where(number: numbers) + + shipments.find_each do |shipment| + shipment.number = shipment.class.number_generator.method(:generate_permalink).call(shipment.class) + shipment.save + end + + remove_index :spree_shipments, :number if index_exists?(:spree_shipments, :number) + add_index :spree_shipments, :number, unique: true + end + end +end diff --git a/db/migrate/20181125224275_add_unique_index_on_number_to_spree_payments.spree.rb b/db/migrate/20181125224275_add_unique_index_on_number_to_spree_payments.spree.rb new file mode 100644 index 0000000..e8a4c7a --- /dev/null +++ b/db/migrate/20181125224275_add_unique_index_on_number_to_spree_payments.spree.rb @@ -0,0 +1,18 @@ +# This migration comes from spree (originally 20170320134043) +class AddUniqueIndexOnNumberToSpreePayments < ActiveRecord::Migration[5.0] + def change + unless index_exists?(:spree_payments, :number, unique: true) + # default scope in Spree::Payment disturbs Postgres, hence `unscoped` is needed. + numbers = Spree::Payment.unscoped.group(:number).having('sum(1) > 1').pluck(:number) + payments = Spree::Payment.where(number: numbers) + + payments.find_each do |payment| + payment.number = payment.class.number_generator.method(:generate_permalink).call(payment.class) + payment.save + end + + remove_index :spree_payments, :number if index_exists?(:spree_payments, :number) + add_index :spree_payments, :number, unique: true + end + end +end diff --git a/db/migrate/20181125224276_add_unique_index_on_number_to_spree_return_authorizations.spree.rb b/db/migrate/20181125224276_add_unique_index_on_number_to_spree_return_authorizations.spree.rb new file mode 100644 index 0000000..5ebece2 --- /dev/null +++ b/db/migrate/20181125224276_add_unique_index_on_number_to_spree_return_authorizations.spree.rb @@ -0,0 +1,17 @@ +# This migration comes from spree (originally 20170320142750) +class AddUniqueIndexOnNumberToSpreeReturnAuthorizations < ActiveRecord::Migration[5.0] + def change + unless index_exists?(:spree_return_authorizations, :number, unique: true) + numbers = Spree::ReturnAuthorization.group(:number).having('sum(1) > 1').pluck(:number) + authorizations = Spree::ReturnAuthorization.where(number: numbers) + + authorizations.find_each do |authorization| + authorization.number = authorization.class.number_generator.method(:generate_permalink).call(authorization.class) + authorization.save + end + + remove_index :spree_return_authorizations, :number if index_exists?(:spree_return_authorizations, :number) + add_index :spree_return_authorizations, :number, unique: true + end + end +end diff --git a/db/migrate/20181125224277_add_unique_index_on_number_to_spree_customer_returns.spree.rb b/db/migrate/20181125224277_add_unique_index_on_number_to_spree_customer_returns.spree.rb new file mode 100644 index 0000000..2a8f3cd --- /dev/null +++ b/db/migrate/20181125224277_add_unique_index_on_number_to_spree_customer_returns.spree.rb @@ -0,0 +1,17 @@ +# This migration comes from spree (originally 20170320145040) +class AddUniqueIndexOnNumberToSpreeCustomerReturns < ActiveRecord::Migration[5.0] + def change + unless index_exists?(:spree_customer_returns, :number, unique: true) + numbers = Spree::CustomerReturn.group(:number).having('sum(1) > 1').pluck(:number) + returns = Spree::CustomerReturn.where(number: numbers) + + returns.find_each do |r| + r.number = r.class.number_generator.method(:generate_permalink).call(r.class) + r.save + end + + remove_index :spree_customer_returns, :number if index_exists?(:spree_customer_returns, :number) + add_index :spree_customer_returns, :number, unique: true + end + end +end diff --git a/db/migrate/20181125224278_add_unique_index_on_number_to_spree_reimbursements.spree.rb b/db/migrate/20181125224278_add_unique_index_on_number_to_spree_reimbursements.spree.rb new file mode 100644 index 0000000..9bee6ba --- /dev/null +++ b/db/migrate/20181125224278_add_unique_index_on_number_to_spree_reimbursements.spree.rb @@ -0,0 +1,17 @@ +# This migration comes from spree (originally 20170320145518) +class AddUniqueIndexOnNumberToSpreeReimbursements < ActiveRecord::Migration[5.0] + def change + unless index_exists?(:spree_reimbursements, :number, unique: true) + numbers = Spree::Reimbursement.group(:number).having('sum(1) > 1').pluck(:number) + reimbursements = Spree::Reimbursement.where(number: numbers) + + reimbursements.find_each do |reimbursement| + reimbursement.number = reimbursement.class.number_generator.method(:generate_permalink).call(reimbursement.class) + reimbursement.save + end + + remove_index :spree_reimbursements, :number if index_exists?(:spree_reimbursements, :number) + add_index :spree_reimbursements, :number, unique: true + end + end +end diff --git a/db/migrate/20181125224279_add_missing_unique_indexes_for_unique_attributes.spree.rb b/db/migrate/20181125224279_add_missing_unique_indexes_for_unique_attributes.spree.rb new file mode 100644 index 0000000..2e368fc --- /dev/null +++ b/db/migrate/20181125224279_add_missing_unique_indexes_for_unique_attributes.spree.rb @@ -0,0 +1,38 @@ +# This migration comes from spree (originally 20170323151450) +class AddMissingUniqueIndexesForUniqueAttributes < ActiveRecord::Migration[5.0] + def change + tables = { + country: [:name, :iso_name], + refund_reason: [:name], + reimbursement_type: [:name], + return_authorization_reason: [:name], + role: [:name], + store: [:code] + } + + tables.each do |table, columns| + table_class = "Spree::#{table.to_s.classify}".constantize + table_name = table_class.table_name + + columns.each do |column| + unless index_exists?(table_name, column, unique: true) + attributes = table_class.unscoped.group(column).having('sum(1) > 1').pluck(column) + instances = table_class.where(column => [nil, attributes]) + + instances.find_each do |instance| + column_value = 'Unique String ' + SecureRandom.urlsafe_base64(8).upcase.delete('/+=_-')[0, 8] + instance.send("#{column}=", column_value) + instance.save + end + + remove_index table_name, column if index_exists?(table_name, column) + if supports_expression_index? + add_index table_name, "lower(#{column})", unique: true + else + add_index table_name, column, unique: true + end + end + end + end + end +end diff --git a/db/migrate/20181125224280_add_index_on_stock_location_to_spree_customer_returns.spree.rb b/db/migrate/20181125224280_add_index_on_stock_location_to_spree_customer_returns.spree.rb new file mode 100644 index 0000000..e6050ab --- /dev/null +++ b/db/migrate/20181125224280_add_index_on_stock_location_to_spree_customer_returns.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20170329110859) +class AddIndexOnStockLocationToSpreeCustomerReturns < ActiveRecord::Migration[5.0] + def change + add_index :spree_customer_returns, :stock_location_id + end +end diff --git a/db/migrate/20181125224281_add_index_on_prototype_to_spree_option_type_prototype.spree.rb b/db/migrate/20181125224281_add_index_on_prototype_to_spree_option_type_prototype.spree.rb new file mode 100644 index 0000000..70e37c7 --- /dev/null +++ b/db/migrate/20181125224281_add_index_on_prototype_to_spree_option_type_prototype.spree.rb @@ -0,0 +1,20 @@ +# This migration comes from spree (originally 20170329113917) +class AddIndexOnPrototypeToSpreeOptionTypePrototype < ActiveRecord::Migration[5.0] + def change + duplicates = Spree::OptionTypePrototype.group(:prototype_id, :option_type_id).having('sum(1) > 1').size + + duplicates.each do |f| + prototype_id, option_type_id = f.first + count = f.last - 1 # we want to leave one record + otp = Spree::OptionTypePrototype.where(prototype_id: prototype_id, option_type_id: option_type_id).last(count) + otp.map(&:destroy) + end + + if index_exists? :spree_option_type_prototypes, [:prototype_id, :option_type_id] + remove_index :spree_option_type_prototypes, [:prototype_id, :option_type_id] + add_index :spree_option_type_prototypes, [:prototype_id, :option_type_id], unique: true, name: 'spree_option_type_prototypes_prototype_id_option_type_id' + end + + add_index :spree_option_type_prototypes, :prototype_id + end +end diff --git a/db/migrate/20181125224282_add_indexes_to_spree_option_value_variant.spree.rb b/db/migrate/20181125224282_add_indexes_to_spree_option_value_variant.spree.rb new file mode 100644 index 0000000..eca6593 --- /dev/null +++ b/db/migrate/20181125224282_add_indexes_to_spree_option_value_variant.spree.rb @@ -0,0 +1,20 @@ +# This migration comes from spree (originally 20170330082155) +class AddIndexesToSpreeOptionValueVariant < ActiveRecord::Migration[5.0] + def change + duplicates = Spree::OptionValueVariant.group(:variant_id, :option_value_id).having('sum(1) > 1').size + + duplicates.each do |f| + variant_id, option_value_id = f.first + count = f.last - 1 # we want to leave one record + ov = Spree::OptionValueVariant.where(variant_id: variant_id, option_value_id: option_value_id).last(count) + ov.map(&:destroy) + end + + if index_exists? :spree_option_value_variants, [:variant_id, :option_value_id], name: "index_option_values_variants_on_variant_id_and_option_value_id" + remove_index :spree_option_value_variants, [:variant_id, :option_value_id] + add_index :spree_option_value_variants, [:variant_id, :option_value_id], unique: true, name: "index_option_values_variants_on_variant_id_and_option_value_id" + end + + add_index :spree_option_value_variants, :variant_id + end +end diff --git a/db/migrate/20181125224283_add_index_on_promotion_id_to_order_promotions.spree.rb b/db/migrate/20181125224283_add_index_on_promotion_id_to_order_promotions.spree.rb new file mode 100644 index 0000000..b025bb7 --- /dev/null +++ b/db/migrate/20181125224283_add_index_on_promotion_id_to_order_promotions.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20170330132215) +class AddIndexOnPromotionIdToOrderPromotions < ActiveRecord::Migration[5.0] + def change + add_index :spree_order_promotions, :promotion_id + end +end diff --git a/db/migrate/20181125224284_add_indexes_for_property_prototype.spree.rb b/db/migrate/20181125224284_add_indexes_for_property_prototype.spree.rb new file mode 100644 index 0000000..7f153e0 --- /dev/null +++ b/db/migrate/20181125224284_add_indexes_for_property_prototype.spree.rb @@ -0,0 +1,21 @@ +# This migration comes from spree (originally 20170331101758) +class AddIndexesForPropertyPrototype < ActiveRecord::Migration[5.0] + def change + duplicates = Spree::PropertyPrototype.group(:prototype_id, :property_id).having('sum(1) > 1').size + + duplicates.each do |f| + prototype_id, property_id = f.first + count = f.last - 1 # we want to leave one record + prototypes = Spree::PropertyPrototype.where(prototype_id: prototype_id, property_id: property_id).last(count) + prototypes.map(&:destroy) + end + + if index_exists? :spree_property_prototypes, [:prototype_id, :property_id] + remove_index :spree_property_prototypes, [:prototype_id, :property_id] + add_index :spree_property_prototypes, [:prototype_id, :property_id], unique: true, name: 'index_property_prototypes_on_prototype_id_and_property_id' + end + + add_index :spree_property_prototypes, :prototype_id + add_index :spree_property_prototypes, :property_id + end +end diff --git a/db/migrate/20181125224285_add_index_for_prototype_id_to_prototype_taxons.spree.rb b/db/migrate/20181125224285_add_index_for_prototype_id_to_prototype_taxons.spree.rb new file mode 100644 index 0000000..ddefb69 --- /dev/null +++ b/db/migrate/20181125224285_add_index_for_prototype_id_to_prototype_taxons.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20170331103334) +class AddIndexForPrototypeIdToPrototypeTaxons < ActiveRecord::Migration[5.0] + def change + add_index :spree_prototype_taxons, :prototype_id + end +end diff --git a/db/migrate/20181125224286_add_indexes_to_refunds.spree.rb b/db/migrate/20181125224286_add_indexes_to_refunds.spree.rb new file mode 100644 index 0000000..9dd3207 --- /dev/null +++ b/db/migrate/20181125224286_add_indexes_to_refunds.spree.rb @@ -0,0 +1,7 @@ +# This migration comes from spree (originally 20170331110454) +class AddIndexesToRefunds < ActiveRecord::Migration[5.0] + def change + add_index :spree_refunds, :payment_id + add_index :spree_refunds, :reimbursement_id + end +end diff --git a/db/migrate/20181125224287_add_indexes_to_reimbursement_credits.spree.rb b/db/migrate/20181125224287_add_indexes_to_reimbursement_credits.spree.rb new file mode 100644 index 0000000..1411c48 --- /dev/null +++ b/db/migrate/20181125224287_add_indexes_to_reimbursement_credits.spree.rb @@ -0,0 +1,7 @@ +# This migration comes from spree (originally 20170331111757) +class AddIndexesToReimbursementCredits < ActiveRecord::Migration[5.0] + def change + add_index :spree_reimbursement_credits, :reimbursement_id + add_index :spree_reimbursement_credits, [:creditable_id, :creditable_type], name: 'index_reimbursement_credits_on_creditable_id_and_type' + end +end diff --git a/db/migrate/20181125224288_add_indexes_to_return_authorizations.spree.rb b/db/migrate/20181125224288_add_indexes_to_return_authorizations.spree.rb new file mode 100644 index 0000000..dd5189b --- /dev/null +++ b/db/migrate/20181125224288_add_indexes_to_return_authorizations.spree.rb @@ -0,0 +1,7 @@ +# This migration comes from spree (originally 20170331115246) +class AddIndexesToReturnAuthorizations < ActiveRecord::Migration[5.0] + def change + add_index :spree_return_authorizations, :order_id + add_index :spree_return_authorizations, :stock_location_id + end +end diff --git a/db/migrate/20181125224289_add_indexes_to_return_items.spree.rb b/db/migrate/20181125224289_add_indexes_to_return_items.spree.rb new file mode 100644 index 0000000..7afd82a --- /dev/null +++ b/db/migrate/20181125224289_add_indexes_to_return_items.spree.rb @@ -0,0 +1,12 @@ +# This migration comes from spree (originally 20170331120125) +class AddIndexesToReturnItems < ActiveRecord::Migration[5.0] + def change + add_index :spree_return_items, :return_authorization_id + add_index :spree_return_items, :inventory_unit_id + add_index :spree_return_items, :reimbursement_id + add_index :spree_return_items, :exchange_variant_id + add_index :spree_return_items, :preferred_reimbursement_type_id + add_index :spree_return_items, :override_reimbursement_type_id + end +end + diff --git a/db/migrate/20181125224290_add_index_to_role_users.spree.rb b/db/migrate/20181125224290_add_index_to_role_users.spree.rb new file mode 100644 index 0000000..7173d9e --- /dev/null +++ b/db/migrate/20181125224290_add_index_to_role_users.spree.rb @@ -0,0 +1,19 @@ +# This migration comes from spree (originally 20170331121725) +class AddIndexToRoleUsers < ActiveRecord::Migration[5.0] + def change + + duplicates = Spree::RoleUser.group(:role_id, :user_id).having('sum(1) > 1').size + + duplicates.each do |f| + role_id, user_id = f.first + count = f.last - 1 # we want to leave one record + roles = Spree::RoleUser.where(role_id: role_id, user_id: user_id).last(count) + roles.map(&:destroy) + end + + if index_exists? :spree_role_users, [:role_id, :user_id] + remove_index :spree_role_users, [:role_id, :user_id] + add_index :spree_role_users, [:role_id, :user_id], unique: true + end + end +end diff --git a/db/migrate/20181125224291_add_index_to_shipping_method_categories.spree.rb b/db/migrate/20181125224291_add_index_to_shipping_method_categories.spree.rb new file mode 100644 index 0000000..5722249 --- /dev/null +++ b/db/migrate/20181125224291_add_index_to_shipping_method_categories.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20170331123625) +class AddIndexToShippingMethodCategories < ActiveRecord::Migration[5.0] + def change + add_index :spree_shipping_method_categories, :shipping_category_id + end +end diff --git a/db/migrate/20181125224292_add_index_to_shipping_method_zones.spree.rb b/db/migrate/20181125224292_add_index_to_shipping_method_zones.spree.rb new file mode 100644 index 0000000..f86b9d5 --- /dev/null +++ b/db/migrate/20181125224292_add_index_to_shipping_method_zones.spree.rb @@ -0,0 +1,21 @@ +# This migration comes from spree (originally 20170331123832) +class AddIndexToShippingMethodZones < ActiveRecord::Migration[5.0] + def change + duplicates = Spree::ShippingMethodZone.group(:shipping_method_id, :zone_id).having('sum(1) > 1').size + + duplicates.each do |f| + shipping_method_id, zone_id = f.first + count = f.last - 1 # we want to leave one record + zones = Spree::ShippingMethodZone.where(shipping_method_id: shipping_method_id, zone_id: zone_id).last(count) + zones.map(&:destroy) + end + + if index_exists? :spree_shipping_method_zones, [:shipping_method_id, :zone_id] + remove_index :spree_shipping_method_zones, [:shipping_method_id, :zone_id] + add_index :spree_shipping_method_zones, [:shipping_method_id, :zone_id], unique: true + end + + add_index :spree_shipping_method_zones, :zone_id + add_index :spree_shipping_method_zones, :shipping_method_id + end +end diff --git a/db/migrate/20181125224293_add_index_to_spree_shipping_rates.spree.rb b/db/migrate/20181125224293_add_index_to_spree_shipping_rates.spree.rb new file mode 100644 index 0000000..7bf55ba --- /dev/null +++ b/db/migrate/20181125224293_add_index_to_spree_shipping_rates.spree.rb @@ -0,0 +1,7 @@ +# This migration comes from spree (originally 20170331124251) +class AddIndexToSpreeShippingRates < ActiveRecord::Migration[5.0] + def change + add_index :spree_shipping_rates, :shipment_id + add_index :spree_shipping_rates, :shipping_method_id + end +end diff --git a/db/migrate/20181125224294_add_index_to_spree_stock_items.spree.rb b/db/migrate/20181125224294_add_index_to_spree_stock_items.spree.rb new file mode 100644 index 0000000..0533fcd --- /dev/null +++ b/db/migrate/20181125224294_add_index_to_spree_stock_items.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20170331124513) +class AddIndexToSpreeStockItems < ActiveRecord::Migration[5.0] + def change + add_index :spree_stock_items, :stock_location_id + end +end diff --git a/db/migrate/20181125224295_add_index_to_spree_stock_movement.spree.rb b/db/migrate/20181125224295_add_index_to_spree_stock_movement.spree.rb new file mode 100644 index 0000000..cf14454 --- /dev/null +++ b/db/migrate/20181125224295_add_index_to_spree_stock_movement.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20170331124924) +class AddIndexToSpreeStockMovement < ActiveRecord::Migration[5.0] + def change + add_index :spree_stock_movements, [:originator_id, :originator_type], name: 'index_stock_movements_on_originator_id_and_originator_type' + end +end diff --git a/db/migrate/20181125224296_change_indexes_on_friendly_id_slugs.spree.rb b/db/migrate/20181125224296_change_indexes_on_friendly_id_slugs.spree.rb new file mode 100644 index 0000000..1240ff4 --- /dev/null +++ b/db/migrate/20181125224296_change_indexes_on_friendly_id_slugs.spree.rb @@ -0,0 +1,11 @@ +# This migration comes from spree (originally 20170413211707) +class ChangeIndexesOnFriendlyIdSlugs < ActiveRecord::Migration[5.0] + def change + # Updating indexes to reflect changes in friendly_id v5.2 + # See: https://github.com/norman/friendly_id/pull/694/commits/9f107f07ec9d2a58bda5a712b6e79a8d8013e0ab + remove_index :friendly_id_slugs, [:slug, :sluggable_type] + remove_index :friendly_id_slugs, [:slug, :sluggable_type, :scope] + add_index :friendly_id_slugs, [:slug, :sluggable_type], length: { name: 100, slug: 20, sluggable_type: 20 } + add_index :friendly_id_slugs, [:slug, :sluggable_type, :scope], length: { name: 100, slug: 20, sluggable_type: 20, scope: 20 }, unique: true + end +end diff --git a/db/migrate/20181125224297_add_analytics_kind_to_spree_trackers.spree.rb b/db/migrate/20181125224297_add_analytics_kind_to_spree_trackers.spree.rb new file mode 100644 index 0000000..cc536c6 --- /dev/null +++ b/db/migrate/20181125224297_add_analytics_kind_to_spree_trackers.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20170722102643) +class AddAnalyticsKindToSpreeTrackers < ActiveRecord::Migration[5.1] + def change + add_column :spree_trackers, :kind, :integer, default: 0, null: false, index: true + end +end diff --git a/db/migrate/20181125224298_rename_tracker_kind_field.spree.rb b/db/migrate/20181125224298_rename_tracker_kind_field.spree.rb new file mode 100644 index 0000000..631b631 --- /dev/null +++ b/db/migrate/20181125224298_rename_tracker_kind_field.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20170727103056) +class RenameTrackerKindField < ActiveRecord::Migration[5.1] + def change + rename_column :spree_trackers, :kind, :engine + end +end diff --git a/db/migrate/20181125224299_remove_icon_from_taxons.spree.rb b/db/migrate/20181125224299_remove_icon_from_taxons.spree.rb new file mode 100644 index 0000000..ca15690 --- /dev/null +++ b/db/migrate/20181125224299_remove_icon_from_taxons.spree.rb @@ -0,0 +1,9 @@ +# This migration comes from spree (originally 20171004223836) +class RemoveIconFromTaxons < ActiveRecord::Migration[5.1] + def change + remove_column :spree_taxons, :icon_file_name if column_exists? :spree_taxons, :icon_file_name + remove_column :spree_taxons, :icon_content_type if column_exists? :spree_taxons, :icon_content_type + remove_column :spree_taxons, :icon_file_size if column_exists? :spree_taxons, :icon_file_size + remove_column :spree_taxons, :icon_updated_at if column_exists? :spree_taxons, :icon_updated_at + end +end diff --git a/db/migrate/20181125224300_add_unique_index_on_spree_promotions_code.spree.rb b/db/migrate/20181125224300_add_unique_index_on_spree_promotions_code.spree.rb new file mode 100644 index 0000000..234d68c --- /dev/null +++ b/db/migrate/20181125224300_add_unique_index_on_spree_promotions_code.spree.rb @@ -0,0 +1,7 @@ +# This migration comes from spree (originally 20180222133746) +class AddUniqueIndexOnSpreePromotionsCode < ActiveRecord::Migration[5.1] + def change + remove_index :spree_promotions, :code + add_index :spree_promotions, :code, unique: true + end +end diff --git a/db/migrate/20181125224301_add_api_key_to_spree_users.spree_api.rb b/db/migrate/20181125224301_add_api_key_to_spree_users.spree_api.rb new file mode 100644 index 0000000..87d38cc --- /dev/null +++ b/db/migrate/20181125224301_add_api_key_to_spree_users.spree_api.rb @@ -0,0 +1,8 @@ +# This migration comes from spree_api (originally 20100107141738) +class AddApiKeyToSpreeUsers < ActiveRecord::Migration[4.2] + def change + unless defined?(User) + add_column :spree_users, :api_key, :string, limit: 40 + end + end +end diff --git a/db/migrate/20181125224302_resize_api_key_field.spree_api.rb b/db/migrate/20181125224302_resize_api_key_field.spree_api.rb new file mode 100644 index 0000000..4282004 --- /dev/null +++ b/db/migrate/20181125224302_resize_api_key_field.spree_api.rb @@ -0,0 +1,8 @@ +# This migration comes from spree_api (originally 20120411123334) +class ResizeApiKeyField < ActiveRecord::Migration[4.2] + def change + unless defined?(User) + change_column :spree_users, :api_key, :string, limit: 48 + end + end +end diff --git a/db/migrate/20181125224303_rename_api_key_to_spree_api_key.spree_api.rb b/db/migrate/20181125224303_rename_api_key_to_spree_api_key.spree_api.rb new file mode 100644 index 0000000..60747db --- /dev/null +++ b/db/migrate/20181125224303_rename_api_key_to_spree_api_key.spree_api.rb @@ -0,0 +1,8 @@ +# This migration comes from spree_api (originally 20120530054546) +class RenameApiKeyToSpreeApiKey < ActiveRecord::Migration[4.2] + def change + unless defined?(User) + rename_column :spree_users, :api_key, :spree_api_key + end + end +end diff --git a/db/migrate/20181125224304_add_index_to_user_spree_api_key.spree_api.rb b/db/migrate/20181125224304_add_index_to_user_spree_api_key.spree_api.rb new file mode 100644 index 0000000..ab7b732 --- /dev/null +++ b/db/migrate/20181125224304_add_index_to_user_spree_api_key.spree_api.rb @@ -0,0 +1,8 @@ +# This migration comes from spree_api (originally 20131017162334) +class AddIndexToUserSpreeApiKey < ActiveRecord::Migration[4.2] + def change + unless defined?(User) + add_index :spree_users, :spree_api_key + end + end +end diff --git a/db/migrate/20181125224305_create_users.spree_auth.rb b/db/migrate/20181125224305_create_users.spree_auth.rb new file mode 100644 index 0000000..c06e70a --- /dev/null +++ b/db/migrate/20181125224305_create_users.spree_auth.rb @@ -0,0 +1,30 @@ +# This migration comes from spree_auth (originally 20101026184949) +class CreateUsers < SpreeExtension::Migration[4.2] + def up + unless data_source_exists?("spree_users") + create_table "spree_users", force: true do |t| + t.string "crypted_password", limit: 128 + t.string "salt", limit: 128 + t.string "email" + t.string "remember_token" + t.string "remember_token_expires_at" + t.string "persistence_token" + t.string "single_access_token" + t.string "perishable_token" + t.integer "login_count", default: 0, null: false + t.integer "failed_login_count", default: 0, null: false + t.datetime "last_request_at" + t.datetime "current_login_at" + t.datetime "last_login_at" + t.string "current_login_ip" + t.string "last_login_ip" + t.string "login" + t.integer "ship_address_id" + t.integer "bill_address_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "openid_identifier" + end + end + end +end diff --git a/db/migrate/20181125224306_rename_columns_for_devise.spree_auth.rb b/db/migrate/20181125224306_rename_columns_for_devise.spree_auth.rb new file mode 100644 index 0000000..e417608 --- /dev/null +++ b/db/migrate/20181125224306_rename_columns_for_devise.spree_auth.rb @@ -0,0 +1,38 @@ +# This migration comes from spree_auth (originally 20101026184950) +class RenameColumnsForDevise < SpreeExtension::Migration[4.2] + def up + return if column_exists?(:spree_users, :password_salt) + rename_column :spree_users, :crypted_password, :encrypted_password + rename_column :spree_users, :salt, :password_salt + rename_column :spree_users, :remember_token_expires_at, :remember_created_at + rename_column :spree_users, :login_count, :sign_in_count + rename_column :spree_users, :failed_login_count, :failed_attempts + rename_column :spree_users, :single_access_token, :reset_password_token + rename_column :spree_users, :current_login_at, :current_sign_in_at + rename_column :spree_users, :last_login_at, :last_sign_in_at + rename_column :spree_users, :current_login_ip, :current_sign_in_ip + rename_column :spree_users, :last_login_ip, :last_sign_in_ip + add_column :spree_users, :authentication_token, :string + add_column :spree_users, :unlock_token, :string + add_column :spree_users, :locked_at, :datetime + remove_column :spree_users, :openid_identifier + end + + def down + remove_column :spree_users, :authentication_token + remove_column :spree_users, :locked_at + remove_column :spree_users, :unlock_token + rename_column :spree_users, :last_sign_in_ip, :last_login_ip + rename_column :spree_users, :current_sign_in_ip, :current_login_ip + rename_column :spree_users, :last_sign_in_at, :last_login_at + rename_column :spree_users, :current_sign_in_at, :current_login_at + rename_column :spree_users, :reset_password_token, :single_access_token + rename_column :spree_users, :failed_attempts, :failed_login_count + rename_column :spree_users, :sign_in_count, :login_count + rename_column :spree_users, :remember_created_at, :remember_token_expires_at + rename_column :spree_users, :password_salt, :salt + rename_column :spree_users, :encrypted_password, :crypted_password + add_column :spree_users, :unlock_token, :string + add_column :spree_users, :openid_identifier, :string + end +end diff --git a/db/migrate/20181125224307_convert_user_remember_field.spree_auth.rb b/db/migrate/20181125224307_convert_user_remember_field.spree_auth.rb new file mode 100644 index 0000000..00fa1bb --- /dev/null +++ b/db/migrate/20181125224307_convert_user_remember_field.spree_auth.rb @@ -0,0 +1,12 @@ +# This migration comes from spree_auth (originally 20101214150824) +class ConvertUserRememberField < SpreeExtension::Migration[4.2] + def up + remove_column :spree_users, :remember_created_at + add_column :spree_users, :remember_created_at, :datetime + end + + def down + remove_column :spree_users, :remember_created_at + add_column :spree_users, :remember_created_at, :string + end +end diff --git a/db/migrate/20181125224308_add_reset_password_sent_at_to_spree_users.spree_auth.rb b/db/migrate/20181125224308_add_reset_password_sent_at_to_spree_users.spree_auth.rb new file mode 100644 index 0000000..b30894f --- /dev/null +++ b/db/migrate/20181125224308_add_reset_password_sent_at_to_spree_users.spree_auth.rb @@ -0,0 +1,9 @@ +# This migration comes from spree_auth (originally 20120203010234) +class AddResetPasswordSentAtToSpreeUsers < SpreeExtension::Migration[4.2] + def change + Spree::User.reset_column_information + unless Spree::User.column_names.include?("reset_password_sent_at") + add_column :spree_users, :reset_password_sent_at, :datetime + end + end +end diff --git a/db/migrate/20181125224309_make_users_email_index_unique.spree_auth.rb b/db/migrate/20181125224309_make_users_email_index_unique.spree_auth.rb new file mode 100644 index 0000000..5a12c06 --- /dev/null +++ b/db/migrate/20181125224309_make_users_email_index_unique.spree_auth.rb @@ -0,0 +1,10 @@ +# This migration comes from spree_auth (originally 20120605211305) +class MakeUsersEmailIndexUnique < SpreeExtension::Migration[4.2] + def up + add_index "spree_users", ["email"], name: "email_idx_unique", unique: true + end + + def down + remove_index "spree_users", name: "email_idx_unique" + end +end diff --git a/db/migrate/20181125224310_add_deleted_at_to_users.spree_auth.rb b/db/migrate/20181125224310_add_deleted_at_to_users.spree_auth.rb new file mode 100644 index 0000000..e2c9901 --- /dev/null +++ b/db/migrate/20181125224310_add_deleted_at_to_users.spree_auth.rb @@ -0,0 +1,7 @@ +# This migration comes from spree_auth (originally 20140904000425) +class AddDeletedAtToUsers < SpreeExtension::Migration[4.2] + def change + add_column :spree_users, :deleted_at, :datetime + add_index :spree_users, :deleted_at + end +end diff --git a/db/migrate/20181125224311_add_confirmable_to_users.spree_auth.rb b/db/migrate/20181125224311_add_confirmable_to_users.spree_auth.rb new file mode 100644 index 0000000..84bed06 --- /dev/null +++ b/db/migrate/20181125224311_add_confirmable_to_users.spree_auth.rb @@ -0,0 +1,8 @@ +# This migration comes from spree_auth (originally 20141002154641) +class AddConfirmableToUsers < SpreeExtension::Migration[4.2] + def change + add_column :spree_users, :confirmation_token, :string + add_column :spree_users, :confirmed_at, :datetime + add_column :spree_users, :confirmation_sent_at, :datetime + end +end diff --git a/db/migrate/20181125224312_add_missing_indices_on_user.spree_auth.rb b/db/migrate/20181125224312_add_missing_indices_on_user.spree_auth.rb new file mode 100644 index 0000000..4559432 --- /dev/null +++ b/db/migrate/20181125224312_add_missing_indices_on_user.spree_auth.rb @@ -0,0 +1,11 @@ +# This migration comes from spree_auth (originally 20150416152553) +class AddMissingIndicesOnUser < SpreeExtension::Migration[4.2] + def change + unless index_exists?(:spree_users, :bill_address_id) + add_index :spree_users, :bill_address_id + end + unless index_exists?(:spree_users, :ship_address_id) + add_index :spree_users, :ship_address_id + end + end +end diff --git a/db/migrate/20181125224313_update_braintree_payment_method_type.spree_gateway.rb b/db/migrate/20181125224313_update_braintree_payment_method_type.spree_gateway.rb new file mode 100644 index 0000000..ce8bd02 --- /dev/null +++ b/db/migrate/20181125224313_update_braintree_payment_method_type.spree_gateway.rb @@ -0,0 +1,10 @@ +# This migration comes from spree_gateway (originally 20121017004102) +class UpdateBraintreePaymentMethodType < SpreeExtension::Migration[4.2] + def up + Spree::PaymentMethod.where(:type => "Spree::Gateway::Braintree").update_all(:type => "Spree::Gateway::BraintreeGateway") + end + + def down + Spree::PaymentMethod.where(:type => "Spree::Gateway::BraintreeGateway").update_all(:type => "Spree::Gateway::Braintree") + end +end diff --git a/db/migrate/20181125224314_update_stripe_payment_method_type.spree_gateway.rb b/db/migrate/20181125224314_update_stripe_payment_method_type.spree_gateway.rb new file mode 100644 index 0000000..ddd43c0 --- /dev/null +++ b/db/migrate/20181125224314_update_stripe_payment_method_type.spree_gateway.rb @@ -0,0 +1,10 @@ +# This migration comes from spree_gateway (originally 20130213222555) +class UpdateStripePaymentMethodType < SpreeExtension::Migration[4.2] + def up + Spree::PaymentMethod.where(:type => "Spree::Gateway::Stripe").update_all(:type => "Spree::Gateway::StripeGateway") + end + + def down + Spree::PaymentMethod.where(:type => "Spree::Gateway::StripeGateway").update_all(:type => "Spree::Gateway::Stripe") + end +end diff --git a/db/migrate/20181125224315_update_balanced_payment_method_type.spree_gateway.rb b/db/migrate/20181125224315_update_balanced_payment_method_type.spree_gateway.rb new file mode 100644 index 0000000..8a527a3 --- /dev/null +++ b/db/migrate/20181125224315_update_balanced_payment_method_type.spree_gateway.rb @@ -0,0 +1,10 @@ +# This migration comes from spree_gateway (originally 20130415222802) +class UpdateBalancedPaymentMethodType < SpreeExtension::Migration[4.2] + def up + Spree::PaymentMethod.where(:type => "Spree::Gateway::Balanced").update_all(:type => "Spree::Gateway::BalancedGateway") + end + + def down + Spree::PaymentMethod.where(:type => "Spree::Gateway::BalancedGateway").update_all(:type => "Spree::Gateway::Balanced") + end +end diff --git a/db/migrate/20181125224316_update_paypal_payment_method_type.spree_gateway.rb b/db/migrate/20181125224316_update_paypal_payment_method_type.spree_gateway.rb new file mode 100644 index 0000000..690ac14 --- /dev/null +++ b/db/migrate/20181125224316_update_paypal_payment_method_type.spree_gateway.rb @@ -0,0 +1,10 @@ +# This migration comes from spree_gateway (originally 20131008221012) +class UpdatePaypalPaymentMethodType < SpreeExtension::Migration[4.2] + def up + Spree::PaymentMethod.where(:type => "Spree::Gateway::PayPal").update_all(:type => "Spree::Gateway::PayPalGateway") + end + + def down + Spree::PaymentMethod.where(:type => "Spree::Gateway::PayPalGateway").update_all(:type => "Spree::Gateway::PayPal") + end +end diff --git a/db/migrate/20181125224317_migrate_stripe_preferences.spree_gateway.rb b/db/migrate/20181125224317_migrate_stripe_preferences.spree_gateway.rb new file mode 100644 index 0000000..8bc15c5 --- /dev/null +++ b/db/migrate/20181125224317_migrate_stripe_preferences.spree_gateway.rb @@ -0,0 +1,9 @@ +# This migration comes from spree_gateway (originally 20131112133401) +class MigrateStripePreferences < SpreeExtension::Migration[4.2] + def up + Spree::Preference.where("#{ActiveRecord::Base.connection.quote_column_name("key")} LIKE 'spree/gateway/stripe_gateway/login%'").each do |pref| + pref.key = pref.key.gsub('login', 'secret_key') + pref.save + end + end +end diff --git a/db/schema.rb b/db/schema.rb new file mode 100644 index 0000000..12de8ae --- /dev/null +++ b/db/schema.rb @@ -0,0 +1,1061 @@ +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# Note that this schema.rb definition is the authoritative source for your +# database schema. If you need to create the application database on another +# system, you should be using db:schema:load, not running all the migrations +# from scratch. The latter is a flawed and unsustainable approach (the more migrations +# you'll amass, the slower it'll run and the greater likelihood for issues). +# +# It's strongly recommended that you check this file into your version control system. + +ActiveRecord::Schema.define(version: 20181125224317) do + + # These are extensions that must be enabled in order to support this database + enable_extension "plpgsql" + + create_table "friendly_id_slugs", id: :serial, force: :cascade do |t| + t.string "slug", null: false + t.integer "sluggable_id", null: false + t.string "sluggable_type", limit: 50 + t.string "scope" + t.datetime "created_at" + t.datetime "deleted_at" + t.index ["deleted_at"], name: "index_friendly_id_slugs_on_deleted_at" + t.index ["slug", "sluggable_type", "scope"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope", unique: true + t.index ["slug", "sluggable_type"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type" + t.index ["sluggable_id"], name: "index_friendly_id_slugs_on_sluggable_id" + t.index ["sluggable_type"], name: "index_friendly_id_slugs_on_sluggable_type" + end + + create_table "spree_addresses", id: :serial, force: :cascade do |t| + t.string "firstname" + t.string "lastname" + t.string "address1" + t.string "address2" + t.string "city" + t.string "zipcode" + t.string "phone" + t.string "state_name" + t.string "alternative_phone" + t.string "company" + t.integer "state_id" + t.integer "country_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["country_id"], name: "index_spree_addresses_on_country_id" + t.index ["firstname"], name: "index_addresses_on_firstname" + t.index ["lastname"], name: "index_addresses_on_lastname" + t.index ["state_id"], name: "index_spree_addresses_on_state_id" + end + + create_table "spree_adjustments", id: :serial, force: :cascade do |t| + t.string "source_type" + t.integer "source_id" + t.string "adjustable_type" + t.integer "adjustable_id" + t.decimal "amount", precision: 10, scale: 2 + t.string "label" + t.boolean "mandatory" + t.boolean "eligible", default: true + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "state" + t.integer "order_id", null: false + t.boolean "included", default: false + t.index ["adjustable_id", "adjustable_type"], name: "index_spree_adjustments_on_adjustable_id_and_adjustable_type" + t.index ["eligible"], name: "index_spree_adjustments_on_eligible" + t.index ["order_id"], name: "index_spree_adjustments_on_order_id" + t.index ["source_id", "source_type"], name: "index_spree_adjustments_on_source_id_and_source_type" + end + + create_table "spree_assets", id: :serial, force: :cascade do |t| + t.string "viewable_type" + t.integer "viewable_id" + t.integer "attachment_width" + t.integer "attachment_height" + t.integer "attachment_file_size" + t.integer "position" + t.string "attachment_content_type" + t.string "attachment_file_name" + t.string "type", limit: 75 + t.datetime "attachment_updated_at" + t.text "alt" + t.datetime "created_at" + t.datetime "updated_at" + t.index ["position"], name: "index_spree_assets_on_position" + t.index ["viewable_id"], name: "index_assets_on_viewable_id" + t.index ["viewable_type", "type"], name: "index_assets_on_viewable_type_and_type" + end + + create_table "spree_calculators", id: :serial, force: :cascade do |t| + t.string "type" + t.string "calculable_type" + t.integer "calculable_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.text "preferences" + t.datetime "deleted_at" + t.index ["calculable_id", "calculable_type"], name: "index_spree_calculators_on_calculable_id_and_calculable_type" + t.index ["deleted_at"], name: "index_spree_calculators_on_deleted_at" + t.index ["id", "type"], name: "index_spree_calculators_on_id_and_type" + end + + create_table "spree_countries", id: :serial, force: :cascade do |t| + t.string "iso_name" + t.string "iso" + t.string "iso3" + t.string "name" + t.integer "numcode" + t.boolean "states_required", default: false + t.datetime "updated_at" + t.boolean "zipcode_required", default: true + t.index "lower((iso_name)::text)", name: "index_spree_countries_on_lower_iso_name", unique: true + t.index "lower((name)::text)", name: "index_spree_countries_on_lower_name", unique: true + end + + create_table "spree_credit_cards", id: :serial, force: :cascade do |t| + t.string "month" + t.string "year" + t.string "cc_type" + t.string "last_digits" + t.integer "address_id" + t.string "gateway_customer_profile_id" + t.string "gateway_payment_profile_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "name" + t.integer "user_id" + t.integer "payment_method_id" + t.boolean "default", default: false, null: false + t.index ["address_id"], name: "index_spree_credit_cards_on_address_id" + t.index ["payment_method_id"], name: "index_spree_credit_cards_on_payment_method_id" + t.index ["user_id"], name: "index_spree_credit_cards_on_user_id" + end + + create_table "spree_customer_returns", id: :serial, force: :cascade do |t| + t.string "number" + t.integer "stock_location_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["number"], name: "index_spree_customer_returns_on_number", unique: true + t.index ["stock_location_id"], name: "index_spree_customer_returns_on_stock_location_id" + end + + create_table "spree_gateways", id: :serial, force: :cascade do |t| + t.string "type" + t.string "name" + t.text "description" + t.boolean "active", default: true + t.string "environment", default: "development" + t.string "server", default: "test" + t.boolean "test_mode", default: true + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.text "preferences" + t.index ["active"], name: "index_spree_gateways_on_active" + t.index ["test_mode"], name: "index_spree_gateways_on_test_mode" + end + + create_table "spree_inventory_units", id: :serial, force: :cascade do |t| + t.string "state" + t.integer "variant_id" + t.integer "order_id" + t.integer "shipment_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.boolean "pending", default: true + t.integer "line_item_id" + t.integer "quantity", default: 1 + t.integer "original_return_item_id" + t.index ["line_item_id"], name: "index_spree_inventory_units_on_line_item_id" + t.index ["order_id"], name: "index_inventory_units_on_order_id" + t.index ["original_return_item_id"], name: "index_spree_inventory_units_on_original_return_item_id" + t.index ["shipment_id"], name: "index_inventory_units_on_shipment_id" + t.index ["variant_id"], name: "index_inventory_units_on_variant_id" + end + + create_table "spree_line_items", id: :serial, force: :cascade do |t| + t.integer "variant_id" + t.integer "order_id" + t.integer "quantity", null: false + t.decimal "price", precision: 10, scale: 2, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "currency" + t.decimal "cost_price", precision: 10, scale: 2 + t.integer "tax_category_id" + t.decimal "adjustment_total", precision: 10, scale: 2, default: "0.0" + t.decimal "additional_tax_total", precision: 10, scale: 2, default: "0.0" + t.decimal "promo_total", precision: 10, scale: 2, default: "0.0" + t.decimal "included_tax_total", precision: 10, scale: 2, default: "0.0", null: false + t.decimal "pre_tax_amount", precision: 12, scale: 4, default: "0.0", null: false + t.decimal "taxable_adjustment_total", precision: 10, scale: 2, default: "0.0", null: false + t.decimal "non_taxable_adjustment_total", precision: 10, scale: 2, default: "0.0", null: false + t.index ["order_id"], name: "index_spree_line_items_on_order_id" + t.index ["tax_category_id"], name: "index_spree_line_items_on_tax_category_id" + t.index ["variant_id"], name: "index_spree_line_items_on_variant_id" + end + + create_table "spree_log_entries", id: :serial, force: :cascade do |t| + t.string "source_type" + t.integer "source_id" + t.text "details" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["source_id", "source_type"], name: "index_spree_log_entries_on_source_id_and_source_type" + end + + create_table "spree_option_type_prototypes", force: :cascade do |t| + t.integer "prototype_id" + t.integer "option_type_id" + t.index ["option_type_id"], name: "index_spree_option_type_prototypes_on_option_type_id" + t.index ["prototype_id", "option_type_id"], name: "spree_option_type_prototypes_prototype_id_option_type_id", unique: true + t.index ["prototype_id"], name: "index_spree_option_type_prototypes_on_prototype_id" + end + + create_table "spree_option_types", id: :serial, force: :cascade do |t| + t.string "name", limit: 100 + t.string "presentation", limit: 100 + t.integer "position", default: 0, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["name"], name: "index_spree_option_types_on_name" + t.index ["position"], name: "index_spree_option_types_on_position" + end + + create_table "spree_option_value_variants", force: :cascade do |t| + t.integer "variant_id" + t.integer "option_value_id" + t.index ["option_value_id"], name: "index_spree_option_value_variants_on_option_value_id" + t.index ["variant_id", "option_value_id"], name: "index_option_values_variants_on_variant_id_and_option_value_id", unique: true + t.index ["variant_id"], name: "index_spree_option_value_variants_on_variant_id" + end + + create_table "spree_option_values", id: :serial, force: :cascade do |t| + t.integer "position" + t.string "name" + t.string "presentation" + t.integer "option_type_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["name"], name: "index_spree_option_values_on_name" + t.index ["option_type_id"], name: "index_spree_option_values_on_option_type_id" + t.index ["position"], name: "index_spree_option_values_on_position" + end + + create_table "spree_order_promotions", force: :cascade do |t| + t.integer "order_id" + t.integer "promotion_id" + t.index ["order_id"], name: "index_spree_order_promotions_on_order_id" + t.index ["promotion_id", "order_id"], name: "index_spree_order_promotions_on_promotion_id_and_order_id" + t.index ["promotion_id"], name: "index_spree_order_promotions_on_promotion_id" + end + + create_table "spree_orders", id: :serial, force: :cascade do |t| + t.string "number", limit: 32 + t.decimal "item_total", precision: 10, scale: 2, default: "0.0", null: false + t.decimal "total", precision: 10, scale: 2, default: "0.0", null: false + t.string "state" + t.decimal "adjustment_total", precision: 10, scale: 2, default: "0.0", null: false + t.integer "user_id" + t.datetime "completed_at" + t.integer "bill_address_id" + t.integer "ship_address_id" + t.decimal "payment_total", precision: 10, scale: 2, default: "0.0" + t.string "shipment_state" + t.string "payment_state" + t.string "email" + t.text "special_instructions" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "currency" + t.string "last_ip_address" + t.integer "created_by_id" + t.decimal "shipment_total", precision: 10, scale: 2, default: "0.0", null: false + t.decimal "additional_tax_total", precision: 10, scale: 2, default: "0.0" + t.decimal "promo_total", precision: 10, scale: 2, default: "0.0" + t.string "channel", default: "spree" + t.decimal "included_tax_total", precision: 10, scale: 2, default: "0.0", null: false + t.integer "item_count", default: 0 + t.integer "approver_id" + t.datetime "approved_at" + t.boolean "confirmation_delivered", default: false + t.boolean "considered_risky", default: false + t.string "guest_token" + t.datetime "canceled_at" + t.integer "canceler_id" + t.integer "store_id" + t.integer "state_lock_version", default: 0, null: false + t.decimal "taxable_adjustment_total", precision: 10, scale: 2, default: "0.0", null: false + t.decimal "non_taxable_adjustment_total", precision: 10, scale: 2, default: "0.0", null: false + t.index ["approver_id"], name: "index_spree_orders_on_approver_id" + t.index ["bill_address_id"], name: "index_spree_orders_on_bill_address_id" + t.index ["canceler_id"], name: "index_spree_orders_on_canceler_id" + t.index ["completed_at"], name: "index_spree_orders_on_completed_at" + t.index ["confirmation_delivered"], name: "index_spree_orders_on_confirmation_delivered" + t.index ["considered_risky"], name: "index_spree_orders_on_considered_risky" + t.index ["created_by_id"], name: "index_spree_orders_on_created_by_id" + t.index ["guest_token"], name: "index_spree_orders_on_guest_token" + t.index ["number"], name: "index_spree_orders_on_number", unique: true + t.index ["ship_address_id"], name: "index_spree_orders_on_ship_address_id" + t.index ["store_id"], name: "index_spree_orders_on_store_id" + t.index ["user_id", "created_by_id"], name: "index_spree_orders_on_user_id_and_created_by_id" + end + + create_table "spree_payment_capture_events", id: :serial, force: :cascade do |t| + t.decimal "amount", precision: 10, scale: 2, default: "0.0" + t.integer "payment_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["payment_id"], name: "index_spree_payment_capture_events_on_payment_id" + end + + create_table "spree_payment_methods", id: :serial, force: :cascade do |t| + t.string "type" + t.string "name" + t.text "description" + t.boolean "active", default: true + t.datetime "deleted_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "display_on", default: "both" + t.boolean "auto_capture" + t.text "preferences" + t.integer "position", default: 0 + t.index ["id", "type"], name: "index_spree_payment_methods_on_id_and_type" + end + + create_table "spree_payments", id: :serial, force: :cascade do |t| + t.decimal "amount", precision: 10, scale: 2, default: "0.0", null: false + t.integer "order_id" + t.string "source_type" + t.integer "source_id" + t.integer "payment_method_id" + t.string "state" + t.string "response_code" + t.string "avs_response" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "number" + t.string "cvv_response_code" + t.string "cvv_response_message" + t.index ["number"], name: "index_spree_payments_on_number", unique: true + t.index ["order_id"], name: "index_spree_payments_on_order_id" + t.index ["payment_method_id"], name: "index_spree_payments_on_payment_method_id" + t.index ["source_id", "source_type"], name: "index_spree_payments_on_source_id_and_source_type" + end + + create_table "spree_preferences", id: :serial, force: :cascade do |t| + t.text "value" + t.string "key" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["key"], name: "index_spree_preferences_on_key", unique: true + end + + create_table "spree_prices", id: :serial, force: :cascade do |t| + t.integer "variant_id", null: false + t.decimal "amount", precision: 10, scale: 2 + t.string "currency" + t.datetime "deleted_at" + t.index ["deleted_at"], name: "index_spree_prices_on_deleted_at" + t.index ["variant_id", "currency"], name: "index_spree_prices_on_variant_id_and_currency" + t.index ["variant_id"], name: "index_spree_prices_on_variant_id" + end + + create_table "spree_product_option_types", id: :serial, force: :cascade do |t| + t.integer "position" + t.integer "product_id" + t.integer "option_type_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["option_type_id"], name: "index_spree_product_option_types_on_option_type_id" + t.index ["position"], name: "index_spree_product_option_types_on_position" + t.index ["product_id"], name: "index_spree_product_option_types_on_product_id" + end + + create_table "spree_product_promotion_rules", force: :cascade do |t| + t.integer "product_id" + t.integer "promotion_rule_id" + t.index ["product_id"], name: "index_products_promotion_rules_on_product_id" + t.index ["promotion_rule_id", "product_id"], name: "index_products_promotion_rules_on_promotion_rule_and_product" + end + + create_table "spree_product_properties", id: :serial, force: :cascade do |t| + t.string "value" + t.integer "product_id" + t.integer "property_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "position", default: 0 + t.index ["position"], name: "index_spree_product_properties_on_position" + t.index ["product_id"], name: "index_product_properties_on_product_id" + t.index ["property_id"], name: "index_spree_product_properties_on_property_id" + end + + create_table "spree_products", id: :serial, force: :cascade do |t| + t.string "name", default: "", null: false + t.text "description" + t.datetime "available_on" + t.datetime "deleted_at" + t.string "slug" + t.text "meta_description" + t.string "meta_keywords" + t.integer "tax_category_id" + t.integer "shipping_category_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.boolean "promotionable", default: true + t.string "meta_title" + t.datetime "discontinue_on" + t.index ["available_on"], name: "index_spree_products_on_available_on" + t.index ["deleted_at"], name: "index_spree_products_on_deleted_at" + t.index ["discontinue_on"], name: "index_spree_products_on_discontinue_on" + t.index ["name"], name: "index_spree_products_on_name" + t.index ["shipping_category_id"], name: "index_spree_products_on_shipping_category_id" + t.index ["slug"], name: "index_spree_products_on_slug", unique: true + t.index ["tax_category_id"], name: "index_spree_products_on_tax_category_id" + end + + create_table "spree_products_taxons", force: :cascade do |t| + t.integer "product_id" + t.integer "taxon_id" + t.integer "position" + t.index ["position"], name: "index_spree_products_taxons_on_position" + t.index ["product_id"], name: "index_spree_products_taxons_on_product_id" + t.index ["taxon_id"], name: "index_spree_products_taxons_on_taxon_id" + end + + create_table "spree_promotion_action_line_items", id: :serial, force: :cascade do |t| + t.integer "promotion_action_id" + t.integer "variant_id" + t.integer "quantity", default: 1 + t.index ["promotion_action_id"], name: "index_spree_promotion_action_line_items_on_promotion_action_id" + t.index ["variant_id"], name: "index_spree_promotion_action_line_items_on_variant_id" + end + + create_table "spree_promotion_actions", id: :serial, force: :cascade do |t| + t.integer "promotion_id" + t.integer "position" + t.string "type" + t.datetime "deleted_at" + t.index ["deleted_at"], name: "index_spree_promotion_actions_on_deleted_at" + t.index ["id", "type"], name: "index_spree_promotion_actions_on_id_and_type" + t.index ["promotion_id"], name: "index_spree_promotion_actions_on_promotion_id" + end + + create_table "spree_promotion_categories", id: :serial, force: :cascade do |t| + t.string "name" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "code" + end + + create_table "spree_promotion_rule_taxons", id: :serial, force: :cascade do |t| + t.integer "taxon_id" + t.integer "promotion_rule_id" + t.index ["promotion_rule_id"], name: "index_spree_promotion_rule_taxons_on_promotion_rule_id" + t.index ["taxon_id"], name: "index_spree_promotion_rule_taxons_on_taxon_id" + end + + create_table "spree_promotion_rule_users", force: :cascade do |t| + t.integer "user_id" + t.integer "promotion_rule_id" + t.index ["promotion_rule_id"], name: "index_promotion_rules_users_on_promotion_rule_id" + t.index ["user_id", "promotion_rule_id"], name: "index_promotion_rules_users_on_user_id_and_promotion_rule_id" + end + + create_table "spree_promotion_rules", id: :serial, force: :cascade do |t| + t.integer "promotion_id" + t.integer "user_id" + t.integer "product_group_id" + t.string "type" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "code" + t.text "preferences" + t.index ["product_group_id"], name: "index_promotion_rules_on_product_group_id" + t.index ["promotion_id"], name: "index_spree_promotion_rules_on_promotion_id" + t.index ["user_id"], name: "index_promotion_rules_on_user_id" + end + + create_table "spree_promotions", id: :serial, force: :cascade do |t| + t.string "description" + t.datetime "expires_at" + t.datetime "starts_at" + t.string "name" + t.string "type" + t.integer "usage_limit" + t.string "match_policy", default: "all" + t.string "code" + t.boolean "advertise", default: false + t.string "path" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "promotion_category_id" + t.index ["advertise"], name: "index_spree_promotions_on_advertise" + t.index ["code"], name: "index_spree_promotions_on_code", unique: true + t.index ["expires_at"], name: "index_spree_promotions_on_expires_at" + t.index ["id", "type"], name: "index_spree_promotions_on_id_and_type" + t.index ["promotion_category_id"], name: "index_spree_promotions_on_promotion_category_id" + t.index ["starts_at"], name: "index_spree_promotions_on_starts_at" + end + + create_table "spree_properties", id: :serial, force: :cascade do |t| + t.string "name" + t.string "presentation", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["name"], name: "index_spree_properties_on_name" + end + + create_table "spree_property_prototypes", force: :cascade do |t| + t.integer "prototype_id" + t.integer "property_id" + t.index ["property_id"], name: "index_spree_property_prototypes_on_property_id" + t.index ["prototype_id", "property_id"], name: "index_property_prototypes_on_prototype_id_and_property_id", unique: true + t.index ["prototype_id"], name: "index_spree_property_prototypes_on_prototype_id" + end + + create_table "spree_prototype_taxons", id: :serial, force: :cascade do |t| + t.integer "taxon_id" + t.integer "prototype_id" + t.index ["prototype_id", "taxon_id"], name: "index_spree_prototype_taxons_on_prototype_id_and_taxon_id" + t.index ["prototype_id"], name: "index_spree_prototype_taxons_on_prototype_id" + t.index ["taxon_id"], name: "index_spree_prototype_taxons_on_taxon_id" + end + + create_table "spree_prototypes", id: :serial, force: :cascade do |t| + t.string "name" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "spree_refund_reasons", id: :serial, force: :cascade do |t| + t.string "name" + t.boolean "active", default: true + t.boolean "mutable", default: true + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index "lower((name)::text)", name: "index_spree_refund_reasons_on_lower_name", unique: true + end + + create_table "spree_refunds", id: :serial, force: :cascade do |t| + t.integer "payment_id" + t.decimal "amount", precision: 10, scale: 2, default: "0.0", null: false + t.string "transaction_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "refund_reason_id" + t.integer "reimbursement_id" + t.index ["payment_id"], name: "index_spree_refunds_on_payment_id" + t.index ["refund_reason_id"], name: "index_refunds_on_refund_reason_id" + t.index ["reimbursement_id"], name: "index_spree_refunds_on_reimbursement_id" + end + + create_table "spree_reimbursement_credits", id: :serial, force: :cascade do |t| + t.decimal "amount", precision: 10, scale: 2, default: "0.0", null: false + t.integer "reimbursement_id" + t.integer "creditable_id" + t.string "creditable_type" + t.index ["creditable_id", "creditable_type"], name: "index_reimbursement_credits_on_creditable_id_and_type" + t.index ["reimbursement_id"], name: "index_spree_reimbursement_credits_on_reimbursement_id" + end + + create_table "spree_reimbursement_types", id: :serial, force: :cascade do |t| + t.string "name" + t.boolean "active", default: true + t.boolean "mutable", default: true + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "type" + t.index "lower((name)::text)", name: "index_spree_reimbursement_types_on_lower_name", unique: true + t.index ["type"], name: "index_spree_reimbursement_types_on_type" + end + + create_table "spree_reimbursements", id: :serial, force: :cascade do |t| + t.string "number" + t.string "reimbursement_status" + t.integer "customer_return_id" + t.integer "order_id" + t.decimal "total", precision: 10, scale: 2 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["customer_return_id"], name: "index_spree_reimbursements_on_customer_return_id" + t.index ["number"], name: "index_spree_reimbursements_on_number", unique: true + t.index ["order_id"], name: "index_spree_reimbursements_on_order_id" + end + + create_table "spree_return_authorization_reasons", id: :serial, force: :cascade do |t| + t.string "name" + t.boolean "active", default: true + t.boolean "mutable", default: true + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index "lower((name)::text)", name: "index_spree_return_authorization_reasons_on_lower_name", unique: true + end + + create_table "spree_return_authorizations", id: :serial, force: :cascade do |t| + t.string "number" + t.string "state" + t.integer "order_id" + t.text "memo" + t.datetime "created_at" + t.datetime "updated_at" + t.integer "stock_location_id" + t.integer "return_authorization_reason_id" + t.index ["number"], name: "index_spree_return_authorizations_on_number", unique: true + t.index ["order_id"], name: "index_spree_return_authorizations_on_order_id" + t.index ["return_authorization_reason_id"], name: "index_return_authorizations_on_return_authorization_reason_id" + t.index ["stock_location_id"], name: "index_spree_return_authorizations_on_stock_location_id" + end + + create_table "spree_return_items", id: :serial, force: :cascade do |t| + t.integer "return_authorization_id" + t.integer "inventory_unit_id" + t.integer "exchange_variant_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.decimal "pre_tax_amount", precision: 12, scale: 4, default: "0.0", null: false + t.decimal "included_tax_total", precision: 12, scale: 4, default: "0.0", null: false + t.decimal "additional_tax_total", precision: 12, scale: 4, default: "0.0", null: false + t.string "reception_status" + t.string "acceptance_status" + t.integer "customer_return_id" + t.integer "reimbursement_id" + t.text "acceptance_status_errors" + t.integer "preferred_reimbursement_type_id" + t.integer "override_reimbursement_type_id" + t.boolean "resellable", default: true, null: false + t.index ["customer_return_id"], name: "index_return_items_on_customer_return_id" + t.index ["exchange_variant_id"], name: "index_spree_return_items_on_exchange_variant_id" + t.index ["inventory_unit_id"], name: "index_spree_return_items_on_inventory_unit_id" + t.index ["override_reimbursement_type_id"], name: "index_spree_return_items_on_override_reimbursement_type_id" + t.index ["preferred_reimbursement_type_id"], name: "index_spree_return_items_on_preferred_reimbursement_type_id" + t.index ["reimbursement_id"], name: "index_spree_return_items_on_reimbursement_id" + t.index ["return_authorization_id"], name: "index_spree_return_items_on_return_authorization_id" + end + + create_table "spree_role_users", force: :cascade do |t| + t.integer "role_id" + t.integer "user_id" + t.index ["role_id"], name: "index_spree_role_users_on_role_id" + t.index ["user_id"], name: "index_spree_role_users_on_user_id" + end + + create_table "spree_roles", id: :serial, force: :cascade do |t| + t.string "name" + t.index "lower((name)::text)", name: "index_spree_roles_on_lower_name", unique: true + end + + create_table "spree_shipments", id: :serial, force: :cascade do |t| + t.string "tracking" + t.string "number" + t.decimal "cost", precision: 10, scale: 2, default: "0.0" + t.datetime "shipped_at" + t.integer "order_id" + t.integer "address_id" + t.string "state" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "stock_location_id" + t.decimal "adjustment_total", precision: 10, scale: 2, default: "0.0" + t.decimal "additional_tax_total", precision: 10, scale: 2, default: "0.0" + t.decimal "promo_total", precision: 10, scale: 2, default: "0.0" + t.decimal "included_tax_total", precision: 10, scale: 2, default: "0.0", null: false + t.decimal "pre_tax_amount", precision: 12, scale: 4, default: "0.0", null: false + t.decimal "taxable_adjustment_total", precision: 10, scale: 2, default: "0.0", null: false + t.decimal "non_taxable_adjustment_total", precision: 10, scale: 2, default: "0.0", null: false + t.index ["address_id"], name: "index_spree_shipments_on_address_id" + t.index ["number"], name: "index_spree_shipments_on_number", unique: true + t.index ["order_id"], name: "index_spree_shipments_on_order_id" + t.index ["stock_location_id"], name: "index_spree_shipments_on_stock_location_id" + end + + create_table "spree_shipping_categories", id: :serial, force: :cascade do |t| + t.string "name" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["name"], name: "index_spree_shipping_categories_on_name" + end + + create_table "spree_shipping_method_categories", id: :serial, force: :cascade do |t| + t.integer "shipping_method_id", null: false + t.integer "shipping_category_id", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["shipping_category_id", "shipping_method_id"], name: "unique_spree_shipping_method_categories", unique: true + t.index ["shipping_category_id"], name: "index_spree_shipping_method_categories_on_shipping_category_id" + t.index ["shipping_method_id"], name: "index_spree_shipping_method_categories_on_shipping_method_id" + end + + create_table "spree_shipping_method_zones", force: :cascade do |t| + t.integer "shipping_method_id" + t.integer "zone_id" + t.index ["shipping_method_id"], name: "index_spree_shipping_method_zones_on_shipping_method_id" + t.index ["zone_id"], name: "index_spree_shipping_method_zones_on_zone_id" + end + + create_table "spree_shipping_methods", id: :serial, force: :cascade do |t| + t.string "name" + t.string "display_on" + t.datetime "deleted_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "tracking_url" + t.string "admin_name" + t.integer "tax_category_id" + t.string "code" + t.index ["deleted_at"], name: "index_spree_shipping_methods_on_deleted_at" + t.index ["tax_category_id"], name: "index_spree_shipping_methods_on_tax_category_id" + end + + create_table "spree_shipping_rates", id: :serial, force: :cascade do |t| + t.integer "shipment_id" + t.integer "shipping_method_id" + t.boolean "selected", default: false + t.decimal "cost", precision: 8, scale: 2, default: "0.0" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "tax_rate_id" + t.index ["selected"], name: "index_spree_shipping_rates_on_selected" + t.index ["shipment_id", "shipping_method_id"], name: "spree_shipping_rates_join_index", unique: true + t.index ["shipment_id"], name: "index_spree_shipping_rates_on_shipment_id" + t.index ["shipping_method_id"], name: "index_spree_shipping_rates_on_shipping_method_id" + t.index ["tax_rate_id"], name: "index_spree_shipping_rates_on_tax_rate_id" + end + + create_table "spree_state_changes", id: :serial, force: :cascade do |t| + t.string "name" + t.string "previous_state" + t.integer "stateful_id" + t.integer "user_id" + t.string "stateful_type" + t.string "next_state" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["stateful_id", "stateful_type"], name: "index_spree_state_changes_on_stateful_id_and_stateful_type" + end + + create_table "spree_states", id: :serial, force: :cascade do |t| + t.string "name" + t.string "abbr" + t.integer "country_id" + t.datetime "updated_at" + t.index ["country_id"], name: "index_spree_states_on_country_id" + end + + create_table "spree_stock_items", id: :serial, force: :cascade do |t| + t.integer "stock_location_id" + t.integer "variant_id" + t.integer "count_on_hand", default: 0, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.boolean "backorderable", default: false + t.datetime "deleted_at" + t.index ["backorderable"], name: "index_spree_stock_items_on_backorderable" + t.index ["deleted_at"], name: "index_spree_stock_items_on_deleted_at" + t.index ["stock_location_id", "variant_id"], name: "stock_item_by_loc_and_var_id" + t.index ["stock_location_id"], name: "index_spree_stock_items_on_stock_location_id" + t.index ["variant_id"], name: "index_spree_stock_items_on_variant_id" + end + + create_table "spree_stock_locations", id: :serial, force: :cascade do |t| + t.string "name" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.boolean "default", default: false, null: false + t.string "address1" + t.string "address2" + t.string "city" + t.integer "state_id" + t.string "state_name" + t.integer "country_id" + t.string "zipcode" + t.string "phone" + t.boolean "active", default: true + t.boolean "backorderable_default", default: false + t.boolean "propagate_all_variants", default: true + t.string "admin_name" + t.index ["active"], name: "index_spree_stock_locations_on_active" + t.index ["backorderable_default"], name: "index_spree_stock_locations_on_backorderable_default" + t.index ["country_id"], name: "index_spree_stock_locations_on_country_id" + t.index ["propagate_all_variants"], name: "index_spree_stock_locations_on_propagate_all_variants" + t.index ["state_id"], name: "index_spree_stock_locations_on_state_id" + end + + create_table "spree_stock_movements", id: :serial, force: :cascade do |t| + t.integer "stock_item_id" + t.integer "quantity", default: 0 + t.string "action" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "originator_type" + t.integer "originator_id" + t.index ["originator_id", "originator_type"], name: "index_stock_movements_on_originator_id_and_originator_type" + t.index ["stock_item_id"], name: "index_spree_stock_movements_on_stock_item_id" + end + + create_table "spree_stock_transfers", id: :serial, force: :cascade do |t| + t.string "type" + t.string "reference" + t.integer "source_location_id" + t.integer "destination_location_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "number" + t.index ["destination_location_id"], name: "index_spree_stock_transfers_on_destination_location_id" + t.index ["number"], name: "index_spree_stock_transfers_on_number", unique: true + t.index ["source_location_id"], name: "index_spree_stock_transfers_on_source_location_id" + end + + create_table "spree_store_credit_categories", id: :serial, force: :cascade do |t| + t.string "name" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "spree_store_credit_events", id: :serial, force: :cascade do |t| + t.integer "store_credit_id", null: false + t.string "action", null: false + t.decimal "amount", precision: 8, scale: 2 + t.string "authorization_code", null: false + t.decimal "user_total_amount", precision: 8, scale: 2, default: "0.0", null: false + t.integer "originator_id" + t.string "originator_type" + t.datetime "deleted_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["originator_id", "originator_type"], name: "spree_store_credit_events_originator" + t.index ["store_credit_id"], name: "index_spree_store_credit_events_on_store_credit_id" + end + + create_table "spree_store_credit_types", id: :serial, force: :cascade do |t| + t.string "name" + t.integer "priority" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["priority"], name: "index_spree_store_credit_types_on_priority" + end + + create_table "spree_store_credits", id: :serial, force: :cascade do |t| + t.integer "user_id" + t.integer "category_id" + t.integer "created_by_id" + t.decimal "amount", precision: 8, scale: 2, default: "0.0", null: false + t.decimal "amount_used", precision: 8, scale: 2, default: "0.0", null: false + t.text "memo" + t.datetime "deleted_at" + t.string "currency" + t.decimal "amount_authorized", precision: 8, scale: 2, default: "0.0", null: false + t.integer "originator_id" + t.string "originator_type" + t.integer "type_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["deleted_at"], name: "index_spree_store_credits_on_deleted_at" + t.index ["originator_id", "originator_type"], name: "spree_store_credits_originator" + t.index ["type_id"], name: "index_spree_store_credits_on_type_id" + t.index ["user_id"], name: "index_spree_store_credits_on_user_id" + end + + create_table "spree_stores", id: :serial, force: :cascade do |t| + t.string "name" + t.string "url" + t.text "meta_description" + t.text "meta_keywords" + t.string "seo_title" + t.string "mail_from_address" + t.string "default_currency" + t.string "code" + t.boolean "default", default: false, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index "lower((code)::text)", name: "index_spree_stores_on_lower_code", unique: true + t.index ["default"], name: "index_spree_stores_on_default" + t.index ["url"], name: "index_spree_stores_on_url" + end + + create_table "spree_taggings", id: :serial, force: :cascade do |t| + t.integer "tag_id" + t.string "taggable_type" + t.integer "taggable_id" + t.string "tagger_type" + t.integer "tagger_id" + t.string "context", limit: 128 + t.datetime "created_at" + t.index ["context"], name: "index_spree_taggings_on_context" + t.index ["tag_id", "taggable_id", "taggable_type", "context", "tagger_id", "tagger_type"], name: "spree_taggings_idx", unique: true + t.index ["tag_id"], name: "index_spree_taggings_on_tag_id" + t.index ["taggable_id", "taggable_type", "tagger_id", "context"], name: "spree_taggings_idy" + t.index ["taggable_id"], name: "index_spree_taggings_on_taggable_id" + t.index ["taggable_type"], name: "index_spree_taggings_on_taggable_type" + t.index ["tagger_id", "tagger_type"], name: "index_spree_taggings_on_tagger_id_and_tagger_type" + t.index ["tagger_id"], name: "index_spree_taggings_on_tagger_id" + end + + create_table "spree_tags", id: :serial, force: :cascade do |t| + t.string "name" + t.integer "taggings_count", default: 0 + t.index ["name"], name: "index_spree_tags_on_name", unique: true + end + + create_table "spree_tax_categories", id: :serial, force: :cascade do |t| + t.string "name" + t.string "description" + t.boolean "is_default", default: false + t.datetime "deleted_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "tax_code" + t.index ["deleted_at"], name: "index_spree_tax_categories_on_deleted_at" + t.index ["is_default"], name: "index_spree_tax_categories_on_is_default" + end + + create_table "spree_tax_rates", id: :serial, force: :cascade do |t| + t.decimal "amount", precision: 8, scale: 5 + t.integer "zone_id" + t.integer "tax_category_id" + t.boolean "included_in_price", default: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "name" + t.boolean "show_rate_in_label", default: true + t.datetime "deleted_at" + t.index ["deleted_at"], name: "index_spree_tax_rates_on_deleted_at" + t.index ["included_in_price"], name: "index_spree_tax_rates_on_included_in_price" + t.index ["show_rate_in_label"], name: "index_spree_tax_rates_on_show_rate_in_label" + t.index ["tax_category_id"], name: "index_spree_tax_rates_on_tax_category_id" + t.index ["zone_id"], name: "index_spree_tax_rates_on_zone_id" + end + + create_table "spree_taxonomies", id: :serial, force: :cascade do |t| + t.string "name", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "position", default: 0 + t.index ["position"], name: "index_spree_taxonomies_on_position" + end + + create_table "spree_taxons", id: :serial, force: :cascade do |t| + t.integer "parent_id" + t.integer "position", default: 0 + t.string "name", null: false + t.string "permalink" + t.integer "taxonomy_id" + t.integer "lft" + t.integer "rgt" + t.text "description" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "meta_title" + t.string "meta_description" + t.string "meta_keywords" + t.integer "depth" + t.index ["lft"], name: "index_spree_taxons_on_lft" + t.index ["name"], name: "index_spree_taxons_on_name" + t.index ["parent_id"], name: "index_taxons_on_parent_id" + t.index ["permalink"], name: "index_taxons_on_permalink" + t.index ["position"], name: "index_spree_taxons_on_position" + t.index ["rgt"], name: "index_spree_taxons_on_rgt" + t.index ["taxonomy_id"], name: "index_taxons_on_taxonomy_id" + end + + create_table "spree_trackers", id: :serial, force: :cascade do |t| + t.string "analytics_id" + t.boolean "active", default: true + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "engine", default: 0, null: false + t.index ["active"], name: "index_spree_trackers_on_active" + end + + create_table "spree_users", id: :serial, force: :cascade do |t| + t.string "encrypted_password", limit: 128 + t.string "password_salt", limit: 128 + t.string "email" + t.string "remember_token" + t.string "persistence_token" + t.string "reset_password_token" + t.string "perishable_token" + t.integer "sign_in_count", default: 0, null: false + t.integer "failed_attempts", default: 0, null: false + t.datetime "last_request_at" + t.datetime "current_sign_in_at" + t.datetime "last_sign_in_at" + t.string "current_sign_in_ip" + t.string "last_sign_in_ip" + t.string "login" + t.integer "ship_address_id" + t.integer "bill_address_id" + t.string "authentication_token" + t.string "unlock_token" + t.datetime "locked_at" + t.datetime "reset_password_sent_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "spree_api_key", limit: 48 + t.datetime "remember_created_at" + t.datetime "deleted_at" + t.string "confirmation_token" + t.datetime "confirmed_at" + t.datetime "confirmation_sent_at" + t.index ["bill_address_id"], name: "index_spree_users_on_bill_address_id" + t.index ["deleted_at"], name: "index_spree_users_on_deleted_at" + t.index ["email"], name: "email_idx_unique", unique: true + t.index ["ship_address_id"], name: "index_spree_users_on_ship_address_id" + t.index ["spree_api_key"], name: "index_spree_users_on_spree_api_key" + end + + create_table "spree_variants", id: :serial, force: :cascade do |t| + t.string "sku", default: "", null: false + t.decimal "weight", precision: 8, scale: 2, default: "0.0" + t.decimal "height", precision: 8, scale: 2 + t.decimal "width", precision: 8, scale: 2 + t.decimal "depth", precision: 8, scale: 2 + t.datetime "deleted_at" + t.boolean "is_master", default: false + t.integer "product_id" + t.decimal "cost_price", precision: 10, scale: 2 + t.integer "position" + t.string "cost_currency" + t.boolean "track_inventory", default: true + t.integer "tax_category_id" + t.datetime "updated_at", null: false + t.datetime "discontinue_on" + t.datetime "created_at", null: false + t.index ["deleted_at"], name: "index_spree_variants_on_deleted_at" + t.index ["discontinue_on"], name: "index_spree_variants_on_discontinue_on" + t.index ["is_master"], name: "index_spree_variants_on_is_master" + t.index ["position"], name: "index_spree_variants_on_position" + t.index ["product_id"], name: "index_spree_variants_on_product_id" + t.index ["sku"], name: "index_spree_variants_on_sku" + t.index ["tax_category_id"], name: "index_spree_variants_on_tax_category_id" + t.index ["track_inventory"], name: "index_spree_variants_on_track_inventory" + end + + create_table "spree_zone_members", id: :serial, force: :cascade do |t| + t.string "zoneable_type" + t.integer "zoneable_id" + t.integer "zone_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["zone_id"], name: "index_spree_zone_members_on_zone_id" + t.index ["zoneable_id", "zoneable_type"], name: "index_spree_zone_members_on_zoneable_id_and_zoneable_type" + end + + create_table "spree_zones", id: :serial, force: :cascade do |t| + t.string "name" + t.string "description" + t.boolean "default_tax", default: false + t.integer "zone_members_count", default: 0 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "kind" + t.index ["default_tax"], name: "index_spree_zones_on_default_tax" + t.index ["kind"], name: "index_spree_zones_on_kind" + end + +end diff --git a/db/seeds.rb b/db/seeds.rb new file mode 100644 index 0000000..00fe3b5 --- /dev/null +++ b/db/seeds.rb @@ -0,0 +1,10 @@ +# This file should contain all the record creation needed to seed the database with its default values. +# The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup). +# +# Examples: +# +# movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) +# Character.create(name: 'Luke', movie: movies.first) + +Spree::Core::Engine.load_seed if defined?(Spree::Core) +Spree::Auth::Engine.load_seed if defined?(Spree::Auth) diff --git a/lib/assets/.keep b/lib/assets/.keep new file mode 100644 index 0000000..e69de29 diff --git a/lib/tasks/.keep b/lib/tasks/.keep new file mode 100644 index 0000000..e69de29 diff --git a/log/.keep b/log/.keep new file mode 100644 index 0000000..e69de29 diff --git a/package.json b/package.json new file mode 100644 index 0000000..0ad21c0 --- /dev/null +++ b/package.json @@ -0,0 +1,5 @@ +{ + "name": "spreeshop", + "private": true, + "dependencies": {} +} diff --git a/public/404.html b/public/404.html new file mode 100644 index 0000000..2be3af2 --- /dev/null +++ b/public/404.html @@ -0,0 +1,67 @@ + + + + The page you were looking for doesn't exist (404) + + + + + + +
    +
    +

    The page you were looking for doesn't exist.

    +

    You may have mistyped the address or the page may have moved.

    +
    +

    If you are the application owner check the logs for more information.

    +
    + + diff --git a/public/422.html b/public/422.html new file mode 100644 index 0000000..c08eac0 --- /dev/null +++ b/public/422.html @@ -0,0 +1,67 @@ + + + + The change you wanted was rejected (422) + + + + + + +
    +
    +

    The change you wanted was rejected.

    +

    Maybe you tried to change something you didn't have access to.

    +
    +

    If you are the application owner check the logs for more information.

    +
    + + diff --git a/public/500.html b/public/500.html new file mode 100644 index 0000000..78a030a --- /dev/null +++ b/public/500.html @@ -0,0 +1,66 @@ + + + + We're sorry, but something went wrong (500) + + + + + + +
    +
    +

    We're sorry, but something went wrong.

    +
    +

    If you are the application owner check the logs for more information.

    +
    + + diff --git a/public/apple-touch-icon-precomposed.png b/public/apple-touch-icon-precomposed.png new file mode 100644 index 0000000..e69de29 diff --git a/public/apple-touch-icon.png b/public/apple-touch-icon.png new file mode 100644 index 0000000..e69de29 diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000..e69de29 diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 0000000..060ea42 --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,9 @@ +# See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file +User-agent: * +Disallow: /checkout +Disallow: /cart +Disallow: /orders +Disallow: /user +Disallow: /account +Disallow: /api +Disallow: /password diff --git a/public/spree/products/1/large/ror_baseball_jersey_red.png b/public/spree/products/1/large/ror_baseball_jersey_red.png new file mode 100644 index 0000000..dc06d34 Binary files /dev/null and b/public/spree/products/1/large/ror_baseball_jersey_red.png differ diff --git a/public/spree/products/1/mini/ror_baseball_jersey_red.png b/public/spree/products/1/mini/ror_baseball_jersey_red.png new file mode 100644 index 0000000..57c8567 Binary files /dev/null and b/public/spree/products/1/mini/ror_baseball_jersey_red.png differ diff --git a/public/spree/products/1/original/ror_baseball_jersey_red.png b/public/spree/products/1/original/ror_baseball_jersey_red.png new file mode 100644 index 0000000..4deb99a Binary files /dev/null and b/public/spree/products/1/original/ror_baseball_jersey_red.png differ diff --git a/public/spree/products/1/product/ror_baseball_jersey_red.png b/public/spree/products/1/product/ror_baseball_jersey_red.png new file mode 100644 index 0000000..dc06d34 Binary files /dev/null and b/public/spree/products/1/product/ror_baseball_jersey_red.png differ diff --git a/public/spree/products/1/small/ror_baseball_jersey_red.png b/public/spree/products/1/small/ror_baseball_jersey_red.png new file mode 100644 index 0000000..515c0be Binary files /dev/null and b/public/spree/products/1/small/ror_baseball_jersey_red.png differ diff --git a/public/spree/products/10/large/ror_baseball_jersey_back_blue.png b/public/spree/products/10/large/ror_baseball_jersey_back_blue.png new file mode 100644 index 0000000..f286553 Binary files /dev/null and b/public/spree/products/10/large/ror_baseball_jersey_back_blue.png differ diff --git a/public/spree/products/10/mini/ror_baseball_jersey_back_blue.png b/public/spree/products/10/mini/ror_baseball_jersey_back_blue.png new file mode 100644 index 0000000..0b90baf Binary files /dev/null and b/public/spree/products/10/mini/ror_baseball_jersey_back_blue.png differ diff --git a/public/spree/products/10/original/ror_baseball_jersey_back_blue.png b/public/spree/products/10/original/ror_baseball_jersey_back_blue.png new file mode 100644 index 0000000..2f023f2 Binary files /dev/null and b/public/spree/products/10/original/ror_baseball_jersey_back_blue.png differ diff --git a/public/spree/products/10/product/ror_baseball_jersey_back_blue.png b/public/spree/products/10/product/ror_baseball_jersey_back_blue.png new file mode 100644 index 0000000..f286553 Binary files /dev/null and b/public/spree/products/10/product/ror_baseball_jersey_back_blue.png differ diff --git a/public/spree/products/10/small/ror_baseball_jersey_back_blue.png b/public/spree/products/10/small/ror_baseball_jersey_back_blue.png new file mode 100644 index 0000000..1ba6e33 Binary files /dev/null and b/public/spree/products/10/small/ror_baseball_jersey_back_blue.png differ diff --git a/public/spree/products/11/large/ror_baseball_jersey_green.png b/public/spree/products/11/large/ror_baseball_jersey_green.png new file mode 100644 index 0000000..eba327a Binary files /dev/null and b/public/spree/products/11/large/ror_baseball_jersey_green.png differ diff --git a/public/spree/products/11/mini/ror_baseball_jersey_green.png b/public/spree/products/11/mini/ror_baseball_jersey_green.png new file mode 100644 index 0000000..a1cb6af Binary files /dev/null and b/public/spree/products/11/mini/ror_baseball_jersey_green.png differ diff --git a/public/spree/products/11/original/ror_baseball_jersey_green.png b/public/spree/products/11/original/ror_baseball_jersey_green.png new file mode 100644 index 0000000..4bd8c0a Binary files /dev/null and b/public/spree/products/11/original/ror_baseball_jersey_green.png differ diff --git a/public/spree/products/11/product/ror_baseball_jersey_green.png b/public/spree/products/11/product/ror_baseball_jersey_green.png new file mode 100644 index 0000000..eba327a Binary files /dev/null and b/public/spree/products/11/product/ror_baseball_jersey_green.png differ diff --git a/public/spree/products/11/small/ror_baseball_jersey_green.png b/public/spree/products/11/small/ror_baseball_jersey_green.png new file mode 100644 index 0000000..6d44faf Binary files /dev/null and b/public/spree/products/11/small/ror_baseball_jersey_green.png differ diff --git a/public/spree/products/12/large/ror_baseball_jersey_back_green.png b/public/spree/products/12/large/ror_baseball_jersey_back_green.png new file mode 100644 index 0000000..b5890a7 Binary files /dev/null and b/public/spree/products/12/large/ror_baseball_jersey_back_green.png differ diff --git a/public/spree/products/12/mini/ror_baseball_jersey_back_green.png b/public/spree/products/12/mini/ror_baseball_jersey_back_green.png new file mode 100644 index 0000000..d6b3f68 Binary files /dev/null and b/public/spree/products/12/mini/ror_baseball_jersey_back_green.png differ diff --git a/public/spree/products/12/original/ror_baseball_jersey_back_green.png b/public/spree/products/12/original/ror_baseball_jersey_back_green.png new file mode 100644 index 0000000..c769e35 Binary files /dev/null and b/public/spree/products/12/original/ror_baseball_jersey_back_green.png differ diff --git a/public/spree/products/12/product/ror_baseball_jersey_back_green.png b/public/spree/products/12/product/ror_baseball_jersey_back_green.png new file mode 100644 index 0000000..b5890a7 Binary files /dev/null and b/public/spree/products/12/product/ror_baseball_jersey_back_green.png differ diff --git a/public/spree/products/12/small/ror_baseball_jersey_back_green.png b/public/spree/products/12/small/ror_baseball_jersey_back_green.png new file mode 100644 index 0000000..2ba1378 Binary files /dev/null and b/public/spree/products/12/small/ror_baseball_jersey_back_green.png differ diff --git a/public/spree/products/13/large/ror_baseball_jersey_red.png b/public/spree/products/13/large/ror_baseball_jersey_red.png new file mode 100644 index 0000000..dc06d34 Binary files /dev/null and b/public/spree/products/13/large/ror_baseball_jersey_red.png differ diff --git a/public/spree/products/13/mini/ror_baseball_jersey_red.png b/public/spree/products/13/mini/ror_baseball_jersey_red.png new file mode 100644 index 0000000..57c8567 Binary files /dev/null and b/public/spree/products/13/mini/ror_baseball_jersey_red.png differ diff --git a/public/spree/products/13/original/ror_baseball_jersey_red.png b/public/spree/products/13/original/ror_baseball_jersey_red.png new file mode 100644 index 0000000..4deb99a Binary files /dev/null and b/public/spree/products/13/original/ror_baseball_jersey_red.png differ diff --git a/public/spree/products/13/product/ror_baseball_jersey_red.png b/public/spree/products/13/product/ror_baseball_jersey_red.png new file mode 100644 index 0000000..dc06d34 Binary files /dev/null and b/public/spree/products/13/product/ror_baseball_jersey_red.png differ diff --git a/public/spree/products/13/small/ror_baseball_jersey_red.png b/public/spree/products/13/small/ror_baseball_jersey_red.png new file mode 100644 index 0000000..515c0be Binary files /dev/null and b/public/spree/products/13/small/ror_baseball_jersey_red.png differ diff --git a/public/spree/products/14/large/ror_baseball_jersey_back_red.png b/public/spree/products/14/large/ror_baseball_jersey_back_red.png new file mode 100644 index 0000000..60dd13c Binary files /dev/null and b/public/spree/products/14/large/ror_baseball_jersey_back_red.png differ diff --git a/public/spree/products/14/mini/ror_baseball_jersey_back_red.png b/public/spree/products/14/mini/ror_baseball_jersey_back_red.png new file mode 100644 index 0000000..26a502f Binary files /dev/null and b/public/spree/products/14/mini/ror_baseball_jersey_back_red.png differ diff --git a/public/spree/products/14/original/ror_baseball_jersey_back_red.png b/public/spree/products/14/original/ror_baseball_jersey_back_red.png new file mode 100644 index 0000000..2be2275 Binary files /dev/null and b/public/spree/products/14/original/ror_baseball_jersey_back_red.png differ diff --git a/public/spree/products/14/product/ror_baseball_jersey_back_red.png b/public/spree/products/14/product/ror_baseball_jersey_back_red.png new file mode 100644 index 0000000..60dd13c Binary files /dev/null and b/public/spree/products/14/product/ror_baseball_jersey_back_red.png differ diff --git a/public/spree/products/14/small/ror_baseball_jersey_back_red.png b/public/spree/products/14/small/ror_baseball_jersey_back_red.png new file mode 100644 index 0000000..4dc59a8 Binary files /dev/null and b/public/spree/products/14/small/ror_baseball_jersey_back_red.png differ diff --git a/public/spree/products/15/large/ror_baseball_jersey_blue.png b/public/spree/products/15/large/ror_baseball_jersey_blue.png new file mode 100644 index 0000000..7b8e539 Binary files /dev/null and b/public/spree/products/15/large/ror_baseball_jersey_blue.png differ diff --git a/public/spree/products/15/mini/ror_baseball_jersey_blue.png b/public/spree/products/15/mini/ror_baseball_jersey_blue.png new file mode 100644 index 0000000..6b4bc93 Binary files /dev/null and b/public/spree/products/15/mini/ror_baseball_jersey_blue.png differ diff --git a/public/spree/products/15/original/ror_baseball_jersey_blue.png b/public/spree/products/15/original/ror_baseball_jersey_blue.png new file mode 100644 index 0000000..ad15f9f Binary files /dev/null and b/public/spree/products/15/original/ror_baseball_jersey_blue.png differ diff --git a/public/spree/products/15/product/ror_baseball_jersey_blue.png b/public/spree/products/15/product/ror_baseball_jersey_blue.png new file mode 100644 index 0000000..7b8e539 Binary files /dev/null and b/public/spree/products/15/product/ror_baseball_jersey_blue.png differ diff --git a/public/spree/products/15/small/ror_baseball_jersey_blue.png b/public/spree/products/15/small/ror_baseball_jersey_blue.png new file mode 100644 index 0000000..51f2ee4 Binary files /dev/null and b/public/spree/products/15/small/ror_baseball_jersey_blue.png differ diff --git a/public/spree/products/16/large/ror_baseball_jersey_back_blue.png b/public/spree/products/16/large/ror_baseball_jersey_back_blue.png new file mode 100644 index 0000000..f286553 Binary files /dev/null and b/public/spree/products/16/large/ror_baseball_jersey_back_blue.png differ diff --git a/public/spree/products/16/mini/ror_baseball_jersey_back_blue.png b/public/spree/products/16/mini/ror_baseball_jersey_back_blue.png new file mode 100644 index 0000000..0b90baf Binary files /dev/null and b/public/spree/products/16/mini/ror_baseball_jersey_back_blue.png differ diff --git a/public/spree/products/16/original/ror_baseball_jersey_back_blue.png b/public/spree/products/16/original/ror_baseball_jersey_back_blue.png new file mode 100644 index 0000000..2f023f2 Binary files /dev/null and b/public/spree/products/16/original/ror_baseball_jersey_back_blue.png differ diff --git a/public/spree/products/16/product/ror_baseball_jersey_back_blue.png b/public/spree/products/16/product/ror_baseball_jersey_back_blue.png new file mode 100644 index 0000000..f286553 Binary files /dev/null and b/public/spree/products/16/product/ror_baseball_jersey_back_blue.png differ diff --git a/public/spree/products/16/small/ror_baseball_jersey_back_blue.png b/public/spree/products/16/small/ror_baseball_jersey_back_blue.png new file mode 100644 index 0000000..1ba6e33 Binary files /dev/null and b/public/spree/products/16/small/ror_baseball_jersey_back_blue.png differ diff --git a/public/spree/products/17/large/ror_baseball_jersey_green.png b/public/spree/products/17/large/ror_baseball_jersey_green.png new file mode 100644 index 0000000..eba327a Binary files /dev/null and b/public/spree/products/17/large/ror_baseball_jersey_green.png differ diff --git a/public/spree/products/17/mini/ror_baseball_jersey_green.png b/public/spree/products/17/mini/ror_baseball_jersey_green.png new file mode 100644 index 0000000..a1cb6af Binary files /dev/null and b/public/spree/products/17/mini/ror_baseball_jersey_green.png differ diff --git a/public/spree/products/17/original/ror_baseball_jersey_green.png b/public/spree/products/17/original/ror_baseball_jersey_green.png new file mode 100644 index 0000000..4bd8c0a Binary files /dev/null and b/public/spree/products/17/original/ror_baseball_jersey_green.png differ diff --git a/public/spree/products/17/product/ror_baseball_jersey_green.png b/public/spree/products/17/product/ror_baseball_jersey_green.png new file mode 100644 index 0000000..eba327a Binary files /dev/null and b/public/spree/products/17/product/ror_baseball_jersey_green.png differ diff --git a/public/spree/products/17/small/ror_baseball_jersey_green.png b/public/spree/products/17/small/ror_baseball_jersey_green.png new file mode 100644 index 0000000..6d44faf Binary files /dev/null and b/public/spree/products/17/small/ror_baseball_jersey_green.png differ diff --git a/public/spree/products/18/large/ror_baseball_jersey_back_green.png b/public/spree/products/18/large/ror_baseball_jersey_back_green.png new file mode 100644 index 0000000..b5890a7 Binary files /dev/null and b/public/spree/products/18/large/ror_baseball_jersey_back_green.png differ diff --git a/public/spree/products/18/mini/ror_baseball_jersey_back_green.png b/public/spree/products/18/mini/ror_baseball_jersey_back_green.png new file mode 100644 index 0000000..d6b3f68 Binary files /dev/null and b/public/spree/products/18/mini/ror_baseball_jersey_back_green.png differ diff --git a/public/spree/products/18/original/ror_baseball_jersey_back_green.png b/public/spree/products/18/original/ror_baseball_jersey_back_green.png new file mode 100644 index 0000000..c769e35 Binary files /dev/null and b/public/spree/products/18/original/ror_baseball_jersey_back_green.png differ diff --git a/public/spree/products/18/product/ror_baseball_jersey_back_green.png b/public/spree/products/18/product/ror_baseball_jersey_back_green.png new file mode 100644 index 0000000..b5890a7 Binary files /dev/null and b/public/spree/products/18/product/ror_baseball_jersey_back_green.png differ diff --git a/public/spree/products/18/small/ror_baseball_jersey_back_green.png b/public/spree/products/18/small/ror_baseball_jersey_back_green.png new file mode 100644 index 0000000..2ba1378 Binary files /dev/null and b/public/spree/products/18/small/ror_baseball_jersey_back_green.png differ diff --git a/public/spree/products/19/large/ror_baseball_jersey_green.png b/public/spree/products/19/large/ror_baseball_jersey_green.png new file mode 100644 index 0000000..eba327a Binary files /dev/null and b/public/spree/products/19/large/ror_baseball_jersey_green.png differ diff --git a/public/spree/products/19/mini/ror_baseball_jersey_green.png b/public/spree/products/19/mini/ror_baseball_jersey_green.png new file mode 100644 index 0000000..a1cb6af Binary files /dev/null and b/public/spree/products/19/mini/ror_baseball_jersey_green.png differ diff --git a/public/spree/products/19/original/ror_baseball_jersey_green.png b/public/spree/products/19/original/ror_baseball_jersey_green.png new file mode 100644 index 0000000..4bd8c0a Binary files /dev/null and b/public/spree/products/19/original/ror_baseball_jersey_green.png differ diff --git a/public/spree/products/19/product/ror_baseball_jersey_green.png b/public/spree/products/19/product/ror_baseball_jersey_green.png new file mode 100644 index 0000000..eba327a Binary files /dev/null and b/public/spree/products/19/product/ror_baseball_jersey_green.png differ diff --git a/public/spree/products/19/small/ror_baseball_jersey_green.png b/public/spree/products/19/small/ror_baseball_jersey_green.png new file mode 100644 index 0000000..6d44faf Binary files /dev/null and b/public/spree/products/19/small/ror_baseball_jersey_green.png differ diff --git a/public/spree/products/2/large/ror_baseball_jersey_back_red.png b/public/spree/products/2/large/ror_baseball_jersey_back_red.png new file mode 100644 index 0000000..60dd13c Binary files /dev/null and b/public/spree/products/2/large/ror_baseball_jersey_back_red.png differ diff --git a/public/spree/products/2/mini/ror_baseball_jersey_back_red.png b/public/spree/products/2/mini/ror_baseball_jersey_back_red.png new file mode 100644 index 0000000..26a502f Binary files /dev/null and b/public/spree/products/2/mini/ror_baseball_jersey_back_red.png differ diff --git a/public/spree/products/2/original/ror_baseball_jersey_back_red.png b/public/spree/products/2/original/ror_baseball_jersey_back_red.png new file mode 100644 index 0000000..2be2275 Binary files /dev/null and b/public/spree/products/2/original/ror_baseball_jersey_back_red.png differ diff --git a/public/spree/products/2/product/ror_baseball_jersey_back_red.png b/public/spree/products/2/product/ror_baseball_jersey_back_red.png new file mode 100644 index 0000000..60dd13c Binary files /dev/null and b/public/spree/products/2/product/ror_baseball_jersey_back_red.png differ diff --git a/public/spree/products/2/small/ror_baseball_jersey_back_red.png b/public/spree/products/2/small/ror_baseball_jersey_back_red.png new file mode 100644 index 0000000..4dc59a8 Binary files /dev/null and b/public/spree/products/2/small/ror_baseball_jersey_back_red.png differ diff --git a/public/spree/products/20/large/ror_baseball_jersey_back_green.png b/public/spree/products/20/large/ror_baseball_jersey_back_green.png new file mode 100644 index 0000000..b5890a7 Binary files /dev/null and b/public/spree/products/20/large/ror_baseball_jersey_back_green.png differ diff --git a/public/spree/products/20/mini/ror_baseball_jersey_back_green.png b/public/spree/products/20/mini/ror_baseball_jersey_back_green.png new file mode 100644 index 0000000..d6b3f68 Binary files /dev/null and b/public/spree/products/20/mini/ror_baseball_jersey_back_green.png differ diff --git a/public/spree/products/20/original/ror_baseball_jersey_back_green.png b/public/spree/products/20/original/ror_baseball_jersey_back_green.png new file mode 100644 index 0000000..c769e35 Binary files /dev/null and b/public/spree/products/20/original/ror_baseball_jersey_back_green.png differ diff --git a/public/spree/products/20/product/ror_baseball_jersey_back_green.png b/public/spree/products/20/product/ror_baseball_jersey_back_green.png new file mode 100644 index 0000000..b5890a7 Binary files /dev/null and b/public/spree/products/20/product/ror_baseball_jersey_back_green.png differ diff --git a/public/spree/products/20/small/ror_baseball_jersey_back_green.png b/public/spree/products/20/small/ror_baseball_jersey_back_green.png new file mode 100644 index 0000000..2ba1378 Binary files /dev/null and b/public/spree/products/20/small/ror_baseball_jersey_back_green.png differ diff --git a/public/spree/products/21/large/ror_tote.jpeg b/public/spree/products/21/large/ror_tote.jpeg new file mode 100644 index 0000000..7d7b0cd Binary files /dev/null and b/public/spree/products/21/large/ror_tote.jpeg differ diff --git a/public/spree/products/21/mini/ror_tote.jpeg b/public/spree/products/21/mini/ror_tote.jpeg new file mode 100644 index 0000000..c86c8ac Binary files /dev/null and b/public/spree/products/21/mini/ror_tote.jpeg differ diff --git a/public/spree/products/21/original/ror_tote.jpeg b/public/spree/products/21/original/ror_tote.jpeg new file mode 100644 index 0000000..38eb0f5 Binary files /dev/null and b/public/spree/products/21/original/ror_tote.jpeg differ diff --git a/public/spree/products/21/product/ror_tote.jpeg b/public/spree/products/21/product/ror_tote.jpeg new file mode 100644 index 0000000..6ccae87 Binary files /dev/null and b/public/spree/products/21/product/ror_tote.jpeg differ diff --git a/public/spree/products/21/small/ror_tote.jpeg b/public/spree/products/21/small/ror_tote.jpeg new file mode 100644 index 0000000..4dd7140 Binary files /dev/null and b/public/spree/products/21/small/ror_tote.jpeg differ diff --git a/public/spree/products/22/large/ror_tote_back.jpeg b/public/spree/products/22/large/ror_tote_back.jpeg new file mode 100644 index 0000000..84acdf9 Binary files /dev/null and b/public/spree/products/22/large/ror_tote_back.jpeg differ diff --git a/public/spree/products/22/mini/ror_tote_back.jpeg b/public/spree/products/22/mini/ror_tote_back.jpeg new file mode 100644 index 0000000..9d8ad74 Binary files /dev/null and b/public/spree/products/22/mini/ror_tote_back.jpeg differ diff --git a/public/spree/products/22/original/ror_tote_back.jpeg b/public/spree/products/22/original/ror_tote_back.jpeg new file mode 100644 index 0000000..0410ebb Binary files /dev/null and b/public/spree/products/22/original/ror_tote_back.jpeg differ diff --git a/public/spree/products/22/product/ror_tote_back.jpeg b/public/spree/products/22/product/ror_tote_back.jpeg new file mode 100644 index 0000000..1a74e40 Binary files /dev/null and b/public/spree/products/22/product/ror_tote_back.jpeg differ diff --git a/public/spree/products/22/small/ror_tote_back.jpeg b/public/spree/products/22/small/ror_tote_back.jpeg new file mode 100644 index 0000000..882d7d9 Binary files /dev/null and b/public/spree/products/22/small/ror_tote_back.jpeg differ diff --git a/public/spree/products/23/large/ror_bag.jpeg b/public/spree/products/23/large/ror_bag.jpeg new file mode 100644 index 0000000..f4b642f Binary files /dev/null and b/public/spree/products/23/large/ror_bag.jpeg differ diff --git a/public/spree/products/23/mini/ror_bag.jpeg b/public/spree/products/23/mini/ror_bag.jpeg new file mode 100644 index 0000000..321a974 Binary files /dev/null and b/public/spree/products/23/mini/ror_bag.jpeg differ diff --git a/public/spree/products/23/original/ror_bag.jpeg b/public/spree/products/23/original/ror_bag.jpeg new file mode 100644 index 0000000..5c88aa7 Binary files /dev/null and b/public/spree/products/23/original/ror_bag.jpeg differ diff --git a/public/spree/products/23/product/ror_bag.jpeg b/public/spree/products/23/product/ror_bag.jpeg new file mode 100644 index 0000000..9cd10da Binary files /dev/null and b/public/spree/products/23/product/ror_bag.jpeg differ diff --git a/public/spree/products/23/small/ror_bag.jpeg b/public/spree/products/23/small/ror_bag.jpeg new file mode 100644 index 0000000..56c9459 Binary files /dev/null and b/public/spree/products/23/small/ror_bag.jpeg differ diff --git a/public/spree/products/24/large/ror_baseball.jpeg b/public/spree/products/24/large/ror_baseball.jpeg new file mode 100644 index 0000000..c0d0427 Binary files /dev/null and b/public/spree/products/24/large/ror_baseball.jpeg differ diff --git a/public/spree/products/24/mini/ror_baseball.jpeg b/public/spree/products/24/mini/ror_baseball.jpeg new file mode 100644 index 0000000..3e70e4d Binary files /dev/null and b/public/spree/products/24/mini/ror_baseball.jpeg differ diff --git a/public/spree/products/24/original/ror_baseball.jpeg b/public/spree/products/24/original/ror_baseball.jpeg new file mode 100644 index 0000000..d76f979 Binary files /dev/null and b/public/spree/products/24/original/ror_baseball.jpeg differ diff --git a/public/spree/products/24/product/ror_baseball.jpeg b/public/spree/products/24/product/ror_baseball.jpeg new file mode 100644 index 0000000..e5789c3 Binary files /dev/null and b/public/spree/products/24/product/ror_baseball.jpeg differ diff --git a/public/spree/products/24/small/ror_baseball.jpeg b/public/spree/products/24/small/ror_baseball.jpeg new file mode 100644 index 0000000..138c16f Binary files /dev/null and b/public/spree/products/24/small/ror_baseball.jpeg differ diff --git a/public/spree/products/25/large/ror_baseball_back.jpeg b/public/spree/products/25/large/ror_baseball_back.jpeg new file mode 100644 index 0000000..1d57d89 Binary files /dev/null and b/public/spree/products/25/large/ror_baseball_back.jpeg differ diff --git a/public/spree/products/25/mini/ror_baseball_back.jpeg b/public/spree/products/25/mini/ror_baseball_back.jpeg new file mode 100644 index 0000000..3e168b4 Binary files /dev/null and b/public/spree/products/25/mini/ror_baseball_back.jpeg differ diff --git a/public/spree/products/25/original/ror_baseball_back.jpeg b/public/spree/products/25/original/ror_baseball_back.jpeg new file mode 100644 index 0000000..a05a14d Binary files /dev/null and b/public/spree/products/25/original/ror_baseball_back.jpeg differ diff --git a/public/spree/products/25/product/ror_baseball_back.jpeg b/public/spree/products/25/product/ror_baseball_back.jpeg new file mode 100644 index 0000000..a437013 Binary files /dev/null and b/public/spree/products/25/product/ror_baseball_back.jpeg differ diff --git a/public/spree/products/25/small/ror_baseball_back.jpeg b/public/spree/products/25/small/ror_baseball_back.jpeg new file mode 100644 index 0000000..cc1f0a5 Binary files /dev/null and b/public/spree/products/25/small/ror_baseball_back.jpeg differ diff --git a/public/spree/products/26/large/ror_jr_spaghetti.jpeg b/public/spree/products/26/large/ror_jr_spaghetti.jpeg new file mode 100644 index 0000000..f269240 Binary files /dev/null and b/public/spree/products/26/large/ror_jr_spaghetti.jpeg differ diff --git a/public/spree/products/26/mini/ror_jr_spaghetti.jpeg b/public/spree/products/26/mini/ror_jr_spaghetti.jpeg new file mode 100644 index 0000000..2b0e026 Binary files /dev/null and b/public/spree/products/26/mini/ror_jr_spaghetti.jpeg differ diff --git a/public/spree/products/26/original/ror_jr_spaghetti.jpeg b/public/spree/products/26/original/ror_jr_spaghetti.jpeg new file mode 100644 index 0000000..51712dd Binary files /dev/null and b/public/spree/products/26/original/ror_jr_spaghetti.jpeg differ diff --git a/public/spree/products/26/product/ror_jr_spaghetti.jpeg b/public/spree/products/26/product/ror_jr_spaghetti.jpeg new file mode 100644 index 0000000..21f8057 Binary files /dev/null and b/public/spree/products/26/product/ror_jr_spaghetti.jpeg differ diff --git a/public/spree/products/26/small/ror_jr_spaghetti.jpeg b/public/spree/products/26/small/ror_jr_spaghetti.jpeg new file mode 100644 index 0000000..76ffda0 Binary files /dev/null and b/public/spree/products/26/small/ror_jr_spaghetti.jpeg differ diff --git a/public/spree/products/27/large/ror_mug.jpeg b/public/spree/products/27/large/ror_mug.jpeg new file mode 100644 index 0000000..b26237e Binary files /dev/null and b/public/spree/products/27/large/ror_mug.jpeg differ diff --git a/public/spree/products/27/mini/ror_mug.jpeg b/public/spree/products/27/mini/ror_mug.jpeg new file mode 100644 index 0000000..022b118 Binary files /dev/null and b/public/spree/products/27/mini/ror_mug.jpeg differ diff --git a/public/spree/products/27/original/ror_mug.jpeg b/public/spree/products/27/original/ror_mug.jpeg new file mode 100644 index 0000000..1569a37 Binary files /dev/null and b/public/spree/products/27/original/ror_mug.jpeg differ diff --git a/public/spree/products/27/product/ror_mug.jpeg b/public/spree/products/27/product/ror_mug.jpeg new file mode 100644 index 0000000..c4603d2 Binary files /dev/null and b/public/spree/products/27/product/ror_mug.jpeg differ diff --git a/public/spree/products/27/small/ror_mug.jpeg b/public/spree/products/27/small/ror_mug.jpeg new file mode 100644 index 0000000..d05d7e4 Binary files /dev/null and b/public/spree/products/27/small/ror_mug.jpeg differ diff --git a/public/spree/products/28/large/ror_mug_back.jpeg b/public/spree/products/28/large/ror_mug_back.jpeg new file mode 100644 index 0000000..3dcce14 Binary files /dev/null and b/public/spree/products/28/large/ror_mug_back.jpeg differ diff --git a/public/spree/products/28/mini/ror_mug_back.jpeg b/public/spree/products/28/mini/ror_mug_back.jpeg new file mode 100644 index 0000000..7c117e5 Binary files /dev/null and b/public/spree/products/28/mini/ror_mug_back.jpeg differ diff --git a/public/spree/products/28/original/ror_mug_back.jpeg b/public/spree/products/28/original/ror_mug_back.jpeg new file mode 100644 index 0000000..688861c Binary files /dev/null and b/public/spree/products/28/original/ror_mug_back.jpeg differ diff --git a/public/spree/products/28/product/ror_mug_back.jpeg b/public/spree/products/28/product/ror_mug_back.jpeg new file mode 100644 index 0000000..0ae0e27 Binary files /dev/null and b/public/spree/products/28/product/ror_mug_back.jpeg differ diff --git a/public/spree/products/28/small/ror_mug_back.jpeg b/public/spree/products/28/small/ror_mug_back.jpeg new file mode 100644 index 0000000..63e6771 Binary files /dev/null and b/public/spree/products/28/small/ror_mug_back.jpeg differ diff --git a/public/spree/products/29/large/ror_ringer.jpeg b/public/spree/products/29/large/ror_ringer.jpeg new file mode 100644 index 0000000..54edd64 Binary files /dev/null and b/public/spree/products/29/large/ror_ringer.jpeg differ diff --git a/public/spree/products/29/mini/ror_ringer.jpeg b/public/spree/products/29/mini/ror_ringer.jpeg new file mode 100644 index 0000000..daa2266 Binary files /dev/null and b/public/spree/products/29/mini/ror_ringer.jpeg differ diff --git a/public/spree/products/29/original/ror_ringer.jpeg b/public/spree/products/29/original/ror_ringer.jpeg new file mode 100644 index 0000000..c26f992 Binary files /dev/null and b/public/spree/products/29/original/ror_ringer.jpeg differ diff --git a/public/spree/products/29/product/ror_ringer.jpeg b/public/spree/products/29/product/ror_ringer.jpeg new file mode 100644 index 0000000..a6507f4 Binary files /dev/null and b/public/spree/products/29/product/ror_ringer.jpeg differ diff --git a/public/spree/products/29/small/ror_ringer.jpeg b/public/spree/products/29/small/ror_ringer.jpeg new file mode 100644 index 0000000..05a6db5 Binary files /dev/null and b/public/spree/products/29/small/ror_ringer.jpeg differ diff --git a/public/spree/products/3/large/ror_baseball_jersey_blue.png b/public/spree/products/3/large/ror_baseball_jersey_blue.png new file mode 100644 index 0000000..7b8e539 Binary files /dev/null and b/public/spree/products/3/large/ror_baseball_jersey_blue.png differ diff --git a/public/spree/products/3/mini/ror_baseball_jersey_blue.png b/public/spree/products/3/mini/ror_baseball_jersey_blue.png new file mode 100644 index 0000000..6b4bc93 Binary files /dev/null and b/public/spree/products/3/mini/ror_baseball_jersey_blue.png differ diff --git a/public/spree/products/3/original/ror_baseball_jersey_blue.png b/public/spree/products/3/original/ror_baseball_jersey_blue.png new file mode 100644 index 0000000..ad15f9f Binary files /dev/null and b/public/spree/products/3/original/ror_baseball_jersey_blue.png differ diff --git a/public/spree/products/3/product/ror_baseball_jersey_blue.png b/public/spree/products/3/product/ror_baseball_jersey_blue.png new file mode 100644 index 0000000..7b8e539 Binary files /dev/null and b/public/spree/products/3/product/ror_baseball_jersey_blue.png differ diff --git a/public/spree/products/3/small/ror_baseball_jersey_blue.png b/public/spree/products/3/small/ror_baseball_jersey_blue.png new file mode 100644 index 0000000..51f2ee4 Binary files /dev/null and b/public/spree/products/3/small/ror_baseball_jersey_blue.png differ diff --git a/public/spree/products/30/large/ror_ringer_back.jpeg b/public/spree/products/30/large/ror_ringer_back.jpeg new file mode 100644 index 0000000..a375e14 Binary files /dev/null and b/public/spree/products/30/large/ror_ringer_back.jpeg differ diff --git a/public/spree/products/30/mini/ror_ringer_back.jpeg b/public/spree/products/30/mini/ror_ringer_back.jpeg new file mode 100644 index 0000000..aeaf21b Binary files /dev/null and b/public/spree/products/30/mini/ror_ringer_back.jpeg differ diff --git a/public/spree/products/30/original/ror_ringer_back.jpeg b/public/spree/products/30/original/ror_ringer_back.jpeg new file mode 100644 index 0000000..b8aa9d6 Binary files /dev/null and b/public/spree/products/30/original/ror_ringer_back.jpeg differ diff --git a/public/spree/products/30/product/ror_ringer_back.jpeg b/public/spree/products/30/product/ror_ringer_back.jpeg new file mode 100644 index 0000000..db4aa6d Binary files /dev/null and b/public/spree/products/30/product/ror_ringer_back.jpeg differ diff --git a/public/spree/products/30/small/ror_ringer_back.jpeg b/public/spree/products/30/small/ror_ringer_back.jpeg new file mode 100644 index 0000000..966cf83 Binary files /dev/null and b/public/spree/products/30/small/ror_ringer_back.jpeg differ diff --git a/public/spree/products/31/large/ror_stein.jpeg b/public/spree/products/31/large/ror_stein.jpeg new file mode 100644 index 0000000..f2f2af7 Binary files /dev/null and b/public/spree/products/31/large/ror_stein.jpeg differ diff --git a/public/spree/products/31/mini/ror_stein.jpeg b/public/spree/products/31/mini/ror_stein.jpeg new file mode 100644 index 0000000..d223efd Binary files /dev/null and b/public/spree/products/31/mini/ror_stein.jpeg differ diff --git a/public/spree/products/31/original/ror_stein.jpeg b/public/spree/products/31/original/ror_stein.jpeg new file mode 100644 index 0000000..126072f Binary files /dev/null and b/public/spree/products/31/original/ror_stein.jpeg differ diff --git a/public/spree/products/31/product/ror_stein.jpeg b/public/spree/products/31/product/ror_stein.jpeg new file mode 100644 index 0000000..9b2c598 Binary files /dev/null and b/public/spree/products/31/product/ror_stein.jpeg differ diff --git a/public/spree/products/31/small/ror_stein.jpeg b/public/spree/products/31/small/ror_stein.jpeg new file mode 100644 index 0000000..71af461 Binary files /dev/null and b/public/spree/products/31/small/ror_stein.jpeg differ diff --git a/public/spree/products/32/large/ror_stein_back.jpeg b/public/spree/products/32/large/ror_stein_back.jpeg new file mode 100644 index 0000000..89d562f Binary files /dev/null and b/public/spree/products/32/large/ror_stein_back.jpeg differ diff --git a/public/spree/products/32/mini/ror_stein_back.jpeg b/public/spree/products/32/mini/ror_stein_back.jpeg new file mode 100644 index 0000000..738566a Binary files /dev/null and b/public/spree/products/32/mini/ror_stein_back.jpeg differ diff --git a/public/spree/products/32/original/ror_stein_back.jpeg b/public/spree/products/32/original/ror_stein_back.jpeg new file mode 100644 index 0000000..cba4f27 Binary files /dev/null and b/public/spree/products/32/original/ror_stein_back.jpeg differ diff --git a/public/spree/products/32/product/ror_stein_back.jpeg b/public/spree/products/32/product/ror_stein_back.jpeg new file mode 100644 index 0000000..7e8d923 Binary files /dev/null and b/public/spree/products/32/product/ror_stein_back.jpeg differ diff --git a/public/spree/products/32/small/ror_stein_back.jpeg b/public/spree/products/32/small/ror_stein_back.jpeg new file mode 100644 index 0000000..89b881b Binary files /dev/null and b/public/spree/products/32/small/ror_stein_back.jpeg differ diff --git a/public/spree/products/33/large/apache_baseball.png b/public/spree/products/33/large/apache_baseball.png new file mode 100644 index 0000000..88504e7 Binary files /dev/null and b/public/spree/products/33/large/apache_baseball.png differ diff --git a/public/spree/products/33/mini/apache_baseball.png b/public/spree/products/33/mini/apache_baseball.png new file mode 100644 index 0000000..df28a6c Binary files /dev/null and b/public/spree/products/33/mini/apache_baseball.png differ diff --git a/public/spree/products/33/original/apache_baseball.png b/public/spree/products/33/original/apache_baseball.png new file mode 100644 index 0000000..40d68d1 Binary files /dev/null and b/public/spree/products/33/original/apache_baseball.png differ diff --git a/public/spree/products/33/product/apache_baseball.png b/public/spree/products/33/product/apache_baseball.png new file mode 100644 index 0000000..13350ea Binary files /dev/null and b/public/spree/products/33/product/apache_baseball.png differ diff --git a/public/spree/products/33/small/apache_baseball.png b/public/spree/products/33/small/apache_baseball.png new file mode 100644 index 0000000..4c5f48f Binary files /dev/null and b/public/spree/products/33/small/apache_baseball.png differ diff --git a/public/spree/products/34/large/ruby_baseball.png b/public/spree/products/34/large/ruby_baseball.png new file mode 100644 index 0000000..4583330 Binary files /dev/null and b/public/spree/products/34/large/ruby_baseball.png differ diff --git a/public/spree/products/34/mini/ruby_baseball.png b/public/spree/products/34/mini/ruby_baseball.png new file mode 100644 index 0000000..680c29f Binary files /dev/null and b/public/spree/products/34/mini/ruby_baseball.png differ diff --git a/public/spree/products/34/original/ruby_baseball.png b/public/spree/products/34/original/ruby_baseball.png new file mode 100644 index 0000000..9801dcb Binary files /dev/null and b/public/spree/products/34/original/ruby_baseball.png differ diff --git a/public/spree/products/34/product/ruby_baseball.png b/public/spree/products/34/product/ruby_baseball.png new file mode 100644 index 0000000..2e7874d Binary files /dev/null and b/public/spree/products/34/product/ruby_baseball.png differ diff --git a/public/spree/products/34/small/ruby_baseball.png b/public/spree/products/34/small/ruby_baseball.png new file mode 100644 index 0000000..3dc9cba Binary files /dev/null and b/public/spree/products/34/small/ruby_baseball.png differ diff --git a/public/spree/products/35/large/spree_bag.jpeg b/public/spree/products/35/large/spree_bag.jpeg new file mode 100644 index 0000000..55b84af Binary files /dev/null and b/public/spree/products/35/large/spree_bag.jpeg differ diff --git a/public/spree/products/35/mini/spree_bag.jpeg b/public/spree/products/35/mini/spree_bag.jpeg new file mode 100644 index 0000000..e00550b Binary files /dev/null and b/public/spree/products/35/mini/spree_bag.jpeg differ diff --git a/public/spree/products/35/original/spree_bag.jpeg b/public/spree/products/35/original/spree_bag.jpeg new file mode 100644 index 0000000..af60cee Binary files /dev/null and b/public/spree/products/35/original/spree_bag.jpeg differ diff --git a/public/spree/products/35/product/spree_bag.jpeg b/public/spree/products/35/product/spree_bag.jpeg new file mode 100644 index 0000000..35d0ab5 Binary files /dev/null and b/public/spree/products/35/product/spree_bag.jpeg differ diff --git a/public/spree/products/35/small/spree_bag.jpeg b/public/spree/products/35/small/spree_bag.jpeg new file mode 100644 index 0000000..735a05e Binary files /dev/null and b/public/spree/products/35/small/spree_bag.jpeg differ diff --git a/public/spree/products/36/large/spree_tote_front.jpeg b/public/spree/products/36/large/spree_tote_front.jpeg new file mode 100644 index 0000000..73b9ee0 Binary files /dev/null and b/public/spree/products/36/large/spree_tote_front.jpeg differ diff --git a/public/spree/products/36/mini/spree_tote_front.jpeg b/public/spree/products/36/mini/spree_tote_front.jpeg new file mode 100644 index 0000000..e9fbac7 Binary files /dev/null and b/public/spree/products/36/mini/spree_tote_front.jpeg differ diff --git a/public/spree/products/36/original/spree_tote_front.jpeg b/public/spree/products/36/original/spree_tote_front.jpeg new file mode 100644 index 0000000..5c56a06 Binary files /dev/null and b/public/spree/products/36/original/spree_tote_front.jpeg differ diff --git a/public/spree/products/36/product/spree_tote_front.jpeg b/public/spree/products/36/product/spree_tote_front.jpeg new file mode 100644 index 0000000..8df73be Binary files /dev/null and b/public/spree/products/36/product/spree_tote_front.jpeg differ diff --git a/public/spree/products/36/small/spree_tote_front.jpeg b/public/spree/products/36/small/spree_tote_front.jpeg new file mode 100644 index 0000000..76054d2 Binary files /dev/null and b/public/spree/products/36/small/spree_tote_front.jpeg differ diff --git a/public/spree/products/37/large/spree_tote_back.jpeg b/public/spree/products/37/large/spree_tote_back.jpeg new file mode 100644 index 0000000..0e1415c Binary files /dev/null and b/public/spree/products/37/large/spree_tote_back.jpeg differ diff --git a/public/spree/products/37/mini/spree_tote_back.jpeg b/public/spree/products/37/mini/spree_tote_back.jpeg new file mode 100644 index 0000000..37bbe21 Binary files /dev/null and b/public/spree/products/37/mini/spree_tote_back.jpeg differ diff --git a/public/spree/products/37/original/spree_tote_back.jpeg b/public/spree/products/37/original/spree_tote_back.jpeg new file mode 100644 index 0000000..846adc8 Binary files /dev/null and b/public/spree/products/37/original/spree_tote_back.jpeg differ diff --git a/public/spree/products/37/product/spree_tote_back.jpeg b/public/spree/products/37/product/spree_tote_back.jpeg new file mode 100644 index 0000000..893b7aa Binary files /dev/null and b/public/spree/products/37/product/spree_tote_back.jpeg differ diff --git a/public/spree/products/37/small/spree_tote_back.jpeg b/public/spree/products/37/small/spree_tote_back.jpeg new file mode 100644 index 0000000..5747abe Binary files /dev/null and b/public/spree/products/37/small/spree_tote_back.jpeg differ diff --git a/public/spree/products/38/large/spree_ringer_t.jpeg b/public/spree/products/38/large/spree_ringer_t.jpeg new file mode 100644 index 0000000..d6f6fd9 Binary files /dev/null and b/public/spree/products/38/large/spree_ringer_t.jpeg differ diff --git a/public/spree/products/38/mini/spree_ringer_t.jpeg b/public/spree/products/38/mini/spree_ringer_t.jpeg new file mode 100644 index 0000000..d7e6f71 Binary files /dev/null and b/public/spree/products/38/mini/spree_ringer_t.jpeg differ diff --git a/public/spree/products/38/original/spree_ringer_t.jpeg b/public/spree/products/38/original/spree_ringer_t.jpeg new file mode 100644 index 0000000..69c641a Binary files /dev/null and b/public/spree/products/38/original/spree_ringer_t.jpeg differ diff --git a/public/spree/products/38/product/spree_ringer_t.jpeg b/public/spree/products/38/product/spree_ringer_t.jpeg new file mode 100644 index 0000000..295c659 Binary files /dev/null and b/public/spree/products/38/product/spree_ringer_t.jpeg differ diff --git a/public/spree/products/38/small/spree_ringer_t.jpeg b/public/spree/products/38/small/spree_ringer_t.jpeg new file mode 100644 index 0000000..6300b3d Binary files /dev/null and b/public/spree/products/38/small/spree_ringer_t.jpeg differ diff --git a/public/spree/products/39/large/spree_ringer_t_back.jpeg b/public/spree/products/39/large/spree_ringer_t_back.jpeg new file mode 100644 index 0000000..1aba8c1 Binary files /dev/null and b/public/spree/products/39/large/spree_ringer_t_back.jpeg differ diff --git a/public/spree/products/39/mini/spree_ringer_t_back.jpeg b/public/spree/products/39/mini/spree_ringer_t_back.jpeg new file mode 100644 index 0000000..64f3e06 Binary files /dev/null and b/public/spree/products/39/mini/spree_ringer_t_back.jpeg differ diff --git a/public/spree/products/39/original/spree_ringer_t_back.jpeg b/public/spree/products/39/original/spree_ringer_t_back.jpeg new file mode 100644 index 0000000..76f18a5 Binary files /dev/null and b/public/spree/products/39/original/spree_ringer_t_back.jpeg differ diff --git a/public/spree/products/39/product/spree_ringer_t_back.jpeg b/public/spree/products/39/product/spree_ringer_t_back.jpeg new file mode 100644 index 0000000..5385965 Binary files /dev/null and b/public/spree/products/39/product/spree_ringer_t_back.jpeg differ diff --git a/public/spree/products/39/small/spree_ringer_t_back.jpeg b/public/spree/products/39/small/spree_ringer_t_back.jpeg new file mode 100644 index 0000000..5e43629 Binary files /dev/null and b/public/spree/products/39/small/spree_ringer_t_back.jpeg differ diff --git a/public/spree/products/4/large/ror_baseball_jersey_back_blue.png b/public/spree/products/4/large/ror_baseball_jersey_back_blue.png new file mode 100644 index 0000000..f286553 Binary files /dev/null and b/public/spree/products/4/large/ror_baseball_jersey_back_blue.png differ diff --git a/public/spree/products/4/mini/ror_baseball_jersey_back_blue.png b/public/spree/products/4/mini/ror_baseball_jersey_back_blue.png new file mode 100644 index 0000000..0b90baf Binary files /dev/null and b/public/spree/products/4/mini/ror_baseball_jersey_back_blue.png differ diff --git a/public/spree/products/4/original/ror_baseball_jersey_back_blue.png b/public/spree/products/4/original/ror_baseball_jersey_back_blue.png new file mode 100644 index 0000000..2f023f2 Binary files /dev/null and b/public/spree/products/4/original/ror_baseball_jersey_back_blue.png differ diff --git a/public/spree/products/4/product/ror_baseball_jersey_back_blue.png b/public/spree/products/4/product/ror_baseball_jersey_back_blue.png new file mode 100644 index 0000000..f286553 Binary files /dev/null and b/public/spree/products/4/product/ror_baseball_jersey_back_blue.png differ diff --git a/public/spree/products/4/small/ror_baseball_jersey_back_blue.png b/public/spree/products/4/small/ror_baseball_jersey_back_blue.png new file mode 100644 index 0000000..1ba6e33 Binary files /dev/null and b/public/spree/products/4/small/ror_baseball_jersey_back_blue.png differ diff --git a/public/spree/products/40/large/spree_spaghetti.jpeg b/public/spree/products/40/large/spree_spaghetti.jpeg new file mode 100644 index 0000000..2f069c4 Binary files /dev/null and b/public/spree/products/40/large/spree_spaghetti.jpeg differ diff --git a/public/spree/products/40/mini/spree_spaghetti.jpeg b/public/spree/products/40/mini/spree_spaghetti.jpeg new file mode 100644 index 0000000..7af80e6 Binary files /dev/null and b/public/spree/products/40/mini/spree_spaghetti.jpeg differ diff --git a/public/spree/products/40/original/spree_spaghetti.jpeg b/public/spree/products/40/original/spree_spaghetti.jpeg new file mode 100644 index 0000000..64723e4 Binary files /dev/null and b/public/spree/products/40/original/spree_spaghetti.jpeg differ diff --git a/public/spree/products/40/product/spree_spaghetti.jpeg b/public/spree/products/40/product/spree_spaghetti.jpeg new file mode 100644 index 0000000..f3dddcb Binary files /dev/null and b/public/spree/products/40/product/spree_spaghetti.jpeg differ diff --git a/public/spree/products/40/small/spree_spaghetti.jpeg b/public/spree/products/40/small/spree_spaghetti.jpeg new file mode 100644 index 0000000..13461f8 Binary files /dev/null and b/public/spree/products/40/small/spree_spaghetti.jpeg differ diff --git a/public/spree/products/41/large/spree_jersey.jpeg b/public/spree/products/41/large/spree_jersey.jpeg new file mode 100644 index 0000000..b7f4c0b Binary files /dev/null and b/public/spree/products/41/large/spree_jersey.jpeg differ diff --git a/public/spree/products/41/mini/spree_jersey.jpeg b/public/spree/products/41/mini/spree_jersey.jpeg new file mode 100644 index 0000000..dbd3d56 Binary files /dev/null and b/public/spree/products/41/mini/spree_jersey.jpeg differ diff --git a/public/spree/products/41/original/spree_jersey.jpeg b/public/spree/products/41/original/spree_jersey.jpeg new file mode 100644 index 0000000..f58ebb1 Binary files /dev/null and b/public/spree/products/41/original/spree_jersey.jpeg differ diff --git a/public/spree/products/41/product/spree_jersey.jpeg b/public/spree/products/41/product/spree_jersey.jpeg new file mode 100644 index 0000000..7434222 Binary files /dev/null and b/public/spree/products/41/product/spree_jersey.jpeg differ diff --git a/public/spree/products/41/small/spree_jersey.jpeg b/public/spree/products/41/small/spree_jersey.jpeg new file mode 100644 index 0000000..1deeb66 Binary files /dev/null and b/public/spree/products/41/small/spree_jersey.jpeg differ diff --git a/public/spree/products/42/large/spree_jersey_back.jpeg b/public/spree/products/42/large/spree_jersey_back.jpeg new file mode 100644 index 0000000..f3621d2 Binary files /dev/null and b/public/spree/products/42/large/spree_jersey_back.jpeg differ diff --git a/public/spree/products/42/mini/spree_jersey_back.jpeg b/public/spree/products/42/mini/spree_jersey_back.jpeg new file mode 100644 index 0000000..0eed3ed Binary files /dev/null and b/public/spree/products/42/mini/spree_jersey_back.jpeg differ diff --git a/public/spree/products/42/original/spree_jersey_back.jpeg b/public/spree/products/42/original/spree_jersey_back.jpeg new file mode 100644 index 0000000..3e48587 Binary files /dev/null and b/public/spree/products/42/original/spree_jersey_back.jpeg differ diff --git a/public/spree/products/42/product/spree_jersey_back.jpeg b/public/spree/products/42/product/spree_jersey_back.jpeg new file mode 100644 index 0000000..ac3dff9 Binary files /dev/null and b/public/spree/products/42/product/spree_jersey_back.jpeg differ diff --git a/public/spree/products/42/small/spree_jersey_back.jpeg b/public/spree/products/42/small/spree_jersey_back.jpeg new file mode 100644 index 0000000..71ea879 Binary files /dev/null and b/public/spree/products/42/small/spree_jersey_back.jpeg differ diff --git a/public/spree/products/43/large/spree_stein.jpeg b/public/spree/products/43/large/spree_stein.jpeg new file mode 100644 index 0000000..3d86b86 Binary files /dev/null and b/public/spree/products/43/large/spree_stein.jpeg differ diff --git a/public/spree/products/43/mini/spree_stein.jpeg b/public/spree/products/43/mini/spree_stein.jpeg new file mode 100644 index 0000000..8053dd9 Binary files /dev/null and b/public/spree/products/43/mini/spree_stein.jpeg differ diff --git a/public/spree/products/43/original/spree_stein.jpeg b/public/spree/products/43/original/spree_stein.jpeg new file mode 100644 index 0000000..e5ebe3b Binary files /dev/null and b/public/spree/products/43/original/spree_stein.jpeg differ diff --git a/public/spree/products/43/product/spree_stein.jpeg b/public/spree/products/43/product/spree_stein.jpeg new file mode 100644 index 0000000..f7b3bd7 Binary files /dev/null and b/public/spree/products/43/product/spree_stein.jpeg differ diff --git a/public/spree/products/43/small/spree_stein.jpeg b/public/spree/products/43/small/spree_stein.jpeg new file mode 100644 index 0000000..8465e38 Binary files /dev/null and b/public/spree/products/43/small/spree_stein.jpeg differ diff --git a/public/spree/products/44/large/spree_stein_back.jpeg b/public/spree/products/44/large/spree_stein_back.jpeg new file mode 100644 index 0000000..fca5936 Binary files /dev/null and b/public/spree/products/44/large/spree_stein_back.jpeg differ diff --git a/public/spree/products/44/mini/spree_stein_back.jpeg b/public/spree/products/44/mini/spree_stein_back.jpeg new file mode 100644 index 0000000..001fd8e Binary files /dev/null and b/public/spree/products/44/mini/spree_stein_back.jpeg differ diff --git a/public/spree/products/44/original/spree_stein_back.jpeg b/public/spree/products/44/original/spree_stein_back.jpeg new file mode 100644 index 0000000..7b1e941 Binary files /dev/null and b/public/spree/products/44/original/spree_stein_back.jpeg differ diff --git a/public/spree/products/44/product/spree_stein_back.jpeg b/public/spree/products/44/product/spree_stein_back.jpeg new file mode 100644 index 0000000..ff29048 Binary files /dev/null and b/public/spree/products/44/product/spree_stein_back.jpeg differ diff --git a/public/spree/products/44/small/spree_stein_back.jpeg b/public/spree/products/44/small/spree_stein_back.jpeg new file mode 100644 index 0000000..72901fc Binary files /dev/null and b/public/spree/products/44/small/spree_stein_back.jpeg differ diff --git a/public/spree/products/45/large/spree_mug.jpeg b/public/spree/products/45/large/spree_mug.jpeg new file mode 100644 index 0000000..1184fc1 Binary files /dev/null and b/public/spree/products/45/large/spree_mug.jpeg differ diff --git a/public/spree/products/45/mini/spree_mug.jpeg b/public/spree/products/45/mini/spree_mug.jpeg new file mode 100644 index 0000000..dba69c9 Binary files /dev/null and b/public/spree/products/45/mini/spree_mug.jpeg differ diff --git a/public/spree/products/45/original/spree_mug.jpeg b/public/spree/products/45/original/spree_mug.jpeg new file mode 100644 index 0000000..478cd9f Binary files /dev/null and b/public/spree/products/45/original/spree_mug.jpeg differ diff --git a/public/spree/products/45/product/spree_mug.jpeg b/public/spree/products/45/product/spree_mug.jpeg new file mode 100644 index 0000000..1184fc1 Binary files /dev/null and b/public/spree/products/45/product/spree_mug.jpeg differ diff --git a/public/spree/products/45/small/spree_mug.jpeg b/public/spree/products/45/small/spree_mug.jpeg new file mode 100644 index 0000000..4e08aa2 Binary files /dev/null and b/public/spree/products/45/small/spree_mug.jpeg differ diff --git a/public/spree/products/46/large/spree_mug_back.jpeg b/public/spree/products/46/large/spree_mug_back.jpeg new file mode 100644 index 0000000..b2dd66f Binary files /dev/null and b/public/spree/products/46/large/spree_mug_back.jpeg differ diff --git a/public/spree/products/46/mini/spree_mug_back.jpeg b/public/spree/products/46/mini/spree_mug_back.jpeg new file mode 100644 index 0000000..20bfe1c Binary files /dev/null and b/public/spree/products/46/mini/spree_mug_back.jpeg differ diff --git a/public/spree/products/46/original/spree_mug_back.jpeg b/public/spree/products/46/original/spree_mug_back.jpeg new file mode 100644 index 0000000..6c54d2a Binary files /dev/null and b/public/spree/products/46/original/spree_mug_back.jpeg differ diff --git a/public/spree/products/46/product/spree_mug_back.jpeg b/public/spree/products/46/product/spree_mug_back.jpeg new file mode 100644 index 0000000..b2dd66f Binary files /dev/null and b/public/spree/products/46/product/spree_mug_back.jpeg differ diff --git a/public/spree/products/46/small/spree_mug_back.jpeg b/public/spree/products/46/small/spree_mug_back.jpeg new file mode 100644 index 0000000..e6e43e5 Binary files /dev/null and b/public/spree/products/46/small/spree_mug_back.jpeg differ diff --git a/public/spree/products/5/large/ror_baseball_jersey_green.png b/public/spree/products/5/large/ror_baseball_jersey_green.png new file mode 100644 index 0000000..eba327a Binary files /dev/null and b/public/spree/products/5/large/ror_baseball_jersey_green.png differ diff --git a/public/spree/products/5/mini/ror_baseball_jersey_green.png b/public/spree/products/5/mini/ror_baseball_jersey_green.png new file mode 100644 index 0000000..a1cb6af Binary files /dev/null and b/public/spree/products/5/mini/ror_baseball_jersey_green.png differ diff --git a/public/spree/products/5/original/ror_baseball_jersey_green.png b/public/spree/products/5/original/ror_baseball_jersey_green.png new file mode 100644 index 0000000..4bd8c0a Binary files /dev/null and b/public/spree/products/5/original/ror_baseball_jersey_green.png differ diff --git a/public/spree/products/5/product/ror_baseball_jersey_green.png b/public/spree/products/5/product/ror_baseball_jersey_green.png new file mode 100644 index 0000000..eba327a Binary files /dev/null and b/public/spree/products/5/product/ror_baseball_jersey_green.png differ diff --git a/public/spree/products/5/small/ror_baseball_jersey_green.png b/public/spree/products/5/small/ror_baseball_jersey_green.png new file mode 100644 index 0000000..6d44faf Binary files /dev/null and b/public/spree/products/5/small/ror_baseball_jersey_green.png differ diff --git a/public/spree/products/6/large/ror_baseball_jersey_back_green.png b/public/spree/products/6/large/ror_baseball_jersey_back_green.png new file mode 100644 index 0000000..b5890a7 Binary files /dev/null and b/public/spree/products/6/large/ror_baseball_jersey_back_green.png differ diff --git a/public/spree/products/6/mini/ror_baseball_jersey_back_green.png b/public/spree/products/6/mini/ror_baseball_jersey_back_green.png new file mode 100644 index 0000000..d6b3f68 Binary files /dev/null and b/public/spree/products/6/mini/ror_baseball_jersey_back_green.png differ diff --git a/public/spree/products/6/original/ror_baseball_jersey_back_green.png b/public/spree/products/6/original/ror_baseball_jersey_back_green.png new file mode 100644 index 0000000..c769e35 Binary files /dev/null and b/public/spree/products/6/original/ror_baseball_jersey_back_green.png differ diff --git a/public/spree/products/6/product/ror_baseball_jersey_back_green.png b/public/spree/products/6/product/ror_baseball_jersey_back_green.png new file mode 100644 index 0000000..b5890a7 Binary files /dev/null and b/public/spree/products/6/product/ror_baseball_jersey_back_green.png differ diff --git a/public/spree/products/6/small/ror_baseball_jersey_back_green.png b/public/spree/products/6/small/ror_baseball_jersey_back_green.png new file mode 100644 index 0000000..2ba1378 Binary files /dev/null and b/public/spree/products/6/small/ror_baseball_jersey_back_green.png differ diff --git a/public/spree/products/7/large/ror_baseball_jersey_red.png b/public/spree/products/7/large/ror_baseball_jersey_red.png new file mode 100644 index 0000000..dc06d34 Binary files /dev/null and b/public/spree/products/7/large/ror_baseball_jersey_red.png differ diff --git a/public/spree/products/7/mini/ror_baseball_jersey_red.png b/public/spree/products/7/mini/ror_baseball_jersey_red.png new file mode 100644 index 0000000..57c8567 Binary files /dev/null and b/public/spree/products/7/mini/ror_baseball_jersey_red.png differ diff --git a/public/spree/products/7/original/ror_baseball_jersey_red.png b/public/spree/products/7/original/ror_baseball_jersey_red.png new file mode 100644 index 0000000..4deb99a Binary files /dev/null and b/public/spree/products/7/original/ror_baseball_jersey_red.png differ diff --git a/public/spree/products/7/product/ror_baseball_jersey_red.png b/public/spree/products/7/product/ror_baseball_jersey_red.png new file mode 100644 index 0000000..dc06d34 Binary files /dev/null and b/public/spree/products/7/product/ror_baseball_jersey_red.png differ diff --git a/public/spree/products/7/small/ror_baseball_jersey_red.png b/public/spree/products/7/small/ror_baseball_jersey_red.png new file mode 100644 index 0000000..515c0be Binary files /dev/null and b/public/spree/products/7/small/ror_baseball_jersey_red.png differ diff --git a/public/spree/products/8/large/ror_baseball_jersey_back_red.png b/public/spree/products/8/large/ror_baseball_jersey_back_red.png new file mode 100644 index 0000000..60dd13c Binary files /dev/null and b/public/spree/products/8/large/ror_baseball_jersey_back_red.png differ diff --git a/public/spree/products/8/mini/ror_baseball_jersey_back_red.png b/public/spree/products/8/mini/ror_baseball_jersey_back_red.png new file mode 100644 index 0000000..26a502f Binary files /dev/null and b/public/spree/products/8/mini/ror_baseball_jersey_back_red.png differ diff --git a/public/spree/products/8/original/ror_baseball_jersey_back_red.png b/public/spree/products/8/original/ror_baseball_jersey_back_red.png new file mode 100644 index 0000000..2be2275 Binary files /dev/null and b/public/spree/products/8/original/ror_baseball_jersey_back_red.png differ diff --git a/public/spree/products/8/product/ror_baseball_jersey_back_red.png b/public/spree/products/8/product/ror_baseball_jersey_back_red.png new file mode 100644 index 0000000..60dd13c Binary files /dev/null and b/public/spree/products/8/product/ror_baseball_jersey_back_red.png differ diff --git a/public/spree/products/8/small/ror_baseball_jersey_back_red.png b/public/spree/products/8/small/ror_baseball_jersey_back_red.png new file mode 100644 index 0000000..4dc59a8 Binary files /dev/null and b/public/spree/products/8/small/ror_baseball_jersey_back_red.png differ diff --git a/public/spree/products/9/large/ror_baseball_jersey_blue.png b/public/spree/products/9/large/ror_baseball_jersey_blue.png new file mode 100644 index 0000000..7b8e539 Binary files /dev/null and b/public/spree/products/9/large/ror_baseball_jersey_blue.png differ diff --git a/public/spree/products/9/mini/ror_baseball_jersey_blue.png b/public/spree/products/9/mini/ror_baseball_jersey_blue.png new file mode 100644 index 0000000..6b4bc93 Binary files /dev/null and b/public/spree/products/9/mini/ror_baseball_jersey_blue.png differ diff --git a/public/spree/products/9/original/ror_baseball_jersey_blue.png b/public/spree/products/9/original/ror_baseball_jersey_blue.png new file mode 100644 index 0000000..ad15f9f Binary files /dev/null and b/public/spree/products/9/original/ror_baseball_jersey_blue.png differ diff --git a/public/spree/products/9/product/ror_baseball_jersey_blue.png b/public/spree/products/9/product/ror_baseball_jersey_blue.png new file mode 100644 index 0000000..7b8e539 Binary files /dev/null and b/public/spree/products/9/product/ror_baseball_jersey_blue.png differ diff --git a/public/spree/products/9/small/ror_baseball_jersey_blue.png b/public/spree/products/9/small/ror_baseball_jersey_blue.png new file mode 100644 index 0000000..51f2ee4 Binary files /dev/null and b/public/spree/products/9/small/ror_baseball_jersey_blue.png differ diff --git a/test/application_system_test_case.rb b/test/application_system_test_case.rb new file mode 100644 index 0000000..d19212a --- /dev/null +++ b/test/application_system_test_case.rb @@ -0,0 +1,5 @@ +require "test_helper" + +class ApplicationSystemTestCase < ActionDispatch::SystemTestCase + driven_by :selenium, using: :chrome, screen_size: [1400, 1400] +end diff --git a/test/controllers/.keep b/test/controllers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/fixtures/.keep b/test/fixtures/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/fixtures/files/.keep b/test/fixtures/files/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/helpers/.keep b/test/helpers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/integration/.keep b/test/integration/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/mailers/.keep b/test/mailers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/models/.keep b/test/models/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/system/.keep b/test/system/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/test_helper.rb b/test/test_helper.rb new file mode 100644 index 0000000..e3c4ff0 --- /dev/null +++ b/test/test_helper.rb @@ -0,0 +1,9 @@ +require File.expand_path('../../config/environment', __FILE__) +require 'rails/test_help' + +class ActiveSupport::TestCase + # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. + fixtures :all + + # Add more helper methods to be used by all tests here... +end diff --git a/tmp/.keep b/tmp/.keep new file mode 100644 index 0000000..e69de29 diff --git a/vendor/.keep b/vendor/.keep new file mode 100644 index 0000000..e69de29 diff --git a/vendor/assets/javascripts/spree/backend/all.js b/vendor/assets/javascripts/spree/backend/all.js new file mode 100644 index 0000000..63e301e --- /dev/null +++ b/vendor/assets/javascripts/spree/backend/all.js @@ -0,0 +1,11 @@ +// This is a manifest file that'll be compiled into including all the files listed below. +// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically +// be included in the compiled file accessible from http://example.com/assets/application.js +// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the +// the compiled file. +// +//= require jquery +//= require jquery_ujs +//= require spree/backend + +//= require_tree . diff --git a/vendor/assets/javascripts/spree/frontend/all.js b/vendor/assets/javascripts/spree/frontend/all.js new file mode 100644 index 0000000..4601b40 --- /dev/null +++ b/vendor/assets/javascripts/spree/frontend/all.js @@ -0,0 +1,12 @@ +// This is a manifest file that'll be compiled into including all the files listed below. +// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically +// be included in the compiled file accessible from http://example.com/assets/application.js +// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the +// the compiled file. +// +//= require jquery +//= require jquery_ujs +//= require accounting.min +//= require spree/frontend + +//= require_tree . diff --git a/vendor/assets/stylesheets/spree/backend/all.css b/vendor/assets/stylesheets/spree/backend/all.css new file mode 100644 index 0000000..3319270 --- /dev/null +++ b/vendor/assets/stylesheets/spree/backend/all.css @@ -0,0 +1,10 @@ +/* + * This is a manifest file that'll automatically include all the stylesheets available in this directory + * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at + * the top of the compiled file, but it's generally better to create a new file per style scope. + * + *= require spree/backend + + *= require_self + *= require_tree . +*/ diff --git a/vendor/assets/stylesheets/spree/frontend/all.css b/vendor/assets/stylesheets/spree/frontend/all.css new file mode 100644 index 0000000..1fc8378 --- /dev/null +++ b/vendor/assets/stylesheets/spree/frontend/all.css @@ -0,0 +1,10 @@ +/* + * This is a manifest file that'll automatically include all the stylesheets available in this directory + * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at + * the top of the compiled file, but it's generally better to create a new file per style scope. + * + *= require spree/frontend + + *= require_self + *= require_tree . +*/