diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..eb3489a --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +# See http://help.github.com/ignore-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 the default SQLite database. +/db/*.sqlite3 + +# Ignore all logfiles and tempfiles. +/log/*.log +/tmp diff --git a/.rvmrc b/.rvmrc new file mode 100644 index 0000000..a73efa1 --- /dev/null +++ b/.rvmrc @@ -0,0 +1 @@ +rmv use 1.9.3-p194@vietcare24h --create diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..4112ced --- /dev/null +++ b/Gemfile @@ -0,0 +1,43 @@ +source 'https://rubygems.org' + +gem 'rails', '3.2.9' + +# Bundle edge Rails instead: +# gem 'rails', :git => 'git://github.com/rails/rails.git' + +gem 'sqlite3' + + +# Gems used only for assets and not required +# in production environments by default. +group :assets do + gem 'sass-rails', '~> 3.2.3' + gem 'coffee-rails', '~> 3.2.1' + + # See https://github.com/sstephenson/execjs#readme for more supported runtimes + gem 'execjs' + gem 'therubyracer', :platforms => :ruby + + gem 'uglifier', '>= 1.0.3' +end + +gem 'jquery-rails' + +# To use ActiveModel has_secure_password +# gem 'bcrypt-ruby', '~> 3.0.0' + +# To use Jbuilder templates for JSON +# gem 'jbuilder' + +# Use unicorn as the app server +# gem 'unicorn' + +# Deploy with Capistrano +# gem 'capistrano' + +# To use debugger +# gem 'debugger' +gem 'spree', '1.2.2' +gem 'spree_usa_epay' +gem 'spree_skrill' +gem 'spree_auth_devise', :github => 'spree/spree_auth_devise', :branch => '1-2-stable' diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..bee4f56 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,258 @@ +GIT + remote: git://github.com/spree/spree_auth_devise.git + revision: 39baa608dc59d5ba76da7c49d3125438704f7250 + branch: 1-2-stable + specs: + spree_auth_devise (1.0.0) + cancan (= 1.6.7) + devise (~> 2.0.4) + spree_core + +GEM + remote: https://rubygems.org/ + specs: + actionmailer (3.2.9) + actionpack (= 3.2.9) + mail (~> 2.4.4) + actionpack (3.2.9) + activemodel (= 3.2.9) + activesupport (= 3.2.9) + builder (~> 3.0.0) + erubis (~> 2.7.0) + journey (~> 1.0.4) + rack (~> 1.4.0) + rack-cache (~> 1.2) + rack-test (~> 0.6.1) + sprockets (~> 2.2.1) + active_utils (1.0.5) + activesupport (>= 2.3.11) + i18n + activemerchant (1.28.0) + active_utils (>= 1.0.2) + activesupport (>= 2.3.11) + builder (>= 2.0.0) + i18n + json (>= 1.5.1) + money + nokogiri + activemodel (3.2.9) + activesupport (= 3.2.9) + builder (~> 3.0.0) + activerecord (3.2.9) + activemodel (= 3.2.9) + activesupport (= 3.2.9) + arel (~> 3.0.2) + tzinfo (~> 0.3.29) + activeresource (3.2.9) + activemodel (= 3.2.9) + activesupport (= 3.2.9) + activesupport (3.2.9) + i18n (~> 0.6) + multi_json (~> 1.0) + acts_as_list (0.1.4) + akami (1.2.0) + gyoku (>= 0.4.0) + nokogiri (>= 1.4.0) + arel (3.0.2) + awesome_nested_set (2.1.4) + activerecord (>= 3.0.0) + aws-sdk (1.3.9) + httparty (~> 0.7) + json (~> 1.4) + nokogiri (>= 1.4.4) + uuidtools (~> 2.1) + bcrypt-ruby (3.0.1) + builder (3.0.4) + cancan (1.6.7) + cocaine (0.4.2) + coffee-rails (3.2.2) + coffee-script (>= 2.2.0) + railties (~> 3.2.0) + coffee-script (2.2.0) + coffee-script-source + execjs + coffee-script-source (1.4.0) + deface (0.9.1) + nokogiri (~> 1.5.0) + rails (~> 3.1) + devise (2.0.4) + bcrypt-ruby (~> 3.0) + orm_adapter (~> 0.0.3) + railties (~> 3.1) + warden (~> 1.1.1) + erubis (2.7.0) + execjs (1.4.0) + multi_json (~> 1.0) + ffaker (1.12.1) + gyoku (0.4.6) + builder (>= 2.1.2) + highline (1.6.11) + hike (1.2.1) + httparty (0.8.3) + multi_json (~> 1.0) + multi_xml + httpi (1.1.1) + rack + i18n (0.6.1) + journey (1.0.4) + jquery-rails (2.1.3) + railties (>= 3.1.0, < 5.0) + thor (~> 0.14) + json (1.7.5) + kaminari (0.13.0) + actionpack (>= 3.0.0) + activesupport (>= 3.0.0) + railties (>= 3.0.0) + libv8 (3.3.10.4) + mail (2.4.4) + i18n (>= 0.4.0) + mime-types (~> 1.16) + treetop (~> 1.4.8) + mime-types (1.19) + money (5.0.0) + i18n (~> 0.4) + json + multi_json (1.3.7) + multi_xml (0.5.1) + nokogiri (1.5.5) + nori (1.1.3) + orm_adapter (0.0.7) + paperclip (2.8.0) + activerecord (>= 2.3.0) + activesupport (>= 2.3.2) + cocaine (>= 0.0.2) + mime-types + polyamorous (0.5.0) + activerecord (~> 3.0) + polyglot (0.3.3) + rabl (0.7.2) + activesupport (>= 2.3.14) + multi_json (~> 1.0) + rack (1.4.1) + rack-cache (1.2) + rack (>= 0.4) + rack-ssl (1.3.2) + rack + rack-test (0.6.2) + rack (>= 1.0) + rails (3.2.9) + actionmailer (= 3.2.9) + actionpack (= 3.2.9) + activerecord (= 3.2.9) + activeresource (= 3.2.9) + activesupport (= 3.2.9) + bundler (~> 1.0) + railties (= 3.2.9) + railties (3.2.9) + actionpack (= 3.2.9) + activesupport (= 3.2.9) + rack-ssl (~> 1.3.2) + rake (>= 0.8.7) + rdoc (~> 3.4) + thor (>= 0.14.6, < 2.0) + rake (10.0.2) + ransack (0.7.0) + actionpack (~> 3.0) + activerecord (~> 3.0) + polyamorous (~> 0.5.0) + rdoc (3.12) + json (~> 1.4) + sass (3.2.3) + sass-rails (3.2.5) + railties (~> 3.2.0) + sass (>= 3.1.10) + tilt (~> 1.3) + savon (1.2.0) + akami (~> 1.2.0) + builder (>= 2.1.2) + gyoku (~> 0.4.5) + httpi (~> 1.1.0) + nokogiri (>= 1.4.0) + nori (~> 1.1.0) + wasabi (~> 2.5.0) + select2-rails (3.2.1) + thor (~> 0.14) + spree (1.2.2) + spree_api (= 1.2.2) + spree_cmd (= 1.2.2) + spree_core (= 1.2.2) + spree_dash (= 1.2.2) + spree_promo (= 1.2.2) + spree_sample (= 1.2.2) + spree_api (1.2.2) + spree_core (= 1.2.2) + spree_cmd (1.2.2) + thor (>= 0.14.6) + spree_core (1.2.2) + activemerchant (= 1.28.0) + acts_as_list (= 0.1.4) + awesome_nested_set (= 2.1.4) + aws-sdk (~> 1.3.4) + cancan (= 1.6.7) + deface (>= 0.9.0) + ffaker (~> 1.12.0) + highline (= 1.6.11) + jquery-rails (~> 2.0) + kaminari (= 0.13.0) + money (= 5.0.0) + paperclip (~> 2.8) + rabl (= 0.7.2) + rails (~> 3.2.9) + ransack (~> 0.7.0) + select2-rails (~> 3.0) + state_machine (= 1.1.2) + stringex (~> 1.3.2) + spree_dash (1.2.2) + httparty (~> 0.8.1) + spree_core (= 1.2.2) + spree_promo (1.2.2) + spree_core (= 1.2.2) + spree_sample (1.2.2) + spree_core (= 1.2.2) + spree_skrill (1.0.2) + spree_core (>= 1.0.0) + spree_usa_epay (1.0.2) + savon + spree_core (>= 1.0.0) + sprockets (2.2.1) + hike (~> 1.2) + multi_json (~> 1.0) + rack (~> 1.0) + tilt (~> 1.1, != 1.3.0) + sqlite3 (1.3.6) + state_machine (1.1.2) + stringex (1.3.3) + therubyracer (0.10.2) + libv8 (~> 3.3.10) + thor (0.16.0) + tilt (1.3.3) + treetop (1.4.12) + polyglot + polyglot (>= 0.3.1) + tzinfo (0.3.35) + uglifier (1.3.0) + execjs (>= 0.3.0) + multi_json (~> 1.0, >= 1.0.2) + uuidtools (2.1.3) + warden (1.1.1) + rack (>= 1.0) + wasabi (2.5.1) + httpi (~> 1.0) + nokogiri (>= 1.4.0) + +PLATFORMS + ruby + +DEPENDENCIES + coffee-rails (~> 3.2.1) + execjs + jquery-rails + rails (= 3.2.9) + sass-rails (~> 3.2.3) + spree (= 1.2.2) + spree_auth_devise! + spree_skrill + spree_usa_epay + sqlite3 + therubyracer + uglifier (>= 1.0.3) diff --git a/README.rdoc b/README.rdoc new file mode 100644 index 0000000..7c36f23 --- /dev/null +++ b/README.rdoc @@ -0,0 +1,261 @@ +== Welcome to Rails + +Rails is a web-application framework that includes everything needed to create +database-backed web applications according to the Model-View-Control pattern. + +This pattern splits the view (also called the presentation) into "dumb" +templates that are primarily responsible for inserting pre-built data in between +HTML tags. The model contains the "smart" domain objects (such as Account, +Product, Person, Post) that holds all the business logic and knows how to +persist themselves to a database. The controller handles the incoming requests +(such as Save New Account, Update Product, Show Post) by manipulating the model +and directing data to the view. + +In Rails, the model is handled by what's called an object-relational mapping +layer entitled Active Record. This layer allows you to present the data from +database rows as objects and embellish these data objects with business logic +methods. You can read more about Active Record in +link:files/vendor/rails/activerecord/README.html. + +The controller and view are handled by the Action Pack, which handles both +layers by its two parts: Action View and Action Controller. These two layers +are bundled in a single package due to their heavy interdependence. This is +unlike the relationship between the Active Record and Action Pack that is much +more separate. Each of these packages can be used independently outside of +Rails. You can read more about Action Pack in +link:files/vendor/rails/actionpack/README.html. + + +== Getting Started + +1. At the command prompt, create a new Rails application: + rails new myapp (where myapp is the application name) + +2. Change directory to myapp and start the web server: + cd myapp; rails server (run with --help for options) + +3. Go to http://localhost:3000/ and you'll see: + "Welcome aboard: You're riding Ruby on Rails!" + +4. Follow the guidelines to start developing your application. You can find +the following resources handy: + +* The Getting Started Guide: http://guides.rubyonrails.org/getting_started.html +* Ruby on Rails Tutorial Book: http://www.railstutorial.org/ + + +== Debugging Rails + +Sometimes your application goes wrong. Fortunately there are a lot of tools that +will help you debug it and get it back on the rails. + +First area to check is the application log files. Have "tail -f" commands +running on the server.log and development.log. Rails will automatically display +debugging and runtime information to these files. Debugging info will also be +shown in the browser on requests from 127.0.0.1. + +You can also log your own messages directly into the log file from your code +using the Ruby logger class from inside your controllers. Example: + + class WeblogController < ActionController::Base + def destroy + @weblog = Weblog.find(params[:id]) + @weblog.destroy + logger.info("#{Time.now} Destroyed Weblog ID ##{@weblog.id}!") + end + end + +The result will be a message in your log file along the lines of: + + Mon Oct 08 14:22:29 +1000 2007 Destroyed Weblog ID #1! + +More information on how to use the logger is at http://www.ruby-doc.org/core/ + +Also, Ruby documentation can be found at http://www.ruby-lang.org/. There are +several books available online as well: + +* Programming Ruby: http://www.ruby-doc.org/docs/ProgrammingRuby/ (Pickaxe) +* Learn to Program: http://pine.fm/LearnToProgram/ (a beginners guide) + +These two books will bring you up to speed on the Ruby language and also on +programming in general. + + +== Debugger + +Debugger support is available through the debugger command when you start your +Mongrel or WEBrick server with --debugger. This means that you can break out of +execution at any point in the code, investigate and change the model, and then, +resume execution! You need to install ruby-debug to run the server in debugging +mode. With gems, use sudo gem install ruby-debug. Example: + + class WeblogController < ActionController::Base + def index + @posts = Post.all + debugger + end + end + +So the controller will accept the action, run the first line, then present you +with a IRB prompt in the server window. Here you can do things like: + + >> @posts.inspect + => "[#nil, "body"=>nil, "id"=>"1"}>, + #"Rails", "body"=>"Only ten..", "id"=>"2"}>]" + >> @posts.first.title = "hello from a debugger" + => "hello from a debugger" + +...and even better, you can examine how your runtime objects actually work: + + >> f = @posts.first + => #nil, "body"=>nil, "id"=>"1"}> + >> f. + Display all 152 possibilities? (y or n) + +Finally, when you're ready to resume execution, you can enter "cont". + + +== Console + +The console is a Ruby shell, which allows you to interact with your +application's domain model. Here you'll have all parts of the application +configured, just like it is when the application is running. You can inspect +domain models, change values, and save to the database. Starting the script +without arguments will launch it in the development environment. + +To start the console, run rails console from the application +directory. + +Options: + +* Passing the -s, --sandbox argument will rollback any modifications + made to the database. +* Passing an environment name as an argument will load the corresponding + environment. Example: rails console production. + +To reload your controllers and models after launching the console run +reload! + +More information about irb can be found at: +link:http://www.rubycentral.org/pickaxe/irb.html + + +== dbconsole + +You can go to the command line of your database directly through rails +dbconsole. You would be connected to the database with the credentials +defined in database.yml. Starting the script without arguments will connect you +to the development database. Passing an argument will connect you to a different +database, like rails dbconsole production. Currently works for MySQL, +PostgreSQL and SQLite 3. + +== Description of Contents + +The default directory structure of a generated Ruby on Rails application: + + |-- app + | |-- assets + | |-- images + | |-- javascripts + | `-- stylesheets + | |-- controllers + | |-- helpers + | |-- mailers + | |-- models + | `-- views + | `-- layouts + |-- config + | |-- environments + | |-- initializers + | `-- locales + |-- db + |-- doc + |-- lib + | `-- tasks + |-- log + |-- public + |-- script + |-- test + | |-- fixtures + | |-- functional + | |-- integration + | |-- performance + | `-- unit + |-- tmp + | |-- cache + | |-- pids + | |-- sessions + | `-- sockets + `-- vendor + |-- assets + `-- stylesheets + `-- plugins + +app + Holds all the code that's specific to this particular application. + +app/assets + Contains subdirectories for images, stylesheets, and JavaScript files. + +app/controllers + Holds controllers that should be named like weblogs_controller.rb for + automated URL mapping. All controllers should descend from + ApplicationController which itself descends from ActionController::Base. + +app/models + Holds models that should be named like post.rb. Models descend from + ActiveRecord::Base by default. + +app/views + Holds the template files for the view that should be named like + weblogs/index.html.erb for the WeblogsController#index action. All views use + eRuby syntax by default. + +app/views/layouts + Holds the template files for layouts to be used with views. This models the + common header/footer method of wrapping views. In your views, define a layout + using the layout :default and create a file named default.html.erb. + Inside default.html.erb, call <% yield %> to render the view using this + layout. + +app/helpers + Holds view helpers that should be named like weblogs_helper.rb. These are + generated for you automatically when using generators for controllers. + Helpers can be used to wrap functionality for your views into methods. + +config + Configuration files for the Rails environment, the routing map, the database, + and other dependencies. + +db + Contains the database schema in schema.rb. db/migrate contains all the + sequence of Migrations for your schema. + +doc + This directory is where your application documentation will be stored when + generated using rake doc:app + +lib + Application specific libraries. Basically, any kind of custom code that + doesn't belong under controllers, models, or helpers. This directory is in + the load path. + +public + The directory available for the web server. Also contains the dispatchers and the + default HTML files. This should be set as the DOCUMENT_ROOT of your web + server. + +script + Helper scripts for automation and generation. + +test + Unit and functional tests along with fixtures. When using the rails generate + command, template test files will be generated for you and placed in this + directory. + +vendor + External libraries that the application depends on. Also includes the plugins + subdirectory. If the app has frozen rails, those gems also go here, under + vendor/rails/. This directory is in the load path. diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..922e5ca --- /dev/null +++ b/Rakefile @@ -0,0 +1,7 @@ +#!/usr/bin/env rake +# 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 File.expand_path('../config/application', __FILE__) + +Vietcare24h::Application.load_tasks diff --git a/app/assets/images/rails.png b/app/assets/images/rails.png new file mode 100644 index 0000000..d5edc04 Binary files /dev/null and b/app/assets/images/rails.png differ diff --git a/app/assets/javascripts/admin/all.js b/app/assets/javascripts/admin/all.js new file mode 100644 index 0000000..3d2cab1 --- /dev/null +++ b/app/assets/javascripts/admin/all.js @@ -0,0 +1,13 @@ +// 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 admin/spree_core +//= require admin/spree_promo + +//= require_tree . diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js new file mode 100644 index 0000000..9097d83 --- /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, vendor/assets/javascripts, +// or vendor/assets/javascripts of plugins, if any, 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 +// the compiled file. +// +// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD +// GO AFTER THE REQUIRES BELOW. +// +//= require jquery +//= require jquery_ujs +//= require_tree . diff --git a/app/assets/javascripts/store/all.js b/app/assets/javascripts/store/all.js new file mode 100644 index 0000000..0d4f086 --- /dev/null +++ b/app/assets/javascripts/store/all.js @@ -0,0 +1,13 @@ +// 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 store/spree_core +//= require store/spree_promo + +//= require_tree . diff --git a/app/assets/stylesheets/admin/all.css b/app/assets/stylesheets/admin/all.css new file mode 100644 index 0000000..1a930fa --- /dev/null +++ b/app/assets/stylesheets/admin/all.css @@ -0,0 +1,12 @@ +/* + * 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 admin/spree_core + *= require admin/spree_promo + + *= require_self + *= require_tree . +*/ diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css new file mode 100644 index 0000000..3192ec8 --- /dev/null +++ b/app/assets/stylesheets/application.css @@ -0,0 +1,13 @@ +/* + * 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, vendor/assets/stylesheets, + * or vendor/assets/stylesheets of plugins, if any, 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 top of the + * compiled file, but it's generally better to create a new file per style scope. + * + *= require_self + *= require_tree . + */ diff --git a/app/assets/stylesheets/store/all.css b/app/assets/stylesheets/store/all.css new file mode 100644 index 0000000..8c2a6e8 --- /dev/null +++ b/app/assets/stylesheets/store/all.css @@ -0,0 +1,12 @@ +/* + * 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 store/spree_core + *= require store/spree_promo + + *= require_self + *= require_tree . +*/ diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb new file mode 100644 index 0000000..e8065d9 --- /dev/null +++ b/app/controllers/application_controller.rb @@ -0,0 +1,3 @@ +class ApplicationController < ActionController::Base + protect_from_forgery +end 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/mailers/.gitkeep b/app/mailers/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/app/models/.gitkeep b/app/models/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb new file mode 100644 index 0000000..2717398 --- /dev/null +++ b/app/views/layouts/application.html.erb @@ -0,0 +1,14 @@ + + + + Vietcare24h + <%= stylesheet_link_tag "application", :media => "all" %> + <%= javascript_include_tag "application" %> + <%= csrf_meta_tags %> + + + +<%= yield %> + + + diff --git a/config.ru b/config.ru new file mode 100644 index 0000000..66d51bd --- /dev/null +++ b/config.ru @@ -0,0 +1,4 @@ +# This file is used by Rack-based servers to start the application. + +require ::File.expand_path('../config/environment', __FILE__) +run Vietcare24h::Application diff --git a/config/application.rb b/config/application.rb new file mode 100644 index 0000000..6b2b70f --- /dev/null +++ b/config/application.rb @@ -0,0 +1,75 @@ +require File.expand_path('../boot', __FILE__) + +require 'rails/all' + +if defined?(Bundler) + # If you precompile assets before deploying to production, use this line + Bundler.require(*Rails.groups(:assets => %w(development test))) + # If you want your assets lazily compiled in production, use this line + # Bundler.require(:default, :assets, Rails.env) +end + +module Vietcare24h + 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 + + # 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. + + # Custom directories with classes and modules you want to be autoloadable. + # config.autoload_paths += %W(#{config.root}/extras) + + # Only load the plugins named here, in the order given (default is alphabetical). + # :all can be used as a placeholder for all plugins not explicitly named. + # config.plugins = [ :exception_notification, :ssl_requirement, :all ] + + # Activate observers that should always be running. + # config.active_record.observers = :cacher, :garbage_collector, :forum_observer + + # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. + # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. + # config.time_zone = 'Central Time (US & Canada)' + + # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. + # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] + # config.i18n.default_locale = :de + + # Configure the default encoding used in templates for Ruby 1.9. + config.encoding = "utf-8" + + # Configure sensitive parameters which will be filtered from the log file. + config.filter_parameters += [:password] + + # Enable escaping HTML in JSON. + config.active_support.escape_html_entities_in_json = true + + # Use SQL instead of Active Record's schema dumper when creating the database. + # This is necessary if your schema can't be completely dumped by the schema dumper, + # like if you have constraints or database-specific column types + # config.active_record.schema_format = :sql + + # Enforce whitelist mode for mass assignment. + # This will create an empty whitelist of attributes available for mass-assignment for all models + # in your app. As such, your models will need to explicitly whitelist or blacklist accessible + # parameters by using an attr_accessible or attr_protected declaration. + config.active_record.whitelist_attributes = true + + # Enable the asset pipeline + config.assets.enabled = true + + # Version of your assets, change this if you want to expire all your assets + config.assets.version = '1.0' + end +end diff --git a/config/boot.rb b/config/boot.rb new file mode 100644 index 0000000..4489e58 --- /dev/null +++ b/config/boot.rb @@ -0,0 +1,6 @@ +require 'rubygems' + +# Set up gems listed in the Gemfile. +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) + +require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE']) diff --git a/config/database.yml b/config/database.yml new file mode 100644 index 0000000..51a4dd4 --- /dev/null +++ b/config/database.yml @@ -0,0 +1,25 @@ +# SQLite version 3.x +# gem install sqlite3 +# +# Ensure the SQLite 3 gem is defined in your Gemfile +# gem 'sqlite3' +development: + adapter: sqlite3 + database: db/development.sqlite3 + pool: 5 + timeout: 5000 + +# 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: + adapter: sqlite3 + database: db/test.sqlite3 + pool: 5 + timeout: 5000 + +production: + adapter: sqlite3 + database: db/production.sqlite3 + pool: 5 + timeout: 5000 diff --git a/config/environment.rb b/config/environment.rb new file mode 100644 index 0000000..f5c1f79 --- /dev/null +++ b/config/environment.rb @@ -0,0 +1,7 @@ +# Load the rails application +require File.expand_path('../application', __FILE__) + +# Initialize the rails application +Vietcare24h::Application.initialize! + +ActiveRecord::Base.include_root_in_json = true diff --git a/config/environments/development.rb b/config/environments/development.rb new file mode 100644 index 0000000..181aa36 --- /dev/null +++ b/config/environments/development.rb @@ -0,0 +1,37 @@ +Vietcare24h::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 + + # Log error messages when you accidentally call methods on nil. + config.whiny_nils = true + + # Show full error reports and disable caching + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + + # Don't care if the mailer can't send + config.action_mailer.raise_delivery_errors = false + + # Print deprecation notices to the Rails logger + config.active_support.deprecation = :log + + # Only use best-standards-support built into browsers + config.action_dispatch.best_standards_support = :builtin + + # Raise exception on mass assignment protection for Active Record models + config.active_record.mass_assignment_sanitizer = :strict + + # Log the query plan for queries taking more than this (works + # with SQLite, MySQL, and PostgreSQL) + config.active_record.auto_explain_threshold_in_seconds = 0.5 + + # Do not compress assets + config.assets.compress = false + + # Expands the lines which load the assets + config.assets.debug = true +end diff --git a/config/environments/production.rb b/config/environments/production.rb new file mode 100644 index 0000000..cd69310 --- /dev/null +++ b/config/environments/production.rb @@ -0,0 +1,67 @@ +Vietcare24h::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 + + # Full error reports are disabled and caching is turned on + config.consider_all_requests_local = false + config.action_controller.perform_caching = true + + # Disable Rails's static asset server (Apache or nginx will already do this) + config.serve_static_assets = false + + # Compress JavaScripts and CSS + config.assets.compress = true + + # Don't fallback to assets pipeline if a precompiled asset is missed + config.assets.compile = false + + # Generate digests for assets URLs + config.assets.digest = true + + # Defaults to nil and saved in location specified by config.assets.prefix + # config.assets.manifest = YOUR_PATH + + # 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 + + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. + # config.force_ssl = true + + # See everything in the log (default is :info) + # config.log_level = :debug + + # Prepend all log lines with the following tags + # config.log_tags = [ :subdomain, :uuid ] + + # Use a different logger for distributed setups + # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) + + # Use a different cache store in production + # config.cache_store = :mem_cache_store + + # Enable serving of images, stylesheets, and JavaScripts from an asset server + # config.action_controller.asset_host = "http://assets.example.com" + + # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added) + # config.assets.precompile += %w( search.js ) + + # Disable delivery errors, bad email addresses will be ignored + # config.action_mailer.raise_delivery_errors = false + + # Enable threaded mode + # config.threadsafe! + + # Enable locale fallbacks for I18n (makes lookups for any locale fall back to + # the I18n.default_locale when a translation can not be found) + config.i18n.fallbacks = true + + # Send deprecation notices to registered listeners + config.active_support.deprecation = :notify + + # Log the query plan for queries taking more than this (works + # with SQLite, MySQL, and PostgreSQL) + # config.active_record.auto_explain_threshold_in_seconds = 0.5 +end diff --git a/config/environments/test.rb b/config/environments/test.rb new file mode 100644 index 0000000..79ae143 --- /dev/null +++ b/config/environments/test.rb @@ -0,0 +1,37 @@ +Vietcare24h::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 + + # Configure static asset server for tests with Cache-Control for performance + config.serve_static_assets = true + config.static_cache_control = "public, max-age=3600" + + # Log error messages when you accidentally call methods on nil + config.whiny_nils = true + + # 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 + + # 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 + + # Raise exception on mass assignment protection for Active Record models + config.active_record.mass_assignment_sanitizer = :strict + + # Print deprecation notices to the stderr + config.active_support.deprecation = :stderr +end 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/inflections.rb b/config/initializers/inflections.rb new file mode 100644 index 0000000..5d8d9be --- /dev/null +++ b/config/initializers/inflections.rb @@ -0,0 +1,15 @@ +# Be sure to restart your server when you modify this file. + +# Add new inflection rules using the following format +# (all these examples are active by default): +# ActiveSupport::Inflector.inflections 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 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..72aca7e --- /dev/null +++ b/config/initializers/mime_types.rb @@ -0,0 +1,5 @@ +# 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 +# Mime::Type.register_alias "text/html", :iphone diff --git a/config/initializers/secret_token.rb b/config/initializers/secret_token.rb new file mode 100644 index 0000000..dab1540 --- /dev/null +++ b/config/initializers/secret_token.rb @@ -0,0 +1,7 @@ +# Be sure to restart your server when you modify this file. + +# Your secret key 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. +Vietcare24h::Application.config.secret_token = 'ad05bdb43e826e922fb136ed1ca7b2c08589e57b6ec1c99443c64b92bfce2e77a0f276e8f0756de48e26dbcb1ca0ed7f97788edf5112a1c67d80cc8fa7f64e12' diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb new file mode 100644 index 0000000..ac8bac0 --- /dev/null +++ b/config/initializers/session_store.rb @@ -0,0 +1,8 @@ +# Be sure to restart your server when you modify this file. + +Vietcare24h::Application.config.session_store :cookie_store, key: '_vietcare24h_session' + +# Use the database for sessions instead of the cookie-based default, +# which shouldn't be used to store highly confidential information +# (create the session table with "rails generate session_migration") +# Vietcare24h::Application.config.session_store :active_record_store diff --git a/config/initializers/spree.rb b/config/initializers/spree.rb new file mode 100644 index 0000000..c1acc40 --- /dev/null +++ b/config/initializers/spree.rb @@ -0,0 +1,14 @@ +# 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. +# +# In order to initialize a setting do: +# config.setting_name = 'new value' +Spree.config do |config| + # Example: + # Uncomment to override the default site name. + # config.site_name = "Spree Demo Site" +end + +Spree.user_class = "Spree::User" diff --git a/config/initializers/wrap_parameters.rb b/config/initializers/wrap_parameters.rb new file mode 100644 index 0000000..999df20 --- /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 + +# Disable root element in JSON by default. +ActiveSupport.on_load(:active_record) do + self.include_root_in_json = false +end diff --git a/config/locales/en.yml b/config/locales/en.yml new file mode 100644 index 0000000..179c14c --- /dev/null +++ b/config/locales/en.yml @@ -0,0 +1,5 @@ +# Sample localization file for English. Add more files in this directory for other locales. +# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +en: + hello: "Hello world" diff --git a/config/routes.rb b/config/routes.rb new file mode 100644 index 0000000..7ad17a3 --- /dev/null +++ b/config/routes.rb @@ -0,0 +1,65 @@ +Vietcare24h::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 => '/' + # The priority is based upon order of creation: + # first created -> highest priority. + + # Sample of regular route: + # match 'products/:id' => 'catalog#view' + # Keep in mind you can assign values other than :controller and :action + + # Sample of named route: + # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase + # This route can be invoked with purchase_url(:id => product.id) + + # Sample resource route (maps HTTP verbs to controller actions automatically): + # resources :products + + # Sample resource route with options: + # resources :products do + # member do + # get 'short' + # post 'toggle' + # end + # + # collection do + # get 'sold' + # end + # end + + # Sample resource route with sub-resources: + # resources :products do + # resources :comments, :sales + # resource :seller + # end + + # Sample resource route with more complex sub-resources + # resources :products do + # resources :comments + # resources :sales do + # get 'recent', :on => :collection + # end + # end + + # Sample resource route within a namespace: + # namespace :admin do + # # Directs /admin/products/* to Admin::ProductsController + # # (app/controllers/admin/products_controller.rb) + # resources :products + # end + + # You can have the root of your site routed with "root" + # just remember to delete public/index.html. + # root :to => 'welcome#index' + + # See how all your routes lay out with "rake routes" + + # This is a legacy wild controller route that's not recommended for RESTful applications. + # Note: This route will make all actions in every controller accessible via GET requests. + # match ':controller(/:action(/:id))(.:format)' +end diff --git a/config/spree.yml b/config/spree.yml new file mode 100644 index 0000000..11ab8d0 --- /dev/null +++ b/config/spree.yml @@ -0,0 +1,2 @@ +--- +version: 1.2.2 diff --git a/db/migrate/20121123154017_spree_zero_nine_zero.spree.rb b/db/migrate/20121123154017_spree_zero_nine_zero.spree.rb new file mode 100644 index 0000000..f25e158 --- /dev/null +++ b/db/migrate/20121123154017_spree_zero_nine_zero.spree.rb @@ -0,0 +1,392 @@ +# This migration comes from spree (originally 20090823005402) +class SpreeZeroNineZero < ActiveRecord::Migration + # This is a legacy migration consolidating all of the database changes needed as of Spree 0.9.0 + # (See http://railsdog.lighthouseapp.com/projects/31096-spree/tickets/772) + + def change + create_table :addresses, :force => true do |t| + t.string :firstname, :lastname, :address1, :address2, :city, + :zipcode, :phone, :state_name, :alternative_phone + t.references :state + t.references :country + + t.timestamps + end + + create_table :adjustments, :force => true do |t| + t.integer :position, :adjustment_source_id + t.decimal :amount, :precision => 8, :scale => 2, :default => 0.0, :null => false + t.string :type, :description, :adjustment_source_type, :secondary_type + t.references :order + + t.timestamps + end + + create_table :assets, :force => true do |t| + t.integer :viewable_id, :attachment_width, :attachment_height, + :attachment_size, :position + t.string :viewable_type, :limit => 50 + t.string :attachment_content_type, :attachment_file_name + t.string :type, :limit => 75 + t.datetime :attachment_updated_at + end + + create_table :calculators, :force => true do |t| + t.string :type + t.integer :calculable_id, :null => false + t.string :calculable_type, :null => false + + t.timestamps + end + + create_table :checkouts, :force => true do |t| + t.references :order + t.string :email, :ip_address + t.text :special_instructions + t.integer :bill_address_id + t.datetime :completed_at + + t.timestamps + end + + create_table :configurations, :force => true do |t| + t.string :name + t.string :type, :limit => 50 + + t.timestamps + end + + add_index :configurations, [:name, :type], :name => 'index_configurations_on_name_and_type' + + create_table :countries, :force => true do |t| + t.string :iso_name, :iso, :iso3, :name + t.integer :numcode + end + + create_table :coupons, :force => true do |t| + t.string :code, :description + t.integer :usage_limit + t.boolean :combine + t.datetime :expires_at, :starts_at + + t.timestamps + end + + create_table :creditcard_txns, :force => true do |t| + t.integer :creditcard_payment_id, :txn_type + t.decimal :amount, :precision => 8, :scale => 2, :default => 0.0, :null => false + t.string :response_code + t.text :avs_response, :cvv_response + + t.timestamps + end + + create_table :creditcards, :force => true do |t| + t.text :number, :verification_value + t.string :month, :year, :cc_type, :display_number, :first_name, + :last_name, :start_month, :start_year, :issue_number + t.references :address + t.references :checkout + + t.timestamps + end + + create_table :gateway_configurations, :force => true do |t| + t.references :gateway + + t.timestamps + end + + create_table :gateway_option_values, :force => true do |t| + t.references :gateway_configuration + t.references :gateway_option + t.text :value + + t.timestamps + end + + create_table :gateway_options, :force => true do |t| + t.string :name + t.text :description + t.boolean :textarea, :default => false + t.references :gateway + + t.timestamps + end + + create_table :gateways, :force => true do |t| + t.string :clazz, :name + t.text :description + t.boolean :active + + t.timestamps + end + + create_table :inventory_units, :force => true do |t| + t.integer :lock_version, :default => 0 + t.string :state + t.references :variant + t.references :order + + t.timestamps + end + + create_table :line_items, :force => true do |t| + t.references :order + t.references :variant + t.integer :quantity, :null => false + t.decimal :price, :precision => 8, :scale => 2, :null => false + + t.timestamps + end + + add_index :line_items, :order_id, :name => 'index_line_items_on_order_id' + add_index :line_items, :variant_id, :name => 'index_line_items_on_variant_id' + + create_table :option_types, :force => true do |t| + t.string :name, :limit => 100 + t.string :presentation, :limit => 100 + + t.timestamps + end + + create_table :option_types_prototypes, :id => false, :force => true do |t| + t.references :prototype + t.references :option_type + end + + create_table :option_values, :force => true do |t| + t.integer :position + t.string :name, :presentation + t.references :option_type + + t.timestamps + end + + create_table :option_values_variants, :id => false, :force => true do |t| + t.integer :variant_id + t.integer :option_value_id + end + + add_index :option_values_variants, :variant_id, :name => 'index_option_values_variants_on_variant_id' + + create_table :orders, :force => true 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.string :token + t.decimal :adjustment_total, :precision => 8, :scale => 2, :default => 0.0, :null => false + t.decimal :credit_total, :precision => 8, :scale => 2, :default => 0.0, :null => false + t.references :user + + t.timestamps + end + + add_index :orders, :number, :name => 'index_orders_on_number' + + create_table :payments, :force => true do |t| + t.decimal :amount, :precision => 8, :scale => 2, :default => 0.0, :null => false + t.string :type + t.references :order + t.references :creditcard + + t.timestamps + end + + create_table :preferences, :force => true do |t| + t.string :attribute, :null => false, :limit => 100 + t.integer :owner_id, :null => false, :limit => 30 + t.string :owner_type, :null => false, :limit => 50 + t.integer :group_id + t.string :group_type, :limit => 50 + t.string :value + + t.timestamps + end + + add_index :preferences, [:owner_id, :owner_type, :attribute, :group_id, :group_type], :name => 'index_preferences_on_owner_and_attribute_and_preference', :unique => true + + create_table :product_option_types, :force => true do |t| + t.integer :position + t.references :product + t.references :option_type + + t.timestamps + end + + create_table :product_properties, :force => true do |t| + t.string :value + t.references :product + t.references :property + + t.timestamps + end + + create_table :products, :force => true do |t| + t.string :name, :default => '', :null => false + t.text :description + t.datetime :available_on, :deleted_at + t.string :permalink, :meta_description, :meta_keywords + t.references :tax_category + t.references :shipping_category + + t.timestamps + end + + add_index :products, :available_on, :name => 'index_products_on_available_on' + add_index :products, :deleted_at, :name => 'index_products_on_deleted_at' + add_index :products, :name, :name => 'index_products_on_name' + add_index :products, :permalink, :name => 'index_products_on_permalink' + + create_table :products_taxons, :id => false, :force => true do |t| + t.references :product + t.references :taxon + end + + add_index :products_taxons, :product_id, :name => 'index_products_taxons_on_product_id' + add_index :products_taxons, :taxon_id, :name => 'index_products_taxons_on_taxon_id' + + create_table :properties, :force => true do |t| + t.string :name + t.string :presentation, :null => false + + t.timestamps + end + + create_table :properties_prototypes, :id => false, :force => true do |t| + t.references :prototype + t.references :property + end + + create_table :prototypes, :force => true do |t| + t.string :name + + t.timestamps + end + + create_table :roles, :force => true do |t| + t.string :name + end + + create_table :roles_users, :id => false, :force => true do |t| + t.references :role + t.references :user + end + + add_index :roles_users, :role_id, :name => 'index_roles_users_on_role_id' + add_index :roles_users, :user_id, :name => 'index_roles_users_on_user_id' + + create_table :shipments, :force => true do |t| + t.string :tracking, :number + t.decimal :cost, :precision => 8, :scale => 2 + t.datetime :shipped_at + t.references :order + t.references :shipping_method + t.references :address + + t.timestamps + end + + create_table :shipping_categories, :force => true do |t| + t.string :name + + t.timestamps + end + + create_table :shipping_methods, :force => true do |t| + t.string :name + t.references :zone + + t.timestamps + end + + create_table :state_events, :force => true do |t| + t.string :name, :previous_state + t.references :order + t.references :user + + t.timestamps + end + + create_table :states, :force => true do |t| + t.string :name + t.string :abbr + t.references :country + end + + create_table :tax_categories, :force => true do |t| + t.string :name, :description + + t.timestamps + end + + create_table :tax_rates, :force => true do |t| + t.decimal :amount, :precision => 8, :scale => 4 + t.references :zone + t.references :tax_category + + t.timestamps + end + + create_table :taxonomies, :force => true do |t| + t.string :name, :null => false + + t.timestamps + end + + create_table :taxons, :force => true do |t| + t.integer :parent_id + t.integer :position, :default => 0 + t.string :name, :null => false + t.string :permalink + t.references :taxonomy + + t.timestamps + end + + unless defined?(User) + create_table :users, :force => true do |t| + t.string :crypted_password, :limit => 128, :default => '', :null => false + t.string :salt, :limit => 128, :default => '', :null => false + t.string :email, :remember_token, :remember_token_expires_at, + :persistence_token, :single_access_token, :perishable_token + t.integer :login_count, :default => 0, :null => false + t.integer :failed_login_count, :default => 0, :null => false + t.datetime :last_request_at, :current_login_at, :last_login_at + t.string :current_login_ip, :last_login_ip, :login + t.integer :ship_address_id, :bill_address_id + + t.timestamps + end + end + + create_table :variants, :force => true 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 + end + + add_index :variants, :product_id, :name => 'index_variants_on_product_id' + + create_table :zone_members, :force => true do |t| + t.integer :zoneable_id + t.string :zoneable_type + t.references :zone + + t.timestamps + end + + create_table :zones, :force => true do |t| + t.string :name, :description + + t.timestamps + end + end +end diff --git a/db/migrate/20121123154018_create_indexes_for_inventory_units.spree.rb b/db/migrate/20121123154018_create_indexes_for_inventory_units.spree.rb new file mode 100644 index 0000000..35f34bf --- /dev/null +++ b/db/migrate/20121123154018_create_indexes_for_inventory_units.spree.rb @@ -0,0 +1,7 @@ +# This migration comes from spree (originally 20090904192342) +class CreateIndexesForInventoryUnits < ActiveRecord::Migration + def change + add_index :inventory_units, :variant_id + add_index :inventory_units, :order_id + end +end diff --git a/db/migrate/20121123154019_add_count_on_hand_to_variants_and_products.spree.rb b/db/migrate/20121123154019_add_count_on_hand_to_variants_and_products.spree.rb new file mode 100644 index 0000000..3a50ae0 --- /dev/null +++ b/db/migrate/20121123154019_add_count_on_hand_to_variants_and_products.spree.rb @@ -0,0 +1,50 @@ +# This migration comes from spree (originally 20090923100315) +class AddCountOnHandToVariantsAndProducts < ActiveRecord::Migration + def up + add_column :variants, :count_on_hand, :integer, :default => 0, :null => false + add_column :products, :count_on_hand, :integer, :default => 0, :null => false + + # Due to our namespacing changes, this migration (from earlier Spree versions) is broken + # To fix it, temporarily set table name on each of the models involved + # And then... + Spree::Variant.table_name = 'variants' + Spree::Product.table_name = 'products' + Spree::InventoryUnit.table_name = 'inventory_units' + + # In some cases needed to reflect changes in table structure + Spree::Variant.reset_column_information + Spree::Product.reset_column_information + + say_with_time 'Transfering inventory units with status on_hand to variants table...' do + Spree::Variant.all.each do |v| + v.update_column(:count_on_hand, v.inventory_units.with_state('on_hand').size) + Spree::InventoryUnit.destroy_all(:variant_id => v.id, :state => 'on_hand') + end + end + + say_with_time 'Updating products count on hand' do + Spree::Product.all.each do |p| + product_count_on_hand = p.has_variants? ? + p.variants.inject(0) { |acc, v| acc + v.count_on_hand } : + (p.master ? p.master.count_on_hand : 0) + p.update_column(:count_on_hand, product_count_on_hand) + end + end + + # ... Switch things back at the end of the migration + Spree::Variant.table_name = 'spree_variants' + Spree::Product.table_name = 'spree_products' + Spree::InventoryUnit.table_name = 'spree_inventory_units' + end + + def down + Spree::Variant.all.each do |v| + v.count_on_hand.times do + Spree::InventoryUnit.create(:variant => variant, :state => 'on_hand') + end + end + + remove_column :variants, :count_on_hand + remove_column :products, :count_on_hand + end +end diff --git a/db/migrate/20121123154020_change_taxons_to_nested_set.spree.rb b/db/migrate/20121123154020_change_taxons_to_nested_set.spree.rb new file mode 100644 index 0000000..c7eb567 --- /dev/null +++ b/db/migrate/20121123154020_change_taxons_to_nested_set.spree.rb @@ -0,0 +1,47 @@ +# This migration comes from spree (originally 20091007134354) +class ChangeTaxonsToNestedSet < ActiveRecord::Migration + def up + add_column :taxons, :lft, :integer + add_column :taxons, :rgt, :integer + + Spree::Taxon.reset_column_information # So the new root ids get saved + + # Temporarily set the table back to taxons + Spree::Taxon.table_name = 'taxons' + + Spree::Taxon.class_eval do + # adapted from awesome nested set to use 'position' information + indices = {} + + left_column_name = 'lft' + right_column_name = 'rgt' + quoted_parent_column_name = 'parent_id' + scope = lambda{|node|} + + set_left_and_rights = lambda do |node| + # set left + node[left_column_name] = indices[scope.call(node)] += 1 + # find + where("#{quoted_parent_column_name} = ?", node).order('position ASC').each{ |n| set_left_and_rights.call(n) } + # set right + node[right_column_name] = indices[scope.call(node)] += 1 + node.save! + end + + # Find root node(s) + where("#{quoted_parent_column_name}" => nil).order('position ASC').each do |root_node| + # setup index for this scope + indices[scope.call(root_node)] ||= 0 + set_left_and_rights.call(root_node) + end + end + + # Set it back after the migration + Spree::Taxon.table_name = 'spree_taxons' + end + + def down + remove_column :taxons, :lft + remove_column :taxons, :rgt + end +end diff --git a/db/migrate/20121123154021_move_to_configurable_gateways.spree.rb b/db/migrate/20121123154021_move_to_configurable_gateways.spree.rb new file mode 100644 index 0000000..3390e0b --- /dev/null +++ b/db/migrate/20121123154021_move_to_configurable_gateways.spree.rb @@ -0,0 +1,55 @@ +# This migration comes from spree (originally 20091008091614) +class MoveToConfigurableGateways < ActiveRecord::Migration + def up + drop_table :gateways + drop_table :gateway_options + drop_table :gateway_option_values + drop_table :gateway_configurations + + create_table :gateways, :force => true do |t| + t.string :type, :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 + end + end + + def down + drop_table :gateways + + create_table :gateway_configurations, :force => true do |t| + t.references :gateway + + t.timestamps + end + + create_table :gateway_option_values, :force => true do |t| + t.text :value + t.references :gateway_configuration + t.references :gateway_option + + t.timestamps + end + + create_table :gateway_options, :force => true do |t| + t.string :name + t.text :description + t.boolean :textarea, :default => false + t.references :gateway + + t.timestamps + end + + create_table :gateways, :force => true do |t| + t.string :clazz, :name + t.text :description + t.boolean :active + + t.timestamps + end + end +end diff --git a/db/migrate/20121123154022_add_open_id_authentication_tables.spree.rb b/db/migrate/20121123154022_add_open_id_authentication_tables.spree.rb new file mode 100644 index 0000000..1715d12 --- /dev/null +++ b/db/migrate/20121123154022_add_open_id_authentication_tables.spree.rb @@ -0,0 +1,16 @@ +# This migration comes from spree (originally 20091015110842) +class AddOpenIdAuthenticationTables < ActiveRecord::Migration + def change + create_table :open_id_authentication_associations, :force => true do |t| + t.integer :issued, :lifetime + t.string :handle, :assoc_type + t.binary :server_url, :secret + end + + create_table :open_id_authentication_nonces, :force => true do |t| + t.integer :timestamp, :null => false + t.string :server_url, :null => true + t.string :salt, :null => false + end + end +end diff --git a/db/migrate/20121123154023_add_openid_field_to_users.spree.rb b/db/migrate/20121123154023_add_openid_field_to_users.spree.rb new file mode 100644 index 0000000..e9e0a99 --- /dev/null +++ b/db/migrate/20121123154023_add_openid_field_to_users.spree.rb @@ -0,0 +1,27 @@ +# This migration comes from spree (originally 20091015153048) +class AddOpenidFieldToUsers < ActiveRecord::Migration + def up + unless defined?(User) + add_column :users, :openid_identifier, :string + add_index :users, :openid_identifier + + change_column :users, :login, :string, :default => nil, :null => true + change_column :users, :crypted_password, :string, :default => nil, :null => true + change_column :users, :salt, :string, :default => nil, :null => true + end + end + + def down + remove_column :users, :openid_identifier + + # Due to namespacing change, temporarily set the table back to users + Spree::LegacyUser.table_name = 'users' + + [:login, :crypted_password, :salt].each do |field| + Spree::User.where(field => nil).each { |user| user.update_column(field, '') if user.send(field).nil? } + change_column :users, field, :string, :default => '', :null => false + end + + Spree::LegacyUser.table_name = 'spree_users' + end +end diff --git a/db/migrate/20121123154024_change_preference_value_type.spree.rb b/db/migrate/20121123154024_change_preference_value_type.spree.rb new file mode 100644 index 0000000..e3cb4ed --- /dev/null +++ b/db/migrate/20121123154024_change_preference_value_type.spree.rb @@ -0,0 +1,11 @@ +# This migration comes from spree (originally 20091016174634) +class ChangePreferenceValueType < ActiveRecord::Migration + def up + remove_index :preferences, :name => 'index_preferences_on_owner_and_attribute_and_preference' + change_column :preferences, :value, :text + end + + def down + change_column :preferences, :value, :string + end +end diff --git a/db/migrate/20121123154025_create_billing_integrations.spree.rb b/db/migrate/20121123154025_create_billing_integrations.spree.rb new file mode 100644 index 0000000..028018a --- /dev/null +++ b/db/migrate/20121123154025_create_billing_integrations.spree.rb @@ -0,0 +1,13 @@ +# This migration comes from spree (originally 20091017175558) +class CreateBillingIntegrations < ActiveRecord::Migration + def change + create_table :billing_integrations do |t| + t.string :type, :name + t.text :description + t.boolean :active, :default => true + t.string :environment, :default => 'development' + + t.timestamps + end + end +end diff --git a/db/migrate/20121123154026_charge_refactoring.spree.rb b/db/migrate/20121123154026_charge_refactoring.spree.rb new file mode 100644 index 0000000..17988ca --- /dev/null +++ b/db/migrate/20121123154026_charge_refactoring.spree.rb @@ -0,0 +1,40 @@ +# This migration comes from spree (originally 20091021133257) +class Checkout < ActiveRecord::Base; end; + +# Hack to prevent issues with legacy migrations +class Order < ActiveRecord::Base + has_one :checkout +end + +class ChargeRefactoring < ActiveRecord::Migration + def up + # Temporarily set table name for legacy support + Spree::Adjustment.table_name = 'adjustments' + + add_column :orders, :completed_at, :timestamp + Order.reset_column_information + Order.all.each { |o| o.update_column(:completed_at, o.checkout && o.checkout.read_attribute(:completed_at)) } + remove_column :checkouts, :completed_at + + change_column :adjustments, :amount, :decimal, :null => true, :default => nil, :precision => 8, :scale => 2 + Spree::Adjustment.update_all :type => 'secondary_type' + Spree::Adjustment.where(:type => 'Credit').update_all(:type => 'CouponCredit') + remove_column :adjustments, :secondary_type + + # Reset table name + Spree::Adjustment.table_name = 'spree_adjustments' + end + + def down + add_column :checkouts, :completed_at, :timestamp + Spree::Checkout.reset_column_information + Spree::Checkout.all.each { |c| c.update_column(:completed_at, c.order && c.order.completed_at) } + remove_column :orders, :completed_at + + add_column :adjustments, :secondary_type, :string + Spree::Adjustment.update_all :secondary_type => 'type' + Spree::Adjustment.where('type LIKE ?', '%Charge').update_all(:type => 'Charge') + Spree::Adjustment.where('type LIKE ?', '%Credit').update_all(:type => 'Credit') + change_column :adjustments, :amount, :decimal, :null => false, :default => 0, :precision => 8, :scale => 2 + end +end diff --git a/db/migrate/20121123154027_add_some_indexes.spree.rb b/db/migrate/20121123154027_add_some_indexes.spree.rb new file mode 100644 index 0000000..65118a5 --- /dev/null +++ b/db/migrate/20121123154027_add_some_indexes.spree.rb @@ -0,0 +1,12 @@ +# This migration comes from spree (originally 20091104151730) +class AddSomeIndexes < ActiveRecord::Migration + def change + add_index :taxons, :permalink + add_index :taxons, :parent_id + add_index :taxons, :taxonomy_id + add_index :assets, :viewable_id + add_index :assets, [:viewable_type, :type] + add_index :product_properties, :product_id + add_index :option_values_variants, [:variant_id, :option_value_id] + end +end diff --git a/db/migrate/20121123154028_checkout_state_machine.spree.rb b/db/migrate/20121123154028_checkout_state_machine.spree.rb new file mode 100644 index 0000000..41055f9 --- /dev/null +++ b/db/migrate/20121123154028_checkout_state_machine.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20091126190904) +class CheckoutStateMachine < ActiveRecord::Migration + def change + add_column :checkouts, :state, :string + end +end diff --git a/db/migrate/20121123154029_state_for_shipments.spree.rb b/db/migrate/20121123154029_state_for_shipments.spree.rb new file mode 100644 index 0000000..52294f8 --- /dev/null +++ b/db/migrate/20121123154029_state_for_shipments.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20091209153045) +class StateForShipments < ActiveRecord::Migration + def change + add_column :shipments, :state, :string + end +end diff --git a/db/migrate/20121123154030_make_state_events_polymorphic.spree.rb b/db/migrate/20121123154030_make_state_events_polymorphic.spree.rb new file mode 100644 index 0000000..d22566b --- /dev/null +++ b/db/migrate/20121123154030_make_state_events_polymorphic.spree.rb @@ -0,0 +1,13 @@ +# This migration comes from spree (originally 20091209202200) +class MakeStateEventsPolymorphic < ActiveRecord::Migration + def up + rename_column :state_events, :order_id, :stateful_id + add_column :state_events, :stateful_type, :string + execute "UPDATE state_events SET stateful_type = 'Order'" + end + + def down + rename_column :state_events, :stateful_id, :order_id + remove_column :state_events, :stateful_type + end +end diff --git a/db/migrate/20121123154031_ship_address_id_for_checkouts.spree.rb b/db/migrate/20121123154031_ship_address_id_for_checkouts.spree.rb new file mode 100644 index 0000000..cb86c44 --- /dev/null +++ b/db/migrate/20121123154031_ship_address_id_for_checkouts.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20091211203813) +class ShipAddressIdForCheckouts < ActiveRecord::Migration + def change + add_column :checkouts, :ship_address_id, :integer + end +end diff --git a/db/migrate/20121123154032_shipping_method_id_for_checkouts.spree.rb b/db/migrate/20121123154032_shipping_method_id_for_checkouts.spree.rb new file mode 100644 index 0000000..8834f29 --- /dev/null +++ b/db/migrate/20121123154032_shipping_method_id_for_checkouts.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20091212161118) +class ShippingMethodIdForCheckouts < ActiveRecord::Migration + def change + add_column :checkouts, :shipping_method_id, :integer + end +end diff --git a/db/migrate/20121123154033_creditcard_last_four_digits.spree.rb b/db/migrate/20121123154033_creditcard_last_four_digits.spree.rb new file mode 100644 index 0000000..327a166 --- /dev/null +++ b/db/migrate/20121123154033_creditcard_last_four_digits.spree.rb @@ -0,0 +1,15 @@ +# This migration comes from spree (originally 20091213222815) +class CreditcardLastFourDigits < ActiveRecord::Migration + def up + rename_column :creditcards, :display_number, :last_digits + + creditcards = select_all "SELECT * FROM creditcards" + creditcards.each do |card| + execute "UPDATE creditcards SET last_digits = '#{card['last_digits'].gsub('XXXX-XXXX-XXXX-', '')}' WHERE id = #{card['id']}" if card['last_digits'].present? + end + end + + def down + rename_column :creditcards, :last_digits, :display_number + end +end diff --git a/db/migrate/20121123154034_populate_legacy_shipment_state.spree.rb b/db/migrate/20121123154034_populate_legacy_shipment_state.spree.rb new file mode 100644 index 0000000..a35558e --- /dev/null +++ b/db/migrate/20121123154034_populate_legacy_shipment_state.spree.rb @@ -0,0 +1,16 @@ +# This migration comes from spree (originally 20091214183826) +class PopulateLegacyShipmentState < ActiveRecord::Migration + def up + shipments = select_all "SELECT * FROM shipments" + shipments.each do |shipment| + if shipment['shipped_at'] + execute "UPDATE shipments SET state = 'shipped'" + else + execute "UPDATE shipments SET state = 'pending'" + end + end + end + + def down + end +end diff --git a/db/migrate/20121123154035_add_cost_price.spree.rb b/db/migrate/20121123154035_add_cost_price.spree.rb new file mode 100644 index 0000000..1d7c8fd --- /dev/null +++ b/db/migrate/20121123154035_add_cost_price.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20100105090147) +class AddCostPrice < ActiveRecord::Migration + def change + add_column :variants, :cost_price, :decimal, :null => true, :default => nil, :precision => 8, :scale => 2 + end +end diff --git a/db/migrate/20121123154036_shipment_id_for_inventory_units.spree.rb b/db/migrate/20121123154036_shipment_id_for_inventory_units.spree.rb new file mode 100644 index 0000000..63ddd14 --- /dev/null +++ b/db/migrate/20121123154036_shipment_id_for_inventory_units.spree.rb @@ -0,0 +1,26 @@ +# This migration comes from spree (originally 20100105132138) +class ShipmentIdForInventoryUnits < ActiveRecord::Migration + def up + add_column :inventory_units, :shipment_id, :integer + add_index :inventory_units, :shipment_id + + # migrate legacy shipments + Spree::Shipment.table_name = 'shipments' + + Spree::Shipment.all.each do |shipment| + unless shipment.order + puts "Warning: shipment has invalid order - #{shipment.id}" + next + end + shipment.order.inventory_units.each do |unit| + unit.update_column('shipment_id', shipment.id) + end + end + + Spree::Shipment.table_name = 'spree_shipments' + end + + def down + remove_column :inventory_units, :shipment_id + end +end diff --git a/db/migrate/20121123154037_cim_fields_for_creditcards.spree.rb b/db/migrate/20121123154037_cim_fields_for_creditcards.spree.rb new file mode 100644 index 0000000..90290e4 --- /dev/null +++ b/db/migrate/20121123154037_cim_fields_for_creditcards.spree.rb @@ -0,0 +1,7 @@ +# This migration comes from spree (originally 20100111205525) +class CimFieldsForCreditcards < ActiveRecord::Migration + def change + add_column :creditcards, :gateway_customer_profile_id, :string + add_column :creditcards, :gateway_payment_profile_id, :string + end +end diff --git a/db/migrate/20121123154038_create_return_authorizations.spree.rb b/db/migrate/20121123154038_create_return_authorizations.spree.rb new file mode 100644 index 0000000..7637447 --- /dev/null +++ b/db/migrate/20121123154038_create_return_authorizations.spree.rb @@ -0,0 +1,13 @@ +# This migration comes from spree (originally 20100112151511) +class CreateReturnAuthorizations < ActiveRecord::Migration + def change + create_table :return_authorizations do |t| + t.string :number, :state + t.decimal :amount, :precision => 8, :scale => 2, :default => 0.0, :null => false + t.references :order + t.text :reason + + t.timestamps + end + end +end diff --git a/db/migrate/20121123154039_add_return_authorization_to_inventory_units.spree.rb b/db/migrate/20121123154039_add_return_authorization_to_inventory_units.spree.rb new file mode 100644 index 0000000..1cb98ae --- /dev/null +++ b/db/migrate/20121123154039_add_return_authorization_to_inventory_units.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20100113090919) +class AddReturnAuthorizationToInventoryUnits < ActiveRecord::Migration + def change + add_column :inventory_units, :return_authorization_id, :integer + end +end diff --git a/db/migrate/20121123154040_create_trackers.spree.rb b/db/migrate/20121123154040_create_trackers.spree.rb new file mode 100644 index 0000000..ef3e28a --- /dev/null +++ b/db/migrate/20121123154040_create_trackers.spree.rb @@ -0,0 +1,11 @@ +# This migration comes from spree (originally 20100113203104) +class CreateTrackers < ActiveRecord::Migration + def change + create_table :trackers do |t| + t.string :environment, :analytics_id + t.boolean :active, :default => true + + t.timestamps + end + end +end diff --git a/db/migrate/20121123154041_creditcard_id_for_creditcard_txns.spree.rb b/db/migrate/20121123154041_creditcard_id_for_creditcard_txns.spree.rb new file mode 100644 index 0000000..b26b458 --- /dev/null +++ b/db/migrate/20121123154041_creditcard_id_for_creditcard_txns.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20100121160010) +class CreditcardIdForCreditcardTxns < ActiveRecord::Migration + def change + add_column :creditcard_txns, :creditcard_id, :integer + end +end diff --git a/db/migrate/20121123154042_original_creditcard_txn_id_for_creditcard_txns.spree.rb b/db/migrate/20121123154042_original_creditcard_txn_id_for_creditcard_txns.spree.rb new file mode 100644 index 0000000..b9145ba --- /dev/null +++ b/db/migrate/20121123154042_original_creditcard_txn_id_for_creditcard_txns.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20100121183934) +class OriginalCreditcardTxnIdForCreditcardTxns < ActiveRecord::Migration + def change + add_column :creditcard_txns, :original_creditcard_txn_id, :integer + end +end diff --git a/db/migrate/20121123154043_add_test_mode_to_billing_integration.spree.rb b/db/migrate/20121123154043_add_test_mode_to_billing_integration.spree.rb new file mode 100644 index 0000000..2e61e8e --- /dev/null +++ b/db/migrate/20121123154043_add_test_mode_to_billing_integration.spree.rb @@ -0,0 +1,7 @@ +# This migration comes from spree (originally 20100125145351) +class AddTestModeToBillingIntegration < ActiveRecord::Migration + def change + add_column :billing_integrations, :test_mode, :boolean, :default => true + add_column :billing_integrations, :server, :string, :default => 'test' + end +end diff --git a/db/migrate/20121123154044_create_payment_methods.spree.rb b/db/migrate/20121123154044_create_payment_methods.spree.rb new file mode 100644 index 0000000..d3f7a89 --- /dev/null +++ b/db/migrate/20121123154044_create_payment_methods.spree.rb @@ -0,0 +1,17 @@ +# This migration comes from spree (originally 20100209025806) +class CreatePaymentMethods < ActiveRecord::Migration + def change + create_table :payment_methods do |t| + t.string :type, :name + t.text :description + t.boolean :active, :default => true + t.string :environment, :default => 'development' + + t.timestamps + end + # TODO - also migrate any legacy configurations for gateways and billing integrations before dropping the old tables + # we probably also need to do this inside the payment_gateway extension b/c table won't exist yet in fresh bootstrap + #drop_table :billing_integrations + #drop_table :gateways + end +end diff --git a/db/migrate/20121123154045_polymorphic_payments.spree.rb b/db/migrate/20121123154045_polymorphic_payments.spree.rb new file mode 100644 index 0000000..01f68d6 --- /dev/null +++ b/db/migrate/20121123154045_polymorphic_payments.spree.rb @@ -0,0 +1,43 @@ +# This migration comes from spree (originally 20100209144531) +# Legacy table support +class Checkout < ActiveRecord::Base; end; + +class PolymorphicPayments < ActiveRecord::Migration + def up + remove_column :payments, :type + remove_column :payments, :creditcard_id + rename_column :payments, :order_id, :payable_id + change_table :payments do |t| + t.string :payable_type, :payment_method + t.references :source, :polymorphic => true + end + execute "UPDATE payments SET payable_type = 'Order'" + + Spree::CreditCard.table_name = 'creditcards' + + Spree::CreditCard.all.each do |credit_card| + if checkout = Checkout.find_by_id(credit_card.checkout_id) && checkout.order + if payment = checkout.order.payments.first + execute "UPDATE payments SET source_type = 'CreditCard', source_id = #{credit_card.id} WHERE id = #{payment.id}" + end + end + end + + Spree::CreditCard.table_name = 'spree_creditcards' + + remove_column :creditcards, :checkout_id + end + + def down + add_column :creditcards, :checkout_id, :integer + change_table :payments do |t| + t.remove :payable_type + t.remove :payment_method + t.remove :source_id + t.remove :source_type + end + rename_column :payments, :payable_id, :order_id + add_column :payments, :creditcard_id, :integer + add_column :payments, :type, :string + end +end diff --git a/db/migrate/20121123154046_change_payments_payment_method_to_belongs_to.spree.rb b/db/migrate/20121123154046_change_payments_payment_method_to_belongs_to.spree.rb new file mode 100644 index 0000000..12f335d --- /dev/null +++ b/db/migrate/20121123154046_change_payments_payment_method_to_belongs_to.spree.rb @@ -0,0 +1,12 @@ +# This migration comes from spree (originally 20100213103131) +class ChangePaymentsPaymentMethodToBelongsTo < ActiveRecord::Migration + def up + remove_column :payments, :payment_method + add_column :payments, :payment_method_id, :integer + end + + def down + add_column :payments, :payment_method, :string + remove_column :payments, :payment_method_id + end +end diff --git a/db/migrate/20121123154047_assign_creditcard_txns_to_payment.spree.rb b/db/migrate/20121123154047_assign_creditcard_txns_to_payment.spree.rb new file mode 100644 index 0000000..f6432bc --- /dev/null +++ b/db/migrate/20121123154047_assign_creditcard_txns_to_payment.spree.rb @@ -0,0 +1,24 @@ +# This migration comes from spree (originally 20100214212536) +class AssignCreditcardTxnsToPayment < ActiveRecord::Migration + def up + add_column :creditcard_txns, :payment_id, :integer + + # Temporarily set back to creditcards + Spree::CreditCard.table_name = 'creditcards' + + ActiveRecord::Base.connection.select_all('SELECT * FROM creditcard_txns').each do |txn_attrs| + if credit_card = Spree::CreditCard.find_by_id(txn_attrs['creditcard_id']) && credit_card.payments.first + execute "UPDATE creditcard_txns SET payment_id = #{credit_card.payments.first.id} WHERE id = #{txn_attrs['id']}" + end + end + + Spree::CreditCard.table_name = 'spree_creditcards' + + remove_column :creditcard_txns, :creditcard_payment_id + end + + def down + remove_column :creditcard_txns, :payment_id + add_column :creditcard_txns, :creditcard_payment_id, :integer + end +end diff --git a/db/migrate/20121123154048_sti_for_transactions.spree.rb b/db/migrate/20121123154048_sti_for_transactions.spree.rb new file mode 100644 index 0000000..88e3f3e --- /dev/null +++ b/db/migrate/20121123154048_sti_for_transactions.spree.rb @@ -0,0 +1,16 @@ +# This migration comes from spree (originally 20100223170312) +class StiForTransactions < ActiveRecord::Migration + def up + rename_table :creditcard_txns, :transactions + add_column :transactions, :type, :string + remove_column :transactions, :creditcard_id + + execute "UPDATE transactions SET type = 'CreditcardTxn'" + end + + def down + rename_table :transactions, :creditcard_txns + remove_column :transactions, :type + add_column :transactions, :creditcard_id, :integer + end +end diff --git a/db/migrate/20121123154049_drop_billing_integrations.spree.rb b/db/migrate/20121123154049_drop_billing_integrations.spree.rb new file mode 100644 index 0000000..b239448 --- /dev/null +++ b/db/migrate/20121123154049_drop_billing_integrations.spree.rb @@ -0,0 +1,17 @@ +# This migration comes from spree (originally 20100223183812) +class DropBillingIntegrations < ActiveRecord::Migration + def up + drop_table :billing_integrations + end + + def down + create_table :billing_integrations do |t| + t.string :type, :name + t.text :description + t.boolean :active, :default => true + t.string :environment, :default => 'development' + + t.timestamps + end + end +end diff --git a/db/migrate/20121123154050_deleted_at_for_payment_methods.spree.rb b/db/migrate/20121123154050_deleted_at_for_payment_methods.spree.rb new file mode 100644 index 0000000..176f774 --- /dev/null +++ b/db/migrate/20121123154050_deleted_at_for_payment_methods.spree.rb @@ -0,0 +1,15 @@ +# This migration comes from spree (originally 20100224153127) +class DeletedAtForPaymentMethods < ActiveRecord::Migration + def up + change_table :payment_methods do |t| + t.timestamp :deleted_at, :default => nil + end + end + + def down + remove_column :payments_methods, :column_name + change_table :payment_methods do |t| + t.remove :deleted_at + end + end +end \ No newline at end of file diff --git a/db/migrate/20121123154051_add_adjustments_index.spree.rb b/db/migrate/20121123154051_add_adjustments_index.spree.rb new file mode 100644 index 0000000..35ca5f0 --- /dev/null +++ b/db/migrate/20121123154051_add_adjustments_index.spree.rb @@ -0,0 +1,7 @@ +# This migration comes from spree (originally 20100301163454) +class AddAdjustmentsIndex < ActiveRecord::Migration + def change + add_index :adjustments, :order_id + end +end + diff --git a/db/migrate/20121123154052_add_alt_text_to_images.spree.rb b/db/migrate/20121123154052_add_alt_text_to_images.spree.rb new file mode 100644 index 0000000..c3bb77a --- /dev/null +++ b/db/migrate/20121123154052_add_alt_text_to_images.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20100317120946) +class AddAltTextToImages < ActiveRecord::Migration + def change + add_column :assets, :alt, :text + end +end diff --git a/db/migrate/20121123154053_fix_existing_coupon_credits.spree.rb b/db/migrate/20121123154053_fix_existing_coupon_credits.spree.rb new file mode 100644 index 0000000..41f2fa2 --- /dev/null +++ b/db/migrate/20121123154053_fix_existing_coupon_credits.spree.rb @@ -0,0 +1,14 @@ +# This migration comes from spree (originally 20100419194457) +class Adjustment < ActiveRecord::Base; end; + +class FixExistingCouponCredits < ActiveRecord::Migration + def up + execute("UPDATE adjustments SET type='PromotionCredit' WHERE type='CouponCredit'") + execute("UPDATE adjustments SET adjustment_source_type='Promotion' WHERE adjustment_source_type='Coupon'") + end + + def down + execute("UPDATE adjustments SET adjustment_source_type='Coupon' WHERE adjustment_source_type='Promotion'") + execute("UPDATE adjustments SET type='CouponCredit' WHERE type='PromotionCredit'") + end +end diff --git a/db/migrate/20121123154054_add_display_to_payment_methods.spree.rb b/db/migrate/20121123154054_add_display_to_payment_methods.spree.rb new file mode 100644 index 0000000..0f8db89 --- /dev/null +++ b/db/migrate/20121123154054_add_display_to_payment_methods.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20100427121301) +class AddDisplayToPaymentMethods < ActiveRecord::Migration + def change + add_column :payment_methods, :display, :string, :default => nil + end +end diff --git a/db/migrate/20121123154055_add_addresses_checkouts_indexes.spree.rb b/db/migrate/20121123154055_add_addresses_checkouts_indexes.spree.rb new file mode 100644 index 0000000..86ce654 --- /dev/null +++ b/db/migrate/20121123154055_add_addresses_checkouts_indexes.spree.rb @@ -0,0 +1,9 @@ +# This migration comes from spree (originally 20100504142133) +class AddAddressesCheckoutsIndexes < ActiveRecord::Migration + def change + add_index :addresses, :firstname + add_index :addresses, :lastname + add_index :checkouts, :order_id + add_index :checkouts, :bill_address_id + end +end diff --git a/db/migrate/20121123154056_add_icon_to_taxons.spree.rb b/db/migrate/20121123154056_add_icon_to_taxons.spree.rb new file mode 100644 index 0000000..a4bede3 --- /dev/null +++ b/db/migrate/20121123154056_add_icon_to_taxons.spree.rb @@ -0,0 +1,18 @@ +# This migration comes from spree (originally 20100506180619) +class AddIconToTaxons < ActiveRecord::Migration + def up + # skip this migration if the attribute already exists because of advanced taxon extension + return if column_exists?(:taxons, :icon_file_name) + add_column :taxons, :icon_file_name, :string + add_column :taxons, :icon_content_type, :string + add_column :taxons, :icon_file_size, :integer + add_column :taxons, :icon_updated_at, :datetime + end + + def down + remove_column :taxons, :icon_file_name + remove_column :taxons, :icon_content_type + remove_column :taxons, :icon_file_size + remove_column :taxons, :icon_updated_at + end +end diff --git a/db/migrate/20121123154057_add_description_to_taxons.spree.rb b/db/migrate/20121123154057_add_description_to_taxons.spree.rb new file mode 100644 index 0000000..41c5865 --- /dev/null +++ b/db/migrate/20121123154057_add_description_to_taxons.spree.rb @@ -0,0 +1,12 @@ +# This migration comes from spree (originally 20100506185838) +class AddDescriptionToTaxons < ActiveRecord::Migration + def up + # skip this migration if the attribute already exists because of advanced taxon extension + return if column_exists?(:taxons, :description) + add_column :taxons, :description, :text + end + + def down + remove_column :taxons, :description + end +end diff --git a/db/migrate/20121123154058_index_for_shipments_number.spree.rb b/db/migrate/20121123154058_index_for_shipments_number.spree.rb new file mode 100644 index 0000000..ac80bf1 --- /dev/null +++ b/db/migrate/20121123154058_index_for_shipments_number.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20100528155333) +class IndexForShipmentsNumber < ActiveRecord::Migration + def change + add_index :shipments, :number + end +end diff --git a/db/migrate/20121123154059_add_index_on_users_persistence_token.spree.rb b/db/migrate/20121123154059_add_index_on_users_persistence_token.spree.rb new file mode 100644 index 0000000..5c21caf --- /dev/null +++ b/db/migrate/20121123154059_add_index_on_users_persistence_token.spree.rb @@ -0,0 +1,8 @@ +# This migration comes from spree (originally 20100528185820) +class AddIndexOnUsersPersistenceToken < ActiveRecord::Migration + def change + unless defined?(User) + add_index :users, :persistence_token + end + end +end diff --git a/db/migrate/20121123154060_add_default_to_tax_categories.spree.rb b/db/migrate/20121123154060_add_default_to_tax_categories.spree.rb new file mode 100644 index 0000000..a7d8c10 --- /dev/null +++ b/db/migrate/20121123154060_add_default_to_tax_categories.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20100605152042) +class AddDefaultToTaxCategories < ActiveRecord::Migration + def change + add_column :tax_categories, :is_default, :boolean, :default => false + end +end diff --git a/db/migrate/20121123154061_add_display_to_shipping_methods.spree.rb b/db/migrate/20121123154061_add_display_to_shipping_methods.spree.rb new file mode 100644 index 0000000..581d42e --- /dev/null +++ b/db/migrate/20121123154061_add_display_to_shipping_methods.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20100624110730) +class AddDisplayToShippingMethods < ActiveRecord::Migration + def change + add_column :shipping_methods, :display_on, :string, :default => nil + end +end diff --git a/db/migrate/20121123154062_rename_payment_method_display.spree.rb b/db/migrate/20121123154062_rename_payment_method_display.spree.rb new file mode 100644 index 0000000..3cb38ab --- /dev/null +++ b/db/migrate/20121123154062_rename_payment_method_display.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20100624123336) +class RenamePaymentMethodDisplay < ActiveRecord::Migration + def change + rename_column :payment_methods, :display, :display_on + end +end diff --git a/db/migrate/20121123154063_rename_preferences_field.spree.rb b/db/migrate/20121123154063_rename_preferences_field.spree.rb new file mode 100644 index 0000000..3cd68a9 --- /dev/null +++ b/db/migrate/20121123154063_rename_preferences_field.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20100624175547) +class RenamePreferencesField < ActiveRecord::Migration + def change + rename_column :preferences, :attribute, :name + end +end diff --git a/db/migrate/20121123154064_add_guest_flag.spree.rb b/db/migrate/20121123154064_add_guest_flag.spree.rb new file mode 100644 index 0000000..8d170a0 --- /dev/null +++ b/db/migrate/20121123154064_add_guest_flag.spree.rb @@ -0,0 +1,8 @@ +# This migration comes from spree (originally 20100811163637) +class AddGuestFlag < ActiveRecord::Migration + def change + unless defined?(User) + add_column :users, :guest, :boolean + end + end +end diff --git a/db/migrate/20121123154065_drop_order_token.spree.rb b/db/migrate/20121123154065_drop_order_token.spree.rb new file mode 100644 index 0000000..986d84b --- /dev/null +++ b/db/migrate/20121123154065_drop_order_token.spree.rb @@ -0,0 +1,10 @@ +# This migration comes from spree (originally 20100811205836) +class DropOrderToken < ActiveRecord::Migration + def up + remove_column :orders, :token + end + + def down + add_column :orders, :token, :string + end +end diff --git a/db/migrate/20121123154066_payments_state_and_assigned_to_order_only.spree.rb b/db/migrate/20121123154066_payments_state_and_assigned_to_order_only.spree.rb new file mode 100644 index 0000000..e2256e2 --- /dev/null +++ b/db/migrate/20121123154066_payments_state_and_assigned_to_order_only.spree.rb @@ -0,0 +1,15 @@ +# This migration comes from spree (originally 20100812162326) +class PaymentsStateAndAssignedToOrderOnly < ActiveRecord::Migration + def up + # TODO: migrate existing payments + rename_column :payments, :payable_id, :order_id + remove_column :payments, :payable_type + add_column :payments, :state, :string + end + + def down + remove_column :payments, :state + add_column :payments, :payable_type, :string + rename_column :payments, :order_id, :payable_id + end +end diff --git a/db/migrate/20121123154067_create_address_keys_for_order.spree.rb b/db/migrate/20121123154067_create_address_keys_for_order.spree.rb new file mode 100644 index 0000000..204ce6e --- /dev/null +++ b/db/migrate/20121123154067_create_address_keys_for_order.spree.rb @@ -0,0 +1,7 @@ +# This migration comes from spree (originally 20100813023502) +class CreateAddressKeysForOrder < ActiveRecord::Migration + def change + add_column :orders, :bill_address_id, :integer + add_column :orders, :ship_address_id, :integer + end +end \ No newline at end of file diff --git a/db/migrate/20121123154068_payment_total_for_orders.spree.rb b/db/migrate/20121123154068_payment_total_for_orders.spree.rb new file mode 100644 index 0000000..6cf32a8 --- /dev/null +++ b/db/migrate/20121123154068_payment_total_for_orders.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20100813185745) +class PaymentTotalForOrders < ActiveRecord::Migration + def change + add_column :orders, :payment_total, :decimal, :precision => 8, :scale => 2, :default => 0.0 + end +end diff --git a/db/migrate/20121123154069_shipping_method_id_for_orders.spree.rb b/db/migrate/20121123154069_shipping_method_id_for_orders.spree.rb new file mode 100644 index 0000000..c7ff0b4 --- /dev/null +++ b/db/migrate/20121123154069_shipping_method_id_for_orders.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20100816212146) +class ShippingMethodIdForOrders < ActiveRecord::Migration + def change + add_column :orders, :shipping_method_id, :integer + end +end diff --git a/db/migrate/20121123154070_add_shipment_and_payment_state.spree.rb b/db/migrate/20121123154070_add_shipment_and_payment_state.spree.rb new file mode 100644 index 0000000..51fb084 --- /dev/null +++ b/db/migrate/20121123154070_add_shipment_and_payment_state.spree.rb @@ -0,0 +1,7 @@ +# This migration comes from spree (originally 20100817152723) +class AddShipmentAndPaymentState < ActiveRecord::Migration + def change + add_column :orders, :shipment_state, :string + add_column :orders, :payment_state, :string + end +end \ No newline at end of file diff --git a/db/migrate/20121123154071_refactor_adjustments.spree.rb b/db/migrate/20121123154071_refactor_adjustments.spree.rb new file mode 100644 index 0000000..ec28a16 --- /dev/null +++ b/db/migrate/20121123154071_refactor_adjustments.spree.rb @@ -0,0 +1,30 @@ +# This migration comes from spree (originally 20100819170125) +class RefactorAdjustments < ActiveRecord::Migration + def up + change_table :adjustments do |t| + t.boolean :mandatory + t.boolean :frozen + t.rename :adjustment_source_id, :source_id + t.rename :adjustment_source_type, :source_type + t.references :originator + t.string :originator_type + t.remove :type + t.rename :description, :label + t.remove :position + end + end + + def down + change_table :adjustments do |t| + t.integer :position + t.rename :label, :description + t.string :type + t.remove :originator_type + t.remove :originator_id + t.rename :source_type, :adjustment_source_type + t.rename :source_id, :adjustment_source_id + t.remove :frozen + t.remove :mandatory + end + end +end diff --git a/db/migrate/20121123154072_response_code_and_avs_response_for_payments.spree.rb b/db/migrate/20121123154072_response_code_and_avs_response_for_payments.spree.rb new file mode 100644 index 0000000..8679c1b --- /dev/null +++ b/db/migrate/20121123154072_response_code_and_avs_response_for_payments.spree.rb @@ -0,0 +1,7 @@ +# This migration comes from spree (originally 20100820135707) +class ResponseCodeAndAvsResponseForPayments < ActiveRecord::Migration + def change + add_column :payments, :response_code, :string + add_column :payments, :avs_response, :string + end +end diff --git a/db/migrate/20121123154073_change_guest_flag_to_anonymous.spree.rb b/db/migrate/20121123154073_change_guest_flag_to_anonymous.spree.rb new file mode 100644 index 0000000..3fe5eb6 --- /dev/null +++ b/db/migrate/20121123154073_change_guest_flag_to_anonymous.spree.rb @@ -0,0 +1,8 @@ +# This migration comes from spree (originally 20100901171814) +class ChangeGuestFlagToAnonymous < ActiveRecord::Migration + def change + unless defined?(User) + rename_column :users, :guest, :anonymous + end + end +end diff --git a/db/migrate/20121123154074_email_for_orders.spree.rb b/db/migrate/20121123154074_email_for_orders.spree.rb new file mode 100644 index 0000000..9e17763 --- /dev/null +++ b/db/migrate/20121123154074_email_for_orders.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20100903203949) +class EmailForOrders < ActiveRecord::Migration + def change + add_column :orders, :email, :string + end +end diff --git a/db/migrate/20121123154075_create_mail_methods.spree.rb b/db/migrate/20121123154075_create_mail_methods.spree.rb new file mode 100644 index 0000000..5efa48b --- /dev/null +++ b/db/migrate/20121123154075_create_mail_methods.spree.rb @@ -0,0 +1,11 @@ +# This migration comes from spree (originally 20100923162011) +class CreateMailMethods < ActiveRecord::Migration + def change + create_table :mail_methods do |t| + t.string :environment + t.boolean :active, :default => true + + t.timestamps + end + end +end diff --git a/db/migrate/20121123154076_rename_frozen_to_locked.spree.rb b/db/migrate/20121123154076_rename_frozen_to_locked.spree.rb new file mode 100644 index 0000000..aee207d --- /dev/null +++ b/db/migrate/20121123154076_rename_frozen_to_locked.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20100929151905) +class RenameFrozenToLocked < ActiveRecord::Migration + def change + rename_column :adjustments, :frozen, :locked + end +end diff --git a/db/migrate/20121123154077_move_special_instructions_to_orders.spree.rb b/db/migrate/20121123154077_move_special_instructions_to_orders.spree.rb new file mode 100644 index 0000000..dbc4e25 --- /dev/null +++ b/db/migrate/20121123154077_move_special_instructions_to_orders.spree.rb @@ -0,0 +1,11 @@ +# This migration comes from spree (originally 20101008190536) +class MoveSpecialInstructionsToOrders < ActiveRecord::Migration + def up + add_column :orders, :special_instructions, :text + execute "UPDATE orders SET special_instructions = (SELECT special_instructions FROM checkouts WHERE order_id = orders.id)" + end + + def down + remove_column :orders, :special_instructions, :text + end +end diff --git a/db/migrate/20121123154078_create_log_entries.spree.rb b/db/migrate/20121123154078_create_log_entries.spree.rb new file mode 100644 index 0000000..2daf37e --- /dev/null +++ b/db/migrate/20121123154078_create_log_entries.spree.rb @@ -0,0 +1,12 @@ +# This migration comes from spree (originally 20101026184700) +class CreateLogEntries < ActiveRecord::Migration + def change + create_table :log_entries do |t| + t.integer :source_id + t.string :source_type + t.text :details + + t.timestamps + end + end +end diff --git a/db/migrate/20121123154079_migrate_transactions_to_payment_state.spree.rb b/db/migrate/20121123154079_migrate_transactions_to_payment_state.spree.rb new file mode 100644 index 0000000..e208262 --- /dev/null +++ b/db/migrate/20121123154079_migrate_transactions_to_payment_state.spree.rb @@ -0,0 +1,99 @@ +# This migration comes from spree (originally 20101026184714) +class Transaction < ActiveRecord::Base; end +class CreditcardTxn < Transaction; end + +class MigrateTransactionsToPaymentState < ActiveRecord::Migration + + AUTHORIZED=1 + COMPLETED=2 + PURCHASED=3 + VOIDED = 4 + CREDITED =5 + + PAYMENT_COMPLETE = 'completed' + PAYMENT_VOID = 'void' + PAYMENT_PENDING = 'pending' + + # Temporarily set the table back to payments + Spree::Payment.table_name = 'payments' + + def up + migrate_authorized_only_transactions + migrate_voided_transactions + migrate_completed_transactions + migrate_purchased_transactions + migrate_credited_transactions + + Spree::Payment.table_name = 'spree_payments' + end + + def migrate_credited_transactions + credited = Transaction.find_by_sql("SELECT * FROM transactions WHERE txn_type = #{CREDITED}") + credited.each do |tx| + payment = Spree::Payment.find(tx) + order = payment.order + order.create_payment( + :amount => tx.amount, + :source_id => payment.source_id, :source_type => 'Creditcard', + :payment_method_id => payment.payment_method_id, :state => PAYMENT_COMPLETE, + :avs_response => tx.avs_response, :response_code => tx.response_code + ) + end + credited.each(&:destroy) + end + + def migrate_voided_transactions + voided = Transaction.find_by_sql("SELECT * FROM transactions WHERE txn_type = #{VOIDED}") + voided.each do |tx| + update_payment(tx, PAYMENT_VOID) + end + unless voided.empty? + all_but_credited = [AUTHORIZED, COMPLETED, PURCHASED, VOIDED] + voided_and_subsequent_transactions = Transaction.find_by_sql("SELECT * FROM transactions WHERE payment_id IN (#{voided.map(&:payment_id).join(',')}) AND txn_type IN (#{all_but_credited.join(',')})") + voided_and_subsequent_transactions.each(&:destroy) + end + end + + def migrate_purchased_transactions + migrate_transactions(PURCHASED) + end + + def migrate_completed_transactions + migrate_transactions(COMPLETED) + end + + def migrate_transactions(type) + txs = Transaction.find_by_sql("SELECT * FROM transactions WHERE txn_type = #{type}") + txs.each do |tx| + update_payment(tx, PAYMENT_COMPLETE) + end + txs.each(&:destroy) + end + + def migrate_authorized_only_transactions + if (ActiveRecord::Base.connection.adapter_name == 'PostgreSQL') + group_by_clause = 'GROUP BY transactions.' + Transaction.column_names.join(', transactions.') + else + group_by_clause = 'GROUP BY payment_id' + end + authorized_only = Transaction.find_by_sql("SELECT * FROM transactions #{group_by_clause} HAVING COUNT(payment_id) = 1 AND txn_type = #{AUTHORIZED}") + authorized_only.each do |tx| + update_payment(tx, PAYMENT_PENDING) + end + authorized_only.each(&:destroy) + end + + def update_payment(tx, state) + payment = Spree::Payment.find(tx.payment_id) + payment.update_attributes_without_callbacks({ + :state => state, + :source_type => 'Creditcard', + :amount => tx.amount, + :response_code => tx.response_code, + :avs_response => tx.avs_response + }) + end + + def down + end +end diff --git a/db/migrate/20121123154080_delete_in_progress_orders.spree.rb b/db/migrate/20121123154080_delete_in_progress_orders.spree.rb new file mode 100644 index 0000000..08c09e3 --- /dev/null +++ b/db/migrate/20121123154080_delete_in_progress_orders.spree.rb @@ -0,0 +1,20 @@ +# This migration comes from spree (originally 20101026184746) +class DeleteInProgressOrders < ActiveRecord::Migration + def up + execute("DELETE FROM orders WHERE orders.state = 'in_progress'") + delete_orphans('adjustments') + delete_orphans('checkouts') + delete_orphans('shipments') + delete_orphans('payments') + delete_orphans('line_items') + delete_orphans('inventory_units') + end + + def down + end + + private + def delete_orphans(table_name) + execute "DELETE FROM #{table_name} WHERE order_id NOT IN (SELECT id FROM orders)" + end +end diff --git a/db/migrate/20121123154081_migrate_checkout_to_orders.spree.rb b/db/migrate/20121123154081_migrate_checkout_to_orders.spree.rb new file mode 100644 index 0000000..6ae948d --- /dev/null +++ b/db/migrate/20121123154081_migrate_checkout_to_orders.spree.rb @@ -0,0 +1,24 @@ +# This migration comes from spree (originally 20101026184808) +class MigrateCheckoutToOrders < ActiveRecord::Migration + def up + orders = select_all "SELECT * FROM orders" + + orders.each do |order| + checkout = update_order(order) + execute "DELETE FROM checkouts WHERE id = #{checkout['id']}" if checkout + end + end + + def down + end + + private + def update_order(order) + checkout = select_one "SELECT * FROM checkouts WHERE order_id = #{order['id']}" + + if checkout + execute "UPDATE orders SET email='#{checkout['email']}', bill_address_id = #{checkout['bill_address_id']}, ship_address_id = #{checkout['ship_address_id']} WHERE id = #{checkout['id']}" + end + checkout + end +end diff --git a/db/migrate/20121123154082_remove_shipped_state.spree.rb b/db/migrate/20121123154082_remove_shipped_state.spree.rb new file mode 100644 index 0000000..041b5fe --- /dev/null +++ b/db/migrate/20121123154082_remove_shipped_state.spree.rb @@ -0,0 +1,13 @@ +# This migration comes from spree (originally 20101026184855) +class RemoveShippedState < ActiveRecord::Migration + def up + execute "UPDATE orders SET state = 'complete' WHERE state = 'shipped'" + shipments = select_all "SELECT shipments.id FROM shipments WHERE order_id IN (SELECT orders.id FROM orders WHERE orders.state = 'shipped')" + shipments.each do |shipment| + execute "UPDATE shipments SET state='shipped' WHERE id = #{shipment[:id]}" + end + end + + def down + end +end diff --git a/db/migrate/20121123154083_prevent_nil_payment_total.spree.rb b/db/migrate/20121123154083_prevent_nil_payment_total.spree.rb new file mode 100644 index 0000000..ba47f39 --- /dev/null +++ b/db/migrate/20121123154083_prevent_nil_payment_total.spree.rb @@ -0,0 +1,9 @@ +# This migration comes from spree (originally 20101026184916) +class PreventNilPaymentTotal < ActiveRecord::Migration + def up + execute "UPDATE orders SET payment_total = 0.0 WHERE payment_total IS NULL" + end + + def down + end +end diff --git a/db/migrate/20121123154084_prevent_nil_email.spree.rb b/db/migrate/20121123154084_prevent_nil_email.spree.rb new file mode 100644 index 0000000..5178279 --- /dev/null +++ b/db/migrate/20121123154084_prevent_nil_email.spree.rb @@ -0,0 +1,10 @@ +# This migration comes from spree (originally 20101026184932) +class PreventNilEmail < ActiveRecord::Migration + def up + execute "UPDATE orders SET email = 'guest@example.com' WHERE email IS NULL" + execute "UPDATE orders SET email = 'guest@example.com' WHERE email = ''" + end + + def down + end +end diff --git a/db/migrate/20121123154085_generate_anonymous_users.spree.rb b/db/migrate/20121123154085_generate_anonymous_users.spree.rb new file mode 100644 index 0000000..544e287 --- /dev/null +++ b/db/migrate/20121123154085_generate_anonymous_users.spree.rb @@ -0,0 +1,21 @@ +# This migration comes from spree (originally 20101026184959) +class GenerateAnonymousUsers < ActiveRecord::Migration + def up + Spree::LegacyUser.table_name = 'users' + Spree::Order.table_name = 'orders' + + Spree::LegacyUser.reset_column_information + Spree::Order.where(:user_id => nil).each do |order| + user = Spree::User.anonymous! + user.email ||= order.email + order.user = user + order.save! + end + + Spree::LegacyUser.table_name = 'spree_users' + Spree::Order.table_name = 'spree_orders' + end + + def down + end +end diff --git a/db/migrate/20121123154086_update_order_state.spree.rb b/db/migrate/20121123154086_update_order_state.spree.rb new file mode 100644 index 0000000..f797544 --- /dev/null +++ b/db/migrate/20121123154086_update_order_state.spree.rb @@ -0,0 +1,13 @@ +# This migration comes from spree (originally 20101026185022) +class UpdateOrderState < ActiveRecord::Migration + def up + Spree::Order.table_name = 'orders' + + Spree::Order.all.map(&:update!) + + Spree::Order.table_name = 'spree_orders' + end + + def down + end +end diff --git a/db/migrate/20121123154087_cleanup_legacy_tables.spree.rb b/db/migrate/20121123154087_cleanup_legacy_tables.spree.rb new file mode 100644 index 0000000..a2dba13 --- /dev/null +++ b/db/migrate/20121123154087_cleanup_legacy_tables.spree.rb @@ -0,0 +1,12 @@ +# This migration comes from spree (originally 20101026192225) +class CleanupLegacyTables < ActiveRecord::Migration + def up + drop_table :checkouts + drop_table :transactions + drop_table :open_id_authentication_associations + drop_table :open_id_authentication_nonces + end + + def down + end +end diff --git a/db/migrate/20121123154088_remove_number_and_cvv_from_credicard.spree.rb b/db/migrate/20121123154088_remove_number_and_cvv_from_credicard.spree.rb new file mode 100644 index 0000000..75fc6f3 --- /dev/null +++ b/db/migrate/20121123154088_remove_number_and_cvv_from_credicard.spree.rb @@ -0,0 +1,12 @@ +# This migration comes from spree (originally 20101028151745) +class RemoveNumberAndCvvFromCredicard < ActiveRecord::Migration + def up + remove_column :creditcards, :number + remove_column :creditcards, :verification_value + end + + def down + add_column :creditcards, :verification_value, :text + add_column :creditcards, :number, :text + end +end diff --git a/db/migrate/20121123154089_drop_anonymous_field_for_user.spree.rb b/db/migrate/20121123154089_drop_anonymous_field_for_user.spree.rb new file mode 100644 index 0000000..0717f5f --- /dev/null +++ b/db/migrate/20121123154089_drop_anonymous_field_for_user.spree.rb @@ -0,0 +1,12 @@ +# This migration comes from spree (originally 20101103212716) +class DropAnonymousFieldForUser < ActiveRecord::Migration + def up + unless defined?(User) + remove_column :users, :anonymous + end + end + + def down + add_column :users, :anonymous, :boolean + end +end diff --git a/db/migrate/20121123154090_renamed_rma_cancelled_state.spree.rb b/db/migrate/20121123154090_renamed_rma_cancelled_state.spree.rb new file mode 100644 index 0000000..5e97999 --- /dev/null +++ b/db/migrate/20121123154090_renamed_rma_cancelled_state.spree.rb @@ -0,0 +1,10 @@ +# This migration comes from spree (originally 20101111133551) +class RenamedRmaCancelledState < ActiveRecord::Migration + def up + execute "UPDATE return_authorizations SET state = 'canceled' WHERE state = 'cancelled'" + end + + def down + execute "UPDATE return_authorizations SET state = 'cancelled' WHERE state = 'canceled'" + end +end diff --git a/db/migrate/20121123154091_fix_problematic_index_names.spree.rb b/db/migrate/20121123154091_fix_problematic_index_names.spree.rb new file mode 100644 index 0000000..f645808 --- /dev/null +++ b/db/migrate/20121123154091_fix_problematic_index_names.spree.rb @@ -0,0 +1,14 @@ +# This migration comes from spree (originally 20101117031806) +class FixProblematicIndexNames < ActiveRecord::Migration + def up + begin + remove_index :preferences, :name => 'index_preferences_on_owner_and_attribute_and_preference' + rescue ArgumentError + # ignore - already remove then + end + add_index :preferences, [:owner_id, :owner_type, :name, :group_id, :group_type], :name => 'ix_prefs_on_owner_attr_pref', :unique => true + end + + def down + end +end diff --git a/db/migrate/20121123154092_add_position_to_variants.spree.rb b/db/migrate/20121123154092_add_position_to_variants.spree.rb new file mode 100644 index 0000000..58b18d6 --- /dev/null +++ b/db/migrate/20121123154092_add_position_to_variants.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20101223215658) +class AddPositionToVariants < ActiveRecord::Migration + def change + add_column :variants, :position, :integer + end +end diff --git a/db/migrate/20121123154093_add_next_state_to_state_events.spree.rb b/db/migrate/20121123154093_add_next_state_to_state_events.spree.rb new file mode 100644 index 0000000..eb0bad6 --- /dev/null +++ b/db/migrate/20121123154093_add_next_state_to_state_events.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20110110130847) +class AddNextStateToStateEvents < ActiveRecord::Migration + def change + add_column :state_events, :next_state, :string + end +end diff --git a/db/migrate/20121123154094_add_position_to_option_types.spree.rb b/db/migrate/20121123154094_add_position_to_option_types.spree.rb new file mode 100644 index 0000000..eebb58d --- /dev/null +++ b/db/migrate/20121123154094_add_position_to_option_types.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20110111122537) +class AddPositionToOptionTypes < ActiveRecord::Migration + def change + add_column :option_types, :position, :integer, :null => false, :default => 0 + end +end diff --git a/db/migrate/20121123154095_remove_trailing_slashes_in_taxon_permalinks.spree.rb b/db/migrate/20121123154095_remove_trailing_slashes_in_taxon_permalinks.spree.rb new file mode 100644 index 0000000..7196965 --- /dev/null +++ b/db/migrate/20121123154095_remove_trailing_slashes_in_taxon_permalinks.spree.rb @@ -0,0 +1,20 @@ +# This migration comes from spree (originally 20110314192118) +class RemoveTrailingSlashesInTaxonPermalinks < ActiveRecord::Migration + def up + taxons = select_all "SELECT * FROM taxons" + taxons.each do |taxon| + if taxon['permalink'] && taxon['permalink'][-1..-1] == '/' + execute "UPDATE taxons SET permalink = '#{taxon['permalink'][0...-1]}' WHERE id = #{taxon['id']}" + end + end + end + + def down + taxons = select_all "SELECT * FROM taxons" + taxons.each do |taxon| + if taxon['permalink'] && taxon['permalink'][-1..-1] != '/' + execute "UPDATE taxons SET permalink = '#{taxon['permalink'] + '/'}' WHERE id = #{taxon['id']}" + end + end + end +end diff --git a/db/migrate/20121123154096_create_activators.spree.rb b/db/migrate/20121123154096_create_activators.spree.rb new file mode 100644 index 0000000..a37f1ef --- /dev/null +++ b/db/migrate/20121123154096_create_activators.spree.rb @@ -0,0 +1,15 @@ +# This migration comes from spree (originally 20110329141434) +class CreateActivators < ActiveRecord::Migration + def change + create_table :activators, :force => true do |t| + t.string :description + t.datetime :expires_at + t.datetime :created_at + t.datetime :updated_at + t.datetime :starts_at + t.string :name + t.string :event_name + t.string :type + end + end +end diff --git a/db/migrate/20121123154097_eligible_for_adjustments.spree.rb b/db/migrate/20121123154097_eligible_for_adjustments.spree.rb new file mode 100644 index 0000000..f3b8a44 --- /dev/null +++ b/db/migrate/20121123154097_eligible_for_adjustments.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20110418151136) +class EligibleForAdjustments < ActiveRecord::Migration + def change + add_column :adjustments, :eligible, :boolean, :default => true + end +end diff --git a/db/migrate/20121123154098_namespace_top_level_models.spree.rb b/db/migrate/20121123154098_namespace_top_level_models.spree.rb new file mode 100644 index 0000000..84aad6d --- /dev/null +++ b/db/migrate/20121123154098_namespace_top_level_models.spree.rb @@ -0,0 +1,67 @@ +# This migration comes from spree (originally 20111007143030) +class NamespaceTopLevelModels < ActiveRecord::Migration + def change + rename_table :activators, :spree_activators + rename_table :addresses, :spree_addresses + rename_table :adjustments, :spree_adjustments + rename_table :configurations, :spree_configurations + rename_table :assets, :spree_assets + rename_table :calculators, :spree_calculators + rename_table :countries, :spree_countries + rename_table :creditcards, :spree_creditcards + rename_table :gateways, :spree_gateways + rename_table :inventory_units, :spree_inventory_units + rename_table :line_items, :spree_line_items + rename_table :log_entries, :spree_log_entries + rename_table :mail_methods, :spree_mail_methods + rename_table :option_types, :spree_option_types + rename_table :option_values, :spree_option_values + rename_table :option_types_prototypes, :spree_option_types_prototypes + rename_table :option_values_variants, :spree_option_values_variants + rename_table :orders, :spree_orders + rename_table :payments, :spree_payments + rename_table :payment_methods, :spree_payment_methods + rename_table :preferences, :spree_preferences + rename_table :products, :spree_products + rename_table :product_option_types, :spree_product_option_types + rename_table :product_properties, :spree_product_properties + rename_table :products_taxons, :spree_products_taxons + rename_table :properties, :spree_properties + rename_table :prototypes, :spree_prototypes + rename_table :properties_prototypes, :spree_properties_prototypes + rename_table :return_authorizations, :spree_return_authorizations + rename_table :roles, :spree_roles + rename_table :roles_users, :spree_roles_users + rename_table :shipments, :spree_shipments + rename_table :shipping_categories, :spree_shipping_categories + rename_table :shipping_methods, :spree_shipping_methods + rename_table :states, :spree_states + rename_table :state_events, :spree_state_events + rename_table :tax_categories, :spree_tax_categories + rename_table :tax_rates, :spree_tax_rates + rename_table :taxons, :spree_taxons + rename_table :taxonomies, :spree_taxonomies + rename_table :trackers, :spree_trackers + unless defined?(User) || table_exists?(:spree_users) + rename_table :users, :spree_users + end + rename_table :variants, :spree_variants + rename_table :zones, :spree_zones + rename_table :zone_members, :spree_zone_members + + rename_index :spree_configurations, 'index_configurations_on_name_and_type', 'index_spree_configurations_on_name_and_type' + rename_index :spree_line_items, 'index_line_items_on_order_id', 'index_spree_line_items_on_order_id' + rename_index :spree_line_items, 'index_line_items_on_variant_id', 'index_spree_line_items_on_variant_id' + rename_index :spree_option_values_variants, 'index_option_values_variants_on_variant_id', 'index_spree_option_values_variants_on_variant_id' + rename_index :spree_orders, 'index_orders_on_number', 'index_spree_orders_on_number' + rename_index :spree_products, 'index_products_on_available_on', 'index_spree_products_on_available_on' + rename_index :spree_products, 'index_products_on_deleted_at', 'index_spree_products_on_deleted_at' + rename_index :spree_products, 'index_products_on_name', 'index_spree_products_on_name' + rename_index :spree_products, 'index_products_on_permalink', 'index_spree_products_on_permalink' + rename_index :spree_products_taxons, 'index_products_taxons_on_product_id', 'index_spree_products_taxons_on_product_id' + rename_index :spree_products_taxons, 'index_products_taxons_on_taxon_id', 'index_spree_products_taxons_on_taxon_id' + rename_index :spree_roles_users, 'index_roles_users_on_role_id', 'index_spree_roles_users_on_role_id' + rename_index :spree_roles_users, 'index_roles_users_on_user_id', 'index_spree_roles_users_on_user_id' + rename_index :spree_variants, 'index_variants_on_product_id', 'index_spree_variants_on_product_id' + end +end diff --git a/db/migrate/20121123154099_migrate_namespaced_polymorphic_models.spree.rb b/db/migrate/20121123154099_migrate_namespaced_polymorphic_models.spree.rb new file mode 100644 index 0000000..fc04334 --- /dev/null +++ b/db/migrate/20121123154099_migrate_namespaced_polymorphic_models.spree.rb @@ -0,0 +1,53 @@ +# This migration comes from spree (originally 20111107143030) +class MigrateNamespacedPolymorphicModels < ActiveRecord::Migration + def concat(str1, str2) + dbtype = Rails.configuration.database_configuration[Rails.env]['adapter'].to_sym + + case dbtype + when :mysql, :mysql2 + "CONCAT(#{str1}, #{str2})" + when :sqlserver + "(#{str1} + #{str2})" + else + "(#{str1} || #{str2})" + end + end + + def update_column_data(table_names, column_name) + tables = Array.wrap(table_names) + tables.each do |table| + execute "UPDATE #{table} SET #{column_name} = #{concat("'Spree::'", column_name)}" + + " where #{column_name} NOT LIKE 'Spree::%' AND #{column_name} IS NOT NULL" + end + end + + def replace_column_data(table_names, column_name) + tables = Array.wrap(table_names) + tables.each do |table| + execute "UPDATE #{table} SET #{column_name} = REPLACE(#{column_name}, 'Spree::', '') " + + " where #{column_name} LIKE 'Spree::%'" + end + end + + def up + update_column_data(['spree_payments', 'spree_adjustments', 'spree_log_entries'], 'source_type') + update_column_data('spree_adjustments', 'originator_type') + update_column_data('spree_calculators', 'calculable_type') + update_column_data('spree_preferences', 'owner_type') + update_column_data('spree_state_events', 'stateful_type') + update_column_data(['spree_activators', 'spree_assets', 'spree_calculators', 'spree_configurations', 'spree_gateways', 'spree_payment_methods'], 'type') + update_column_data('spree_assets', 'viewable_type') + update_column_data('spree_zone_members', 'zoneable_type') + end + + def down + replace_column_data(['spree_payments', 'spree_adjustments', 'spree_log_entries'], 'source_type') + replace_column_data('spree_adjustments', 'originator_type') + replace_column_data('spree_calculators', 'calculable_type') + replace_column_data('spree_preferences', 'owner_type') + replace_column_data('spree_state_events', 'stateful_type') + replace_column_data(['spree_activators', 'spree_assets', 'spree_calculators', 'spree_configurations', 'spree_gateways', 'spree_payment_methods'], 'type') + replace_column_data('spree_assets', 'viewable_type') + replace_column_data('spree_zone_members', 'zoneable_type') + end +end diff --git a/db/migrate/20121123154100_make_adjustments_polymorphic.spree.rb b/db/migrate/20121123154100_make_adjustments_polymorphic.spree.rb new file mode 100644 index 0000000..e7ae007 --- /dev/null +++ b/db/migrate/20121123154100_make_adjustments_polymorphic.spree.rb @@ -0,0 +1,10 @@ +# This migration comes from spree (originally 20111201024007) +class MakeAdjustmentsPolymorphic < ActiveRecord::Migration + + def change + add_column :spree_adjustments, :adjustable_type, :string + rename_column :spree_adjustments, :order_id, :adjustable_id + execute "UPDATE spree_adjustments SET adjustable_type = 'Spree::Order'" + end + +end diff --git a/db/migrate/20121123154101_add_company_to_addresses.spree.rb b/db/migrate/20121123154101_add_company_to_addresses.spree.rb new file mode 100644 index 0000000..db74d0a --- /dev/null +++ b/db/migrate/20121123154101_add_company_to_addresses.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20111215032408) +class AddCompanyToAddresses < ActiveRecord::Migration + def change + add_column :spree_addresses, :company, :string + end +end diff --git a/db/migrate/20121123154102_add_inc_tax_to_tax_rates.spree.rb b/db/migrate/20121123154102_add_inc_tax_to_tax_rates.spree.rb new file mode 100644 index 0000000..c22668e --- /dev/null +++ b/db/migrate/20121123154102_add_inc_tax_to_tax_rates.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20111216154844) +class AddIncTaxToTaxRates < ActiveRecord::Migration + def change + add_column :spree_tax_rates, :inc_tax, :boolean, :default => false + end +end diff --git a/db/migrate/20121123154103_rename_inc_price_attribute.spree.rb b/db/migrate/20121123154103_rename_inc_price_attribute.spree.rb new file mode 100644 index 0000000..10d0428 --- /dev/null +++ b/db/migrate/20121123154103_rename_inc_price_attribute.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20111219203242) +class RenameIncPriceAttribute < ActiveRecord::Migration + def change + rename_column :spree_tax_rates, :inc_tax, :included_in_price + end +end diff --git a/db/migrate/20121123154104_add_default_tax_zone.spree.rb b/db/migrate/20121123154104_add_default_tax_zone.spree.rb new file mode 100644 index 0000000..d4d2169 --- /dev/null +++ b/db/migrate/20121123154104_add_default_tax_zone.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20111219205902) +class AddDefaultTaxZone < ActiveRecord::Migration + def change + add_column :spree_zones, :default_tax, :boolean, :default => false + end +end diff --git a/db/migrate/20121123154105_associate_shipping_methods_and_shipping_categories.spree.rb b/db/migrate/20121123154105_associate_shipping_methods_and_shipping_categories.spree.rb new file mode 100644 index 0000000..0f3d03c --- /dev/null +++ b/db/migrate/20121123154105_associate_shipping_methods_and_shipping_categories.spree.rb @@ -0,0 +1,8 @@ +# This migration comes from spree (originally 20120105193911) +class AssociateShippingMethodsAndShippingCategories < ActiveRecord::Migration + def change + change_table :spree_shipping_methods do |t| + t.references :shipping_category + end + end +end diff --git a/db/migrate/20121123154106_add_match_rules_to_shipping_methods.spree.rb b/db/migrate/20121123154106_add_match_rules_to_shipping_methods.spree.rb new file mode 100644 index 0000000..17e3790 --- /dev/null +++ b/db/migrate/20121123154106_add_match_rules_to_shipping_methods.spree.rb @@ -0,0 +1,8 @@ +# This migration comes from spree (originally 20120105195817) +class AddMatchRulesToShippingMethods < ActiveRecord::Migration + def change + add_column :spree_shipping_methods, :match_none, :boolean + add_column :spree_shipping_methods, :match_all, :boolean + add_column :spree_shipping_methods, :match_one, :boolean + end +end diff --git a/db/migrate/20121123154107_new_preferences.spree.rb b/db/migrate/20121123154107_new_preferences.spree.rb new file mode 100644 index 0000000..7d48500 --- /dev/null +++ b/db/migrate/20121123154107_new_preferences.spree.rb @@ -0,0 +1,49 @@ +# This migration comes from spree (originally 20120119024710) +require 'spree/core/preference_rescue' + +class NewPreferences < ActiveRecord::Migration + + def up + add_column :spree_preferences, :key, :string + add_column :spree_preferences, :value_type, :string + add_index :spree_preferences, :key, :unique => true + + remove_index :spree_preferences, :name => 'ix_prefs_on_owner_attr_pref' + + # remove old constraints for migration + change_column :spree_preferences, :name, :string, :null => true + change_column :spree_preferences, :owner_id, :integer, :null => true + change_column :spree_preferences, :owner_type, :string, :null => true + change_column :spree_preferences, :group_id, :integer, :null => true + change_column :spree_preferences, :group_type, :string, :null => true + + cfgs = execute("select id, type from spree_configurations").to_a + execute("select id, owner_id, name from spree_preferences where owner_type = 'Spree::Configuration'").each do |pref| + configuration = cfgs.detect { |c| c[0].to_s == pref[1].to_s } + + value_type = configuration[1].constantize.new.send "preferred_#{pref[2]}_type" rescue 'string' + + execute "UPDATE spree_preferences set `key` = '#{configuration[1].underscore}/#{pref[2]}', `value_type` = '#{value_type}' where id = #{pref[0]}" rescue nil + end + + # remove orphaned calculator preferences + Spree::Preference.where(:owner_type => 'Spree::Calculator').each do |preference| + preference.destroy unless Spree::Calculator.exists? preference.owner_id + end + + Spree::PreferenceRescue.try + + Spree::Preference.where(:value_type => nil).update_all(:value_type => 'string') + end + + def down + remove_column :spree_preferences, :key + remove_column :spree_preferences, :value_type + + add_column :spree_preferences, :name, :string + add_column :spree_preferences, :owner_id, :integer + add_column :spree_preferences, :owner_type, :string + add_column :spree_preferences, :group_id, :integer + add_column :spree_preferences, :group_type, :string + end +end \ No newline at end of file diff --git a/db/migrate/20121123154108_rename_state_events_to_state_changes.spree.rb b/db/migrate/20121123154108_rename_state_events_to_state_changes.spree.rb new file mode 100644 index 0000000..469e730 --- /dev/null +++ b/db/migrate/20121123154108_rename_state_events_to_state_changes.spree.rb @@ -0,0 +1,10 @@ +# This migration comes from spree (originally 20120203001428) +class RenameStateEventsToStateChanges < ActiveRecord::Migration + def up + rename_table :spree_state_events, :spree_state_changes + end + + def down + rename_table :spree_state_changes, :spree_state_events + end +end diff --git a/db/migrate/20121123154109_add_deleted_at_to_tax_category.spree.rb b/db/migrate/20121123154109_add_deleted_at_to_tax_category.spree.rb new file mode 100644 index 0000000..b5f9023 --- /dev/null +++ b/db/migrate/20121123154109_add_deleted_at_to_tax_category.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20120203153759) +class AddDeletedAtToTaxCategory < ActiveRecord::Migration + def change + add_column :spree_tax_categories, :deleted_at, :datetime + end +end diff --git a/db/migrate/20121123154110_migrate_images_from_products_to_variants.spree.rb b/db/migrate/20121123154110_migrate_images_from_products_to_variants.spree.rb new file mode 100644 index 0000000..e92982d --- /dev/null +++ b/db/migrate/20121123154110_migrate_images_from_products_to_variants.spree.rb @@ -0,0 +1,38 @@ +# This migration comes from spree (originally 20120315064358) +class MigrateImagesFromProductsToVariants < ActiveRecord::Migration + def up + images = select_all("SELECT spree_assets.* FROM spree_assets + WHERE spree_assets.type = 'Spree::Image' + AND spree_assets.viewable_type = 'Spree::Product' + AND spree_assets.viewable_id IS NOT NULL") + + images.each do |image| + master_variant_id = select_value("SELECT id FROM spree_variants + WHERE product_id = #{image['viewable_id']} + AND is_master = #{quoted_true}") + + execute("UPDATE spree_assets SET viewable_type = 'Spree::Variant', viewable_id = #{master_variant_id} + WHERE id = #{image['id']}") if master_variant_id + end + end + + def down + images = select_all("SELECT spree_assets.* FROM spree_assets + JOIN spree_variants + ON spree_variants.id = spree_assets.viewable_id + AND spree_variants.is_master = #{quoted_true} + WHERE spree_assets.type = 'Spree::Image' + AND spree_assets.viewable_type = 'Spree::Variant' + AND spree_assets.viewable_id IS NOT NULL") + + images.each do |image| + product_id = select_value("SELECT spree_products.id FROM spree_products + JOIN spree_variants + ON spree_variants.id = #{image['viewable_id']} + AND spree_products.id = spree_variants.product_id") + + execute("UPDATE spree_assets SET viewable_type = 'Spree::Product', viewable_id = #{product_id} + WHERE id = #{image['id']}") if product_id + end + end +end diff --git a/db/migrate/20121123154111_rename_attachment_size_to_attachment_file_size.spree.rb b/db/migrate/20121123154111_rename_attachment_size_to_attachment_file_size.spree.rb new file mode 100644 index 0000000..2dec8f2 --- /dev/null +++ b/db/migrate/20121123154111_rename_attachment_size_to_attachment_file_size.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20120416233427) +class RenameAttachmentSizeToAttachmentFileSize < ActiveRecord::Migration + def change + rename_column :spree_assets, :attachment_size, :attachment_file_size + end +end diff --git a/db/migrate/20121123154112_increase_scale_of_tax_rate_amount.spree.rb b/db/migrate/20121123154112_increase_scale_of_tax_rate_amount.spree.rb new file mode 100644 index 0000000..f4725b0 --- /dev/null +++ b/db/migrate/20121123154112_increase_scale_of_tax_rate_amount.spree.rb @@ -0,0 +1,10 @@ +# This migration comes from spree (originally 20120507232704) +class IncreaseScaleOfTaxRateAmount < ActiveRecord::Migration + def up + change_column :spree_tax_rates, :amount, :decimal, { :scale => 5, :precision => 8 } + end + + def down + change_column :spree_tax_rates, :amount, :decimal, { :scale => 4, :precision => 8 } + end +end diff --git a/db/migrate/20121123154113_create_tokenized_permissions_table.spree.rb b/db/migrate/20121123154113_create_tokenized_permissions_table.spree.rb new file mode 100644 index 0000000..91c8ad1 --- /dev/null +++ b/db/migrate/20121123154113_create_tokenized_permissions_table.spree.rb @@ -0,0 +1,17 @@ +# This migration comes from spree (originally 20120509055454) +class CreateTokenizedPermissionsTable < ActiveRecord::Migration + def change + unless Spree::TokenizedPermission.table_exists? + create_table :spree_tokenized_permissions do |t| + t.integer :permissable_id + t.string :permissable_type + t.string :token + + t.timestamps + end + + add_index :spree_tokenized_permissions, [:permissable_id, :permissable_type], :name => 'index_tokenized_name_and_type' + end + end +end + diff --git a/db/migrate/20121123154114_convert_sales_tax_to_default_tax.spree.rb b/db/migrate/20121123154114_convert_sales_tax_to_default_tax.spree.rb new file mode 100644 index 0000000..a15416d --- /dev/null +++ b/db/migrate/20121123154114_convert_sales_tax_to_default_tax.spree.rb @@ -0,0 +1,10 @@ +# This migration comes from spree (originally 20120523061241) +class ConvertSalesTaxToDefaultTax < ActiveRecord::Migration + def up + execute "UPDATE spree_calculators SET type='Spree::Calculator::DefaultTax' WHERE type='Spree::Calculator::SalesTax'" + end + + def down + execute "UPDATE spree_calculators SET type='Spree::Calculator::SalesTax' WHERE type='Spree::Calculator::DefaultTax'" + end +end diff --git a/db/migrate/20121123154115_rename_creditcards_to_credit_cards.spree.rb b/db/migrate/20121123154115_rename_creditcards_to_credit_cards.spree.rb new file mode 100644 index 0000000..b6d61a8 --- /dev/null +++ b/db/migrate/20121123154115_rename_creditcards_to_credit_cards.spree.rb @@ -0,0 +1,12 @@ +# This migration comes from spree (originally 20120530012000) +class RenameCreditcardsToCreditCards < ActiveRecord::Migration + def change + rename_table :spree_creditcards, :spree_credit_cards + execute("UPDATE spree_payments SET source_type = 'Spree::CreditCard' WHERE source_type = 'Spree::Creditcard'") + end + + def down + execute("UPDATE spree_payments SET source_type = 'Spree::Creditcard' WHERE source_type = 'Spree::CreditCard'") + rename_table :spree_credit_cards, :spree_creditcards + end +end diff --git a/db/migrate/20121123154116_add_deleted_at_to_spree_shipping_methods.spree.rb b/db/migrate/20121123154116_add_deleted_at_to_spree_shipping_methods.spree.rb new file mode 100644 index 0000000..54c5978 --- /dev/null +++ b/db/migrate/20121123154116_add_deleted_at_to_spree_shipping_methods.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20120604030249) +class AddDeletedAtToSpreeShippingMethods < ActiveRecord::Migration + def change + add_column :spree_shipping_methods, :deleted_at, :datetime + end +end diff --git a/db/migrate/20121123154117_remove_credit_total_from_orders.spree.rb b/db/migrate/20121123154117_remove_credit_total_from_orders.spree.rb new file mode 100644 index 0000000..09559d5 --- /dev/null +++ b/db/migrate/20121123154117_remove_credit_total_from_orders.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20120604203654) +class RemoveCreditTotalFromOrders < ActiveRecord::Migration + def change + remove_column :spree_orders, :credit_total + end +end diff --git a/db/migrate/20121123154118_add_counter_cache_to_zone_members.spree.rb b/db/migrate/20121123154118_add_counter_cache_to_zone_members.spree.rb new file mode 100644 index 0000000..669434e --- /dev/null +++ b/db/migrate/20121123154118_add_counter_cache_to_zone_members.spree.rb @@ -0,0 +1,15 @@ +# This migration comes from spree (originally 20120712172620) +class AddCounterCacheToZoneMembers < ActiveRecord::Migration + def up + add_column :spree_zones, :zone_members_count, :integer, :default => 0 + + Spree::Zone.reset_column_information + Spree::Zone.find(:all).each do |zone| + Spree::Zone.update_counters zone.id, :zone_members_count => zone.zone_members.length + end + end + + def down + remove_column :spree_zones, :zone_members_count + end +end diff --git a/db/migrate/20121123154119_add_tax_rate_label.spree.rb b/db/migrate/20121123154119_add_tax_rate_label.spree.rb new file mode 100644 index 0000000..c39a83c --- /dev/null +++ b/db/migrate/20121123154119_add_tax_rate_label.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20120905145253) +class AddTaxRateLabel < ActiveRecord::Migration + def change + add_column :spree_tax_rates, :name, :string + end +end diff --git a/db/migrate/20121123154120_add_toggle_tax_rate_display.spree.rb b/db/migrate/20121123154120_add_toggle_tax_rate_display.spree.rb new file mode 100644 index 0000000..83da18b --- /dev/null +++ b/db/migrate/20121123154120_add_toggle_tax_rate_display.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20120905151823) +class AddToggleTaxRateDisplay < ActiveRecord::Migration + def change + add_column :spree_tax_rates, :show_rate_in_label, :boolean, :default => true + end +end diff --git a/db/migrate/20121123154121_add_lock_version_to_variant.spree.rb b/db/migrate/20121123154121_add_lock_version_to_variant.spree.rb new file mode 100644 index 0000000..0e8cc92 --- /dev/null +++ b/db/migrate/20121123154121_add_lock_version_to_variant.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20121009142519) +class AddLockVersionToVariant < ActiveRecord::Migration + def change + add_column :spree_variants, :lock_version, :integer, :default => 0 + end +end diff --git a/db/migrate/20121123154122_remove_not_null_constraint_from_products_on_hand.spree.rb b/db/migrate/20121123154122_remove_not_null_constraint_from_products_on_hand.spree.rb new file mode 100644 index 0000000..acbebfc --- /dev/null +++ b/db/migrate/20121123154122_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 + 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/20121123154123_add_api_key_to_spree_users.spree_api.rb b/db/migrate/20121123154123_add_api_key_to_spree_users.spree_api.rb new file mode 100644 index 0000000..b9e3fe3 --- /dev/null +++ b/db/migrate/20121123154123_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 + def change + unless defined?(User) + add_column :spree_users, :api_key, :string, :limit => 40 + end + end +end diff --git a/db/migrate/20121123154124_resize_api_key_field.spree_api.rb b/db/migrate/20121123154124_resize_api_key_field.spree_api.rb new file mode 100644 index 0000000..0ee8eed --- /dev/null +++ b/db/migrate/20121123154124_resize_api_key_field.spree_api.rb @@ -0,0 +1,8 @@ +# This migration comes from spree_api (originally 20120411123334) +class ResizeApiKeyField < ActiveRecord::Migration + def change + unless defined?(User) + change_column :spree_users, :api_key, :string, :limit => 48 + end + end +end diff --git a/db/migrate/20121123154125_rename_api_key_to_spree_api_key.spree_api.rb b/db/migrate/20121123154125_rename_api_key_to_spree_api_key.spree_api.rb new file mode 100644 index 0000000..7fd09d3 --- /dev/null +++ b/db/migrate/20121123154125_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 + def change + unless defined?(User) + rename_column :spree_users, :api_key, :spree_api_key + end + end +end diff --git a/db/migrate/20121123154126_rename_coupons_to_promotions.spree_promo.rb b/db/migrate/20121123154126_rename_coupons_to_promotions.spree_promo.rb new file mode 100644 index 0000000..b9ba6ad --- /dev/null +++ b/db/migrate/20121123154126_rename_coupons_to_promotions.spree_promo.rb @@ -0,0 +1,11 @@ +# This migration comes from spree_promo (originally 20100419190933) +class RenameCouponsToPromotions < ActiveRecord::Migration + def up + drop_table :promotions if table_exists?(:promotions) + rename_table :coupons, :promotions + end + + def down + rename_table :promotions, :coupons + end +end diff --git a/db/migrate/20121123154127_create_promotion_rules.spree_promo.rb b/db/migrate/20121123154127_create_promotion_rules.spree_promo.rb new file mode 100644 index 0000000..aaacd9e --- /dev/null +++ b/db/migrate/20121123154127_create_promotion_rules.spree_promo.rb @@ -0,0 +1,25 @@ +# This migration comes from spree_promo (originally 20100426100726) +class CreatePromotionRules < ActiveRecord::Migration + def up + create_table :promotion_rules do |t| + t.references :promotion, :user, :product_group + t.string :type + + t.timestamps + end + add_index :promotion_rules, :product_group_id + add_index :promotion_rules, :user_id + + create_table :products_promotion_rules do |t| + t.integer :product_id, :promotion_rule_id + end + remove_column :products_promotion_rules, :id + add_index :products_promotion_rules, :product_id + add_index :products_promotion_rules, :promotion_rule_id + end + + def down + drop_table :promotion_rules + drop_table :products_promotion_rules + end +end diff --git a/db/migrate/20121123154128_match_policy_for_promotions.spree_promo.rb b/db/migrate/20121123154128_match_policy_for_promotions.spree_promo.rb new file mode 100644 index 0000000..c6f4717 --- /dev/null +++ b/db/migrate/20121123154128_match_policy_for_promotions.spree_promo.rb @@ -0,0 +1,6 @@ +# This migration comes from spree_promo (originally 20100501084722) +class MatchPolicyForPromotions < ActiveRecord::Migration + def change + add_column :promotions, :match_policy, :string, :default => 'all' + end +end diff --git a/db/migrate/20121123154129_create_promotion_rules_users.spree_promo.rb b/db/migrate/20121123154129_create_promotion_rules_users.spree_promo.rb new file mode 100644 index 0000000..fe3393e --- /dev/null +++ b/db/migrate/20121123154129_create_promotion_rules_users.spree_promo.rb @@ -0,0 +1,15 @@ +# This migration comes from spree_promo (originally 20100501095202) +class CreatePromotionRulesUsers < ActiveRecord::Migration + def up + create_table :promotion_rules_users do |t| + t.integer :user_id, :promotion_rule_id + end + remove_column :promotion_rules_users, :id + add_index :promotion_rules_users, :user_id + add_index :promotion_rules_users, :promotion_rule_id + end + + def down + drop_table :promotion_rules_users + end +end diff --git a/db/migrate/20121123154130_name_for_promotions.spree_promo.rb b/db/migrate/20121123154130_name_for_promotions.spree_promo.rb new file mode 100644 index 0000000..8bd3bb0 --- /dev/null +++ b/db/migrate/20121123154130_name_for_promotions.spree_promo.rb @@ -0,0 +1,6 @@ +# This migration comes from spree_promo (originally 20100502163939) +class NameForPromotions < ActiveRecord::Migration + def change + add_column :promotions, :name, :string + end +end diff --git a/db/migrate/20121123154131_update_calculable_type_for_promotions.spree_promo.rb b/db/migrate/20121123154131_update_calculable_type_for_promotions.spree_promo.rb new file mode 100644 index 0000000..ac731a1 --- /dev/null +++ b/db/migrate/20121123154131_update_calculable_type_for_promotions.spree_promo.rb @@ -0,0 +1,10 @@ +# This migration comes from spree_promo (originally 20100923095305) +class UpdateCalculableTypeForPromotions < ActiveRecord::Migration + def up + execute "UPDATE spree_calculators SET calculable_type = 'Promotion' WHERE calculable_type = 'Coupon'" + end + + def down + execute "UPDATE spree_calculators SET calculable_type = 'Coupon' WHERE calculable_type = 'Promotion'" + end +end diff --git a/db/migrate/20121123154132_migrate_adjustments.spree_promo.rb b/db/migrate/20121123154132_migrate_adjustments.spree_promo.rb new file mode 100644 index 0000000..f2abf32 --- /dev/null +++ b/db/migrate/20121123154132_migrate_adjustments.spree_promo.rb @@ -0,0 +1,10 @@ +# This migration comes from spree_promo (originally 20101026184833) +class MigrateAdjustments < ActiveRecord::Migration + def up + execute "UPDATE spree_adjustments SET amount = 0.0 WHERE amount IS NULL" + execute "UPDATE spree_adjustments SET mandatory = #{quoted_true} WHERE locked = #{quoted_true}" + end + + def down + end +end diff --git a/db/migrate/20121123154133_promotion_changes_to_subclass_of_activator.spree_promo.rb b/db/migrate/20121123154133_promotion_changes_to_subclass_of_activator.spree_promo.rb new file mode 100644 index 0000000..dc4cd82 --- /dev/null +++ b/db/migrate/20121123154133_promotion_changes_to_subclass_of_activator.spree_promo.rb @@ -0,0 +1,23 @@ +# This migration comes from spree_promo (originally 20110331094351) +class PromotionChangesToSubclassOfActivator < ActiveRecord::Migration + def up + drop_table :promotions + rename_column :promotion_rules, :promotion_id, :activator_id + end + + def down + create_table :promotions, :force => true do |t| + t.string :name + t.string :code + t.string :description + t.integer :usage_limit + t.boolean :combine + t.datetime :expires_at + t.datetime :starts_at + t.string :match_policy, :default => 'all' + + t.timestamps + end + rename_column :promotion_rules, :activator_id, :promotion_id + end +end diff --git a/db/migrate/20121123154134_create_promotion_actions.spree_promo.rb b/db/migrate/20121123154134_create_promotion_actions.spree_promo.rb new file mode 100644 index 0000000..aad1baa --- /dev/null +++ b/db/migrate/20121123154134_create_promotion_actions.spree_promo.rb @@ -0,0 +1,10 @@ +# This migration comes from spree_promo (originally 20110404123358) +class CreatePromotionActions < ActiveRecord::Migration + def change + create_table :promotion_actions do |t| + t.integer :activator_id + t.integer :position + t.string :type + end + end +end diff --git a/db/migrate/20121123154135_create_promotion_action_line_items.spree_promo.rb b/db/migrate/20121123154135_create_promotion_action_line_items.spree_promo.rb new file mode 100644 index 0000000..b58dd2f --- /dev/null +++ b/db/migrate/20121123154135_create_promotion_action_line_items.spree_promo.rb @@ -0,0 +1,11 @@ +# This migration comes from spree_promo (originally 20110601202923) +class CreatePromotionActionLineItems < ActiveRecord::Migration + def change + create_table :promotion_action_line_items do |t| + t.integer :promotion_action_id, :variant_id + t.integer :quantity, :default => 1 + t.references :promotion_action + t.references :variant + end + end +end diff --git a/db/migrate/20121123154136_namespace_promo_tables.spree_promo.rb b/db/migrate/20121123154136_namespace_promo_tables.spree_promo.rb new file mode 100644 index 0000000..ec04ac6 --- /dev/null +++ b/db/migrate/20121123154136_namespace_promo_tables.spree_promo.rb @@ -0,0 +1,86 @@ +# This migration comes from spree_promo (originally 20120119024707) +require 'spree/core/preference_rescue' + +class NamespacePromoTables < ActiveRecord::Migration + + def concat(str1, str2) + dbtype = Rails.configuration.database_configuration[Rails.env]['adapter'].to_sym + + case dbtype + when :mysql, :mysql2 + "CONCAT(#{str1}, #{str2})" + when :sqlserver + "(#{str1} + #{str2})" + else + "(#{str1} || #{str2})" + end + end + + def update_column_data(table_names, column_name) + tables = Array.wrap(table_names) + tables.each do |table| + execute "UPDATE #{table} SET #{column_name} = #{concat("'Spree::'", column_name)}" + + " where #{column_name} NOT LIKE 'Spree::%' AND #{column_name} IS NOT NULL" + end + end + + def replace_column_data(table_names, column_name) + tables = Array.wrap(table_names) + tables.each do |table| + execute "UPDATE #{table} SET #{column_name} = REPLACE(#{column_name}, 'Spree::', '') " + + " where #{column_name} LIKE 'Spree::%'" + end + end + + def self.up + # namespace promo tables + rename_table :promotion_actions, :spree_promotion_actions + rename_table :promotion_rules, :spree_promotion_rules + rename_table :promotion_rules_users, :spree_promotion_rules_users + rename_table :promotion_action_line_items, :spree_promotion_action_line_items + rename_table :products_promotion_rules, :spree_products_promotion_rules + + update_column_data('spree_promotion_actions', 'type') + update_column_data('spree_promotion_rules', 'type') + + # add old promo preferences as columns + add_column :spree_activators, :usage_limit, :integer + add_column :spree_activators, :match_policy, :string, :default => 'all' + add_column :spree_activators, :code, :string + add_column :spree_activators, :advertise, :boolean, :default => false + + Spree::Activator.reset_column_information + + Spree::Preference.where(:owner_type => 'Spree::Activator').each do |preference| + unless Spree::Activator.exists? preference.owner_id + preference.destroy + next + end + + @activator = Spree::Activator.find(preference.owner_id) + @activator.update_attribute(preference.name, preference.raw_value) + preference.destroy + end + + Spree::PreferenceRescue.try + + # This *should* be in the new_preferences migration inside of Core but... + # This is migration needs to have these keys around so that + # we can convert the promotions over correctly. + # So they hang around until we're *finally* done with them, since promo's + # migrations are copied over *after* core, and then we ditch them. + remove_column :spree_preferences, :group_id + remove_column :spree_preferences, :group_type + end + + def self.down + replace_column_data('spree_promotion_actions', 'type') + replace_column_data('spree_promotion_rules', 'type') + + rename_table :spree_promotion_actions, :promotion_actions + rename_table :spree_promotion_rules, :promotion_rules + rename_table :spree_promotion_rules_users, :promotion_rules_users + rename_table :spree_promotion_action_line_items, :promotion_action_line_items + rename_table :spree_products_promotion_rules, :products_promotion_rules + end +end \ No newline at end of file diff --git a/db/migrate/20121123154137_create_spree_pending_promotions.spree_promo.rb b/db/migrate/20121123154137_create_spree_pending_promotions.spree_promo.rb new file mode 100644 index 0000000..bccd6ef --- /dev/null +++ b/db/migrate/20121123154137_create_spree_pending_promotions.spree_promo.rb @@ -0,0 +1,12 @@ +# This migration comes from spree_promo (originally 20120119024708) +class CreateSpreePendingPromotions < ActiveRecord::Migration + def change + create_table :spree_pending_promotions do |t| + t.references :user + t.references :promotion + end + + add_index :spree_pending_promotions, :user_id + add_index :spree_pending_promotions, :promotion_id + end +end diff --git a/db/migrate/20121123154138_content_visited_event.spree_promo.rb b/db/migrate/20121123154138_content_visited_event.spree_promo.rb new file mode 100644 index 0000000..e90f90d --- /dev/null +++ b/db/migrate/20121123154138_content_visited_event.spree_promo.rb @@ -0,0 +1,30 @@ +# This migration comes from spree_promo (originally 20120119024721) +# LandingPage used to support static pages, we've moved to a static +# event. This adds path to promotions then migrates the old LandingPage rules +class ContentVisitedEvent < ActiveRecord::Migration + + # Removed Class for Migrations + class Spree::Promotion::Rules::LandingPage < Spree::PromotionRule + preference :path, :string + def eligible?(order, options = {}) + true + end + end + + def up + add_column :spree_activators, :path, :string + + Spree::Promotion::Rules::LandingPage.all.each do |promotion_rule| + promotion = promotion_rule.promotion + say "migrating #{promotion.name} promotion to use 'spree.content.visited' event" + promotion.event_name = 'spree.content.visited' + promotion.path = promotion_rule.preferred_path + promotion.promotion_rules.delete promotion_rule + promotion.save(:validate => false) + end + end + + def down + remove_column :spree_activators, :path + end +end \ No newline at end of file diff --git a/db/migrate/20121123154139_create_skrill_transactions.spree_skrill.rb b/db/migrate/20121123154139_create_skrill_transactions.spree_skrill.rb new file mode 100644 index 0000000..21f688e --- /dev/null +++ b/db/migrate/20121123154139_create_skrill_transactions.spree_skrill.rb @@ -0,0 +1,15 @@ +# This migration comes from spree_skrill (originally 20111118164631) +class CreateSkrillTransactions < ActiveRecord::Migration + def change + create_table :spree_skrill_transactions do |t| + t.string :email + t.float :amount + t.string :currency + t.integer :transaction_id + t.integer :customer_id + t.string :payment_type + t.timestamps + end + end +end + diff --git a/db/migrate/20121123154140_create_users.spree_auth.rb b/db/migrate/20121123154140_create_users.spree_auth.rb new file mode 100644 index 0000000..a4e8e60 --- /dev/null +++ b/db/migrate/20121123154140_create_users.spree_auth.rb @@ -0,0 +1,30 @@ +# This migration comes from spree_auth (originally 20101026184949) +class CreateUsers < ActiveRecord::Migration + def up + unless table_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/20121123154141_rename_columns_for_devise.spree_auth.rb b/db/migrate/20121123154141_rename_columns_for_devise.spree_auth.rb new file mode 100644 index 0000000..6aa647e --- /dev/null +++ b/db/migrate/20121123154141_rename_columns_for_devise.spree_auth.rb @@ -0,0 +1,38 @@ +# This migration comes from spree_auth (originally 20101026184950) +class RenameColumnsForDevise < ActiveRecord::Migration + 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/20121123154142_convert_user_remember_field.spree_auth.rb b/db/migrate/20121123154142_convert_user_remember_field.spree_auth.rb new file mode 100644 index 0000000..9e6a94f --- /dev/null +++ b/db/migrate/20121123154142_convert_user_remember_field.spree_auth.rb @@ -0,0 +1,12 @@ +# This migration comes from spree_auth (originally 20101214150824) +class ConvertUserRememberField < ActiveRecord::Migration + 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/20121123154143_add_reset_password_sent_at_to_spree_users.spree_auth.rb b/db/migrate/20121123154143_add_reset_password_sent_at_to_spree_users.spree_auth.rb new file mode 100644 index 0000000..262727e --- /dev/null +++ b/db/migrate/20121123154143_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 < ActiveRecord::Migration + 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/20121123154144_make_users_email_index_unique.spree_auth.rb b/db/migrate/20121123154144_make_users_email_index_unique.spree_auth.rb new file mode 100644 index 0000000..00f6f14 --- /dev/null +++ b/db/migrate/20121123154144_make_users_email_index_unique.spree_auth.rb @@ -0,0 +1,10 @@ +# This migration comes from spree_auth (originally 20120605211305) +class MakeUsersEmailIndexUnique < ActiveRecord::Migration + 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/schema.rb b/db/schema.rb new file mode 100644 index 0000000..7b0296a --- /dev/null +++ b/db/schema.rb @@ -0,0 +1,600 @@ +# encoding: UTF-8 +# 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 to check this file into your version control system. + +ActiveRecord::Schema.define(:version => 20121123154144) do + + create_table "spree_activators", :force => true do |t| + t.string "description" + t.datetime "expires_at" + t.datetime "created_at" + t.datetime "updated_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" + end + + create_table "spree_addresses", :force => true 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.integer "state_id" + t.integer "country_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "company" + 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", :force => true do |t| + t.integer "source_id" + t.decimal "amount", :precision => 8, :scale => 2 + t.string "label" + t.string "source_type" + t.integer "adjustable_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.boolean "mandatory" + t.boolean "locked" + t.integer "originator_id" + t.string "originator_type" + t.boolean "eligible", :default => true + t.string "adjustable_type" + end + + add_index "spree_adjustments", ["adjustable_id"], :name => "index_adjustments_on_order_id" + + create_table "spree_assets", :force => true do |t| + t.integer "viewable_id" + t.integer "attachment_width" + t.integer "attachment_height" + t.integer "attachment_file_size" + t.integer "position" + t.string "viewable_type", :limit => 50 + 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", :force => true do |t| + t.string "type" + t.integer "calculable_id", :null => false + t.string "calculable_type", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "spree_configurations", :force => true do |t| + t.string "name" + t.string "type", :limit => 50 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "spree_configurations", ["name", "type"], :name => "index_spree_configurations_on_name_and_type" + + create_table "spree_countries", :force => true do |t| + t.string "iso_name" + t.string "iso" + t.string "iso3" + t.string "name" + t.integer "numcode" + end + + create_table "spree_credit_cards", :force => true 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.integer "address_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "gateway_customer_profile_id" + t.string "gateway_payment_profile_id" + end + + create_table "spree_gateways", :force => true 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 + end + + create_table "spree_inventory_units", :force => true do |t| + t.integer "lock_version", :default => 0 + t.string "state" + t.integer "variant_id" + t.integer "order_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "shipment_id" + t.integer "return_authorization_id" + 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", :force => true do |t| + t.integer "order_id" + t.integer "variant_id" + t.integer "quantity", :null => false + t.decimal "price", :precision => 8, :scale => 2, :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :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", :force => true do |t| + t.integer "source_id" + t.string "source_type" + t.text "details" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "spree_mail_methods", :force => true do |t| + t.string "environment" + t.boolean "active", :default => true + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "spree_option_types", :force => true do |t| + t.string "name", :limit => 100 + t.string "presentation", :limit => 100 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "position", :default => 0, :null => false + end + + create_table "spree_option_types_prototypes", :id => false, :force => true do |t| + t.integer "prototype_id" + t.integer "option_type_id" + end + + create_table "spree_option_values", :force => true 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 + end + + create_table "spree_option_values_variants", :id => false, :force => true do |t| + t.integer "variant_id" + t.integer "option_value_id" + 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", :force => true 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.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.datetime "completed_at" + t.integer "bill_address_id" + t.integer "ship_address_id" + t.decimal "payment_total", :precision => 8, :scale => 2, :default => 0.0 + t.integer "shipping_method_id" + t.string "shipment_state" + t.string "payment_state" + t.string "email" + t.text "special_instructions" + end + + add_index "spree_orders", ["number"], :name => "index_spree_orders_on_number" + + create_table "spree_payment_methods", :force => true do |t| + t.string "type" + t.string "name" + t.text "description" + t.boolean "active", :default => true + t.string "environment", :default => "development" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.datetime "deleted_at" + t.string "display_on" + end + + create_table "spree_payments", :force => true do |t| + t.decimal "amount", :precision => 8, :scale => 2, :default => 0.0, :null => false + t.integer "order_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "source_id" + t.string "source_type" + t.integer "payment_method_id" + t.string "state" + t.string "response_code" + t.string "avs_response" + end + + create_table "spree_pending_promotions", :force => true do |t| + t.integer "user_id" + t.integer "promotion_id" + end + + add_index "spree_pending_promotions", ["promotion_id"], :name => "index_spree_pending_promotions_on_promotion_id" + add_index "spree_pending_promotions", ["user_id"], :name => "index_spree_pending_promotions_on_user_id" + + create_table "spree_preferences", :force => true do |t| + t.string "name", :limit => 100 + t.integer "owner_id", :limit => 30 + t.string "owner_type", :limit => 50 + t.text "value", :limit => 255 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "key" + t.string "value_type" + end + + add_index "spree_preferences", ["key"], :name => "index_spree_preferences_on_key", :unique => true + + create_table "spree_product_option_types", :force => true 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 + end + + create_table "spree_product_properties", :force => true 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 + end + + add_index "spree_product_properties", ["product_id"], :name => "index_product_properties_on_product_id" + + create_table "spree_products", :force => true 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.integer "tax_category_id" + t.integer "shipping_category_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "count_on_hand", :default => 0 + 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_promotion_rules", :id => false, :force => true do |t| + t.integer "product_id" + t.integer "promotion_rule_id" + 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_products_taxons", :id => false, :force => true do |t| + t.integer "product_id" + t.integer "taxon_id" + 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_promotion_action_line_items", :force => true do |t| + t.integer "promotion_action_id" + t.integer "variant_id" + t.integer "quantity", :default => 1 + end + + create_table "spree_promotion_actions", :force => true do |t| + t.integer "activator_id" + t.integer "position" + t.string "type" + end + + create_table "spree_promotion_rules", :force => true do |t| + t.integer "activator_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 + 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.integer "user_id" + t.integer "promotion_rule_id" + 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" + + create_table "spree_properties", :force => true do |t| + t.string "name" + t.string "presentation", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "spree_properties_prototypes", :id => false, :force => true do |t| + t.integer "prototype_id" + t.integer "property_id" + end + + create_table "spree_prototypes", :force => true do |t| + t.string "name" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "spree_return_authorizations", :force => true do |t| + t.string "number" + t.string "state" + t.decimal "amount", :precision => 8, :scale => 2, :default => 0.0, :null => false + t.integer "order_id" + t.text "reason" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "spree_roles", :force => true do |t| + t.string "name" + end + + create_table "spree_roles_users", :id => false, :force => true do |t| + t.integer "role_id" + t.integer "user_id" + 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", :force => true do |t| + t.string "tracking" + t.string "number" + t.decimal "cost", :precision => 8, :scale => 2 + t.datetime "shipped_at" + t.integer "order_id" + t.integer "shipping_method_id" + t.integer "address_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "state" + end + + add_index "spree_shipments", ["number"], :name => "index_shipments_on_number" + + create_table "spree_shipping_categories", :force => true do |t| + t.string "name" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "spree_shipping_methods", :force => true do |t| + t.string "name" + t.integer "zone_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "display_on" + t.integer "shipping_category_id" + t.boolean "match_none" + t.boolean "match_all" + t.boolean "match_one" + t.datetime "deleted_at" + end + + create_table "spree_skrill_transactions", :force => true do |t| + t.string "email" + t.float "amount" + t.string "currency" + t.integer "transaction_id" + t.integer "customer_id" + t.string "payment_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "spree_state_changes", :force => true do |t| + t.string "name" + t.string "previous_state" + t.integer "stateful_id" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "stateful_type" + t.string "next_state" + end + + create_table "spree_states", :force => true do |t| + t.string "name" + t.string "abbr" + t.integer "country_id" + end + + create_table "spree_tax_categories", :force => true do |t| + t.string "name" + t.string "description" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.boolean "is_default", :default => false + t.datetime "deleted_at" + end + + create_table "spree_tax_rates", :force => true do |t| + t.decimal "amount", :precision => 8, :scale => 5 + t.integer "zone_id" + t.integer "tax_category_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.boolean "included_in_price", :default => false + t.string "name" + t.boolean "show_rate_in_label", :default => true + end + + create_table "spree_taxonomies", :force => true do |t| + t.string "name", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "spree_taxons", :force => true do |t| + t.integer "parent_id" + t.integer "position", :default => 0 + t.string "name", :null => false + t.string "permalink" + t.integer "taxonomy_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + 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" + 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.integer "permissable_id" + t.string "permissable_type" + t.string "token" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "spree_tokenized_permissions", ["permissable_id", "permissable_type"], :name => "index_tokenized_name_and_type" + + create_table "spree_trackers", :force => true do |t| + t.string "environment" + t.string "analytics_id" + t.boolean "active", :default => true + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "spree_users", :force => true 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.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "spree_api_key", :limit => 48 + t.string "authentication_token" + t.string "unlock_token" + t.datetime "locked_at" + t.datetime "remember_created_at" + t.datetime "reset_password_sent_at" + end + + add_index "spree_users", ["email"], :name => "email_idx_unique", :unique => true + add_index "spree_users", ["persistence_token"], :name => "index_users_on_persistence_token" + + create_table "spree_variants", :force => true 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.integer "product_id" + t.integer "count_on_hand", :default => 0 + t.decimal "cost_price", :precision => 8, :scale => 2 + t.integer "position" + t.integer "lock_version", :default => 0 + end + + add_index "spree_variants", ["product_id"], :name => "index_spree_variants_on_product_id" + + create_table "spree_zone_members", :force => true do |t| + t.integer "zoneable_id" + t.string "zoneable_type" + t.integer "zone_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "spree_zones", :force => true do |t| + t.string "name" + t.string "description" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.boolean "default_tax", :default => false + t.integer "zone_members_count", :default => 0 + end + +end diff --git a/db/seeds.rb b/db/seeds.rb new file mode 100644 index 0000000..8fef18a --- /dev/null +++ b/db/seeds.rb @@ -0,0 +1,11 @@ +# 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 rake db:seed (or created alongside the db with db:setup). +# +# Examples: +# +# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) +# Mayor.create(name: 'Emanuel', city: cities.first) + + +Spree::Core::Engine.load_seed if defined?(Spree::Core) +Spree::Auth::Engine.load_seed if defined?(Spree::Auth) diff --git a/doc/README_FOR_APP b/doc/README_FOR_APP new file mode 100644 index 0000000..fe41f5c --- /dev/null +++ b/doc/README_FOR_APP @@ -0,0 +1,2 @@ +Use this README file to introduce your application and point to useful places in the API for learning more. +Run "rake doc:app" to generate API documentation for your models, controllers, helpers, and libraries. diff --git a/lib/assets/.gitkeep b/lib/assets/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/lib/tasks/.gitkeep b/lib/tasks/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/log/.gitkeep b/log/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/public/404.html b/public/404.html new file mode 100644 index 0000000..9a48320 --- /dev/null +++ b/public/404.html @@ -0,0 +1,26 @@ + + + + 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.

+
+ + diff --git a/public/422.html b/public/422.html new file mode 100644 index 0000000..83660ab --- /dev/null +++ b/public/422.html @@ -0,0 +1,26 @@ + + + + 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.

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

We're sorry, but something went wrong.

+
+ + 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..17bd20c --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,14 @@ +# See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file +# +# To ban all spiders from the entire site uncomment the next two lines: +# User-Agent: * +# Disallow: / +User-agent: * +Disallow: /checkouts +Disallow: /orders +Disallow: /countries +Disallow: /line_items +Disallow: /password_resets +Disallow: /states +Disallow: /user_sessions +Disallow: /users diff --git a/public/spree/products/1/large/ror_tote.jpeg b/public/spree/products/1/large/ror_tote.jpeg new file mode 100644 index 0000000..f338b78 Binary files /dev/null and b/public/spree/products/1/large/ror_tote.jpeg differ diff --git a/public/spree/products/1/mini/ror_tote.jpeg b/public/spree/products/1/mini/ror_tote.jpeg new file mode 100644 index 0000000..52cd134 Binary files /dev/null and b/public/spree/products/1/mini/ror_tote.jpeg differ diff --git a/public/spree/products/1/original/ror_tote.jpeg b/public/spree/products/1/original/ror_tote.jpeg new file mode 100644 index 0000000..08bff01 Binary files /dev/null and b/public/spree/products/1/original/ror_tote.jpeg differ diff --git a/public/spree/products/1/product/ror_tote.jpeg b/public/spree/products/1/product/ror_tote.jpeg new file mode 100644 index 0000000..0bcf4d4 Binary files /dev/null and b/public/spree/products/1/product/ror_tote.jpeg differ diff --git a/public/spree/products/1/small/ror_tote.jpeg b/public/spree/products/1/small/ror_tote.jpeg new file mode 100644 index 0000000..b708dab Binary files /dev/null and b/public/spree/products/1/small/ror_tote.jpeg differ diff --git a/public/spree/products/10/large/ror_ringer_back.jpeg b/public/spree/products/10/large/ror_ringer_back.jpeg new file mode 100644 index 0000000..2ea1b21 Binary files /dev/null and b/public/spree/products/10/large/ror_ringer_back.jpeg differ diff --git a/public/spree/products/10/mini/ror_ringer_back.jpeg b/public/spree/products/10/mini/ror_ringer_back.jpeg new file mode 100644 index 0000000..16acd7b Binary files /dev/null and b/public/spree/products/10/mini/ror_ringer_back.jpeg differ diff --git a/public/spree/products/10/original/ror_ringer_back.jpeg b/public/spree/products/10/original/ror_ringer_back.jpeg new file mode 100644 index 0000000..c8f5f30 Binary files /dev/null and b/public/spree/products/10/original/ror_ringer_back.jpeg differ diff --git a/public/spree/products/10/product/ror_ringer_back.jpeg b/public/spree/products/10/product/ror_ringer_back.jpeg new file mode 100644 index 0000000..82190db Binary files /dev/null and b/public/spree/products/10/product/ror_ringer_back.jpeg differ diff --git a/public/spree/products/10/small/ror_ringer_back.jpeg b/public/spree/products/10/small/ror_ringer_back.jpeg new file mode 100644 index 0000000..3a20126 Binary files /dev/null and b/public/spree/products/10/small/ror_ringer_back.jpeg differ diff --git a/public/spree/products/1004/large/apache_baseball.png b/public/spree/products/1004/large/apache_baseball.png new file mode 100644 index 0000000..feae4b7 Binary files /dev/null and b/public/spree/products/1004/large/apache_baseball.png differ diff --git a/public/spree/products/1004/mini/apache_baseball.png b/public/spree/products/1004/mini/apache_baseball.png new file mode 100644 index 0000000..81edb3a Binary files /dev/null and b/public/spree/products/1004/mini/apache_baseball.png differ diff --git a/public/spree/products/1004/original/apache_baseball.png b/public/spree/products/1004/original/apache_baseball.png new file mode 100644 index 0000000..cc677bc Binary files /dev/null and b/public/spree/products/1004/original/apache_baseball.png differ diff --git a/public/spree/products/1004/product/apache_baseball.png b/public/spree/products/1004/product/apache_baseball.png new file mode 100644 index 0000000..d79e647 Binary files /dev/null and b/public/spree/products/1004/product/apache_baseball.png differ diff --git a/public/spree/products/1004/small/apache_baseball.png b/public/spree/products/1004/small/apache_baseball.png new file mode 100644 index 0000000..21b2926 Binary files /dev/null and b/public/spree/products/1004/small/apache_baseball.png differ diff --git a/public/spree/products/1008/large/ruby_baseball.png b/public/spree/products/1008/large/ruby_baseball.png new file mode 100644 index 0000000..e58bb94 Binary files /dev/null and b/public/spree/products/1008/large/ruby_baseball.png differ diff --git a/public/spree/products/1008/mini/ruby_baseball.png b/public/spree/products/1008/mini/ruby_baseball.png new file mode 100644 index 0000000..28c180d Binary files /dev/null and b/public/spree/products/1008/mini/ruby_baseball.png differ diff --git a/public/spree/products/1008/original/ruby_baseball.png b/public/spree/products/1008/original/ruby_baseball.png new file mode 100644 index 0000000..8eef1be Binary files /dev/null and b/public/spree/products/1008/original/ruby_baseball.png differ diff --git a/public/spree/products/1008/product/ruby_baseball.png b/public/spree/products/1008/product/ruby_baseball.png new file mode 100644 index 0000000..685d8b3 Binary files /dev/null and b/public/spree/products/1008/product/ruby_baseball.png differ diff --git a/public/spree/products/1008/small/ruby_baseball.png b/public/spree/products/1008/small/ruby_baseball.png new file mode 100644 index 0000000..4d0a056 Binary files /dev/null and b/public/spree/products/1008/small/ruby_baseball.png differ diff --git a/public/spree/products/1009/large/ror_baseball_jersey_green.png b/public/spree/products/1009/large/ror_baseball_jersey_green.png new file mode 100644 index 0000000..92830f0 Binary files /dev/null and b/public/spree/products/1009/large/ror_baseball_jersey_green.png differ diff --git a/public/spree/products/1009/mini/ror_baseball_jersey_green.png b/public/spree/products/1009/mini/ror_baseball_jersey_green.png new file mode 100644 index 0000000..fa91802 Binary files /dev/null and b/public/spree/products/1009/mini/ror_baseball_jersey_green.png differ diff --git a/public/spree/products/1009/original/ror_baseball_jersey_green.png b/public/spree/products/1009/original/ror_baseball_jersey_green.png new file mode 100644 index 0000000..a14b7fc Binary files /dev/null and b/public/spree/products/1009/original/ror_baseball_jersey_green.png differ diff --git a/public/spree/products/1009/product/ror_baseball_jersey_green.png b/public/spree/products/1009/product/ror_baseball_jersey_green.png new file mode 100644 index 0000000..92830f0 Binary files /dev/null and b/public/spree/products/1009/product/ror_baseball_jersey_green.png differ diff --git a/public/spree/products/1009/small/ror_baseball_jersey_green.png b/public/spree/products/1009/small/ror_baseball_jersey_green.png new file mode 100644 index 0000000..bf9be43 Binary files /dev/null and b/public/spree/products/1009/small/ror_baseball_jersey_green.png differ diff --git a/public/spree/products/1010/large/ror_baseball_jersey_back_green.png b/public/spree/products/1010/large/ror_baseball_jersey_back_green.png new file mode 100644 index 0000000..4e3fe51 Binary files /dev/null and b/public/spree/products/1010/large/ror_baseball_jersey_back_green.png differ diff --git a/public/spree/products/1010/mini/ror_baseball_jersey_back_green.png b/public/spree/products/1010/mini/ror_baseball_jersey_back_green.png new file mode 100644 index 0000000..926ee20 Binary files /dev/null and b/public/spree/products/1010/mini/ror_baseball_jersey_back_green.png differ diff --git a/public/spree/products/1010/original/ror_baseball_jersey_back_green.png b/public/spree/products/1010/original/ror_baseball_jersey_back_green.png new file mode 100644 index 0000000..0f25489 Binary files /dev/null and b/public/spree/products/1010/original/ror_baseball_jersey_back_green.png differ diff --git a/public/spree/products/1010/product/ror_baseball_jersey_back_green.png b/public/spree/products/1010/product/ror_baseball_jersey_back_green.png new file mode 100644 index 0000000..4e3fe51 Binary files /dev/null and b/public/spree/products/1010/product/ror_baseball_jersey_back_green.png differ diff --git a/public/spree/products/1010/small/ror_baseball_jersey_back_green.png b/public/spree/products/1010/small/ror_baseball_jersey_back_green.png new file mode 100644 index 0000000..6867530 Binary files /dev/null and b/public/spree/products/1010/small/ror_baseball_jersey_back_green.png differ diff --git a/public/spree/products/1011/large/ror_baseball_jersey_green.png b/public/spree/products/1011/large/ror_baseball_jersey_green.png new file mode 100644 index 0000000..92830f0 Binary files /dev/null and b/public/spree/products/1011/large/ror_baseball_jersey_green.png differ diff --git a/public/spree/products/1011/mini/ror_baseball_jersey_green.png b/public/spree/products/1011/mini/ror_baseball_jersey_green.png new file mode 100644 index 0000000..fa91802 Binary files /dev/null and b/public/spree/products/1011/mini/ror_baseball_jersey_green.png differ diff --git a/public/spree/products/1011/original/ror_baseball_jersey_green.png b/public/spree/products/1011/original/ror_baseball_jersey_green.png new file mode 100644 index 0000000..a14b7fc Binary files /dev/null and b/public/spree/products/1011/original/ror_baseball_jersey_green.png differ diff --git a/public/spree/products/1011/product/ror_baseball_jersey_green.png b/public/spree/products/1011/product/ror_baseball_jersey_green.png new file mode 100644 index 0000000..92830f0 Binary files /dev/null and b/public/spree/products/1011/product/ror_baseball_jersey_green.png differ diff --git a/public/spree/products/1011/small/ror_baseball_jersey_green.png b/public/spree/products/1011/small/ror_baseball_jersey_green.png new file mode 100644 index 0000000..bf9be43 Binary files /dev/null and b/public/spree/products/1011/small/ror_baseball_jersey_green.png differ diff --git a/public/spree/products/1012/large/ror_baseball_jersey_back_green.png b/public/spree/products/1012/large/ror_baseball_jersey_back_green.png new file mode 100644 index 0000000..4e3fe51 Binary files /dev/null and b/public/spree/products/1012/large/ror_baseball_jersey_back_green.png differ diff --git a/public/spree/products/1012/mini/ror_baseball_jersey_back_green.png b/public/spree/products/1012/mini/ror_baseball_jersey_back_green.png new file mode 100644 index 0000000..926ee20 Binary files /dev/null and b/public/spree/products/1012/mini/ror_baseball_jersey_back_green.png differ diff --git a/public/spree/products/1012/original/ror_baseball_jersey_back_green.png b/public/spree/products/1012/original/ror_baseball_jersey_back_green.png new file mode 100644 index 0000000..0f25489 Binary files /dev/null and b/public/spree/products/1012/original/ror_baseball_jersey_back_green.png differ diff --git a/public/spree/products/1012/product/ror_baseball_jersey_back_green.png b/public/spree/products/1012/product/ror_baseball_jersey_back_green.png new file mode 100644 index 0000000..4e3fe51 Binary files /dev/null and b/public/spree/products/1012/product/ror_baseball_jersey_back_green.png differ diff --git a/public/spree/products/1012/small/ror_baseball_jersey_back_green.png b/public/spree/products/1012/small/ror_baseball_jersey_back_green.png new file mode 100644 index 0000000..6867530 Binary files /dev/null and b/public/spree/products/1012/small/ror_baseball_jersey_back_green.png differ diff --git a/public/spree/products/1013/large/ror_baseball_jersey_green.png b/public/spree/products/1013/large/ror_baseball_jersey_green.png new file mode 100644 index 0000000..92830f0 Binary files /dev/null and b/public/spree/products/1013/large/ror_baseball_jersey_green.png differ diff --git a/public/spree/products/1013/mini/ror_baseball_jersey_green.png b/public/spree/products/1013/mini/ror_baseball_jersey_green.png new file mode 100644 index 0000000..fa91802 Binary files /dev/null and b/public/spree/products/1013/mini/ror_baseball_jersey_green.png differ diff --git a/public/spree/products/1013/original/ror_baseball_jersey_green.png b/public/spree/products/1013/original/ror_baseball_jersey_green.png new file mode 100644 index 0000000..a14b7fc Binary files /dev/null and b/public/spree/products/1013/original/ror_baseball_jersey_green.png differ diff --git a/public/spree/products/1013/product/ror_baseball_jersey_green.png b/public/spree/products/1013/product/ror_baseball_jersey_green.png new file mode 100644 index 0000000..92830f0 Binary files /dev/null and b/public/spree/products/1013/product/ror_baseball_jersey_green.png differ diff --git a/public/spree/products/1013/small/ror_baseball_jersey_green.png b/public/spree/products/1013/small/ror_baseball_jersey_green.png new file mode 100644 index 0000000..bf9be43 Binary files /dev/null and b/public/spree/products/1013/small/ror_baseball_jersey_green.png differ diff --git a/public/spree/products/1014/large/ror_baseball_jersey_back_green.png b/public/spree/products/1014/large/ror_baseball_jersey_back_green.png new file mode 100644 index 0000000..4e3fe51 Binary files /dev/null and b/public/spree/products/1014/large/ror_baseball_jersey_back_green.png differ diff --git a/public/spree/products/1014/mini/ror_baseball_jersey_back_green.png b/public/spree/products/1014/mini/ror_baseball_jersey_back_green.png new file mode 100644 index 0000000..926ee20 Binary files /dev/null and b/public/spree/products/1014/mini/ror_baseball_jersey_back_green.png differ diff --git a/public/spree/products/1014/original/ror_baseball_jersey_back_green.png b/public/spree/products/1014/original/ror_baseball_jersey_back_green.png new file mode 100644 index 0000000..0f25489 Binary files /dev/null and b/public/spree/products/1014/original/ror_baseball_jersey_back_green.png differ diff --git a/public/spree/products/1014/product/ror_baseball_jersey_back_green.png b/public/spree/products/1014/product/ror_baseball_jersey_back_green.png new file mode 100644 index 0000000..4e3fe51 Binary files /dev/null and b/public/spree/products/1014/product/ror_baseball_jersey_back_green.png differ diff --git a/public/spree/products/1014/small/ror_baseball_jersey_back_green.png b/public/spree/products/1014/small/ror_baseball_jersey_back_green.png new file mode 100644 index 0000000..6867530 Binary files /dev/null and b/public/spree/products/1014/small/ror_baseball_jersey_back_green.png differ diff --git a/public/spree/products/1015/large/ror_baseball_jersey_blue.png b/public/spree/products/1015/large/ror_baseball_jersey_blue.png new file mode 100644 index 0000000..ba85bd0 Binary files /dev/null and b/public/spree/products/1015/large/ror_baseball_jersey_blue.png differ diff --git a/public/spree/products/1015/mini/ror_baseball_jersey_blue.png b/public/spree/products/1015/mini/ror_baseball_jersey_blue.png new file mode 100644 index 0000000..5261533 Binary files /dev/null and b/public/spree/products/1015/mini/ror_baseball_jersey_blue.png differ diff --git a/public/spree/products/1015/original/ror_baseball_jersey_blue.png b/public/spree/products/1015/original/ror_baseball_jersey_blue.png new file mode 100644 index 0000000..55f98b1 Binary files /dev/null and b/public/spree/products/1015/original/ror_baseball_jersey_blue.png differ diff --git a/public/spree/products/1015/product/ror_baseball_jersey_blue.png b/public/spree/products/1015/product/ror_baseball_jersey_blue.png new file mode 100644 index 0000000..ba85bd0 Binary files /dev/null and b/public/spree/products/1015/product/ror_baseball_jersey_blue.png differ diff --git a/public/spree/products/1015/small/ror_baseball_jersey_blue.png b/public/spree/products/1015/small/ror_baseball_jersey_blue.png new file mode 100644 index 0000000..f9bcffc Binary files /dev/null and b/public/spree/products/1015/small/ror_baseball_jersey_blue.png differ diff --git a/public/spree/products/1016/large/ror_baseball_jersey_back_blue.png b/public/spree/products/1016/large/ror_baseball_jersey_back_blue.png new file mode 100644 index 0000000..0741d7b Binary files /dev/null and b/public/spree/products/1016/large/ror_baseball_jersey_back_blue.png differ diff --git a/public/spree/products/1016/mini/ror_baseball_jersey_back_blue.png b/public/spree/products/1016/mini/ror_baseball_jersey_back_blue.png new file mode 100644 index 0000000..b37f8eb Binary files /dev/null and b/public/spree/products/1016/mini/ror_baseball_jersey_back_blue.png differ diff --git a/public/spree/products/1016/original/ror_baseball_jersey_back_blue.png b/public/spree/products/1016/original/ror_baseball_jersey_back_blue.png new file mode 100644 index 0000000..de551c6 Binary files /dev/null and b/public/spree/products/1016/original/ror_baseball_jersey_back_blue.png differ diff --git a/public/spree/products/1016/product/ror_baseball_jersey_back_blue.png b/public/spree/products/1016/product/ror_baseball_jersey_back_blue.png new file mode 100644 index 0000000..0741d7b Binary files /dev/null and b/public/spree/products/1016/product/ror_baseball_jersey_back_blue.png differ diff --git a/public/spree/products/1016/small/ror_baseball_jersey_back_blue.png b/public/spree/products/1016/small/ror_baseball_jersey_back_blue.png new file mode 100644 index 0000000..4dd05f3 Binary files /dev/null and b/public/spree/products/1016/small/ror_baseball_jersey_back_blue.png differ diff --git a/public/spree/products/1017/large/ror_baseball_jersey_blue.png b/public/spree/products/1017/large/ror_baseball_jersey_blue.png new file mode 100644 index 0000000..ba85bd0 Binary files /dev/null and b/public/spree/products/1017/large/ror_baseball_jersey_blue.png differ diff --git a/public/spree/products/1017/mini/ror_baseball_jersey_blue.png b/public/spree/products/1017/mini/ror_baseball_jersey_blue.png new file mode 100644 index 0000000..5261533 Binary files /dev/null and b/public/spree/products/1017/mini/ror_baseball_jersey_blue.png differ diff --git a/public/spree/products/1017/original/ror_baseball_jersey_blue.png b/public/spree/products/1017/original/ror_baseball_jersey_blue.png new file mode 100644 index 0000000..55f98b1 Binary files /dev/null and b/public/spree/products/1017/original/ror_baseball_jersey_blue.png differ diff --git a/public/spree/products/1017/product/ror_baseball_jersey_blue.png b/public/spree/products/1017/product/ror_baseball_jersey_blue.png new file mode 100644 index 0000000..ba85bd0 Binary files /dev/null and b/public/spree/products/1017/product/ror_baseball_jersey_blue.png differ diff --git a/public/spree/products/1017/small/ror_baseball_jersey_blue.png b/public/spree/products/1017/small/ror_baseball_jersey_blue.png new file mode 100644 index 0000000..f9bcffc Binary files /dev/null and b/public/spree/products/1017/small/ror_baseball_jersey_blue.png differ diff --git a/public/spree/products/1018/large/ror_baseball_jersey_back_blue.png b/public/spree/products/1018/large/ror_baseball_jersey_back_blue.png new file mode 100644 index 0000000..0741d7b Binary files /dev/null and b/public/spree/products/1018/large/ror_baseball_jersey_back_blue.png differ diff --git a/public/spree/products/1018/mini/ror_baseball_jersey_back_blue.png b/public/spree/products/1018/mini/ror_baseball_jersey_back_blue.png new file mode 100644 index 0000000..b37f8eb Binary files /dev/null and b/public/spree/products/1018/mini/ror_baseball_jersey_back_blue.png differ diff --git a/public/spree/products/1018/original/ror_baseball_jersey_back_blue.png b/public/spree/products/1018/original/ror_baseball_jersey_back_blue.png new file mode 100644 index 0000000..de551c6 Binary files /dev/null and b/public/spree/products/1018/original/ror_baseball_jersey_back_blue.png differ diff --git a/public/spree/products/1018/product/ror_baseball_jersey_back_blue.png b/public/spree/products/1018/product/ror_baseball_jersey_back_blue.png new file mode 100644 index 0000000..0741d7b Binary files /dev/null and b/public/spree/products/1018/product/ror_baseball_jersey_back_blue.png differ diff --git a/public/spree/products/1018/small/ror_baseball_jersey_back_blue.png b/public/spree/products/1018/small/ror_baseball_jersey_back_blue.png new file mode 100644 index 0000000..4dd05f3 Binary files /dev/null and b/public/spree/products/1018/small/ror_baseball_jersey_back_blue.png differ diff --git a/public/spree/products/1019/large/ror_baseball_jersey_blue.png b/public/spree/products/1019/large/ror_baseball_jersey_blue.png new file mode 100644 index 0000000..ba85bd0 Binary files /dev/null and b/public/spree/products/1019/large/ror_baseball_jersey_blue.png differ diff --git a/public/spree/products/1019/mini/ror_baseball_jersey_blue.png b/public/spree/products/1019/mini/ror_baseball_jersey_blue.png new file mode 100644 index 0000000..5261533 Binary files /dev/null and b/public/spree/products/1019/mini/ror_baseball_jersey_blue.png differ diff --git a/public/spree/products/1019/original/ror_baseball_jersey_blue.png b/public/spree/products/1019/original/ror_baseball_jersey_blue.png new file mode 100644 index 0000000..55f98b1 Binary files /dev/null and b/public/spree/products/1019/original/ror_baseball_jersey_blue.png differ diff --git a/public/spree/products/1019/product/ror_baseball_jersey_blue.png b/public/spree/products/1019/product/ror_baseball_jersey_blue.png new file mode 100644 index 0000000..ba85bd0 Binary files /dev/null and b/public/spree/products/1019/product/ror_baseball_jersey_blue.png differ diff --git a/public/spree/products/1019/small/ror_baseball_jersey_blue.png b/public/spree/products/1019/small/ror_baseball_jersey_blue.png new file mode 100644 index 0000000..f9bcffc Binary files /dev/null and b/public/spree/products/1019/small/ror_baseball_jersey_blue.png differ diff --git a/public/spree/products/1020/large/ror_baseball_jersey_back_blue.png b/public/spree/products/1020/large/ror_baseball_jersey_back_blue.png new file mode 100644 index 0000000..0741d7b Binary files /dev/null and b/public/spree/products/1020/large/ror_baseball_jersey_back_blue.png differ diff --git a/public/spree/products/1020/mini/ror_baseball_jersey_back_blue.png b/public/spree/products/1020/mini/ror_baseball_jersey_back_blue.png new file mode 100644 index 0000000..b37f8eb Binary files /dev/null and b/public/spree/products/1020/mini/ror_baseball_jersey_back_blue.png differ diff --git a/public/spree/products/1020/original/ror_baseball_jersey_back_blue.png b/public/spree/products/1020/original/ror_baseball_jersey_back_blue.png new file mode 100644 index 0000000..de551c6 Binary files /dev/null and b/public/spree/products/1020/original/ror_baseball_jersey_back_blue.png differ diff --git a/public/spree/products/1020/product/ror_baseball_jersey_back_blue.png b/public/spree/products/1020/product/ror_baseball_jersey_back_blue.png new file mode 100644 index 0000000..0741d7b Binary files /dev/null and b/public/spree/products/1020/product/ror_baseball_jersey_back_blue.png differ diff --git a/public/spree/products/1020/small/ror_baseball_jersey_back_blue.png b/public/spree/products/1020/small/ror_baseball_jersey_back_blue.png new file mode 100644 index 0000000..4dd05f3 Binary files /dev/null and b/public/spree/products/1020/small/ror_baseball_jersey_back_blue.png differ diff --git a/public/spree/products/1021/large/ror_baseball_jersey_red.png b/public/spree/products/1021/large/ror_baseball_jersey_red.png new file mode 100644 index 0000000..d42f86d Binary files /dev/null and b/public/spree/products/1021/large/ror_baseball_jersey_red.png differ diff --git a/public/spree/products/1021/mini/ror_baseball_jersey_red.png b/public/spree/products/1021/mini/ror_baseball_jersey_red.png new file mode 100644 index 0000000..e4167ec Binary files /dev/null and b/public/spree/products/1021/mini/ror_baseball_jersey_red.png differ diff --git a/public/spree/products/1021/original/ror_baseball_jersey_red.png b/public/spree/products/1021/original/ror_baseball_jersey_red.png new file mode 100644 index 0000000..1b534f9 Binary files /dev/null and b/public/spree/products/1021/original/ror_baseball_jersey_red.png differ diff --git a/public/spree/products/1021/product/ror_baseball_jersey_red.png b/public/spree/products/1021/product/ror_baseball_jersey_red.png new file mode 100644 index 0000000..d42f86d Binary files /dev/null and b/public/spree/products/1021/product/ror_baseball_jersey_red.png differ diff --git a/public/spree/products/1021/small/ror_baseball_jersey_red.png b/public/spree/products/1021/small/ror_baseball_jersey_red.png new file mode 100644 index 0000000..91d6e37 Binary files /dev/null and b/public/spree/products/1021/small/ror_baseball_jersey_red.png differ diff --git a/public/spree/products/1022/large/ror_baseball_jersey_back_red.png b/public/spree/products/1022/large/ror_baseball_jersey_back_red.png new file mode 100644 index 0000000..90e3aae Binary files /dev/null and b/public/spree/products/1022/large/ror_baseball_jersey_back_red.png differ diff --git a/public/spree/products/1022/mini/ror_baseball_jersey_back_red.png b/public/spree/products/1022/mini/ror_baseball_jersey_back_red.png new file mode 100644 index 0000000..7391ddd Binary files /dev/null and b/public/spree/products/1022/mini/ror_baseball_jersey_back_red.png differ diff --git a/public/spree/products/1022/original/ror_baseball_jersey_back_red.png b/public/spree/products/1022/original/ror_baseball_jersey_back_red.png new file mode 100644 index 0000000..864fe09 Binary files /dev/null and b/public/spree/products/1022/original/ror_baseball_jersey_back_red.png differ diff --git a/public/spree/products/1022/product/ror_baseball_jersey_back_red.png b/public/spree/products/1022/product/ror_baseball_jersey_back_red.png new file mode 100644 index 0000000..90e3aae Binary files /dev/null and b/public/spree/products/1022/product/ror_baseball_jersey_back_red.png differ diff --git a/public/spree/products/1022/small/ror_baseball_jersey_back_red.png b/public/spree/products/1022/small/ror_baseball_jersey_back_red.png new file mode 100644 index 0000000..7ca4300 Binary files /dev/null and b/public/spree/products/1022/small/ror_baseball_jersey_back_red.png differ diff --git a/public/spree/products/1023/large/ror_baseball_jersey_red.png b/public/spree/products/1023/large/ror_baseball_jersey_red.png new file mode 100644 index 0000000..d42f86d Binary files /dev/null and b/public/spree/products/1023/large/ror_baseball_jersey_red.png differ diff --git a/public/spree/products/1023/mini/ror_baseball_jersey_red.png b/public/spree/products/1023/mini/ror_baseball_jersey_red.png new file mode 100644 index 0000000..e4167ec Binary files /dev/null and b/public/spree/products/1023/mini/ror_baseball_jersey_red.png differ diff --git a/public/spree/products/1023/original/ror_baseball_jersey_red.png b/public/spree/products/1023/original/ror_baseball_jersey_red.png new file mode 100644 index 0000000..1b534f9 Binary files /dev/null and b/public/spree/products/1023/original/ror_baseball_jersey_red.png differ diff --git a/public/spree/products/1023/product/ror_baseball_jersey_red.png b/public/spree/products/1023/product/ror_baseball_jersey_red.png new file mode 100644 index 0000000..d42f86d Binary files /dev/null and b/public/spree/products/1023/product/ror_baseball_jersey_red.png differ diff --git a/public/spree/products/1023/small/ror_baseball_jersey_red.png b/public/spree/products/1023/small/ror_baseball_jersey_red.png new file mode 100644 index 0000000..91d6e37 Binary files /dev/null and b/public/spree/products/1023/small/ror_baseball_jersey_red.png differ diff --git a/public/spree/products/1024/large/ror_baseball_jersey_back_red.png b/public/spree/products/1024/large/ror_baseball_jersey_back_red.png new file mode 100644 index 0000000..90e3aae Binary files /dev/null and b/public/spree/products/1024/large/ror_baseball_jersey_back_red.png differ diff --git a/public/spree/products/1024/mini/ror_baseball_jersey_back_red.png b/public/spree/products/1024/mini/ror_baseball_jersey_back_red.png new file mode 100644 index 0000000..7391ddd Binary files /dev/null and b/public/spree/products/1024/mini/ror_baseball_jersey_back_red.png differ diff --git a/public/spree/products/1024/original/ror_baseball_jersey_back_red.png b/public/spree/products/1024/original/ror_baseball_jersey_back_red.png new file mode 100644 index 0000000..864fe09 Binary files /dev/null and b/public/spree/products/1024/original/ror_baseball_jersey_back_red.png differ diff --git a/public/spree/products/1024/product/ror_baseball_jersey_back_red.png b/public/spree/products/1024/product/ror_baseball_jersey_back_red.png new file mode 100644 index 0000000..90e3aae Binary files /dev/null and b/public/spree/products/1024/product/ror_baseball_jersey_back_red.png differ diff --git a/public/spree/products/1024/small/ror_baseball_jersey_back_red.png b/public/spree/products/1024/small/ror_baseball_jersey_back_red.png new file mode 100644 index 0000000..7ca4300 Binary files /dev/null and b/public/spree/products/1024/small/ror_baseball_jersey_back_red.png differ diff --git a/public/spree/products/1025/large/ror_baseball_jersey_red.png b/public/spree/products/1025/large/ror_baseball_jersey_red.png new file mode 100644 index 0000000..d42f86d Binary files /dev/null and b/public/spree/products/1025/large/ror_baseball_jersey_red.png differ diff --git a/public/spree/products/1025/mini/ror_baseball_jersey_red.png b/public/spree/products/1025/mini/ror_baseball_jersey_red.png new file mode 100644 index 0000000..e4167ec Binary files /dev/null and b/public/spree/products/1025/mini/ror_baseball_jersey_red.png differ diff --git a/public/spree/products/1025/original/ror_baseball_jersey_red.png b/public/spree/products/1025/original/ror_baseball_jersey_red.png new file mode 100644 index 0000000..1b534f9 Binary files /dev/null and b/public/spree/products/1025/original/ror_baseball_jersey_red.png differ diff --git a/public/spree/products/1025/product/ror_baseball_jersey_red.png b/public/spree/products/1025/product/ror_baseball_jersey_red.png new file mode 100644 index 0000000..d42f86d Binary files /dev/null and b/public/spree/products/1025/product/ror_baseball_jersey_red.png differ diff --git a/public/spree/products/1025/small/ror_baseball_jersey_red.png b/public/spree/products/1025/small/ror_baseball_jersey_red.png new file mode 100644 index 0000000..91d6e37 Binary files /dev/null and b/public/spree/products/1025/small/ror_baseball_jersey_red.png differ diff --git a/public/spree/products/1026/large/ror_baseball_jersey_back_red.png b/public/spree/products/1026/large/ror_baseball_jersey_back_red.png new file mode 100644 index 0000000..90e3aae Binary files /dev/null and b/public/spree/products/1026/large/ror_baseball_jersey_back_red.png differ diff --git a/public/spree/products/1026/mini/ror_baseball_jersey_back_red.png b/public/spree/products/1026/mini/ror_baseball_jersey_back_red.png new file mode 100644 index 0000000..7391ddd Binary files /dev/null and b/public/spree/products/1026/mini/ror_baseball_jersey_back_red.png differ diff --git a/public/spree/products/1026/original/ror_baseball_jersey_back_red.png b/public/spree/products/1026/original/ror_baseball_jersey_back_red.png new file mode 100644 index 0000000..864fe09 Binary files /dev/null and b/public/spree/products/1026/original/ror_baseball_jersey_back_red.png differ diff --git a/public/spree/products/1026/product/ror_baseball_jersey_back_red.png b/public/spree/products/1026/product/ror_baseball_jersey_back_red.png new file mode 100644 index 0000000..90e3aae Binary files /dev/null and b/public/spree/products/1026/product/ror_baseball_jersey_back_red.png differ diff --git a/public/spree/products/1026/small/ror_baseball_jersey_back_red.png b/public/spree/products/1026/small/ror_baseball_jersey_back_red.png new file mode 100644 index 0000000..7ca4300 Binary files /dev/null and b/public/spree/products/1026/small/ror_baseball_jersey_back_red.png differ diff --git a/public/spree/products/1027/large/spree_bag.jpeg b/public/spree/products/1027/large/spree_bag.jpeg new file mode 100644 index 0000000..b889f56 Binary files /dev/null and b/public/spree/products/1027/large/spree_bag.jpeg differ diff --git a/public/spree/products/1027/mini/spree_bag.jpeg b/public/spree/products/1027/mini/spree_bag.jpeg new file mode 100644 index 0000000..318a022 Binary files /dev/null and b/public/spree/products/1027/mini/spree_bag.jpeg differ diff --git a/public/spree/products/1027/original/spree_bag.jpeg b/public/spree/products/1027/original/spree_bag.jpeg new file mode 100644 index 0000000..f57951e Binary files /dev/null and b/public/spree/products/1027/original/spree_bag.jpeg differ diff --git a/public/spree/products/1027/product/spree_bag.jpeg b/public/spree/products/1027/product/spree_bag.jpeg new file mode 100644 index 0000000..435b48a Binary files /dev/null and b/public/spree/products/1027/product/spree_bag.jpeg differ diff --git a/public/spree/products/1027/small/spree_bag.jpeg b/public/spree/products/1027/small/spree_bag.jpeg new file mode 100644 index 0000000..7395159 Binary files /dev/null and b/public/spree/products/1027/small/spree_bag.jpeg differ diff --git a/public/spree/products/1028/large/spree_tote_front.jpeg b/public/spree/products/1028/large/spree_tote_front.jpeg new file mode 100644 index 0000000..0c8e523 Binary files /dev/null and b/public/spree/products/1028/large/spree_tote_front.jpeg differ diff --git a/public/spree/products/1028/mini/spree_tote_front.jpeg b/public/spree/products/1028/mini/spree_tote_front.jpeg new file mode 100644 index 0000000..ca6e462 Binary files /dev/null and b/public/spree/products/1028/mini/spree_tote_front.jpeg differ diff --git a/public/spree/products/1028/original/spree_tote_front.jpeg b/public/spree/products/1028/original/spree_tote_front.jpeg new file mode 100644 index 0000000..4e7d7fb Binary files /dev/null and b/public/spree/products/1028/original/spree_tote_front.jpeg differ diff --git a/public/spree/products/1028/product/spree_tote_front.jpeg b/public/spree/products/1028/product/spree_tote_front.jpeg new file mode 100644 index 0000000..0dbd950 Binary files /dev/null and b/public/spree/products/1028/product/spree_tote_front.jpeg differ diff --git a/public/spree/products/1028/small/spree_tote_front.jpeg b/public/spree/products/1028/small/spree_tote_front.jpeg new file mode 100644 index 0000000..07618a0 Binary files /dev/null and b/public/spree/products/1028/small/spree_tote_front.jpeg differ diff --git a/public/spree/products/1029/large/spree_tote_back.jpeg b/public/spree/products/1029/large/spree_tote_back.jpeg new file mode 100644 index 0000000..c3ffbb1 Binary files /dev/null and b/public/spree/products/1029/large/spree_tote_back.jpeg differ diff --git a/public/spree/products/1029/mini/spree_tote_back.jpeg b/public/spree/products/1029/mini/spree_tote_back.jpeg new file mode 100644 index 0000000..94a17c6 Binary files /dev/null and b/public/spree/products/1029/mini/spree_tote_back.jpeg differ diff --git a/public/spree/products/1029/original/spree_tote_back.jpeg b/public/spree/products/1029/original/spree_tote_back.jpeg new file mode 100644 index 0000000..18119c3 Binary files /dev/null and b/public/spree/products/1029/original/spree_tote_back.jpeg differ diff --git a/public/spree/products/1029/product/spree_tote_back.jpeg b/public/spree/products/1029/product/spree_tote_back.jpeg new file mode 100644 index 0000000..7fce02e Binary files /dev/null and b/public/spree/products/1029/product/spree_tote_back.jpeg differ diff --git a/public/spree/products/1029/small/spree_tote_back.jpeg b/public/spree/products/1029/small/spree_tote_back.jpeg new file mode 100644 index 0000000..206e5d7 Binary files /dev/null and b/public/spree/products/1029/small/spree_tote_back.jpeg differ diff --git a/public/spree/products/1030/large/spree_ringer_t.jpeg b/public/spree/products/1030/large/spree_ringer_t.jpeg new file mode 100644 index 0000000..a8c7c44 Binary files /dev/null and b/public/spree/products/1030/large/spree_ringer_t.jpeg differ diff --git a/public/spree/products/1030/mini/spree_ringer_t.jpeg b/public/spree/products/1030/mini/spree_ringer_t.jpeg new file mode 100644 index 0000000..da29cae Binary files /dev/null and b/public/spree/products/1030/mini/spree_ringer_t.jpeg differ diff --git a/public/spree/products/1030/original/spree_ringer_t.jpeg b/public/spree/products/1030/original/spree_ringer_t.jpeg new file mode 100644 index 0000000..f859489 Binary files /dev/null and b/public/spree/products/1030/original/spree_ringer_t.jpeg differ diff --git a/public/spree/products/1030/product/spree_ringer_t.jpeg b/public/spree/products/1030/product/spree_ringer_t.jpeg new file mode 100644 index 0000000..ea3ee53 Binary files /dev/null and b/public/spree/products/1030/product/spree_ringer_t.jpeg differ diff --git a/public/spree/products/1030/small/spree_ringer_t.jpeg b/public/spree/products/1030/small/spree_ringer_t.jpeg new file mode 100644 index 0000000..8871977 Binary files /dev/null and b/public/spree/products/1030/small/spree_ringer_t.jpeg differ diff --git a/public/spree/products/1031/large/spree_ringer_t_back.jpeg b/public/spree/products/1031/large/spree_ringer_t_back.jpeg new file mode 100644 index 0000000..e63b33c Binary files /dev/null and b/public/spree/products/1031/large/spree_ringer_t_back.jpeg differ diff --git a/public/spree/products/1031/mini/spree_ringer_t_back.jpeg b/public/spree/products/1031/mini/spree_ringer_t_back.jpeg new file mode 100644 index 0000000..eff7524 Binary files /dev/null and b/public/spree/products/1031/mini/spree_ringer_t_back.jpeg differ diff --git a/public/spree/products/1031/original/spree_ringer_t_back.jpeg b/public/spree/products/1031/original/spree_ringer_t_back.jpeg new file mode 100644 index 0000000..e2dc7c5 Binary files /dev/null and b/public/spree/products/1031/original/spree_ringer_t_back.jpeg differ diff --git a/public/spree/products/1031/product/spree_ringer_t_back.jpeg b/public/spree/products/1031/product/spree_ringer_t_back.jpeg new file mode 100644 index 0000000..300e3e3 Binary files /dev/null and b/public/spree/products/1031/product/spree_ringer_t_back.jpeg differ diff --git a/public/spree/products/1031/small/spree_ringer_t_back.jpeg b/public/spree/products/1031/small/spree_ringer_t_back.jpeg new file mode 100644 index 0000000..8f15f8e Binary files /dev/null and b/public/spree/products/1031/small/spree_ringer_t_back.jpeg differ diff --git a/public/spree/products/1032/large/spree_spaghetti.jpeg b/public/spree/products/1032/large/spree_spaghetti.jpeg new file mode 100644 index 0000000..bb8dad9 Binary files /dev/null and b/public/spree/products/1032/large/spree_spaghetti.jpeg differ diff --git a/public/spree/products/1032/mini/spree_spaghetti.jpeg b/public/spree/products/1032/mini/spree_spaghetti.jpeg new file mode 100644 index 0000000..c8d883e Binary files /dev/null and b/public/spree/products/1032/mini/spree_spaghetti.jpeg differ diff --git a/public/spree/products/1032/original/spree_spaghetti.jpeg b/public/spree/products/1032/original/spree_spaghetti.jpeg new file mode 100644 index 0000000..81e1221 Binary files /dev/null and b/public/spree/products/1032/original/spree_spaghetti.jpeg differ diff --git a/public/spree/products/1032/product/spree_spaghetti.jpeg b/public/spree/products/1032/product/spree_spaghetti.jpeg new file mode 100644 index 0000000..648ce28 Binary files /dev/null and b/public/spree/products/1032/product/spree_spaghetti.jpeg differ diff --git a/public/spree/products/1032/small/spree_spaghetti.jpeg b/public/spree/products/1032/small/spree_spaghetti.jpeg new file mode 100644 index 0000000..dedaca0 Binary files /dev/null and b/public/spree/products/1032/small/spree_spaghetti.jpeg differ diff --git a/public/spree/products/1033/large/spree_stein.jpeg b/public/spree/products/1033/large/spree_stein.jpeg new file mode 100644 index 0000000..9ab9f6f Binary files /dev/null and b/public/spree/products/1033/large/spree_stein.jpeg differ diff --git a/public/spree/products/1033/mini/spree_stein.jpeg b/public/spree/products/1033/mini/spree_stein.jpeg new file mode 100644 index 0000000..748c69a Binary files /dev/null and b/public/spree/products/1033/mini/spree_stein.jpeg differ diff --git a/public/spree/products/1033/original/spree_stein.jpeg b/public/spree/products/1033/original/spree_stein.jpeg new file mode 100644 index 0000000..deba985 Binary files /dev/null and b/public/spree/products/1033/original/spree_stein.jpeg differ diff --git a/public/spree/products/1033/product/spree_stein.jpeg b/public/spree/products/1033/product/spree_stein.jpeg new file mode 100644 index 0000000..0683052 Binary files /dev/null and b/public/spree/products/1033/product/spree_stein.jpeg differ diff --git a/public/spree/products/1033/small/spree_stein.jpeg b/public/spree/products/1033/small/spree_stein.jpeg new file mode 100644 index 0000000..c0b8627 Binary files /dev/null and b/public/spree/products/1033/small/spree_stein.jpeg differ diff --git a/public/spree/products/1034/large/spree_stein_back.jpeg b/public/spree/products/1034/large/spree_stein_back.jpeg new file mode 100644 index 0000000..6b98c83 Binary files /dev/null and b/public/spree/products/1034/large/spree_stein_back.jpeg differ diff --git a/public/spree/products/1034/mini/spree_stein_back.jpeg b/public/spree/products/1034/mini/spree_stein_back.jpeg new file mode 100644 index 0000000..c6b7068 Binary files /dev/null and b/public/spree/products/1034/mini/spree_stein_back.jpeg differ diff --git a/public/spree/products/1034/original/spree_stein_back.jpeg b/public/spree/products/1034/original/spree_stein_back.jpeg new file mode 100644 index 0000000..ecadca9 Binary files /dev/null and b/public/spree/products/1034/original/spree_stein_back.jpeg differ diff --git a/public/spree/products/1034/product/spree_stein_back.jpeg b/public/spree/products/1034/product/spree_stein_back.jpeg new file mode 100644 index 0000000..dcd64d5 Binary files /dev/null and b/public/spree/products/1034/product/spree_stein_back.jpeg differ diff --git a/public/spree/products/1034/small/spree_stein_back.jpeg b/public/spree/products/1034/small/spree_stein_back.jpeg new file mode 100644 index 0000000..1373c7d Binary files /dev/null and b/public/spree/products/1034/small/spree_stein_back.jpeg differ diff --git a/public/spree/products/1035/large/spree_mug.jpeg b/public/spree/products/1035/large/spree_mug.jpeg new file mode 100644 index 0000000..9f143e1 Binary files /dev/null and b/public/spree/products/1035/large/spree_mug.jpeg differ diff --git a/public/spree/products/1035/mini/spree_mug.jpeg b/public/spree/products/1035/mini/spree_mug.jpeg new file mode 100644 index 0000000..fcebed1 Binary files /dev/null and b/public/spree/products/1035/mini/spree_mug.jpeg differ diff --git a/public/spree/products/1035/original/spree_mug.jpeg b/public/spree/products/1035/original/spree_mug.jpeg new file mode 100644 index 0000000..9e9b649 Binary files /dev/null and b/public/spree/products/1035/original/spree_mug.jpeg differ diff --git a/public/spree/products/1035/product/spree_mug.jpeg b/public/spree/products/1035/product/spree_mug.jpeg new file mode 100644 index 0000000..9f143e1 Binary files /dev/null and b/public/spree/products/1035/product/spree_mug.jpeg differ diff --git a/public/spree/products/1035/small/spree_mug.jpeg b/public/spree/products/1035/small/spree_mug.jpeg new file mode 100644 index 0000000..83f04cd Binary files /dev/null and b/public/spree/products/1035/small/spree_mug.jpeg differ diff --git a/public/spree/products/1036/large/spree_mug_back.jpeg b/public/spree/products/1036/large/spree_mug_back.jpeg new file mode 100644 index 0000000..83e598d Binary files /dev/null and b/public/spree/products/1036/large/spree_mug_back.jpeg differ diff --git a/public/spree/products/1036/mini/spree_mug_back.jpeg b/public/spree/products/1036/mini/spree_mug_back.jpeg new file mode 100644 index 0000000..7553040 Binary files /dev/null and b/public/spree/products/1036/mini/spree_mug_back.jpeg differ diff --git a/public/spree/products/1036/original/spree_mug_back.jpeg b/public/spree/products/1036/original/spree_mug_back.jpeg new file mode 100644 index 0000000..9f7d5ce Binary files /dev/null and b/public/spree/products/1036/original/spree_mug_back.jpeg differ diff --git a/public/spree/products/1036/product/spree_mug_back.jpeg b/public/spree/products/1036/product/spree_mug_back.jpeg new file mode 100644 index 0000000..83e598d Binary files /dev/null and b/public/spree/products/1036/product/spree_mug_back.jpeg differ diff --git a/public/spree/products/1036/small/spree_mug_back.jpeg b/public/spree/products/1036/small/spree_mug_back.jpeg new file mode 100644 index 0000000..6e8b02f Binary files /dev/null and b/public/spree/products/1036/small/spree_mug_back.jpeg differ diff --git a/public/spree/products/1037/large/spree_jersey.jpeg b/public/spree/products/1037/large/spree_jersey.jpeg new file mode 100644 index 0000000..9878537 Binary files /dev/null and b/public/spree/products/1037/large/spree_jersey.jpeg differ diff --git a/public/spree/products/1037/mini/spree_jersey.jpeg b/public/spree/products/1037/mini/spree_jersey.jpeg new file mode 100644 index 0000000..74de9a1 Binary files /dev/null and b/public/spree/products/1037/mini/spree_jersey.jpeg differ diff --git a/public/spree/products/1037/original/spree_jersey.jpeg b/public/spree/products/1037/original/spree_jersey.jpeg new file mode 100644 index 0000000..cd569b3 Binary files /dev/null and b/public/spree/products/1037/original/spree_jersey.jpeg differ diff --git a/public/spree/products/1037/product/spree_jersey.jpeg b/public/spree/products/1037/product/spree_jersey.jpeg new file mode 100644 index 0000000..b306cff Binary files /dev/null and b/public/spree/products/1037/product/spree_jersey.jpeg differ diff --git a/public/spree/products/1037/small/spree_jersey.jpeg b/public/spree/products/1037/small/spree_jersey.jpeg new file mode 100644 index 0000000..d1e502e Binary files /dev/null and b/public/spree/products/1037/small/spree_jersey.jpeg differ diff --git a/public/spree/products/1038/large/spree_jersey_back.jpeg b/public/spree/products/1038/large/spree_jersey_back.jpeg new file mode 100644 index 0000000..7495102 Binary files /dev/null and b/public/spree/products/1038/large/spree_jersey_back.jpeg differ diff --git a/public/spree/products/1038/mini/spree_jersey_back.jpeg b/public/spree/products/1038/mini/spree_jersey_back.jpeg new file mode 100644 index 0000000..fd12096 Binary files /dev/null and b/public/spree/products/1038/mini/spree_jersey_back.jpeg differ diff --git a/public/spree/products/1038/original/spree_jersey_back.jpeg b/public/spree/products/1038/original/spree_jersey_back.jpeg new file mode 100644 index 0000000..5bd7433 Binary files /dev/null and b/public/spree/products/1038/original/spree_jersey_back.jpeg differ diff --git a/public/spree/products/1038/product/spree_jersey_back.jpeg b/public/spree/products/1038/product/spree_jersey_back.jpeg new file mode 100644 index 0000000..41e19ad Binary files /dev/null and b/public/spree/products/1038/product/spree_jersey_back.jpeg differ diff --git a/public/spree/products/1038/small/spree_jersey_back.jpeg b/public/spree/products/1038/small/spree_jersey_back.jpeg new file mode 100644 index 0000000..92b5b4a Binary files /dev/null and b/public/spree/products/1038/small/spree_jersey_back.jpeg differ diff --git a/public/spree/products/11/large/ror_stein.jpeg b/public/spree/products/11/large/ror_stein.jpeg new file mode 100644 index 0000000..1214e8b Binary files /dev/null and b/public/spree/products/11/large/ror_stein.jpeg differ diff --git a/public/spree/products/11/mini/ror_stein.jpeg b/public/spree/products/11/mini/ror_stein.jpeg new file mode 100644 index 0000000..09160f6 Binary files /dev/null and b/public/spree/products/11/mini/ror_stein.jpeg differ diff --git a/public/spree/products/11/original/ror_stein.jpeg b/public/spree/products/11/original/ror_stein.jpeg new file mode 100644 index 0000000..2d65f6e Binary files /dev/null and b/public/spree/products/11/original/ror_stein.jpeg differ diff --git a/public/spree/products/11/product/ror_stein.jpeg b/public/spree/products/11/product/ror_stein.jpeg new file mode 100644 index 0000000..4e8cc49 Binary files /dev/null and b/public/spree/products/11/product/ror_stein.jpeg differ diff --git a/public/spree/products/11/small/ror_stein.jpeg b/public/spree/products/11/small/ror_stein.jpeg new file mode 100644 index 0000000..ba15838 Binary files /dev/null and b/public/spree/products/11/small/ror_stein.jpeg differ diff --git a/public/spree/products/12/large/ror_stein_back.jpeg b/public/spree/products/12/large/ror_stein_back.jpeg new file mode 100644 index 0000000..258ad65 Binary files /dev/null and b/public/spree/products/12/large/ror_stein_back.jpeg differ diff --git a/public/spree/products/12/mini/ror_stein_back.jpeg b/public/spree/products/12/mini/ror_stein_back.jpeg new file mode 100644 index 0000000..7a45fe7 Binary files /dev/null and b/public/spree/products/12/mini/ror_stein_back.jpeg differ diff --git a/public/spree/products/12/original/ror_stein_back.jpeg b/public/spree/products/12/original/ror_stein_back.jpeg new file mode 100644 index 0000000..cdc9871 Binary files /dev/null and b/public/spree/products/12/original/ror_stein_back.jpeg differ diff --git a/public/spree/products/12/product/ror_stein_back.jpeg b/public/spree/products/12/product/ror_stein_back.jpeg new file mode 100644 index 0000000..f383e69 Binary files /dev/null and b/public/spree/products/12/product/ror_stein_back.jpeg differ diff --git a/public/spree/products/12/small/ror_stein_back.jpeg b/public/spree/products/12/small/ror_stein_back.jpeg new file mode 100644 index 0000000..2e18e0f Binary files /dev/null and b/public/spree/products/12/small/ror_stein_back.jpeg differ diff --git a/public/spree/products/3/large/ror_bag.jpeg b/public/spree/products/3/large/ror_bag.jpeg new file mode 100644 index 0000000..9cef7a8 Binary files /dev/null and b/public/spree/products/3/large/ror_bag.jpeg differ diff --git a/public/spree/products/3/mini/ror_bag.jpeg b/public/spree/products/3/mini/ror_bag.jpeg new file mode 100644 index 0000000..28237d4 Binary files /dev/null and b/public/spree/products/3/mini/ror_bag.jpeg differ diff --git a/public/spree/products/3/original/ror_bag.jpeg b/public/spree/products/3/original/ror_bag.jpeg new file mode 100644 index 0000000..e062536 Binary files /dev/null and b/public/spree/products/3/original/ror_bag.jpeg differ diff --git a/public/spree/products/3/product/ror_bag.jpeg b/public/spree/products/3/product/ror_bag.jpeg new file mode 100644 index 0000000..94d8614 Binary files /dev/null and b/public/spree/products/3/product/ror_bag.jpeg differ diff --git a/public/spree/products/3/small/ror_bag.jpeg b/public/spree/products/3/small/ror_bag.jpeg new file mode 100644 index 0000000..bd59f51 Binary files /dev/null and b/public/spree/products/3/small/ror_bag.jpeg differ diff --git a/public/spree/products/4/large/ror_baseball.jpeg b/public/spree/products/4/large/ror_baseball.jpeg new file mode 100644 index 0000000..643f2b6 Binary files /dev/null and b/public/spree/products/4/large/ror_baseball.jpeg differ diff --git a/public/spree/products/4/mini/ror_baseball.jpeg b/public/spree/products/4/mini/ror_baseball.jpeg new file mode 100644 index 0000000..0c13bad Binary files /dev/null and b/public/spree/products/4/mini/ror_baseball.jpeg differ diff --git a/public/spree/products/4/original/ror_baseball.jpeg b/public/spree/products/4/original/ror_baseball.jpeg new file mode 100644 index 0000000..3aaf65a Binary files /dev/null and b/public/spree/products/4/original/ror_baseball.jpeg differ diff --git a/public/spree/products/4/product/ror_baseball.jpeg b/public/spree/products/4/product/ror_baseball.jpeg new file mode 100644 index 0000000..5138571 Binary files /dev/null and b/public/spree/products/4/product/ror_baseball.jpeg differ diff --git a/public/spree/products/4/small/ror_baseball.jpeg b/public/spree/products/4/small/ror_baseball.jpeg new file mode 100644 index 0000000..a12b9c4 Binary files /dev/null and b/public/spree/products/4/small/ror_baseball.jpeg differ diff --git a/public/spree/products/5/large/ror_baseball_back.jpeg b/public/spree/products/5/large/ror_baseball_back.jpeg new file mode 100644 index 0000000..0c1aa21 Binary files /dev/null and b/public/spree/products/5/large/ror_baseball_back.jpeg differ diff --git a/public/spree/products/5/mini/ror_baseball_back.jpeg b/public/spree/products/5/mini/ror_baseball_back.jpeg new file mode 100644 index 0000000..a15d7d0 Binary files /dev/null and b/public/spree/products/5/mini/ror_baseball_back.jpeg differ diff --git a/public/spree/products/5/original/ror_baseball_back.jpeg b/public/spree/products/5/original/ror_baseball_back.jpeg new file mode 100644 index 0000000..08b9db6 Binary files /dev/null and b/public/spree/products/5/original/ror_baseball_back.jpeg differ diff --git a/public/spree/products/5/product/ror_baseball_back.jpeg b/public/spree/products/5/product/ror_baseball_back.jpeg new file mode 100644 index 0000000..dd5d9db Binary files /dev/null and b/public/spree/products/5/product/ror_baseball_back.jpeg differ diff --git a/public/spree/products/5/small/ror_baseball_back.jpeg b/public/spree/products/5/small/ror_baseball_back.jpeg new file mode 100644 index 0000000..905333a Binary files /dev/null and b/public/spree/products/5/small/ror_baseball_back.jpeg differ diff --git a/public/spree/products/6/large/ror_jr_spaghetti.jpeg b/public/spree/products/6/large/ror_jr_spaghetti.jpeg new file mode 100644 index 0000000..0e236ea Binary files /dev/null and b/public/spree/products/6/large/ror_jr_spaghetti.jpeg differ diff --git a/public/spree/products/6/mini/ror_jr_spaghetti.jpeg b/public/spree/products/6/mini/ror_jr_spaghetti.jpeg new file mode 100644 index 0000000..0c28406 Binary files /dev/null and b/public/spree/products/6/mini/ror_jr_spaghetti.jpeg differ diff --git a/public/spree/products/6/original/ror_jr_spaghetti.jpeg b/public/spree/products/6/original/ror_jr_spaghetti.jpeg new file mode 100644 index 0000000..b24d431 Binary files /dev/null and b/public/spree/products/6/original/ror_jr_spaghetti.jpeg differ diff --git a/public/spree/products/6/product/ror_jr_spaghetti.jpeg b/public/spree/products/6/product/ror_jr_spaghetti.jpeg new file mode 100644 index 0000000..e70520b Binary files /dev/null and b/public/spree/products/6/product/ror_jr_spaghetti.jpeg differ diff --git a/public/spree/products/6/small/ror_jr_spaghetti.jpeg b/public/spree/products/6/small/ror_jr_spaghetti.jpeg new file mode 100644 index 0000000..35c942f Binary files /dev/null and b/public/spree/products/6/small/ror_jr_spaghetti.jpeg differ diff --git a/public/spree/products/7/large/ror_mug.jpeg b/public/spree/products/7/large/ror_mug.jpeg new file mode 100644 index 0000000..e342a69 Binary files /dev/null and b/public/spree/products/7/large/ror_mug.jpeg differ diff --git a/public/spree/products/7/mini/ror_mug.jpeg b/public/spree/products/7/mini/ror_mug.jpeg new file mode 100644 index 0000000..015ba40 Binary files /dev/null and b/public/spree/products/7/mini/ror_mug.jpeg differ diff --git a/public/spree/products/7/original/ror_mug.jpeg b/public/spree/products/7/original/ror_mug.jpeg new file mode 100644 index 0000000..6d5b406 Binary files /dev/null and b/public/spree/products/7/original/ror_mug.jpeg differ diff --git a/public/spree/products/7/product/ror_mug.jpeg b/public/spree/products/7/product/ror_mug.jpeg new file mode 100644 index 0000000..5298b36 Binary files /dev/null and b/public/spree/products/7/product/ror_mug.jpeg differ diff --git a/public/spree/products/7/small/ror_mug.jpeg b/public/spree/products/7/small/ror_mug.jpeg new file mode 100644 index 0000000..2a0e358 Binary files /dev/null and b/public/spree/products/7/small/ror_mug.jpeg differ diff --git a/public/spree/products/8/large/ror_mug_back.jpeg b/public/spree/products/8/large/ror_mug_back.jpeg new file mode 100644 index 0000000..ddb2618 Binary files /dev/null and b/public/spree/products/8/large/ror_mug_back.jpeg differ diff --git a/public/spree/products/8/mini/ror_mug_back.jpeg b/public/spree/products/8/mini/ror_mug_back.jpeg new file mode 100644 index 0000000..71c78a0 Binary files /dev/null and b/public/spree/products/8/mini/ror_mug_back.jpeg differ diff --git a/public/spree/products/8/original/ror_mug_back.jpeg b/public/spree/products/8/original/ror_mug_back.jpeg new file mode 100644 index 0000000..687e949 Binary files /dev/null and b/public/spree/products/8/original/ror_mug_back.jpeg differ diff --git a/public/spree/products/8/product/ror_mug_back.jpeg b/public/spree/products/8/product/ror_mug_back.jpeg new file mode 100644 index 0000000..c56935e Binary files /dev/null and b/public/spree/products/8/product/ror_mug_back.jpeg differ diff --git a/public/spree/products/8/small/ror_mug_back.jpeg b/public/spree/products/8/small/ror_mug_back.jpeg new file mode 100644 index 0000000..c1fb5ab Binary files /dev/null and b/public/spree/products/8/small/ror_mug_back.jpeg differ diff --git a/public/spree/products/9/large/ror_ringer.jpeg b/public/spree/products/9/large/ror_ringer.jpeg new file mode 100644 index 0000000..ef44502 Binary files /dev/null and b/public/spree/products/9/large/ror_ringer.jpeg differ diff --git a/public/spree/products/9/mini/ror_ringer.jpeg b/public/spree/products/9/mini/ror_ringer.jpeg new file mode 100644 index 0000000..5db1961 Binary files /dev/null and b/public/spree/products/9/mini/ror_ringer.jpeg differ diff --git a/public/spree/products/9/original/ror_ringer.jpeg b/public/spree/products/9/original/ror_ringer.jpeg new file mode 100644 index 0000000..935ad95 Binary files /dev/null and b/public/spree/products/9/original/ror_ringer.jpeg differ diff --git a/public/spree/products/9/product/ror_ringer.jpeg b/public/spree/products/9/product/ror_ringer.jpeg new file mode 100644 index 0000000..cede58d Binary files /dev/null and b/public/spree/products/9/product/ror_ringer.jpeg differ diff --git a/public/spree/products/9/small/ror_ringer.jpeg b/public/spree/products/9/small/ror_ringer.jpeg new file mode 100644 index 0000000..5475e51 Binary files /dev/null and b/public/spree/products/9/small/ror_ringer.jpeg differ diff --git a/script/rails b/script/rails new file mode 100755 index 0000000..f8da2cf --- /dev/null +++ b/script/rails @@ -0,0 +1,6 @@ +#!/usr/bin/env ruby +# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. + +APP_PATH = File.expand_path('../../config/application', __FILE__) +require File.expand_path('../../config/boot', __FILE__) +require 'rails/commands' diff --git a/test/fixtures/.gitkeep b/test/fixtures/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/test/functional/.gitkeep b/test/functional/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/test/integration/.gitkeep b/test/integration/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/test/performance/browsing_test.rb b/test/performance/browsing_test.rb new file mode 100644 index 0000000..3fea27b --- /dev/null +++ b/test/performance/browsing_test.rb @@ -0,0 +1,12 @@ +require 'test_helper' +require 'rails/performance_test_help' + +class BrowsingTest < ActionDispatch::PerformanceTest + # Refer to the documentation for all available options + # self.profile_options = { :runs => 5, :metrics => [:wall_time, :memory] + # :output => 'tmp/performance', :formats => [:flat] } + + def test_homepage + get '/' + end +end diff --git a/test/test_helper.rb b/test/test_helper.rb new file mode 100644 index 0000000..8bf1192 --- /dev/null +++ b/test/test_helper.rb @@ -0,0 +1,13 @@ +ENV["RAILS_ENV"] = "test" +require File.expand_path('../../config/environment', __FILE__) +require 'rails/test_help' + +class ActiveSupport::TestCase + # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order. + # + # Note: You'll currently still have to declare fixtures explicitly in integration tests + # -- they do not yet inherit this setting + fixtures :all + + # Add more helper methods to be used by all tests here... +end diff --git a/test/unit/.gitkeep b/test/unit/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/vendor/assets/javascripts/.gitkeep b/vendor/assets/javascripts/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/vendor/assets/stylesheets/.gitkeep b/vendor/assets/stylesheets/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/vendor/plugins/.gitkeep b/vendor/plugins/.gitkeep new file mode 100644 index 0000000..e69de29