diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..9612375 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,37 @@ +# See https://docs.docker.com/engine/reference/builder/#dockerignore-file for more about ignoring files. + +# Ignore git directory. +/.git/ + +# Ignore bundler config. +/.bundle + +# Ignore all environment files (except templates). +/.env* +!/.env*.erb + +# Ignore all default key files. +/config/master.key +/config/credentials/*.key + +# Ignore all logfiles and tempfiles. +/log/* +/tmp/* +!/log/.keep +!/tmp/.keep + +# Ignore pidfiles, but keep the directory. +/tmp/pids/* +!/tmp/pids/.keep + +# Ignore storage (uploaded files in development and any SQLite databases). +/storage/* +!/storage/.keep +/tmp/storage/* +!/tmp/storage/.keep + +# Ignore assets. +/node_modules/ +/app/assets/builds/* +!/app/assets/builds/.keep +/public/assets diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..8dc4323 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,9 @@ +# See https://git-scm.com/docs/gitattributes for more about git attribute files. + +# Mark the database schema as having been generated. +db/schema.rb linguist-generated + +# Mark any vendored files as having been vendored. +vendor/* linguist-vendored +config/credentials/*.yml.enc diff=rails_credentials +config/credentials.yml.enc diff=rails_credentials diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..c496bc7 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file + +version: 2 +updates: + - package-ecosystem: "bundler" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5fb66c9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,35 @@ +# See https://help.github.com/articles/ignoring-files for more about ignoring files. +# +# If you find yourself ignoring temporary files generated by your text editor +# or operating system, you probably want to add a global ignore instead: +# git config --global core.excludesfile '~/.gitignore_global' + +# Ignore bundler config. +/.bundle + +# Ignore all environment files (except templates). +/.env* +!/.env*.erb + +# Ignore all logfiles and tempfiles. +/log/* +/tmp/* +!/log/.keep +!/tmp/.keep + +# Ignore pidfiles, but keep the directory. +/tmp/pids/* +!/tmp/pids/ +!/tmp/pids/.keep + +# Ignore storage (uploaded files in development and any SQLite databases). +/storage/* +!/storage/.keep +/tmp/storage/* +!/tmp/storage/ +!/tmp/storage/.keep + +/public/assets + +# Ignore master key for decrypting credentials and more. +/config/master.key diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..15a2799 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +3.3.0 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2c1e8b4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,62 @@ +# syntax = docker/dockerfile:1 + +# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile +ARG RUBY_VERSION=3.3.0 +FROM registry.docker.com/library/ruby:$RUBY_VERSION-slim as base + +# Rails app lives here +WORKDIR /rails + +# Set production environment +ENV RAILS_ENV="production" \ + BUNDLE_DEPLOYMENT="1" \ + BUNDLE_PATH="/usr/local/bundle" \ + BUNDLE_WITHOUT="development" + + +# Throw-away build stage to reduce size of final image +FROM base as build + +# Install packages needed to build gems +RUN apt-get update -qq && \ + apt-get install --no-install-recommends -y build-essential git libpq-dev libvips pkg-config + +# Install application gems +COPY Gemfile Gemfile.lock ./ +RUN bundle install && \ + rm -rf ~/.bundle/ "${BUNDLE_PATH}"/ruby/*/cache "${BUNDLE_PATH}"/ruby/*/bundler/gems/*/.git && \ + bundle exec bootsnap precompile --gemfile + +# Copy application code +COPY . . + +# Precompile bootsnap code for faster boot times +RUN bundle exec bootsnap precompile app/ lib/ + +# Precompiling assets for production without requiring secret RAILS_MASTER_KEY +RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile + + +# Final stage for app image +FROM base + +# Install packages needed for deployment +RUN apt-get update -qq && \ + apt-get install --no-install-recommends -y curl libvips postgresql-client && \ + rm -rf /var/lib/apt/lists /var/cache/apt/archives + +# Copy built artifacts: gems, application +COPY --from=build /usr/local/bundle /usr/local/bundle +COPY --from=build /rails /rails + +# Run and own only the runtime files as a non-root user for security +RUN useradd rails --create-home --shell /bin/bash && \ + chown -R rails:rails db log storage tmp +USER rails:rails + +# Entrypoint prepares the database. +ENTRYPOINT ["/rails/bin/docker-entrypoint"] + +# Start the server by default, this can be overwritten at runtime +EXPOSE 3000 +CMD ["./bin/rails", "server"] diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..9982537 --- /dev/null +++ b/Gemfile @@ -0,0 +1,87 @@ +source "https://rubygems.org" + +ruby File.read('.ruby-version').strip.to_s + +# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main" +gem "rails", "~> 7.1.3", ">= 7.1.3.4" + +# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails] +gem "sprockets-rails" + +# Use pg as the database for Active Record +gem "pg", "~> 1.1" + +# Use the Puma web server [https://github.com/puma/puma] +gem "puma", ">= 5.0" + +# Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails] +gem "importmap-rails" + +# Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev] +gem "turbo-rails" + +# Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev] +gem "stimulus-rails" + +# Build JSON APIs with ease [https://github.com/rails/jbuilder] +gem "jbuilder" + +# Use Redis adapter to run Action Cable in production +gem "redis", ">= 4.0.1", group: :production + +# Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis] +# gem "kredis" + +# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword] +# gem "bcrypt", "~> 3.1.7" + +# Windows does not include zoneinfo files, so bundle the tzinfo-data gem +gem "tzinfo-data", platforms: %i[ windows jruby ] + +# Reduces boot times through caching; required in config/boot.rb +gem "bootsnap", require: false + +# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images] +gem "image_processing", "~> 1.2" + +group :development, :test do + # See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem + gem "debug", platforms: %i[ mri windows ] +end + +group :development do + # Use console on exceptions pages [https://github.com/rails/web-console] + gem "web-console" + + # Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler] + # gem "rack-mini-profiler" + + # Speed up commands on slow machines / big apps [https://github.com/rails/spring] + # gem "spring" +end + +group :test do + # Use system testing [https://guides.rubyonrails.org/testing.html#system-testing] + gem "capybara" + gem "selenium-webdriver" +end + +# Use Solid Queue for background jobs +gem "solid_queue", ">= 0.3.2" +gem "mission_control-jobs" + +# Use Solid Cache for caching +gem "solid_cache" + +# Spree gems +gem "spree" +gem "spree_emails" +gem "spree_sample" +gem "spree_backend" +gem "spree_frontend" +gem "spree_auth_devise" +gem "spree_gateway" +gem "spree_i18n" + +# only needed for MacOS and Ruby 3.0 +gem 'sassc', github: 'sass/sassc-ruby', branch: 'master' diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..0c31519 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,580 @@ +GIT + remote: https://github.com/sass/sassc-ruby.git + revision: 4fce2b635ca5d616a8b1381c64846410bc785ea4 + branch: master + specs: + sassc (2.4.0) + ffi (~> 1.9) + +GEM + remote: https://rubygems.org/ + specs: + actioncable (7.1.3.4) + actionpack (= 7.1.3.4) + activesupport (= 7.1.3.4) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + zeitwerk (~> 2.6) + actionmailbox (7.1.3.4) + actionpack (= 7.1.3.4) + activejob (= 7.1.3.4) + activerecord (= 7.1.3.4) + activestorage (= 7.1.3.4) + activesupport (= 7.1.3.4) + mail (>= 2.7.1) + net-imap + net-pop + net-smtp + actionmailer (7.1.3.4) + actionpack (= 7.1.3.4) + actionview (= 7.1.3.4) + activejob (= 7.1.3.4) + activesupport (= 7.1.3.4) + mail (~> 2.5, >= 2.5.4) + net-imap + net-pop + net-smtp + rails-dom-testing (~> 2.2) + actionpack (7.1.3.4) + actionview (= 7.1.3.4) + activesupport (= 7.1.3.4) + nokogiri (>= 1.8.5) + racc + rack (>= 2.2.4) + rack-session (>= 1.0.1) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + actiontext (7.1.3.4) + actionpack (= 7.1.3.4) + activerecord (= 7.1.3.4) + activestorage (= 7.1.3.4) + activesupport (= 7.1.3.4) + globalid (>= 0.6.0) + nokogiri (>= 1.8.5) + actionview (7.1.3.4) + activesupport (= 7.1.3.4) + builder (~> 3.1) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + active_link_to (1.0.5) + actionpack + addressable + active_storage_validations (1.1.4) + activejob (>= 5.2.0) + activemodel (>= 5.2.0) + activestorage (>= 5.2.0) + activesupport (>= 5.2.0) + activejob (7.1.3.4) + activesupport (= 7.1.3.4) + globalid (>= 0.3.6) + activemerchant (1.126.0) + activesupport (>= 4.2) + builder (>= 2.1.2, < 4.0.0) + i18n (>= 0.6.9) + nokogiri (~> 1.4) + activemodel (7.1.3.4) + activesupport (= 7.1.3.4) + activerecord (7.1.3.4) + activemodel (= 7.1.3.4) + activesupport (= 7.1.3.4) + timeout (>= 0.4.0) + activerecord-typedstore (1.6.0) + activerecord (>= 6.1) + activestorage (7.1.3.4) + actionpack (= 7.1.3.4) + activejob (= 7.1.3.4) + activerecord (= 7.1.3.4) + activesupport (= 7.1.3.4) + marcel (~> 1.0) + activesupport (7.1.3.4) + base64 + bigdecimal + concurrent-ruby (~> 1.0, >= 1.0.2) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + minitest (>= 5.1) + mutex_m + tzinfo (~> 2.0) + acts_as_list (1.2.1) + activerecord (>= 6.1) + activesupport (>= 6.1) + addressable (2.8.6) + public_suffix (>= 2.0.2, < 6.0) + auto_strip_attributes (2.6.0) + activerecord (>= 4.0) + autoprefixer-rails (10.4.16.0) + execjs (~> 2) + awesome_nested_set (3.6.0) + activerecord (>= 4.0.0, < 7.2) + babel-source (5.8.35) + babel-transpiler (0.7.0) + babel-source (>= 4.0, < 6) + execjs (~> 2.0) + base64 (0.2.0) + bcrypt (3.1.20) + bigdecimal (3.1.8) + bindex (0.8.1) + bootsnap (1.18.3) + msgpack (~> 1.2) + bootstrap (4.6.2) + autoprefixer-rails (>= 9.1.0) + popper_js (>= 1.16.1, < 2) + sassc-rails (>= 2.0.0) + builder (3.3.0) + cancancan (3.6.1) + canonical-rails (0.2.15) + actionview (>= 4.1, <= 7.2) + capybara (3.40.0) + addressable + matrix + mini_mime (>= 0.1.3) + nokogiri (~> 1.11) + rack (>= 1.6.0) + rack-test (>= 0.6.3) + regexp_parser (>= 1.5, < 3.0) + xpath (~> 3.2) + carmen (1.1.3) + activesupport (>= 3.0.0) + concurrent-ruby (1.3.3) + connection_pool (2.4.1) + crass (1.0.6) + date (3.3.4) + debug (1.9.2) + irb (~> 1.10) + reline (>= 0.3.8) + devise (4.9.4) + bcrypt (~> 3.0) + orm_adapter (~> 0.1) + railties (>= 4.1.0) + responders + warden (~> 1.2.3) + devise-encryptable (0.2.0) + devise (>= 2.1.0) + doorkeeper (5.7.0) + railties (>= 5) + drb (2.2.1) + erubi (1.13.0) + et-orbi (1.2.11) + tzinfo + execjs (2.9.1) + ffaker (2.23.0) + ffi (1.17.0-aarch64-linux-gnu) + ffi (1.17.0-arm-linux-gnu) + ffi (1.17.0-arm64-darwin) + ffi (1.17.0-x86-linux-gnu) + ffi (1.17.0-x86_64-darwin) + ffi (1.17.0-x86_64-linux-gnu) + flag-icons-rails (3.4.6.1) + sass-rails + flatpickr (4.6.13.1) + friendly_id (5.4.2) + activerecord (>= 4.0.0) + friendly_id-mobility (1.0.4) + friendly_id (>= 5.0.0, < 5.5) + mobility (>= 1.0.1, < 2.0) + fugit (1.11.0) + et-orbi (~> 1, >= 1.2.11) + raabro (~> 1.4) + globalid (1.2.1) + activesupport (>= 6.1) + glyphicons (1.0.2) + highline (3.0.1) + i18n (1.14.5) + concurrent-ruby (~> 1.0) + i18n_data (0.17.1) + simple_po_parser (~> 1.1) + image_processing (1.12.2) + mini_magick (>= 4.9.5, < 5) + ruby-vips (>= 2.0.17, < 3) + importmap-rails (2.0.1) + actionpack (>= 6.0.0) + activesupport (>= 6.0.0) + railties (>= 6.0.0) + inline_svg (1.9.0) + activesupport (>= 3.0) + nokogiri (>= 1.6) + io-console (0.7.2) + irb (1.13.2) + rdoc (>= 4.0.0) + reline (>= 0.4.2) + jbuilder (2.12.0) + actionview (>= 5.0.0) + activesupport (>= 5.0.0) + jquery-rails (4.6.0) + rails-dom-testing (>= 1, < 3) + railties (>= 4.2.0) + thor (>= 0.14, < 2.0) + jquery-ui-rails (7.0.0) + railties (>= 3.2.16) + jsonapi-serializer (2.2.0) + activesupport (>= 4.2) + kaminari (1.2.2) + activesupport (>= 4.1.0) + kaminari-actionview (= 1.2.2) + kaminari-activerecord (= 1.2.2) + kaminari-core (= 1.2.2) + kaminari-actionview (1.2.2) + actionview + kaminari-core (= 1.2.2) + kaminari-activerecord (1.2.2) + activerecord + kaminari-core (= 1.2.2) + kaminari-core (1.2.2) + kaminari-i18n (0.5.0) + kaminari + rails + logger (1.6.0) + loofah (2.22.0) + crass (~> 1.0.2) + nokogiri (>= 1.12.0) + mail (2.8.1) + mini_mime (>= 0.1.1) + net-imap + net-pop + net-smtp + marcel (1.0.4) + matrix (0.4.2) + mini_magick (4.13.1) + mini_mime (1.1.5) + minitest (5.23.1) + mission_control-jobs (0.2.1) + importmap-rails + rails (~> 7.1) + stimulus-rails + turbo-rails + mobility (1.2.9) + i18n (>= 0.6.10, < 2) + request_store (~> 1.0) + mobility-ransack (1.2.2) + mobility (>= 1.0.1, < 2.0) + ransack (>= 1.8.0, < 5.0) + monetize (1.13.0) + money (~> 6.12) + money (6.19.0) + i18n (>= 0.6.4, <= 2) + msgpack (1.7.2) + mutex_m (0.2.0) + net-imap (0.4.13) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.2) + timeout + net-smtp (0.5.0) + net-protocol + nio4r (2.7.3) + nokogiri (1.16.6-aarch64-linux) + racc (~> 1.4) + nokogiri (1.16.6-arm-linux) + racc (~> 1.4) + nokogiri (1.16.6-arm64-darwin) + racc (~> 1.4) + nokogiri (1.16.6-x86-linux) + racc (~> 1.4) + nokogiri (1.16.6-x86_64-darwin) + racc (~> 1.4) + nokogiri (1.16.6-x86_64-linux) + racc (~> 1.4) + orm_adapter (0.5.0) + paranoia (2.6.3) + activerecord (>= 5.1, < 7.2) + pg (1.5.6) + popper_js (1.16.1) + psych (5.1.2) + stringio + public_suffix (5.0.5) + puma (6.4.2) + nio4r (~> 2.0) + raabro (1.4.0) + racc (1.8.0) + rack (3.1.3) + rack-session (2.0.0) + rack (>= 3.0.0) + rack-test (2.1.0) + rack (>= 1.3) + rackup (2.1.0) + rack (>= 3) + webrick (~> 1.8) + rails (7.1.3.4) + actioncable (= 7.1.3.4) + actionmailbox (= 7.1.3.4) + actionmailer (= 7.1.3.4) + actionpack (= 7.1.3.4) + actiontext (= 7.1.3.4) + actionview (= 7.1.3.4) + activejob (= 7.1.3.4) + activemodel (= 7.1.3.4) + activerecord (= 7.1.3.4) + activestorage (= 7.1.3.4) + activesupport (= 7.1.3.4) + bundler (>= 1.15.0) + railties (= 7.1.3.4) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest + nokogiri (>= 1.6) + rails-html-sanitizer (1.6.0) + loofah (~> 2.21) + nokogiri (~> 1.14) + rails-i18n (7.0.9) + i18n (>= 0.7, < 2) + railties (>= 6.0.0, < 8) + railties (7.1.3.4) + actionpack (= 7.1.3.4) + activesupport (= 7.1.3.4) + irb + rackup (>= 1.0.0) + rake (>= 12.2) + thor (~> 1.0, >= 1.2.2) + zeitwerk (~> 2.6) + rake (13.2.1) + ransack (4.1.1) + activerecord (>= 6.1.5) + activesupport (>= 6.1.5) + i18n + rdoc (6.7.0) + psych (>= 4.0.0) + redis (5.2.0) + redis-client (>= 0.22.0) + redis-client (0.22.2) + connection_pool + regexp_parser (2.9.2) + reline (0.5.9) + io-console (~> 0.5) + request_store (1.7.0) + rack (>= 1.4) + requestjs-rails (0.0.11) + railties (>= 6.1.0) + responders (3.1.1) + actionpack (>= 5.2) + railties (>= 5.2) + rexml (3.3.0) + strscan + ruby-vips (2.2.1) + ffi (~> 1.12) + rubyzip (2.3.2) + sass-rails (6.0.0) + sassc-rails (~> 2.1, >= 2.1.1) + sassc-rails (2.1.2) + railties (>= 4.0.0) + sassc (>= 2.0) + sprockets (> 3.0) + sprockets-rails + tilt + select2-rails (4.0.13) + selenium-webdriver (4.22.0) + base64 (~> 0.2) + logger (~> 1.4) + rexml (~> 3.2, >= 3.2.5) + rubyzip (>= 1.2.2, < 3.0) + websocket (~> 1.0) + simple_po_parser (1.1.6) + solid_cache (0.6.0) + activejob (>= 7) + activerecord (>= 7) + railties (>= 7) + solid_queue (0.3.3) + activejob (>= 7.1) + activerecord (>= 7.1) + concurrent-ruby (>= 1.3.1) + fugit (~> 1.11.0) + railties (>= 7.1) + spree (4.8.3) + spree_api (= 4.8.3) + spree_cli (= 4.8.3) + spree_core (= 4.8.3) + spree_api (4.8.3) + bcrypt (~> 3.1) + doorkeeper (~> 5.3) + jsonapi-serializer (~> 2.1) + spree_core (= 4.8.3) + spree_auth_devise (4.6.3) + devise (~> 4.7) + devise-encryptable (= 0.2.0) + spree_core (>= 4.5.0) + spree_extension + spree_backend (4.8.2) + babel-transpiler (~> 0.7) + bootstrap (~> 4.0) + flag-icons-rails (~> 3.4) + flatpickr (~> 4.6) + glyphicons (~> 1.0) + importmap-rails + inline_svg (~> 1.5) + jquery-rails (~> 4.3) + jquery-ui-rails (>= 6, < 8) + requestjs-rails + responders + sass-rails (>= 5) + select2-rails (~> 4.0.6) + spree (>= 4.7.0) + sprockets (~> 4.0) + stimulus-rails + tinymce-rails (~> 5.0) + turbo-rails + spree_cli (4.8.3) + thor (~> 1.0) + spree_core (4.8.3) + actionpack (>= 6.1, < 8.0) + actionview (>= 6.1, < 8.0) + active_storage_validations (~> 1.1) + activejob (>= 6.1, < 8.0) + activemerchant (~> 1.67) + activemodel (>= 6.1, < 8.0) + activerecord (>= 6.1, < 8.0) + activerecord-typedstore + activestorage (>= 6.1, < 8.0) + activesupport (>= 6.1, < 8.0) + acts_as_list (>= 0.8) + auto_strip_attributes (~> 2.6) + awesome_nested_set (~> 3.3, >= 3.3.1) + cancancan (~> 3.2) + carmen (>= 1.0) + friendly_id (~> 5.2, >= 5.2.1) + friendly_id-mobility (~> 1.0) + highline (>= 2, < 4) + image_processing (~> 1.2) + kaminari (~> 1.2) + mobility (~> 1.2) + mobility-ransack (~> 1.2) + monetize (~> 1.9) + money (~> 6.13) + paranoia (~> 2.4) + railties (>= 6.1, < 8.0) + ransack (>= 4.1) + rexml + state_machines-activemodel (~> 0.7) + state_machines-activerecord (~> 0.6) + stringex + validates_zipcode + spree_emails (4.8.3) + actionmailer + spree_core (>= 4.8.3) + sprockets (>= 4.0) + spree_extension (0.1.0) + activerecord (>= 4.2) + spree_core + spree_frontend (4.8.0) + active_link_to + babel-transpiler (~> 0.7) + bootstrap (~> 4.0) + canonical-rails (~> 0.2, >= 0.2.10) + flag-icons-rails (~> 3.4) + glyphicons (~> 1.0) + importmap-rails + inline_svg (~> 1.5) + jquery-rails (~> 4.3) + responders + sass-rails (>= 5) + spree_api (~> 4.7) + spree_core (~> 4.7) + sprockets (~> 4.0) + stimulus-rails + turbo-rails + spree_gateway (3.11.1) + spree_core (>= 3.7) + spree_extension + spree_i18n (5.3.0) + i18n_data + kaminari-i18n + rails-i18n + spree_core (>= 4.2.0.rc3) + spree_extension + spree_sample (4.8.3) + ffaker (~> 2.9) + spree_core (>= 4.8.3) + sprockets (4.2.1) + concurrent-ruby (~> 1.0) + rack (>= 2.2.4, < 4) + sprockets-rails (3.5.1) + actionpack (>= 6.1) + activesupport (>= 6.1) + sprockets (>= 3.0.0) + state_machines (0.6.0) + state_machines-activemodel (0.9.0) + activemodel (>= 6.0) + state_machines (>= 0.6.0) + state_machines-activerecord (0.9.0) + activerecord (>= 6.0) + state_machines-activemodel (>= 0.9.0) + stimulus-rails (1.3.3) + railties (>= 6.0.0) + stringex (2.8.6) + stringio (3.1.1) + strscan (3.1.0) + thor (1.3.1) + tilt (2.3.0) + timeout (0.4.1) + tinymce-rails (5.10.9) + railties (>= 3.1.1) + turbo-rails (2.0.5) + actionpack (>= 6.0.0) + activejob (>= 6.0.0) + railties (>= 6.0.0) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + validates_zipcode (0.5.2) + activemodel (>= 4.2.0) + warden (1.2.9) + rack (>= 2.0.9) + web-console (4.2.1) + actionview (>= 6.0.0) + activemodel (>= 6.0.0) + bindex (>= 0.4.0) + railties (>= 6.0.0) + webrick (1.8.1) + websocket (1.2.10) + websocket-driver (0.7.6) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) + xpath (3.2.0) + nokogiri (~> 1.8) + zeitwerk (2.6.16) + +PLATFORMS + aarch64-linux + arm-linux + arm64-darwin + x86-linux + x86_64-darwin + x86_64-linux + +DEPENDENCIES + bootsnap + capybara + debug + image_processing (~> 1.2) + importmap-rails + jbuilder + mission_control-jobs + pg (~> 1.1) + puma (>= 5.0) + rails (~> 7.1.3, >= 7.1.3.4) + redis (>= 4.0.1) + sassc! + selenium-webdriver + solid_cache + solid_queue (>= 0.3.2) + spree + spree_auth_devise + spree_backend + spree_emails + spree_frontend + spree_gateway + spree_i18n + spree_sample + sprockets-rails + stimulus-rails + turbo-rails + tzinfo-data + web-console + +RUBY VERSION + ruby 3.3.0p0 + +BUNDLED WITH + 2.5.3 diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..65ed922 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,26 @@ +Copyright (c) 2015-2024 Spark Solutions Sp. z o.o., Vendo Connect Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name Spree nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..651405b --- /dev/null +++ b/Procfile @@ -0,0 +1,4 @@ +release: bin/rails db:migrate +web: bundle exec puma -C config/puma.rb +worker: bin/rake solid_queue:start +cache: bin/rails cache:clear diff --git a/README.md b/README.md new file mode 100644 index 0000000..dd1e962 --- /dev/null +++ b/README.md @@ -0,0 +1,79 @@ +# Spree Starter + +This is a starter kit for [Spree Commerce](https://spreecommerce.org) - the open-source e-commerce platform for Rails. It is a great starting point for any Rails developer to quickly build an e-commerce store. + +This starter uses: + +* Spree Commerce 4.8 which includes Admin Dashboard, API and Storefront +* Ruby 3.3 and Ruby on Rails 7.1 +* Solid Queue with Mission Control UI (access only to Spree admins) for background jobs +* Solid Cache for excellent caching and performance + +You don't need to install any additional tools or libraries to start developing with Spree Starter. Everything is already set up for you. + +## Installation + +Make sure you have the following installed: +* Docker with Docker Compose - [installation instructions](https://docs.docker.com/get-docker/) +* Ruby 3.3 - [installation instructions](https://www.ruby-lang.org/en/documentation/installation/) +* Vips - [installation instructions](https://libvips.github.io/libvips/install.html) + +```bash +bin/setup +``` + +If you want to use sample data (products, categories), you can load it using the following command: + +```bash +bin/rake spree_sample:load +``` + +### Switching to MySQL + +By default, Spree Starter uses PostgreSQL. If you want to switch to MySQL, you can do so by running the following command: + +```bash +bin/rails db:system:change --to=mysql +``` + +You will also need to run `bin/setup` again to install the MySQL adapter and create the database. + +### Launch local server + +```bash +bin/rails s +``` + +## Deployment + +### Using Render + + + Deploy to Render + + +Note that sample data does not automatically get loaded when deploying to Render with the default configuration. In order to add sample data, run the following commands in the web service shell: + +```bash +bin/rake spree_sample:load +``` + +### Using Heroku + +[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy) + +### Other platforms + +Spree Starter is a standard Rails application, so you can deploy it to any platform that supports Ruby on Rails applications. You can also use Docker to deploy it to any container-based platform. Please check [Spree Guides](https://guides.spreecommerce.org/developer/deployment.html) for more information. + +## Troubleshooting + +### libvips error + +If you encounter an error like the following: + +```bash +LoadError: Could not open library 'vips.so.42' +``` + +Please check that libvips is installed with `vips -v`, and if it is not installed, follow [installation instructions here](https://www.libvips.org/install.html). diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..9a5ea73 --- /dev/null +++ b/Rakefile @@ -0,0 +1,6 @@ +# Add your own tasks in files placed in lib/tasks ending in .rake, +# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. + +require_relative "config/application" + +Rails.application.load_tasks diff --git a/app.json b/app.json new file mode 100644 index 0000000..1b0de2d --- /dev/null +++ b/app.json @@ -0,0 +1,45 @@ +{ + "name": "Spree Commerce Demo", + "description": "Spree is a is a open-source e-commerce platform for Rails. It is a great starting point for any Rails developer to quickly build an e-commerce store.", + "keywords": [ + "spree commerce", + "spree", + "e-commerce", + "global commerce" + ], + "logo": "https://spreecommerce.org/wp-content/uploads/2019/09/spree-60x60@2x.png", + "website": "https://spreecommerce.org", + "repository": "https://github.com/spree/spree_starter", + "env": { + "ADMIN_EMAIL": { + "description": "We will create an admin user with this email.", + "value": "spree@example.com" + }, + "ADMIN_PASSWORD": { + "description": "We will create an admin user with this password.", + "value": "spree123" + }, + "SECRET_KEY_BASE": { + "description": "A secret key for verifying the integrity of signed cookies.", + "generator": "secret" + } + }, + "formation": { + "web": { + "quantity": 1, + "size": "standard-2x" + } + }, + "scripts": { + "postdeploy": "bundle exec rails db:seed" + }, + "addons": [ + "heroku-postgresql", + "heroku-redis" + ], + "buildpacks": [ + { + "url": "heroku/ruby" + } + ] +} diff --git a/app/assets/config/manifest.js b/app/assets/config/manifest.js new file mode 100644 index 0000000..ddd546a --- /dev/null +++ b/app/assets/config/manifest.js @@ -0,0 +1,4 @@ +//= link_tree ../images +//= link_directory ../stylesheets .css +//= link_tree ../../javascript .js +//= link_tree ../../../vendor/javascript .js diff --git a/app/assets/images/.keep b/app/assets/images/.keep new file mode 100644 index 0000000..e69de29 diff --git a/app/assets/images/homepage/products.jpg b/app/assets/images/homepage/products.jpg new file mode 100644 index 0000000..12f3f04 Binary files /dev/null and b/app/assets/images/homepage/products.jpg differ diff --git a/app/assets/images/noimage/large.png b/app/assets/images/noimage/large.png new file mode 100644 index 0000000..246d3d1 Binary files /dev/null and b/app/assets/images/noimage/large.png differ diff --git a/app/assets/images/noimage/mini.png b/app/assets/images/noimage/mini.png new file mode 100644 index 0000000..c91b4de Binary files /dev/null and b/app/assets/images/noimage/mini.png differ diff --git a/app/assets/images/noimage/plp.png b/app/assets/images/noimage/plp.png new file mode 100644 index 0000000..a5fa866 Binary files /dev/null and b/app/assets/images/noimage/plp.png differ diff --git a/app/assets/images/noimage/plp.svg b/app/assets/images/noimage/plp.svg new file mode 100644 index 0000000..838ba6d --- /dev/null +++ b/app/assets/images/noimage/plp.svg @@ -0,0 +1,16 @@ + + + + + + + + NO IMAGE + AVAILABLE + + + diff --git a/app/assets/images/noimage/product.png b/app/assets/images/noimage/product.png new file mode 100644 index 0000000..246d3d1 Binary files /dev/null and b/app/assets/images/noimage/product.png differ diff --git a/app/assets/images/noimage/small.png b/app/assets/images/noimage/small.png new file mode 100644 index 0000000..0407e9f Binary files /dev/null and b/app/assets/images/noimage/small.png differ diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css new file mode 100644 index 0000000..288b9ab --- /dev/null +++ b/app/assets/stylesheets/application.css @@ -0,0 +1,15 @@ +/* + * This is a manifest file that'll be compiled into application.css, which will include all the files + * listed below. + * + * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's + * vendor/assets/stylesheets directory can be referenced here using a relative path. + * + * You're free to add application-wide styles to this file and they'll appear at the bottom of the + * compiled file so the styles you add here take precedence over styles defined in any other CSS + * files in this directory. Styles in this file should be added after the last require_* statement. + * It is generally better to create a new file per style scope. + * + *= require_tree . + *= require_self + */ diff --git a/app/assets/stylesheets/spree/frontend/variables/variables.scss b/app/assets/stylesheets/spree/frontend/variables/variables.scss new file mode 100644 index 0000000..be26a98 --- /dev/null +++ b/app/assets/stylesheets/spree/frontend/variables/variables.scss @@ -0,0 +1,88 @@ +// main spree variables +$primary-color: #000; +$secondary-color: #4c4c4c; +$primary-background: #ffffff; +$secondary-background: #f2f2f2; +$input-background: #ffffff; +$font-color: black; +$font-family: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif !default; +$header-font-color: $font-color; +$header-background: $primary-background; +$meganav-font-color: $font-color; +$meganav-background: $primary-background; +$footer-font-color: $font-color; +$footer-background: $primary-background; +$secondary-font-color: $font-color; +$global-border-style: #e2e2e2; +$second-global-border: #e2e2e2; +$spree-header-max-width: 1440px; +$spree-header-mobile-height: 50px; +$spree-header-tablet-height: 50px; +$spree-header-desktop-height: 50px; + +// bootstrap overrides +$grid-gutter-width: 1rem; +$body-color: $font-color; +$theme-colors: ( + // standard bootstrap colors + "primary": $primary-color, + "secondary": $secondary-color, + "danger": #f53737, + "info": #999999, + "warning": #ffc107, + "light-secondary": #999999, + "borders": $second-global-border, + "dark-borders": $global-border-style, + "light-background": $primary-background, + "dark-text": $font-color, + "overlay": rgba(76, 76, 76, 0.5), + "shadow": rgba(0, 0, 0, 0.16) +); + +$enable-responsive-font-sizes: true; +$font-size-base: 0.813rem !default; +$font-size-plus: 0.875rem !default; +$font-size-sm: 0.75rem !default; +$font-size-lg: 1rem !default; + +$border-radius: 0.5rem !default; +$border-radius-sm: 0.4rem !default; +$border-radius-lg: 0.75rem !default; + +$dropdown-item-padding-y: .5rem !default; +$dropdown-item-padding-x: 1rem !default; + +$input-btn-padding-y: .7rem !default; +$input-btn-padding-x: .75rem !default; + +$font-family-sans-serif: $font-family; +$font-weight-medium: 500; +.font-weight-medium { + font-weight: $font-weight-medium; +} +$btn-border-width: 2px; +$modal-dialog-margin: 0; +$grid-breakpoints: ( + xs: 0, + sm: 576px, + md: 768px, + lg: 992px, + xl: 1200px +); +$container-max-widths: ( + sm: 768px, + md: 992px, + lg: 1200px +); + +// helper variables +$container-padding: $grid-gutter-width / 2; +$photo-width-to-height-ratio: 30001/ 37500; +$photo-width-to-height-ratio-zoom: 28015 / 37500; +$thumbnails-carousel-single-height: 100% / $photo-width-to-height-ratio; +$thumbnails-carousel-single-height-zoom: 100% / + $photo-width-to-height-ratio-zoom; +$zoom-height-breakpoint: calc( + 650px / #{$photo-width-to-height-ratio-zoom} + 102px * 2 +); +$spree-plp-filter-desktop-position: $spree-header-desktop-height + 77px; diff --git a/app/channels/application_cable/channel.rb b/app/channels/application_cable/channel.rb new file mode 100644 index 0000000..d672697 --- /dev/null +++ b/app/channels/application_cable/channel.rb @@ -0,0 +1,4 @@ +module ApplicationCable + class Channel < ActionCable::Channel::Base + end +end diff --git a/app/channels/application_cable/connection.rb b/app/channels/application_cable/connection.rb new file mode 100644 index 0000000..0ff5442 --- /dev/null +++ b/app/channels/application_cable/connection.rb @@ -0,0 +1,4 @@ +module ApplicationCable + class Connection < ActionCable::Connection::Base + end +end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb new file mode 100644 index 0000000..09705d1 --- /dev/null +++ b/app/controllers/application_controller.rb @@ -0,0 +1,2 @@ +class ApplicationController < ActionController::Base +end diff --git a/app/controllers/concerns/.keep b/app/controllers/concerns/.keep new file mode 100644 index 0000000..e69de29 diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb new file mode 100644 index 0000000..de6be79 --- /dev/null +++ b/app/helpers/application_helper.rb @@ -0,0 +1,2 @@ +module ApplicationHelper +end diff --git a/app/javascript/application.js b/app/javascript/application.js new file mode 100644 index 0000000..d33bbbc --- /dev/null +++ b/app/javascript/application.js @@ -0,0 +1,4 @@ +// Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails +import "@hotwired/turbo-rails" +import "controllers" +import "@rails/request.js" diff --git a/app/javascript/controllers/application.js b/app/javascript/controllers/application.js new file mode 100644 index 0000000..1213e85 --- /dev/null +++ b/app/javascript/controllers/application.js @@ -0,0 +1,9 @@ +import { Application } from "@hotwired/stimulus" + +const application = Application.start() + +// Configure Stimulus development experience +application.debug = false +window.Stimulus = application + +export { application } diff --git a/app/javascript/controllers/hello_controller.js b/app/javascript/controllers/hello_controller.js new file mode 100644 index 0000000..5975c07 --- /dev/null +++ b/app/javascript/controllers/hello_controller.js @@ -0,0 +1,7 @@ +import { Controller } from "@hotwired/stimulus" + +export default class extends Controller { + connect() { + this.element.textContent = "Hello World!" + } +} diff --git a/app/javascript/controllers/index.js b/app/javascript/controllers/index.js new file mode 100644 index 0000000..54ad4ca --- /dev/null +++ b/app/javascript/controllers/index.js @@ -0,0 +1,11 @@ +// Import and register all your controllers from the importmap under controllers/* + +import { application } from "controllers/application" + +// Eager load all controllers defined in the import map under controllers/**/*_controller +import { eagerLoadControllersFrom } from "@hotwired/stimulus-loading" +eagerLoadControllersFrom("controllers", application) + +// Lazy load controllers as they appear in the DOM (remember not to preload controllers in import map!) +// import { lazyLoadControllersFrom } from "@hotwired/stimulus-loading" +// lazyLoadControllersFrom("controllers", application) diff --git a/app/jobs/application_job.rb b/app/jobs/application_job.rb new file mode 100644 index 0000000..d394c3d --- /dev/null +++ b/app/jobs/application_job.rb @@ -0,0 +1,7 @@ +class ApplicationJob < ActiveJob::Base + # Automatically retry jobs that encountered a deadlock + # retry_on ActiveRecord::Deadlocked + + # Most jobs are safe to ignore if the underlying records are no longer available + # discard_on ActiveJob::DeserializationError +end diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb new file mode 100644 index 0000000..3c34c81 --- /dev/null +++ b/app/mailers/application_mailer.rb @@ -0,0 +1,4 @@ +class ApplicationMailer < ActionMailer::Base + default from: "from@example.com" + layout "mailer" +end diff --git a/app/models/application_record.rb b/app/models/application_record.rb new file mode 100644 index 0000000..b63caeb --- /dev/null +++ b/app/models/application_record.rb @@ -0,0 +1,3 @@ +class ApplicationRecord < ActiveRecord::Base + primary_abstract_class +end diff --git a/app/models/concerns/.keep b/app/models/concerns/.keep new file mode 100644 index 0000000..e69de29 diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb new file mode 100644 index 0000000..9c7396e --- /dev/null +++ b/app/views/layouts/application.html.erb @@ -0,0 +1,16 @@ + + + + SpreeStarter + + <%= csrf_meta_tags %> + <%= csp_meta_tag %> + + <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %> + <%= javascript_importmap_tags %> + + + + <%= yield %> + + diff --git a/app/views/layouts/mailer.html.erb b/app/views/layouts/mailer.html.erb new file mode 100644 index 0000000..3aac900 --- /dev/null +++ b/app/views/layouts/mailer.html.erb @@ -0,0 +1,13 @@ + + + + + + + + + <%= yield %> + + diff --git a/app/views/layouts/mailer.text.erb b/app/views/layouts/mailer.text.erb new file mode 100644 index 0000000..37f0bdd --- /dev/null +++ b/app/views/layouts/mailer.text.erb @@ -0,0 +1 @@ +<%= yield %> diff --git a/app/views/spree/home/index.html.erb b/app/views/spree/home/index.html.erb new file mode 100644 index 0000000..98b8255 --- /dev/null +++ b/app/views/spree/home/index.html.erb @@ -0,0 +1,22 @@ +<% if @homepage %> + <% @homepage.cms_sections.each do |section| %> + <%= build_section(section) %> + <% end %> +<% else %> +
+
+
+ +
+
+

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

+

<%= Spree.t('we_are_busy_updating', store_name: current_store.name) %>

+

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

+
+
+
+<% end %> + +<%= render "spree/shared/cms/pages/edit_mode", edit_mode: @edit_mode %> diff --git a/bin/bundle b/bin/bundle new file mode 100755 index 0000000..50da5fd --- /dev/null +++ b/bin/bundle @@ -0,0 +1,109 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'bundle' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "rubygems" + +m = Module.new do + module_function + + def invoked_as_script? + File.expand_path($0) == File.expand_path(__FILE__) + end + + def env_var_version + ENV["BUNDLER_VERSION"] + end + + def cli_arg_version + return unless invoked_as_script? # don't want to hijack other binstubs + return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update` + bundler_version = nil + update_index = nil + ARGV.each_with_index do |a, i| + if update_index && update_index.succ == i && a.match?(Gem::Version::ANCHORED_VERSION_PATTERN) + bundler_version = a + end + next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/ + bundler_version = $1 + update_index = i + end + bundler_version + end + + def gemfile + gemfile = ENV["BUNDLE_GEMFILE"] + return gemfile if gemfile && !gemfile.empty? + + File.expand_path("../Gemfile", __dir__) + end + + def lockfile + lockfile = + case File.basename(gemfile) + when "gems.rb" then gemfile.sub(/\.rb$/, ".locked") + else "#{gemfile}.lock" + end + File.expand_path(lockfile) + end + + def lockfile_version + return unless File.file?(lockfile) + lockfile_contents = File.read(lockfile) + return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/ + Regexp.last_match(1) + end + + def bundler_requirement + @bundler_requirement ||= + env_var_version || + cli_arg_version || + bundler_requirement_for(lockfile_version) + end + + def bundler_requirement_for(version) + return "#{Gem::Requirement.default}.a" unless version + + bundler_gem_version = Gem::Version.new(version) + + bundler_gem_version.approximate_recommendation + end + + def load_bundler! + ENV["BUNDLE_GEMFILE"] ||= gemfile + + activate_bundler + end + + def activate_bundler + gem_error = activation_error_handling do + gem "bundler", bundler_requirement + end + return if gem_error.nil? + require_error = activation_error_handling do + require "bundler/version" + end + return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION)) + warn "Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`" + exit 42 + end + + def activation_error_handling + yield + nil + rescue StandardError, LoadError => e + e + end +end + +m.load_bundler! + +if m.invoked_as_script? + load Gem.bin_path("bundler", "bundle") +end diff --git a/bin/docker-entrypoint b/bin/docker-entrypoint new file mode 100755 index 0000000..67ef493 --- /dev/null +++ b/bin/docker-entrypoint @@ -0,0 +1,8 @@ +#!/bin/bash -e + +# If running the rails server then create or migrate existing database +if [ "${1}" == "./bin/rails" ] && [ "${2}" == "server" ]; then + ./bin/rails db:prepare +fi + +exec "${@}" diff --git a/bin/importmap b/bin/importmap new file mode 100755 index 0000000..36502ab --- /dev/null +++ b/bin/importmap @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby + +require_relative "../config/application" +require "importmap/commands" diff --git a/bin/rails b/bin/rails new file mode 100755 index 0000000..efc0377 --- /dev/null +++ b/bin/rails @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +APP_PATH = File.expand_path("../config/application", __dir__) +require_relative "../config/boot" +require "rails/commands" diff --git a/bin/rake b/bin/rake new file mode 100755 index 0000000..4fbf10b --- /dev/null +++ b/bin/rake @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +require_relative "../config/boot" +require "rake" +Rake.application.run diff --git a/bin/render-build.sh b/bin/render-build.sh new file mode 100755 index 0000000..f857dce --- /dev/null +++ b/bin/render-build.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +# exit on error +set -o errexit + +bundle install +bundle exec rails assets:precompile +bundle exec rails assets:clean \ No newline at end of file diff --git a/bin/setup b/bin/setup new file mode 100755 index 0000000..5ab72a0 --- /dev/null +++ b/bin/setup @@ -0,0 +1,39 @@ +#!/usr/bin/env ruby +require "fileutils" + +# path to your application root. +APP_ROOT = File.expand_path("..", __dir__) + +def system!(*args) + system(*args, exception: true) +end + +FileUtils.chdir APP_ROOT do + # This script is a way to set up or update your development environment automatically. + # This script is idempotent, so that you can run it at any time and get an expectable outcome. + # Add necessary setup steps to this file. + + puts "== Setup PostgreSQL and Redis ==" + system! "docker-compose up -d" + + puts "== Installing dependencies ==" + system! "gem install bundler --conservative" + system("bundle check") || system!("bundle install") + + # puts "\n== Copying sample files ==" + # unless File.exist?("config/database.yml") + # FileUtils.cp "config/database.yml.sample", "config/database.yml" + # end + + puts "\n== Preparing database ==" + system! "bin/rails db:prepare" + + puts "\n== Seeding database ==" + system! "bin/rails db:seed" + + puts "\n== Removing old logs and tempfiles ==" + system! "bin/rails log:clear tmp:clear" + + puts "\n== Restarting application server ==" + system! "bin/rails restart" +end diff --git a/config.ru b/config.ru new file mode 100644 index 0000000..4a3c09a --- /dev/null +++ b/config.ru @@ -0,0 +1,6 @@ +# This file is used by Rack-based servers to start the application. + +require_relative "config/environment" + +run Rails.application +Rails.application.load_server diff --git a/config/application.rb b/config/application.rb new file mode 100644 index 0000000..c9056ab --- /dev/null +++ b/config/application.rb @@ -0,0 +1,41 @@ +require_relative "boot" + +require "rails/all" + +# Require the gems listed in Gemfile, including any gems +# you've limited to :test, :development, or :production. +Bundler.require(*Rails.groups) + +module SpreeStarter + class Application < Rails::Application + + config.to_prepare do + # Load application's model / class decorators + Dir.glob(File.join(File.dirname(__FILE__), "../app/**/*_decorator*.rb")) do |c| + Rails.configuration.cache_classes ? require(c) : load(c) + end + + # Load application's view overrides + Dir.glob(File.join(File.dirname(__FILE__), "../app/overrides/*.rb")) do |c| + Rails.configuration.cache_classes ? require(c) : load(c) + end + end + # Initialize configuration defaults for originally generated Rails version. + config.load_defaults 7.1 + + # Please, add to the `ignore` list any other `lib` subdirectories that do + # not contain `.rb` files, or that should not be reloaded or eager loaded. + # Common ones are `templates`, `generators`, or `middleware`, for example. + config.autoload_lib(ignore: %w(assets tasks)) + + # Configuration for the application, engines, and railties goes here. + # + # These settings can be overridden in specific environments using the files + # in config/environments, which are processed later. + # + # config.time_zone = "Central Time (US & Canada)" + # config.eager_load_paths << Rails.root.join("extras") + + config.mission_control.jobs.base_controller_class = "Spree::Admin::BaseController" + end +end diff --git a/config/boot.rb b/config/boot.rb new file mode 100644 index 0000000..988a5dd --- /dev/null +++ b/config/boot.rb @@ -0,0 +1,4 @@ +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +require "bundler/setup" # Set up gems listed in the Gemfile. +require "bootsnap/setup" # Speed up boot time by caching expensive operations. diff --git a/config/cable.yml b/config/cable.yml new file mode 100644 index 0000000..bdc46ef --- /dev/null +++ b/config/cable.yml @@ -0,0 +1,11 @@ +development: + adapter: redis + url: redis://localhost:6379/1 + +test: + adapter: test + +production: + adapter: redis + url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> + channel_prefix: spree_starter_production diff --git a/config/credentials.yml.enc b/config/credentials.yml.enc new file mode 100644 index 0000000..64ed890 --- /dev/null +++ b/config/credentials.yml.enc @@ -0,0 +1 @@ +hUjyWIkjWjJdHEUkVCQ93ilegoPre49potSmrsm6U1wevzy9FgOMpDvMnEZS+tIeRQsbzKHUfdq/fcJboPzslr2AFeVpB69nTfBQ8Q0uq/8Gw7aVXmNPA/IKw82hrNedwiA4NolJKuG68RJCa6l8cr/lsS1RVdzBJjfHoYPeqXb2au4xPP7pWxVIYinZzSmKUiW70bSHhLJ8un3GV4qTgtYSWOSzeSyWDt2tYMdyO75rkcjD1WhqBmh7mQXd56P7I5P3t9qn82kRdyOTohPMRxDQW91FO9MH0912wIo3ibfnTJhaxYrcs+wiQfnGpGpYxOjV44S3nJP2I4qqejZmlOCgNEGhhUk49WolPcQ2y3xEReyCgFrTjvtFCQrfILRIo7zzZLDJsi162bdy7RHkaKWZMqO/--f62r8rBg3vEmRGnQ--q4E/pF9uiHucdp1QJhjXDg== \ No newline at end of file diff --git a/config/database.yml b/config/database.yml new file mode 100644 index 0000000..37b792a --- /dev/null +++ b/config/database.yml @@ -0,0 +1,86 @@ +# PostgreSQL. Versions 9.3 and up are supported. +# +# Install the pg driver: +# gem install pg +# On macOS with Homebrew: +# gem install pg -- --with-pg-config=/usr/local/bin/pg_config +# On Windows: +# gem install pg +# Choose the win32 build. +# Install PostgreSQL and put its /bin directory on your path. +# +# Configure Using Gemfile +# gem "pg" +# +default: &default + adapter: postgresql + encoding: unicode + # For details on connection pooling, see Rails configuration guide + # https://guides.rubyonrails.org/configuring.html#database-pooling + pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> + +development: + <<: *default + database: spree_starter_development + host: localhost + username: postgres + + # The specified database role being used to connect to PostgreSQL. + # To create additional roles in PostgreSQL see `$ createuser --help`. + # When left blank, PostgreSQL will use the default role. This is + # the same name as the operating system user running Rails. + #username: spree_starter + + # The password associated with the PostgreSQL role (username). + #password: + + # Connect on a TCP socket. Omitted by default since the client uses a + # domain socket that doesn't need configuration. Windows does not have + # domain sockets, so uncomment these lines. + #host: localhost + + # The TCP port the server listens on. Defaults to 5432. + # If your server runs on a different port number, change accordingly. + #port: 5432 + + # Schema search path. The server defaults to $user,public + #schema_search_path: myapp,sharedapp,public + + # Minimum log levels, in increasing order: + # debug5, debug4, debug3, debug2, debug1, + # log, notice, warning, error, fatal, and panic + # Defaults to warning. + #min_messages: notice + +# Warning: The database defined as "test" will be erased and +# re-generated from your development database when you run "rake". +# Do not set this db to the same as development or production. +test: + <<: *default + database: spree_starter_test + host: localhost + username: postgres + +# As with config/credentials.yml, you never want to store sensitive information, +# like your database password, in your source code. If your source code is +# ever seen by anyone, they now have access to your database. +# +# Instead, provide the password or a full connection URL as an environment +# variable when you boot the app. For example: +# +# DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase" +# +# If the connection URL is provided in the special DATABASE_URL environment +# variable, Rails will automatically merge its configuration values on top of +# the values provided in this file. Alternatively, you can specify a connection +# URL environment variable explicitly: +# +# production: +# url: <%= ENV["MY_APP_DATABASE_URL"] %> +# +# Read https://guides.rubyonrails.org/configuring.html#configuring-a-database +# for a full overview on how database connection configuration can be specified. +# +production: + <<: *default + url: <%= ENV["DATABASE_URL"] %> diff --git a/config/environment.rb b/config/environment.rb new file mode 100644 index 0000000..cac5315 --- /dev/null +++ b/config/environment.rb @@ -0,0 +1,5 @@ +# Load the Rails application. +require_relative "application" + +# Initialize the Rails application. +Rails.application.initialize! diff --git a/config/environments/development.rb b/config/environments/development.rb new file mode 100644 index 0000000..cd1f9f6 --- /dev/null +++ b/config/environments/development.rb @@ -0,0 +1,76 @@ +require "active_support/core_ext/integer/time" + +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # In the development environment your application's code is reloaded any time + # it changes. 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.enable_reloading = true + + # Do not eager load code on boot. + config.eager_load = false + + # Show full error reports. + config.consider_all_requests_local = true + + # Enable server timing + config.server_timing = true + + # Enable/disable caching. By default caching is disabled. + # Run rails dev:cache to toggle caching. + if Rails.root.join("tmp/caching-dev.txt").exist? + config.action_controller.perform_caching = true + config.action_controller.enable_fragment_cache_logging = true + + config.cache_store = :solid_cache_store + config.public_file_server.headers = { + "Cache-Control" => "public, max-age=#{2.days.to_i}" + } + else + config.action_controller.perform_caching = false + + config.cache_store = :null_store + end + + # Store uploaded files on the local file system (see config/storage.yml for options). + config.active_storage.service = :local + + # Don't care if the mailer can't send. + config.action_mailer.raise_delivery_errors = false + + config.action_mailer.perform_caching = false + + # Print deprecation notices to the Rails logger. + config.active_support.deprecation = :log + + # Raise exceptions for disallowed deprecations. + config.active_support.disallowed_deprecation = :raise + + # Tell Active Support which deprecation messages to disallow. + config.active_support.disallowed_deprecation_warnings = [] + + # Raise an error on page load if there are pending migrations. + config.active_record.migration_error = :page_load + + # Highlight code that triggered database queries in logs. + config.active_record.verbose_query_logs = true + + # Highlight code that enqueued background job in logs. + config.active_job.verbose_enqueue_logs = true + + # Suppress logger output for asset requests. + config.assets.quiet = true + + # Raises error for missing translations. + # config.i18n.raise_on_missing_translations = true + + # Annotate rendered view with file names. + # config.action_view.annotate_rendered_view_with_filenames = true + + # Uncomment if you wish to allow Action Cable access from any origin. + # config.action_cable.disable_request_forgery_protection = true + + # Raise error when a before_action's only/except options reference missing actions + config.action_controller.raise_on_missing_callback_actions = true +end diff --git a/config/environments/production.rb b/config/environments/production.rb new file mode 100644 index 0000000..7e44492 --- /dev/null +++ b/config/environments/production.rb @@ -0,0 +1,97 @@ +require "active_support/core_ext/integer/time" + +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # Code is not reloaded between requests. + config.enable_reloading = false + + # Eager load code on boot. This eager loads most of Rails and + # your application in memory, allowing both threaded web servers + # and those relying on copy on write to perform better. + # Rake tasks automatically ignore this option for performance. + config.eager_load = true + + # Full error reports are disabled and caching is turned on. + config.consider_all_requests_local = false + config.action_controller.perform_caching = true + + # Ensures that a master key has been made available in ENV["RAILS_MASTER_KEY"], config/master.key, or an environment + # key such as config/credentials/production.key. This key is used to decrypt credentials (and other encrypted files). + # config.require_master_key = true + + # Disable serving static files from `public/`, relying on NGINX/Apache to do so instead. + # config.public_file_server.enabled = false + + # Compress CSS using a preprocessor. + # config.assets.css_compressor = :sass + + # Do not fall back to assets pipeline if a precompiled asset is missed. + config.assets.compile = false + + # Enable serving of images, stylesheets, and JavaScripts from an asset server. + # config.asset_host = "http://assets.example.com" + + # Specifies the header that your server uses for sending files. + # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache + # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX + + # Store uploaded files on the local file system (see config/storage.yml for options). + config.active_storage.service = :local + + # Mount Action Cable outside main process or domain. + # config.action_cable.mount_path = nil + # config.action_cable.url = "wss://example.com/cable" + # config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ] + + # Assume all access to the app is happening through a SSL-terminating reverse proxy. + # Can be used together with config.force_ssl for Strict-Transport-Security and secure cookies. + # config.assume_ssl = true + + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. + config.force_ssl = true + + # Log to STDOUT by default + config.logger = ActiveSupport::Logger.new(STDOUT) + .tap { |logger| logger.formatter = ::Logger::Formatter.new } + .then { |logger| ActiveSupport::TaggedLogging.new(logger) } + + # Prepend all log lines with the following tags. + config.log_tags = [ :request_id ] + + # "info" includes generic and useful information about system operation, but avoids logging too much + # information to avoid inadvertent exposure of personally identifiable information (PII). If you + # want to log everything, set the level to "debug". + config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info") + + # Use a different cache store in production. + config.cache_store = :solid_cache_store + + # Use a real queuing backend for Active Job (and separate queues per environment). + config.active_job.queue_adapter = :solid_queue + # config.active_job.queue_name_prefix = "spree_starter_production" + + config.action_mailer.perform_caching = false + + # Ignore bad email addresses and do not raise email delivery errors. + # Set this to true and configure the email server for immediate delivery to raise delivery errors. + # config.action_mailer.raise_delivery_errors = false + + # Enable locale fallbacks for I18n (makes lookups for any locale fall back to + # the I18n.default_locale when a translation cannot be found). + config.i18n.fallbacks = true + + # Don't log any deprecations. + config.active_support.report_deprecations = false + + # Do not dump schema after migrations. + config.active_record.dump_schema_after_migration = false + + # Enable DNS rebinding protection and other `Host` header attacks. + # config.hosts = [ + # "example.com", # Allow requests from example.com + # /.*\.example\.com/ # Allow requests from subdomains like `www.example.com` + # ] + # Skip DNS rebinding protection for the default health check endpoint. + # config.host_authorization = { exclude: ->(request) { request.path == "/up" } } +end diff --git a/config/environments/test.rb b/config/environments/test.rb new file mode 100644 index 0000000..adbb4a6 --- /dev/null +++ b/config/environments/test.rb @@ -0,0 +1,64 @@ +require "active_support/core_ext/integer/time" + +# 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! + +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # While tests run files are not watched, reloading is not necessary. + config.enable_reloading = false + + # Eager loading loads your entire application. When running a single test locally, + # this is usually not necessary, and can slow down your test suite. However, it's + # recommended that you enable it in continuous integration systems to ensure eager + # loading is working properly before deploying your code. + config.eager_load = ENV["CI"].present? + + # Configure public file server for tests with Cache-Control for performance. + config.public_file_server.enabled = true + config.public_file_server.headers = { + "Cache-Control" => "public, max-age=#{1.hour.to_i}" + } + + # Show full error reports and disable caching. + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + config.cache_store = :null_store + + # Render exception templates for rescuable exceptions and raise for other exceptions. + config.action_dispatch.show_exceptions = :rescuable + + # Disable request forgery protection in test environment. + config.action_controller.allow_forgery_protection = false + + # Store uploaded files on the local file system in a temporary directory. + config.active_storage.service = :test + + config.action_mailer.perform_caching = false + + # Tell Action Mailer not to deliver emails to the real world. + # The :test delivery method accumulates sent emails in the + # ActionMailer::Base.deliveries array. + config.action_mailer.delivery_method = :test + + # Print deprecation notices to the stderr. + config.active_support.deprecation = :stderr + + # Raise exceptions for disallowed deprecations. + config.active_support.disallowed_deprecation = :raise + + # Tell Active Support which deprecation messages to disallow. + config.active_support.disallowed_deprecation_warnings = [] + + # Raises error for missing translations. + # config.i18n.raise_on_missing_translations = true + + # Annotate rendered view with file names. + # config.action_view.annotate_rendered_view_with_filenames = true + + # Raise error when a before_action's only/except options reference missing actions + config.action_controller.raise_on_missing_callback_actions = true +end diff --git a/config/importmap.rb b/config/importmap.rb new file mode 100644 index 0000000..909dfc5 --- /dev/null +++ b/config/importmap.rb @@ -0,0 +1,7 @@ +# Pin npm packages by running ./bin/importmap + +pin "application" +pin "@hotwired/turbo-rails", to: "turbo.min.js" +pin "@hotwired/stimulus", to: "stimulus.min.js" +pin "@hotwired/stimulus-loading", to: "stimulus-loading.js" +pin_all_from "app/javascript/controllers", under: "controllers" diff --git a/config/initializers/active_storage.rb b/config/initializers/active_storage.rb new file mode 100644 index 0000000..ed34f86 --- /dev/null +++ b/config/initializers/active_storage.rb @@ -0,0 +1,2 @@ +Rails.application.config.active_storage.resolve_model_to_route = :rails_storage_proxy +Rails.application.config.active_storage.variant_processor = :vips diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb new file mode 100644 index 0000000..2eeef96 --- /dev/null +++ b/config/initializers/assets.rb @@ -0,0 +1,12 @@ +# Be sure to restart your server when you modify this file. + +# Version of your assets, change this if you want to expire all your assets. +Rails.application.config.assets.version = "1.0" + +# Add additional assets to the asset load path. +# Rails.application.config.assets.paths << Emoji.images_path + +# Precompile additional assets. +# application.js, application.css, and all non-JS/CSS in the app/assets +# folder are already added. +# Rails.application.config.assets.precompile += %w( admin.js admin.css ) diff --git a/config/initializers/content_security_policy.rb b/config/initializers/content_security_policy.rb new file mode 100644 index 0000000..b3076b3 --- /dev/null +++ b/config/initializers/content_security_policy.rb @@ -0,0 +1,25 @@ +# Be sure to restart your server when you modify this file. + +# Define an application-wide content security policy. +# See the Securing Rails Applications Guide for more information: +# https://guides.rubyonrails.org/security.html#content-security-policy-header + +# Rails.application.configure do +# config.content_security_policy do |policy| +# policy.default_src :self, :https +# policy.font_src :self, :https, :data +# policy.img_src :self, :https, :data +# policy.object_src :none +# policy.script_src :self, :https +# policy.style_src :self, :https +# # Specify URI for violation reports +# # policy.report_uri "/csp-violation-report-endpoint" +# end +# +# # Generate session nonces for permitted importmap, inline scripts, and inline styles. +# config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s } +# config.content_security_policy_nonce_directives = %w(script-src style-src) +# +# # Report violations without enforcing the policy. +# # config.content_security_policy_report_only = true +# end diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb new file mode 100644 index 0000000..16ed310 --- /dev/null +++ b/config/initializers/devise.rb @@ -0,0 +1 @@ +Devise.secret_key = Rails.application.credentials.secret_key_base diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb new file mode 100644 index 0000000..c2d89e2 --- /dev/null +++ b/config/initializers/filter_parameter_logging.rb @@ -0,0 +1,8 @@ +# Be sure to restart your server when you modify this file. + +# Configure parameters to be partially matched (e.g. passw matches password) and filtered from the log file. +# Use this to limit dissemination of sensitive information. +# See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors. +Rails.application.config.filter_parameters += [ + :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn +] diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb new file mode 100644 index 0000000..3860f65 --- /dev/null +++ b/config/initializers/inflections.rb @@ -0,0 +1,16 @@ +# Be sure to restart your server when you modify this file. + +# Add new inflection rules using the following format. Inflections +# are locale specific, and you may define rules for as many different +# locales as you wish. All of these examples are active by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.plural /^(ox)$/i, "\\1en" +# inflect.singular /^(ox)en/i, "\\1" +# inflect.irregular "person", "people" +# inflect.uncountable %w( fish sheep ) +# end + +# These inflection rules are supported but not enabled by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.acronym "RESTful" +# end diff --git a/config/initializers/permissions_policy.rb b/config/initializers/permissions_policy.rb new file mode 100644 index 0000000..7db3b95 --- /dev/null +++ b/config/initializers/permissions_policy.rb @@ -0,0 +1,13 @@ +# Be sure to restart your server when you modify this file. + +# Define an application-wide HTTP permissions policy. For further +# information see: https://developers.google.com/web/updates/2018/06/feature-policy + +# Rails.application.config.permissions_policy do |policy| +# policy.camera :none +# policy.gyroscope :none +# policy.microphone :none +# policy.usb :none +# policy.fullscreen :self +# policy.payment :self, "https://secure.example.com" +# end diff --git a/config/initializers/spree.rb b/config/initializers/spree.rb new file mode 100644 index 0000000..9ead1ec --- /dev/null +++ b/config/initializers/spree.rb @@ -0,0 +1,32 @@ +# Configure Spree Preferences +# +# Note: Initializing preferences available within the Admin will overwrite any changes that were made through the user interface when you restart. +# If you would like users to be able to update a setting with the Admin it should NOT be set here. +# +# Note: If a preference is set here it will be stored within the cache & database upon initialization. +# Just removing an entry from this initializer will not make the preference value go away. +# Instead you must either set a new value or remove entry, clear cache, and remove database entry. +# +# In order to initialize a setting do: +# config.setting_name = 'new value' + +Spree.config do |config| + # Example: + # Uncomment to stop tracking inventory levels in the application + config.track_inventory_levels = false +end + +# Configure Spree Dependencies +# +# Note: If a dependency is set here it will NOT be stored within the cache & database upon initialization. +# Just removing an entry from this initializer will make the dependency value go away. +# +Spree.dependencies do |dependencies| + # Example: + # Uncomment to change the default Service handling adding Items to Cart + # dependencies.cart_add_item_service = 'MyNewAwesomeService' +end + +# Spree::Api::Dependencies.storefront_cart_serializer = 'MyRailsApp::CartSerializer' + +Spree.user_class = "Spree::User" diff --git a/config/locales/en.yml b/config/locales/en.yml new file mode 100644 index 0000000..6c349ae --- /dev/null +++ b/config/locales/en.yml @@ -0,0 +1,31 @@ +# Files in the config/locales directory are used for internationalization and +# are automatically loaded by Rails. If you want to use locales other than +# English, add the necessary files in this directory. +# +# To use the locales, use `I18n.t`: +# +# I18n.t "hello" +# +# In views, this is aliased to just `t`: +# +# <%= t("hello") %> +# +# To use a different locale, set it with `I18n.locale`: +# +# I18n.locale = :es +# +# This would use the information in config/locales/es.yml. +# +# To learn more about the API, please read the Rails Internationalization guide +# at https://guides.rubyonrails.org/i18n.html. +# +# Be aware that YAML interprets the following case-insensitive strings as +# booleans: `true`, `false`, `on`, `off`, `yes`, `no`. Therefore, these strings +# must be quoted to be interpreted as strings. For example: +# +# en: +# "yes": yup +# enabled: "ON" + +en: + hello: "Hello world" diff --git a/config/puma.rb b/config/puma.rb new file mode 100644 index 0000000..afa809b --- /dev/null +++ b/config/puma.rb @@ -0,0 +1,35 @@ +# This configuration file will be evaluated by Puma. The top-level methods that +# are invoked here are part of Puma's configuration DSL. For more information +# about methods provided by the DSL, see https://puma.io/puma/Puma/DSL.html. + +# Puma can serve each request in a thread from an internal thread pool. +# The `threads` method setting takes two numbers: a minimum and maximum. +# Any libraries that use thread pools should be configured to match +# the maximum value specified for Puma. Default is set to 5 threads for minimum +# and maximum; this matches the default thread size of Active Record. +max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 } +min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count } +threads min_threads_count, max_threads_count + +# Specifies that the worker count should equal the number of processors in production. +if ENV["RAILS_ENV"] == "production" + require "concurrent-ruby" + worker_count = Integer(ENV.fetch("WEB_CONCURRENCY") { Concurrent.physical_processor_count }) + workers worker_count if worker_count > 1 +end + +# Specifies the `worker_timeout` threshold that Puma will use to wait before +# terminating a worker in development environments. +worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development" + +# Specifies the `port` that Puma will listen on to receive requests; default is 3000. +port ENV.fetch("PORT") { 3000 } + +# Specifies the `environment` that Puma will run in. +environment ENV.fetch("RAILS_ENV") { "development" } + +# Specifies the `pidfile` that Puma will use. +pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" } + +# Allow puma to be restarted by `bin/rails restart` command. +plugin :tmp_restart diff --git a/config/routes.rb b/config/routes.rb new file mode 100644 index 0000000..c6d66ff --- /dev/null +++ b/config/routes.rb @@ -0,0 +1,23 @@ +Rails.application.routes.draw do + # This line mounts Spree's routes at the root of your application. + # This means, any requests to URLs such as /products, will go to + # Spree::ProductsController. + # If you would like to change where this engine is mounted, simply change the + # :at option to something different. + # + # We ask that you don't use the :as option here, as Spree relies on it being + # the default of "spree". + mount Spree::Core::Engine, at: '/' + + # https://github.com/basecamp/mission_control-jobs?tab=readme-ov-file#basic-configuration + mount MissionControl::Jobs::Engine, at: "/jobs" + + # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html + + # Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500. + # Can be used by load balancers and uptime monitors to verify that the app is live. + get "up" => "rails/health#show", as: :rails_health_check + + # Defines the root path route ("/") + # root "posts#index" +end diff --git a/config/solid_queue.yml b/config/solid_queue.yml new file mode 100644 index 0000000..5a43735 --- /dev/null +++ b/config/solid_queue.yml @@ -0,0 +1,18 @@ +# default: &default +# dispatchers: +# - polling_interval: 1 +# batch_size: 500 +# workers: +# - queues: "*" +# threads: 5 +# processes: 1 +# polling_interval: 0.1 +# +# development: +# <<: *default +# +# test: +# <<: *default +# +# production: +# <<: *default diff --git a/config/storage.yml b/config/storage.yml new file mode 100644 index 0000000..4942ab6 --- /dev/null +++ b/config/storage.yml @@ -0,0 +1,34 @@ +test: + service: Disk + root: <%= Rails.root.join("tmp/storage") %> + +local: + service: Disk + root: <%= Rails.root.join("storage") %> + +# Use bin/rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key) +# amazon: +# service: S3 +# access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %> +# secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %> +# region: us-east-1 +# bucket: your_own_bucket-<%= Rails.env %> + +# Remember not to checkin your GCS keyfile to a repository +# google: +# service: GCS +# project: your_project +# credentials: <%= Rails.root.join("path/to/gcs.keyfile") %> +# bucket: your_own_bucket-<%= Rails.env %> + +# Use bin/rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key) +# microsoft: +# service: AzureStorage +# storage_account_name: your_account_name +# storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %> +# container: your_container_name-<%= Rails.env %> + +# mirror: +# service: Mirror +# primary: local +# mirrors: [ amazon, google, microsoft ] diff --git a/db/migrate/20240523142422_create_active_storage_tables.active_storage.rb b/db/migrate/20240523142422_create_active_storage_tables.active_storage.rb new file mode 100644 index 0000000..e4706aa --- /dev/null +++ b/db/migrate/20240523142422_create_active_storage_tables.active_storage.rb @@ -0,0 +1,57 @@ +# This migration comes from active_storage (originally 20170806125915) +class CreateActiveStorageTables < ActiveRecord::Migration[7.0] + def change + # Use Active Record's configured type for primary and foreign keys + primary_key_type, foreign_key_type = primary_and_foreign_key_types + + create_table :active_storage_blobs, id: primary_key_type do |t| + t.string :key, null: false + t.string :filename, null: false + t.string :content_type + t.text :metadata + t.string :service_name, null: false + t.bigint :byte_size, null: false + t.string :checksum + + if connection.supports_datetime_with_precision? + t.datetime :created_at, precision: 6, null: false + else + t.datetime :created_at, null: false + end + + t.index [ :key ], unique: true + end + + create_table :active_storage_attachments, id: primary_key_type do |t| + t.string :name, null: false + t.references :record, null: false, polymorphic: true, index: false, type: foreign_key_type + t.references :blob, null: false, type: foreign_key_type + + if connection.supports_datetime_with_precision? + t.datetime :created_at, precision: 6, null: false + else + t.datetime :created_at, null: false + end + + t.index [ :record_type, :record_id, :name, :blob_id ], name: :index_active_storage_attachments_uniqueness, unique: true + t.foreign_key :active_storage_blobs, column: :blob_id + end + + create_table :active_storage_variant_records, id: primary_key_type do |t| + t.belongs_to :blob, null: false, index: false, type: foreign_key_type + t.string :variation_digest, null: false + + t.index [ :blob_id, :variation_digest ], name: :index_active_storage_variant_records_uniqueness, unique: true + t.foreign_key :active_storage_blobs, column: :blob_id + end + end + + private + def primary_and_foreign_key_types + config = Rails.configuration.generators + setting = config.options[config.orm][:primary_key_type] + primary_key_type = setting || :primary_key + foreign_key_type = setting || :bigint + [primary_key_type, foreign_key_type] + end +end diff --git a/db/migrate/20240523142423_create_action_mailbox_tables.action_mailbox.rb b/db/migrate/20240523142423_create_action_mailbox_tables.action_mailbox.rb new file mode 100644 index 0000000..7b2b807 --- /dev/null +++ b/db/migrate/20240523142423_create_action_mailbox_tables.action_mailbox.rb @@ -0,0 +1,20 @@ +# This migration comes from action_mailbox (originally 20180917164000) +class CreateActionMailboxTables < ActiveRecord::Migration[6.0] + def change + create_table :action_mailbox_inbound_emails, id: primary_key_type do |t| + t.integer :status, default: 0, null: false + t.string :message_id, null: false + t.string :message_checksum, null: false + + t.timestamps + + t.index [ :message_id, :message_checksum ], name: "index_action_mailbox_inbound_emails_uniqueness", unique: true + end + end + + private + def primary_key_type + config = Rails.configuration.generators + config.options[config.orm][:primary_key_type] || :primary_key + end +end diff --git a/db/migrate/20240523142424_create_action_text_tables.action_text.rb b/db/migrate/20240523142424_create_action_text_tables.action_text.rb new file mode 100644 index 0000000..1be48d7 --- /dev/null +++ b/db/migrate/20240523142424_create_action_text_tables.action_text.rb @@ -0,0 +1,26 @@ +# This migration comes from action_text (originally 20180528164100) +class CreateActionTextTables < ActiveRecord::Migration[6.0] + def change + # Use Active Record's configured type for primary and foreign keys + primary_key_type, foreign_key_type = primary_and_foreign_key_types + + create_table :action_text_rich_texts, id: primary_key_type do |t| + t.string :name, null: false + t.text :body, size: :long + t.references :record, null: false, polymorphic: true, index: false, type: foreign_key_type + + t.timestamps + + t.index [ :record_type, :record_id, :name ], name: "index_action_text_rich_texts_uniqueness", unique: true + end + end + + private + def primary_and_foreign_key_types + config = Rails.configuration.generators + setting = config.options[config.orm][:primary_key_type] + primary_key_type = setting || :primary_key + foreign_key_type = setting || :bigint + [primary_key_type, foreign_key_type] + end +end diff --git a/db/migrate/20240523142425_create_solid_queue_tables.solid_queue.rb b/db/migrate/20240523142425_create_solid_queue_tables.solid_queue.rb new file mode 100644 index 0000000..6d8c4f6 --- /dev/null +++ b/db/migrate/20240523142425_create_solid_queue_tables.solid_queue.rb @@ -0,0 +1,101 @@ +# This migration comes from solid_queue (originally 20231211200639) +class CreateSolidQueueTables < ActiveRecord::Migration[7.0] + def change + create_table :solid_queue_jobs do |t| + t.string :queue_name, null: false + t.string :class_name, null: false, index: true + t.text :arguments + t.integer :priority, default: 0, null: false + t.string :active_job_id, index: true + t.datetime :scheduled_at + t.datetime :finished_at, index: true + t.string :concurrency_key + + t.timestamps + + t.index [ :queue_name, :finished_at ], name: "index_solid_queue_jobs_for_filtering" + t.index [ :scheduled_at, :finished_at ], name: "index_solid_queue_jobs_for_alerting" + end + + create_table :solid_queue_scheduled_executions do |t| + t.references :job, index: { unique: true }, null: false + t.string :queue_name, null: false + t.integer :priority, default: 0, null: false + t.datetime :scheduled_at, null: false + + t.datetime :created_at, null: false + + t.index [ :scheduled_at, :priority, :job_id ], name: "index_solid_queue_dispatch_all" + end + + create_table :solid_queue_ready_executions do |t| + t.references :job, index: { unique: true }, null: false + t.string :queue_name, null: false + t.integer :priority, default: 0, null: false + + t.datetime :created_at, null: false + + t.index [ :priority, :job_id ], name: "index_solid_queue_poll_all" + t.index [ :queue_name, :priority, :job_id ], name: "index_solid_queue_poll_by_queue" + end + + create_table :solid_queue_claimed_executions do |t| + t.references :job, index: { unique: true }, null: false + t.bigint :process_id + t.datetime :created_at, null: false + + t.index [ :process_id, :job_id ] + end + + create_table :solid_queue_blocked_executions do |t| + t.references :job, index: { unique: true }, null: false + t.string :queue_name, null: false + t.integer :priority, default: 0, null: false + t.string :concurrency_key, null: false + t.datetime :expires_at, null: false + + t.datetime :created_at, null: false + + t.index [ :expires_at, :concurrency_key ], name: "index_solid_queue_blocked_executions_for_maintenance" + end + + create_table :solid_queue_failed_executions do |t| + t.references :job, index: { unique: true }, null: false + t.text :error + t.datetime :created_at, null: false + end + + create_table :solid_queue_pauses do |t| + t.string :queue_name, null: false, index: { unique: true } + t.datetime :created_at, null: false + end + + create_table :solid_queue_processes do |t| + t.string :kind, null: false + t.datetime :last_heartbeat_at, null: false, index: true + t.bigint :supervisor_id, index: true + + t.integer :pid, null: false + t.string :hostname + t.text :metadata + + t.datetime :created_at, null: false + end + + create_table :solid_queue_semaphores do |t| + t.string :key, null: false, index: { unique: true } + t.integer :value, default: 1, null: false + t.datetime :expires_at, null: false, index: true + + t.timestamps + + t.index [ :key, :value ], name: "index_solid_queue_semaphores_on_key_and_value" + end + + add_foreign_key :solid_queue_blocked_executions, :solid_queue_jobs, column: :job_id, on_delete: :cascade + add_foreign_key :solid_queue_claimed_executions, :solid_queue_jobs, column: :job_id, on_delete: :cascade + add_foreign_key :solid_queue_failed_executions, :solid_queue_jobs, column: :job_id, on_delete: :cascade + add_foreign_key :solid_queue_ready_executions, :solid_queue_jobs, column: :job_id, on_delete: :cascade + add_foreign_key :solid_queue_scheduled_executions, :solid_queue_jobs, column: :job_id, on_delete: :cascade + end +end diff --git a/db/migrate/20240523142426_add_missing_index_to_blocked_executions.solid_queue.rb b/db/migrate/20240523142426_add_missing_index_to_blocked_executions.solid_queue.rb new file mode 100644 index 0000000..2d96b10 --- /dev/null +++ b/db/migrate/20240523142426_add_missing_index_to_blocked_executions.solid_queue.rb @@ -0,0 +1,6 @@ +# This migration comes from solid_queue (originally 20240110143450) +class AddMissingIndexToBlockedExecutions < ActiveRecord::Migration[7.1] + def change + add_index :solid_queue_blocked_executions, [ :concurrency_key, :priority, :job_id ], name: "index_solid_queue_blocked_executions_for_release" + end +end diff --git a/db/migrate/20240523142427_create_recurring_executions.solid_queue.rb b/db/migrate/20240523142427_create_recurring_executions.solid_queue.rb new file mode 100644 index 0000000..4c49821 --- /dev/null +++ b/db/migrate/20240523142427_create_recurring_executions.solid_queue.rb @@ -0,0 +1,15 @@ +# This migration comes from solid_queue (originally 20240218110712) +class CreateRecurringExecutions < ActiveRecord::Migration[7.1] + def change + create_table :solid_queue_recurring_executions do |t| + t.references :job, index: { unique: true }, null: false + t.string :task_key, null: false + t.datetime :run_at, null: false + t.datetime :created_at, null: false + + t.index [ :task_key, :run_at ], unique: true + end + + add_foreign_key :solid_queue_recurring_executions, :solid_queue_jobs, column: :job_id, on_delete: :cascade + end +end diff --git a/db/migrate/20240523142428_create_solid_cache_entries.solid_cache.rb b/db/migrate/20240523142428_create_solid_cache_entries.solid_cache.rb new file mode 100644 index 0000000..4ff1fbd --- /dev/null +++ b/db/migrate/20240523142428_create_solid_cache_entries.solid_cache.rb @@ -0,0 +1,12 @@ +# This migration comes from solid_cache (originally 20230724121448) +class CreateSolidCacheEntries < ActiveRecord::Migration[7.0] + def change + create_table :solid_cache_entries do |t| + t.binary :key, null: false, limit: 1024 + t.binary :value, null: false, limit: 512.megabytes + t.datetime :created_at, null: false + + t.index :key, unique: true + end + end +end diff --git a/db/migrate/20240523142429_add_key_hash_and_byte_size_to_solid_cache_entries.solid_cache.rb b/db/migrate/20240523142429_add_key_hash_and_byte_size_to_solid_cache_entries.solid_cache.rb new file mode 100644 index 0000000..b56e847 --- /dev/null +++ b/db/migrate/20240523142429_add_key_hash_and_byte_size_to_solid_cache_entries.solid_cache.rb @@ -0,0 +1,9 @@ +# This migration comes from solid_cache (originally 20240108155507) +class AddKeyHashAndByteSizeToSolidCacheEntries < ActiveRecord::Migration[7.0] + def change + change_table :solid_cache_entries do |t| + t.column :key_hash, :integer, null: true, limit: 8 + t.column :byte_size, :integer, null: true, limit: 4 + end + end +end diff --git a/db/migrate/20240523142430_add_key_hash_and_byte_size_indexes_and_null_constraints_to_solid_cache_entries.solid_cache.rb b/db/migrate/20240523142430_add_key_hash_and_byte_size_indexes_and_null_constraints_to_solid_cache_entries.solid_cache.rb new file mode 100644 index 0000000..eadfe43 --- /dev/null +++ b/db/migrate/20240523142430_add_key_hash_and_byte_size_indexes_and_null_constraints_to_solid_cache_entries.solid_cache.rb @@ -0,0 +1,12 @@ +# This migration comes from solid_cache (originally 20240110111600) +class AddKeyHashAndByteSizeIndexesAndNullConstraintsToSolidCacheEntries < ActiveRecord::Migration[7.0] + def change + change_table :solid_cache_entries, bulk: true do |t| + t.change_null :key_hash, false + t.change_null :byte_size, false + t.index :key_hash, unique: true + t.index [:key_hash, :byte_size] + t.index :byte_size + end + end +end diff --git a/db/migrate/20240523142431_remove_key_index_from_solid_cache_entries.solid_cache.rb b/db/migrate/20240523142431_remove_key_index_from_solid_cache_entries.solid_cache.rb new file mode 100644 index 0000000..72ee613 --- /dev/null +++ b/db/migrate/20240523142431_remove_key_index_from_solid_cache_entries.solid_cache.rb @@ -0,0 +1,8 @@ +# This migration comes from solid_cache (originally 20240110111702) +class RemoveKeyIndexFromSolidCacheEntries < ActiveRecord::Migration[7.0] + def change + change_table :solid_cache_entries do |t| + t.remove_index :key, unique: true + end + end +end diff --git a/db/migrate/20240523142432_spree_four_three.spree.rb b/db/migrate/20240523142432_spree_four_three.spree.rb new file mode 100644 index 0000000..629772c --- /dev/null +++ b/db/migrate/20240523142432_spree_four_three.spree.rb @@ -0,0 +1,1206 @@ +# This migration comes from spree (originally 20210914000000) +class SpreeFourThree < ActiveRecord::Migration[5.2] + def up + # This migration is just a compressed version of all the previous + # migrations for spree_core. Do not run it if one of the core tables + # already exists. Assume the best. + return if data_source_exists?(:spree_addresses) + + create_table "friendly_id_slugs", force: :cascade do |t| + t.string "slug", null: false + t.bigint "sluggable_id", null: false + t.string "sluggable_type", limit: 50 + t.string "scope" + t.datetime "created_at" + t.datetime "deleted_at" + t.index ["deleted_at"], name: "index_friendly_id_slugs_on_deleted_at" + t.index ["slug", "sluggable_type", "scope"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope", unique: true + t.index ["slug", "sluggable_type"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type" + t.index ["sluggable_id"], name: "index_friendly_id_slugs_on_sluggable_id" + t.index ["sluggable_type"], name: "index_friendly_id_slugs_on_sluggable_type" + end + + create_table "spree_addresses", force: :cascade do |t| + t.string "firstname" + t.string "lastname" + t.string "address1" + t.string "address2" + t.string "city" + t.string "zipcode" + t.string "phone" + t.string "state_name" + t.string "alternative_phone" + t.string "company" + t.bigint "state_id" + t.bigint "country_id" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.bigint "user_id" + t.datetime "deleted_at" + t.string "label" + t.index ["country_id"], name: "index_spree_addresses_on_country_id" + t.index ["deleted_at"], name: "index_spree_addresses_on_deleted_at" + t.index ["firstname"], name: "index_addresses_on_firstname" + t.index ["lastname"], name: "index_addresses_on_lastname" + t.index ["state_id"], name: "index_spree_addresses_on_state_id" + t.index ["user_id"], name: "index_spree_addresses_on_user_id" + end + + create_table "spree_adjustments", force: :cascade do |t| + t.string "source_type" + t.bigint "source_id" + t.string "adjustable_type" + t.bigint "adjustable_id" + t.decimal "amount", precision: 10, scale: 2 + t.string "label" + t.boolean "mandatory" + t.boolean "eligible", default: true + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.string "state" + t.bigint "order_id", null: false + t.boolean "included", default: false + t.index ["adjustable_id", "adjustable_type"], name: "index_spree_adjustments_on_adjustable_id_and_adjustable_type" + t.index ["eligible"], name: "index_spree_adjustments_on_eligible" + t.index ["order_id"], name: "index_spree_adjustments_on_order_id" + t.index ["source_id", "source_type"], name: "index_spree_adjustments_on_source_id_and_source_type" + end + + create_table "spree_assets", force: :cascade do |t| + t.string "viewable_type" + t.bigint "viewable_id" + t.integer "attachment_width" + t.integer "attachment_height" + t.integer "attachment_file_size" + t.integer "position" + t.string "attachment_content_type" + t.string "attachment_file_name" + t.string "type", limit: 75 + t.datetime "attachment_updated_at" + t.text "alt" + t.datetime "created_at" + t.datetime "updated_at" + t.index ["position"], name: "index_spree_assets_on_position" + t.index ["viewable_id"], name: "index_assets_on_viewable_id" + t.index ["viewable_type", "type"], name: "index_assets_on_viewable_type_and_type" + end + + create_table "spree_calculators", force: :cascade do |t| + t.string "type" + t.string "calculable_type" + t.bigint "calculable_id" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.text "preferences" + t.datetime "deleted_at" + t.index ["calculable_id", "calculable_type"], name: "index_spree_calculators_on_calculable_id_and_calculable_type" + t.index ["deleted_at"], name: "index_spree_calculators_on_deleted_at" + t.index ["id", "type"], name: "index_spree_calculators_on_id_and_type" + end + + create_table "spree_cms_pages", force: :cascade do |t| + t.string "title", null: false + t.string "meta_title" + t.text "content" + t.text "meta_description" + t.boolean "visible", default: true + t.string "slug" + t.string "type" + t.string "locale" + t.datetime "deleted_at" + t.bigint "store_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["deleted_at"], name: "index_spree_cms_pages_on_deleted_at" + t.index ["slug", "store_id", "deleted_at"], name: "index_spree_cms_pages_on_slug_and_store_id_and_deleted_at" + t.index ["slug", "store_id"], name: "index_spree_cms_pages_on_slug_and_store_id", unique: true + t.index ["store_id", "locale", "type"], name: "index_spree_cms_pages_on_store_id_and_locale_and_type" + t.index ["store_id"], name: "index_spree_cms_pages_on_store_id" + t.index ["title", "type", "store_id"], name: "index_spree_cms_pages_on_title_and_type_and_store_id" + t.index ["visible"], name: "index_spree_cms_pages_on_visible" + end + + create_table "spree_cms_sections", force: :cascade do |t| + t.string "name", null: false + t.text "content" + t.text "settings" + t.string "fit" + t.string "destination" + t.string "type" + t.integer "position" + t.string "linked_resource_type" + t.bigint "linked_resource_id" + t.bigint "cms_page_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["cms_page_id"], name: "index_spree_cms_sections_on_cms_page_id" + t.index ["linked_resource_type", "linked_resource_id"], name: "index_spree_cms_sections_on_linked_resource" + t.index ["position"], name: "index_spree_cms_sections_on_position" + t.index ["type"], name: "index_spree_cms_sections_on_type" + end + + create_table "spree_countries", force: :cascade do |t| + t.string "iso_name" + t.string "iso", null: false + t.string "iso3", null: false + t.string "name" + t.integer "numcode" + t.boolean "states_required", default: false + t.datetime "updated_at" + t.boolean "zipcode_required", default: true + t.datetime "created_at" + t.index ["iso_name"], name: "index_spree_countries_on_iso_name", unique: true + t.index ["name"], name: "index_spree_countries_on_name", unique: true + t.index ["iso"], name: "index_spree_countries_on_iso", unique: true + t.index ["iso3"], name: "index_spree_countries_on_iso3", unique: true + end + + create_table "spree_credit_cards", force: :cascade do |t| + t.string "month" + t.string "year" + t.string "cc_type" + t.string "last_digits" + t.bigint "address_id" + t.string "gateway_customer_profile_id" + t.string "gateway_payment_profile_id" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.string "name" + t.bigint "user_id" + t.bigint "payment_method_id" + t.boolean "default", default: false, null: false + t.datetime "deleted_at" + t.index ["address_id"], name: "index_spree_credit_cards_on_address_id" + t.index ["deleted_at"], name: "index_spree_credit_cards_on_deleted_at" + t.index ["payment_method_id"], name: "index_spree_credit_cards_on_payment_method_id" + t.index ["user_id"], name: "index_spree_credit_cards_on_user_id" + end + + create_table "spree_customer_returns", force: :cascade do |t| + t.string "number" + t.bigint "stock_location_id" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.bigint "store_id" + t.index ["number"], name: "index_spree_customer_returns_on_number", unique: true + t.index ["stock_location_id"], name: "index_spree_customer_returns_on_stock_location_id" + t.index ["store_id"], name: "index_spree_customer_returns_on_store_id" + end + + create_table "spree_gateways", force: :cascade do |t| + t.string "type" + t.string "name" + t.text "description" + t.boolean "active", default: true + t.string "environment", default: "development" + t.string "server", default: "test" + t.boolean "test_mode", default: true + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.text "preferences" + t.index ["active"], name: "index_spree_gateways_on_active" + t.index ["test_mode"], name: "index_spree_gateways_on_test_mode" + end + + create_table "spree_inventory_units", force: :cascade do |t| + t.string "state" + t.bigint "variant_id" + t.bigint "order_id" + t.bigint "shipment_id" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.boolean "pending", default: true + t.bigint "line_item_id" + t.integer "quantity", default: 1 + t.bigint "original_return_item_id" + t.index ["line_item_id"], name: "index_spree_inventory_units_on_line_item_id" + t.index ["order_id"], name: "index_inventory_units_on_order_id" + t.index ["original_return_item_id"], name: "index_spree_inventory_units_on_original_return_item_id" + t.index ["shipment_id"], name: "index_inventory_units_on_shipment_id" + t.index ["variant_id"], name: "index_inventory_units_on_variant_id" + end + + create_table "spree_line_items", force: :cascade do |t| + t.bigint "variant_id" + t.bigint "order_id" + t.integer "quantity", null: false + t.decimal "price", precision: 10, scale: 2, null: false + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.string "currency" + t.decimal "cost_price", precision: 10, scale: 2 + t.bigint "tax_category_id" + t.decimal "adjustment_total", precision: 10, scale: 2, default: "0.0" + t.decimal "additional_tax_total", precision: 10, scale: 2, default: "0.0" + t.decimal "promo_total", precision: 10, scale: 2, default: "0.0" + t.decimal "included_tax_total", precision: 10, scale: 2, default: "0.0", null: false + t.decimal "pre_tax_amount", precision: 12, scale: 4, default: "0.0", null: false + t.decimal "taxable_adjustment_total", precision: 10, scale: 2, default: "0.0", null: false + t.decimal "non_taxable_adjustment_total", precision: 10, scale: 2, default: "0.0", null: false + t.index ["order_id"], name: "index_spree_line_items_on_order_id" + t.index ["tax_category_id"], name: "index_spree_line_items_on_tax_category_id" + t.index ["variant_id"], name: "index_spree_line_items_on_variant_id" + end + + create_table "spree_log_entries", force: :cascade do |t| + t.string "source_type" + t.bigint "source_id" + t.text "details" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.index ["source_id", "source_type"], name: "index_spree_log_entries_on_source_id_and_source_type" + end + + create_table "spree_menu_items", force: :cascade do |t| + t.string "name", null: false + t.string "subtitle" + t.string "destination" + t.boolean "new_window", default: false + t.string "item_type" + t.string "linked_resource_type", default: "URL" + t.bigint "linked_resource_id" + t.string "code" + t.bigint "parent_id" + t.bigint "lft", null: false + t.bigint "rgt", null: false + t.integer "depth", default: 0, null: false + t.bigint "menu_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["code"], name: "index_spree_menu_items_on_code" + t.index ["depth"], name: "index_spree_menu_items_on_depth" + t.index ["item_type"], name: "index_spree_menu_items_on_item_type" + t.index ["lft"], name: "index_spree_menu_items_on_lft" + t.index ["linked_resource_type", "linked_resource_id"], name: "index_spree_menu_items_on_linked_resource" + t.index ["menu_id"], name: "index_spree_menu_items_on_menu_id" + t.index ["parent_id"], name: "index_spree_menu_items_on_parent_id" + t.index ["rgt"], name: "index_spree_menu_items_on_rgt" + end + + create_table "spree_menus", force: :cascade do |t| + t.string "name" + t.string "location" + t.string "locale" + t.bigint "store_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["locale"], name: "index_spree_menus_on_locale" + t.index ["store_id", "location", "locale"], name: "index_spree_menus_on_store_id_and_location_and_locale", unique: true + t.index ["store_id"], name: "index_spree_menus_on_store_id" + end + + create_table "spree_option_type_prototypes", force: :cascade do |t| + t.bigint "prototype_id" + t.bigint "option_type_id" + t.datetime "created_at" + t.datetime "updated_at" + t.index ["option_type_id"], name: "index_spree_option_type_prototypes_on_option_type_id" + t.index ["prototype_id", "option_type_id"], name: "spree_option_type_prototypes_prototype_id_option_type_id", unique: true + t.index ["prototype_id"], name: "index_spree_option_type_prototypes_on_prototype_id" + end + + create_table "spree_option_types", force: :cascade do |t| + t.string "name", limit: 100 + t.string "presentation", limit: 100 + t.integer "position", default: 0, null: false + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.boolean "filterable", default: true, null: false + t.index ["filterable"], name: "index_spree_option_types_on_filterable" + t.index ["name"], name: "index_spree_option_types_on_name" + t.index ["position"], name: "index_spree_option_types_on_position" + end + + create_table "spree_option_value_variants", force: :cascade do |t| + t.bigint "variant_id" + t.bigint "option_value_id" + t.datetime "created_at" + t.datetime "updated_at" + t.index ["option_value_id"], name: "index_spree_option_value_variants_on_option_value_id" + t.index ["variant_id", "option_value_id"], name: "index_option_values_variants_on_variant_id_and_option_value_id", unique: true + t.index ["variant_id"], name: "index_spree_option_value_variants_on_variant_id" + end + + create_table "spree_option_values", force: :cascade do |t| + t.integer "position" + t.string "name" + t.string "presentation" + t.bigint "option_type_id" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.index ["name"], name: "index_spree_option_values_on_name" + t.index ["option_type_id"], name: "index_spree_option_values_on_option_type_id" + t.index ["position"], name: "index_spree_option_values_on_position" + end + + create_table "spree_order_promotions", force: :cascade do |t| + t.bigint "order_id" + t.bigint "promotion_id" + t.datetime "created_at" + t.datetime "updated_at" + t.index ["order_id"], name: "index_spree_order_promotions_on_order_id" + t.index ["promotion_id", "order_id"], name: "index_spree_order_promotions_on_promotion_id_and_order_id" + t.index ["promotion_id"], name: "index_spree_order_promotions_on_promotion_id" + end + + create_table "spree_orders", force: :cascade do |t| + t.string "number", limit: 32 + t.decimal "item_total", precision: 10, scale: 2, default: "0.0", null: false + t.decimal "total", precision: 10, scale: 2, default: "0.0", null: false + t.string "state" + t.decimal "adjustment_total", precision: 10, scale: 2, default: "0.0", null: false + t.bigint "user_id" + t.datetime "completed_at" + t.bigint "bill_address_id" + t.bigint "ship_address_id" + t.decimal "payment_total", precision: 10, scale: 2, default: "0.0" + t.string "shipment_state" + t.string "payment_state" + t.string "email" + t.text "special_instructions" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.string "currency" + t.string "last_ip_address" + t.bigint "created_by_id" + t.decimal "shipment_total", precision: 10, scale: 2, default: "0.0", null: false + t.decimal "additional_tax_total", precision: 10, scale: 2, default: "0.0" + t.decimal "promo_total", precision: 10, scale: 2, default: "0.0" + t.string "channel", default: "spree" + t.decimal "included_tax_total", precision: 10, scale: 2, default: "0.0", null: false + t.integer "item_count", default: 0 + t.bigint "approver_id" + t.datetime "approved_at" + t.boolean "confirmation_delivered", default: false + t.boolean "considered_risky", default: false + t.string "token" + t.datetime "canceled_at" + t.bigint "canceler_id" + t.bigint "store_id" + t.integer "state_lock_version", default: 0, null: false + t.decimal "taxable_adjustment_total", precision: 10, scale: 2, default: "0.0", null: false + t.decimal "non_taxable_adjustment_total", precision: 10, scale: 2, default: "0.0", null: false + t.boolean "store_owner_notification_delivered" + t.index ["approver_id"], name: "index_spree_orders_on_approver_id" + t.index ["bill_address_id"], name: "index_spree_orders_on_bill_address_id" + t.index ["canceler_id"], name: "index_spree_orders_on_canceler_id" + t.index ["completed_at"], name: "index_spree_orders_on_completed_at" + t.index ["confirmation_delivered"], name: "index_spree_orders_on_confirmation_delivered" + t.index ["considered_risky"], name: "index_spree_orders_on_considered_risky" + t.index ["created_by_id"], name: "index_spree_orders_on_created_by_id" + t.index ["number"], name: "index_spree_orders_on_number", unique: true + t.index ["ship_address_id"], name: "index_spree_orders_on_ship_address_id" + t.index ["store_id"], name: "index_spree_orders_on_store_id" + t.index ["token"], name: "index_spree_orders_on_token" + t.index ["user_id", "created_by_id"], name: "index_spree_orders_on_user_id_and_created_by_id" + end + + create_table "spree_payment_capture_events", force: :cascade do |t| + t.decimal "amount", precision: 10, scale: 2, default: "0.0" + t.bigint "payment_id" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.index ["payment_id"], name: "index_spree_payment_capture_events_on_payment_id" + end + + create_table "spree_payment_methods", force: :cascade do |t| + t.string "type" + t.string "name" + t.text "description" + t.boolean "active", default: true + t.datetime "deleted_at" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.string "display_on", default: "both" + t.boolean "auto_capture" + t.text "preferences" + t.integer "position", default: 0 + t.index ["id", "type"], name: "index_spree_payment_methods_on_id_and_type" + end + + create_table "spree_payment_methods_stores", id: false, force: :cascade do |t| + t.bigint "payment_method_id" + t.bigint "store_id" + t.index ["payment_method_id", "store_id"], name: "payment_mentod_id_store_id_unique_index", unique: true + t.index ["payment_method_id"], name: "index_spree_payment_methods_stores_on_payment_method_id" + t.index ["store_id"], name: "index_spree_payment_methods_stores_on_store_id" + end + + create_table "spree_payments", force: :cascade do |t| + t.decimal "amount", precision: 10, scale: 2, default: "0.0", null: false + t.bigint "order_id" + t.string "source_type" + t.bigint "source_id" + t.bigint "payment_method_id" + t.string "state" + t.string "response_code" + t.string "avs_response" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.string "number" + t.string "cvv_response_code" + t.string "cvv_response_message" + t.index ["number"], name: "index_spree_payments_on_number", unique: true + t.index ["order_id"], name: "index_spree_payments_on_order_id" + t.index ["payment_method_id"], name: "index_spree_payments_on_payment_method_id" + t.index ["source_id", "source_type"], name: "index_spree_payments_on_source_id_and_source_type" + end + + create_table "spree_preferences", force: :cascade do |t| + t.text "value" + t.string "key" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.index ["key"], name: "index_spree_preferences_on_key", unique: true + end + + create_table "spree_prices", force: :cascade do |t| + t.bigint "variant_id", null: false + t.decimal "amount", precision: 10, scale: 2 + t.string "currency" + t.datetime "deleted_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.decimal "compare_at_amount", precision: 10, scale: 2 + t.index ["deleted_at"], name: "index_spree_prices_on_deleted_at" + t.index ["variant_id", "currency"], name: "index_spree_prices_on_variant_id_and_currency" + t.index ["variant_id"], name: "index_spree_prices_on_variant_id" + end + + create_table "spree_product_option_types", force: :cascade do |t| + t.integer "position" + t.bigint "product_id" + t.bigint "option_type_id" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.index ["option_type_id"], name: "index_spree_product_option_types_on_option_type_id" + t.index ["position"], name: "index_spree_product_option_types_on_position" + t.index ["product_id"], name: "index_spree_product_option_types_on_product_id" + end + + create_table "spree_product_promotion_rules", force: :cascade do |t| + t.bigint "product_id" + t.bigint "promotion_rule_id" + t.datetime "created_at" + t.datetime "updated_at" + t.index ["product_id"], name: "index_products_promotion_rules_on_product_id" + t.index ["promotion_rule_id", "product_id"], name: "index_products_promotion_rules_on_promotion_rule_and_product" + end + + create_table "spree_product_properties", force: :cascade do |t| + t.string "value" + t.bigint "product_id" + t.bigint "property_id" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.integer "position", default: 0 + t.boolean "show_property", default: true + t.string "filter_param" + t.index ["filter_param"], name: "index_spree_product_properties_on_filter_param" + t.index ["position"], name: "index_spree_product_properties_on_position" + t.index ["product_id"], name: "index_product_properties_on_product_id" + t.index ["property_id", "product_id"], name: "index_spree_product_properties_on_property_id_and_product_id", unique: true + t.index ["property_id"], name: "index_spree_product_properties_on_property_id" + end + + create_table "spree_products", force: :cascade do |t| + t.string "name", default: "", null: false + t.text "description" + t.datetime "available_on" + t.datetime "deleted_at" + t.string "slug" + t.text "meta_description" + t.string "meta_keywords" + t.bigint "tax_category_id" + t.bigint "shipping_category_id" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.boolean "promotionable", default: true + t.string "meta_title" + t.datetime "discontinue_on" + t.index ["available_on"], name: "index_spree_products_on_available_on" + t.index ["deleted_at"], name: "index_spree_products_on_deleted_at" + t.index ["discontinue_on"], name: "index_spree_products_on_discontinue_on" + t.index ["name"], name: "index_spree_products_on_name" + t.index ["shipping_category_id"], name: "index_spree_products_on_shipping_category_id" + t.index ["slug"], name: "index_spree_products_on_slug", unique: true + t.index ["tax_category_id"], name: "index_spree_products_on_tax_category_id" + end + + create_table "spree_products_stores", force: :cascade do |t| + t.bigint "product_id" + t.bigint "store_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["product_id", "store_id"], name: "index_spree_products_stores_on_product_id_and_store_id", unique: true + t.index ["product_id"], name: "index_spree_products_stores_on_product_id" + t.index ["store_id"], name: "index_spree_products_stores_on_store_id" + end + + create_table "spree_products_taxons", force: :cascade do |t| + t.bigint "product_id" + t.bigint "taxon_id" + t.integer "position" + t.datetime "created_at" + t.datetime "updated_at" + t.index ["position"], name: "index_spree_products_taxons_on_position" + t.index ["product_id", "taxon_id"], name: "index_spree_products_taxons_on_product_id_and_taxon_id", unique: true + t.index ["product_id"], name: "index_spree_products_taxons_on_product_id" + t.index ["taxon_id"], name: "index_spree_products_taxons_on_taxon_id" + end + + create_table "spree_promotion_action_line_items", force: :cascade do |t| + t.bigint "promotion_action_id" + t.bigint "variant_id" + t.integer "quantity", default: 1 + t.datetime "created_at" + t.datetime "updated_at" + t.index ["promotion_action_id"], name: "index_spree_promotion_action_line_items_on_promotion_action_id" + t.index ["variant_id"], name: "index_spree_promotion_action_line_items_on_variant_id" + end + + create_table "spree_promotion_actions", force: :cascade do |t| + t.bigint "promotion_id" + t.integer "position" + t.string "type" + t.datetime "deleted_at" + t.datetime "created_at" + t.datetime "updated_at" + t.index ["deleted_at"], name: "index_spree_promotion_actions_on_deleted_at" + t.index ["id", "type"], name: "index_spree_promotion_actions_on_id_and_type" + t.index ["promotion_id"], name: "index_spree_promotion_actions_on_promotion_id" + end + + create_table "spree_promotion_categories", force: :cascade do |t| + t.string "name" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.string "code" + end + + create_table "spree_promotion_rule_taxons", force: :cascade do |t| + t.bigint "taxon_id" + t.bigint "promotion_rule_id" + t.datetime "created_at" + t.datetime "updated_at" + t.index ["promotion_rule_id"], name: "index_spree_promotion_rule_taxons_on_promotion_rule_id" + t.index ["taxon_id"], name: "index_spree_promotion_rule_taxons_on_taxon_id" + end + + create_table "spree_promotion_rule_users", force: :cascade do |t| + t.bigint "user_id" + t.bigint "promotion_rule_id" + t.datetime "created_at" + t.datetime "updated_at" + t.index ["promotion_rule_id"], name: "index_promotion_rules_users_on_promotion_rule_id" + t.index ["user_id", "promotion_rule_id"], name: "index_promotion_rules_users_on_user_id_and_promotion_rule_id" + end + + create_table "spree_promotion_rules", force: :cascade do |t| + t.bigint "promotion_id" + t.bigint "user_id" + t.bigint "product_group_id" + t.string "type" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.string "code" + t.text "preferences" + t.index ["product_group_id"], name: "index_promotion_rules_on_product_group_id" + t.index ["promotion_id"], name: "index_spree_promotion_rules_on_promotion_id" + t.index ["user_id"], name: "index_promotion_rules_on_user_id" + end + + create_table "spree_promotions", force: :cascade do |t| + t.string "description" + t.datetime "expires_at" + t.datetime "starts_at" + t.string "name" + t.string "type" + t.integer "usage_limit" + t.string "match_policy", default: "all" + t.string "code" + t.boolean "advertise", default: false + t.string "path" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.bigint "promotion_category_id" + t.index ["advertise"], name: "index_spree_promotions_on_advertise" + t.index ["code"], name: "index_spree_promotions_on_code" + t.index ["expires_at"], name: "index_spree_promotions_on_expires_at" + t.index ["id", "type"], name: "index_spree_promotions_on_id_and_type" + t.index ["path"], name: "index_spree_promotions_on_path" + t.index ["promotion_category_id"], name: "index_spree_promotions_on_promotion_category_id" + t.index ["starts_at"], name: "index_spree_promotions_on_starts_at" + end + + create_table "spree_promotions_stores", force: :cascade do |t| + t.bigint "promotion_id" + t.bigint "store_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["promotion_id", "store_id"], name: "index_spree_promotions_stores_on_promotion_id_and_store_id", unique: true + t.index ["promotion_id"], name: "index_spree_promotions_stores_on_promotion_id" + t.index ["store_id"], name: "index_spree_promotions_stores_on_store_id" + end + + create_table "spree_properties", force: :cascade do |t| + t.string "name" + t.string "presentation", null: false + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.boolean "filterable", default: false, null: false + t.string "filter_param" + t.index ["filter_param"], name: "index_spree_properties_on_filter_param" + t.index ["filterable"], name: "index_spree_properties_on_filterable" + t.index ["name"], name: "index_spree_properties_on_name" + end + + create_table "spree_property_prototypes", force: :cascade do |t| + t.bigint "prototype_id" + t.bigint "property_id" + t.datetime "created_at" + t.datetime "updated_at" + t.index ["property_id"], name: "index_spree_property_prototypes_on_property_id" + t.index ["prototype_id", "property_id"], name: "index_property_prototypes_on_prototype_id_and_property_id", unique: true + t.index ["prototype_id"], name: "index_spree_property_prototypes_on_prototype_id" + end + + create_table "spree_prototype_taxons", force: :cascade do |t| + t.bigint "taxon_id" + t.bigint "prototype_id" + t.datetime "created_at" + t.datetime "updated_at" + t.index ["prototype_id", "taxon_id"], name: "index_spree_prototype_taxons_on_prototype_id_and_taxon_id" + t.index ["prototype_id"], name: "index_spree_prototype_taxons_on_prototype_id" + t.index ["taxon_id"], name: "index_spree_prototype_taxons_on_taxon_id" + end + + create_table "spree_prototypes", force: :cascade do |t| + t.string "name" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + end + + create_table "spree_refund_reasons", force: :cascade do |t| + t.string "name" + t.boolean "active", default: true + t.boolean "mutable", default: true + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.index ["name"], name: "index_spree_refund_reasons_on_name", unique: true + end + + create_table "spree_refunds", force: :cascade do |t| + t.bigint "payment_id" + t.decimal "amount", precision: 10, scale: 2, default: "0.0", null: false + t.string "transaction_id" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.bigint "refund_reason_id" + t.bigint "reimbursement_id" + t.index ["payment_id"], name: "index_spree_refunds_on_payment_id" + t.index ["refund_reason_id"], name: "index_refunds_on_refund_reason_id" + t.index ["reimbursement_id"], name: "index_spree_refunds_on_reimbursement_id" + end + + create_table "spree_reimbursement_credits", force: :cascade do |t| + t.decimal "amount", precision: 10, scale: 2, default: "0.0", null: false + t.bigint "reimbursement_id" + t.bigint "creditable_id" + t.string "creditable_type" + t.datetime "created_at" + t.datetime "updated_at" + t.index ["creditable_id", "creditable_type"], name: "index_reimbursement_credits_on_creditable_id_and_type" + t.index ["reimbursement_id"], name: "index_spree_reimbursement_credits_on_reimbursement_id" + end + + create_table "spree_reimbursement_types", force: :cascade do |t| + t.string "name" + t.boolean "active", default: true + t.boolean "mutable", default: true + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.string "type" + t.index ["name"], name: "index_spree_reimbursement_types_on_name", unique: true + t.index ["type"], name: "index_spree_reimbursement_types_on_type" + end + + create_table "spree_reimbursements", force: :cascade do |t| + t.string "number" + t.string "reimbursement_status" + t.bigint "customer_return_id" + t.bigint "order_id" + t.decimal "total", precision: 10, scale: 2 + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.index ["customer_return_id"], name: "index_spree_reimbursements_on_customer_return_id" + t.index ["number"], name: "index_spree_reimbursements_on_number", unique: true + t.index ["order_id"], name: "index_spree_reimbursements_on_order_id" + end + + create_table "spree_return_authorization_reasons", force: :cascade do |t| + t.string "name" + t.boolean "active", default: true + t.boolean "mutable", default: true + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.index ["name"], name: "index_spree_return_authorization_reasons_on_name", unique: true + end + + create_table "spree_return_authorizations", force: :cascade do |t| + t.string "number" + t.string "state" + t.bigint "order_id" + t.text "memo" + t.datetime "created_at" + t.datetime "updated_at" + t.bigint "stock_location_id" + t.bigint "return_authorization_reason_id" + t.index ["number"], name: "index_spree_return_authorizations_on_number", unique: true + t.index ["order_id"], name: "index_spree_return_authorizations_on_order_id" + t.index ["return_authorization_reason_id"], name: "index_return_authorizations_on_return_authorization_reason_id" + t.index ["stock_location_id"], name: "index_spree_return_authorizations_on_stock_location_id" + end + + create_table "spree_return_items", force: :cascade do |t| + t.bigint "return_authorization_id" + t.bigint "inventory_unit_id" + t.bigint "exchange_variant_id" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.decimal "pre_tax_amount", precision: 12, scale: 4, default: "0.0", null: false + t.decimal "included_tax_total", precision: 12, scale: 4, default: "0.0", null: false + t.decimal "additional_tax_total", precision: 12, scale: 4, default: "0.0", null: false + t.string "reception_status" + t.string "acceptance_status" + t.bigint "customer_return_id" + t.bigint "reimbursement_id" + t.text "acceptance_status_errors" + t.bigint "preferred_reimbursement_type_id" + t.bigint "override_reimbursement_type_id" + t.boolean "resellable", default: true, null: false + t.index ["customer_return_id"], name: "index_return_items_on_customer_return_id" + t.index ["exchange_variant_id"], name: "index_spree_return_items_on_exchange_variant_id" + t.index ["inventory_unit_id"], name: "index_spree_return_items_on_inventory_unit_id" + t.index ["override_reimbursement_type_id"], name: "index_spree_return_items_on_override_reimbursement_type_id" + t.index ["preferred_reimbursement_type_id"], name: "index_spree_return_items_on_preferred_reimbursement_type_id" + t.index ["reimbursement_id"], name: "index_spree_return_items_on_reimbursement_id" + t.index ["return_authorization_id"], name: "index_spree_return_items_on_return_authorization_id" + end + + create_table "spree_role_users", force: :cascade do |t| + t.bigint "role_id" + t.bigint "user_id" + t.datetime "created_at" + t.datetime "updated_at" + t.index ["role_id"], name: "index_spree_role_users_on_role_id" + t.index ["user_id"], name: "index_spree_role_users_on_user_id" + end + + create_table "spree_roles", force: :cascade do |t| + t.string "name" + t.datetime "created_at" + t.datetime "updated_at" + t.index ["name"], name: "index_spree_roles_on_name", unique: true + end + + create_table "spree_shipments", force: :cascade do |t| + t.string "tracking" + t.string "number" + t.decimal "cost", precision: 10, scale: 2, default: "0.0" + t.datetime "shipped_at" + t.bigint "order_id" + t.bigint "address_id" + t.string "state" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.bigint "stock_location_id" + t.decimal "adjustment_total", precision: 10, scale: 2, default: "0.0" + t.decimal "additional_tax_total", precision: 10, scale: 2, default: "0.0" + t.decimal "promo_total", precision: 10, scale: 2, default: "0.0" + t.decimal "included_tax_total", precision: 10, scale: 2, default: "0.0", null: false + t.decimal "pre_tax_amount", precision: 12, scale: 4, default: "0.0", null: false + t.decimal "taxable_adjustment_total", precision: 10, scale: 2, default: "0.0", null: false + t.decimal "non_taxable_adjustment_total", precision: 10, scale: 2, default: "0.0", null: false + t.index ["address_id"], name: "index_spree_shipments_on_address_id" + t.index ["number"], name: "index_spree_shipments_on_number", unique: true + t.index ["order_id"], name: "index_spree_shipments_on_order_id" + t.index ["stock_location_id"], name: "index_spree_shipments_on_stock_location_id" + end + + create_table "spree_shipping_categories", force: :cascade do |t| + t.string "name" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.index ["name"], name: "index_spree_shipping_categories_on_name" + end + + create_table "spree_shipping_method_categories", force: :cascade do |t| + t.bigint "shipping_method_id", null: false + t.bigint "shipping_category_id", null: false + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.index ["shipping_category_id", "shipping_method_id"], name: "unique_spree_shipping_method_categories", unique: true + t.index ["shipping_category_id"], name: "index_spree_shipping_method_categories_on_shipping_category_id" + t.index ["shipping_method_id"], name: "index_spree_shipping_method_categories_on_shipping_method_id" + end + + create_table "spree_shipping_method_zones", force: :cascade do |t| + t.bigint "shipping_method_id" + t.bigint "zone_id" + t.datetime "created_at" + t.datetime "updated_at" + t.index ["shipping_method_id"], name: "index_spree_shipping_method_zones_on_shipping_method_id" + t.index ["zone_id"], name: "index_spree_shipping_method_zones_on_zone_id" + end + + create_table "spree_shipping_methods", force: :cascade do |t| + t.string "name" + t.string "display_on" + t.datetime "deleted_at" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.string "tracking_url" + t.string "admin_name" + t.bigint "tax_category_id" + t.string "code" + t.index ["deleted_at"], name: "index_spree_shipping_methods_on_deleted_at" + t.index ["tax_category_id"], name: "index_spree_shipping_methods_on_tax_category_id" + end + + create_table "spree_shipping_rates", force: :cascade do |t| + t.bigint "shipment_id" + t.bigint "shipping_method_id" + t.boolean "selected", default: false + t.decimal "cost", precision: 8, scale: 2, default: "0.0" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.bigint "tax_rate_id" + t.index ["selected"], name: "index_spree_shipping_rates_on_selected" + t.index ["shipment_id", "shipping_method_id"], name: "spree_shipping_rates_join_index", unique: true + t.index ["shipment_id"], name: "index_spree_shipping_rates_on_shipment_id" + t.index ["shipping_method_id"], name: "index_spree_shipping_rates_on_shipping_method_id" + t.index ["tax_rate_id"], name: "index_spree_shipping_rates_on_tax_rate_id" + end + + create_table "spree_state_changes", force: :cascade do |t| + t.string "name" + t.string "previous_state" + t.bigint "stateful_id" + t.bigint "user_id" + t.string "stateful_type" + t.string "next_state" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.index ["stateful_id", "stateful_type"], name: "index_spree_state_changes_on_stateful_id_and_stateful_type" + end + + create_table "spree_states", force: :cascade do |t| + t.string "name" + t.string "abbr" + t.bigint "country_id" + t.datetime "updated_at" + t.datetime "created_at" + t.index ["country_id"], name: "index_spree_states_on_country_id" + end + + create_table "spree_stock_items", force: :cascade do |t| + t.bigint "stock_location_id" + t.bigint "variant_id" + t.integer "count_on_hand", default: 0, null: false + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.boolean "backorderable", default: false + t.datetime "deleted_at" + t.index ["backorderable"], name: "index_spree_stock_items_on_backorderable" + t.index ["deleted_at"], name: "index_spree_stock_items_on_deleted_at" + t.index ["stock_location_id", "variant_id"], name: "stock_item_by_loc_and_var_id" + t.index ["stock_location_id"], name: "index_spree_stock_items_on_stock_location_id" + t.index ["variant_id"], name: "index_spree_stock_items_on_variant_id" + end + + create_table "spree_stock_locations", force: :cascade do |t| + t.string "name" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.boolean "default", default: false, null: false + t.string "address1" + t.string "address2" + t.string "city" + t.bigint "state_id" + t.string "state_name" + t.bigint "country_id" + t.string "zipcode" + t.string "phone" + t.boolean "active", default: true + t.boolean "backorderable_default", default: false + t.boolean "propagate_all_variants", default: true + t.string "admin_name" + t.index ["active"], name: "index_spree_stock_locations_on_active" + t.index ["backorderable_default"], name: "index_spree_stock_locations_on_backorderable_default" + t.index ["country_id"], name: "index_spree_stock_locations_on_country_id" + t.index ["propagate_all_variants"], name: "index_spree_stock_locations_on_propagate_all_variants" + t.index ["state_id"], name: "index_spree_stock_locations_on_state_id" + end + + create_table "spree_stock_movements", force: :cascade do |t| + t.bigint "stock_item_id" + t.integer "quantity", default: 0 + t.string "action" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.string "originator_type" + t.bigint "originator_id" + t.index ["originator_id", "originator_type"], name: "index_stock_movements_on_originator_id_and_originator_type" + t.index ["stock_item_id"], name: "index_spree_stock_movements_on_stock_item_id" + end + + create_table "spree_stock_transfers", force: :cascade do |t| + t.string "type" + t.string "reference" + t.bigint "source_location_id" + t.bigint "destination_location_id" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.string "number" + t.index ["destination_location_id"], name: "index_spree_stock_transfers_on_destination_location_id" + t.index ["number"], name: "index_spree_stock_transfers_on_number", unique: true + t.index ["source_location_id"], name: "index_spree_stock_transfers_on_source_location_id" + end + + create_table "spree_store_credit_categories", force: :cascade do |t| + t.string "name" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + end + + create_table "spree_store_credit_events", force: :cascade do |t| + t.bigint "store_credit_id", null: false + t.string "action", null: false + t.decimal "amount", precision: 8, scale: 2 + t.string "authorization_code", null: false + t.decimal "user_total_amount", precision: 8, scale: 2, default: "0.0", null: false + t.bigint "originator_id" + t.string "originator_type" + t.datetime "deleted_at" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.index ["originator_id", "originator_type"], name: "spree_store_credit_events_originator" + t.index ["store_credit_id"], name: "index_spree_store_credit_events_on_store_credit_id" + end + + create_table "spree_store_credit_types", force: :cascade do |t| + t.string "name" + t.integer "priority" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.index ["priority"], name: "index_spree_store_credit_types_on_priority" + end + + create_table "spree_store_credits", force: :cascade do |t| + t.bigint "user_id" + t.bigint "category_id" + t.bigint "created_by_id" + t.decimal "amount", precision: 8, scale: 2, default: "0.0", null: false + t.decimal "amount_used", precision: 8, scale: 2, default: "0.0", null: false + t.text "memo" + t.datetime "deleted_at" + t.string "currency" + t.decimal "amount_authorized", precision: 8, scale: 2, default: "0.0", null: false + t.bigint "originator_id" + t.string "originator_type" + t.bigint "type_id" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.bigint "store_id" + t.index ["deleted_at"], name: "index_spree_store_credits_on_deleted_at" + t.index ["originator_id", "originator_type"], name: "spree_store_credits_originator" + t.index ["store_id"], name: "index_spree_store_credits_on_store_id" + t.index ["type_id"], name: "index_spree_store_credits_on_type_id" + t.index ["user_id"], name: "index_spree_store_credits_on_user_id" + end + + create_table "spree_stores", force: :cascade do |t| + t.string "name" + t.string "url" + t.text "meta_description" + t.text "meta_keywords" + t.string "seo_title" + t.string "mail_from_address" + t.string "default_currency" + t.string "code" + t.boolean "default", default: false, null: false + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.string "supported_currencies" + t.string "facebook" + t.string "twitter" + t.string "instagram" + t.string "default_locale" + t.string "customer_support_email" + t.bigint "default_country_id" + t.text "description" + t.text "address" + t.string "contact_phone" + t.string "new_order_notifications_email" + t.bigint "checkout_zone_id" + t.string "seo_robots" + t.string "supported_locales" + t.index ["code"], name: "index_spree_stores_on_code", unique: true + t.index ["default"], name: "index_spree_stores_on_default" + t.index ["url"], name: "index_spree_stores_on_url" + end + + create_table "spree_tax_categories", force: :cascade do |t| + t.string "name" + t.string "description" + t.boolean "is_default", default: false + t.datetime "deleted_at" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.string "tax_code" + t.index ["deleted_at"], name: "index_spree_tax_categories_on_deleted_at" + t.index ["is_default"], name: "index_spree_tax_categories_on_is_default" + end + + create_table "spree_tax_rates", force: :cascade do |t| + t.decimal "amount", precision: 8, scale: 5 + t.bigint "zone_id" + t.bigint "tax_category_id" + t.boolean "included_in_price", default: false + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.string "name" + t.boolean "show_rate_in_label", default: true + t.datetime "deleted_at" + t.index ["deleted_at"], name: "index_spree_tax_rates_on_deleted_at" + t.index ["included_in_price"], name: "index_spree_tax_rates_on_included_in_price" + t.index ["show_rate_in_label"], name: "index_spree_tax_rates_on_show_rate_in_label" + t.index ["tax_category_id"], name: "index_spree_tax_rates_on_tax_category_id" + t.index ["zone_id"], name: "index_spree_tax_rates_on_zone_id" + end + + create_table "spree_taxonomies", force: :cascade do |t| + t.string "name", null: false + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.integer "position", default: 0 + t.bigint "store_id" + t.index ["name", "store_id"], name: "index_spree_taxonomies_on_name_and_store_id", unique: true + t.index ["position"], name: "index_spree_taxonomies_on_position" + t.index ["store_id"], name: "index_spree_taxonomies_on_store_id" + end + + create_table "spree_taxons", force: :cascade do |t| + t.bigint "parent_id" + t.integer "position", default: 0 + t.string "name", null: false + t.string "permalink" + t.bigint "taxonomy_id" + t.bigint "lft" + t.bigint "rgt" + t.text "description" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.string "meta_title" + t.string "meta_description" + t.string "meta_keywords" + t.integer "depth" + t.boolean "hide_from_nav", default: false + t.index ["lft"], name: "index_spree_taxons_on_lft" + t.index ["name", "parent_id", "taxonomy_id"], name: "index_spree_taxons_on_name_and_parent_id_and_taxonomy_id", unique: true + t.index ["name"], name: "index_spree_taxons_on_name" + t.index ["parent_id"], name: "index_taxons_on_parent_id" + t.index ["permalink", "parent_id", "taxonomy_id"], name: "index_spree_taxons_on_permalink_and_parent_id_and_taxonomy_id", unique: true + t.index ["permalink"], name: "index_taxons_on_permalink" + t.index ["position"], name: "index_spree_taxons_on_position" + t.index ["rgt"], name: "index_spree_taxons_on_rgt" + t.index ["taxonomy_id"], name: "index_taxons_on_taxonomy_id" + end + + create_table "spree_trackers", force: :cascade do |t| + t.string "analytics_id" + t.boolean "active", default: true + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.integer "engine", default: 0, null: false + t.index ["active"], name: "index_spree_trackers_on_active" + end + + create_table "spree_users", force: :cascade do |t| + t.string "encrypted_password", limit: 128 + t.string "password_salt", limit: 128 + t.string "email" + t.string "remember_token" + t.string "persistence_token" + t.string "reset_password_token" + t.string "perishable_token" + t.integer "sign_in_count", default: 0, null: false + t.integer "failed_attempts", default: 0, null: false + t.datetime "last_request_at" + t.datetime "current_sign_in_at" + t.datetime "last_sign_in_at" + t.string "current_sign_in_ip" + t.string "last_sign_in_ip" + t.string "login" + t.bigint "ship_address_id" + t.bigint "bill_address_id" + t.string "authentication_token" + t.string "unlock_token" + t.datetime "locked_at" + t.datetime "remember_created_at" + t.datetime "reset_password_sent_at" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + end + + create_table "spree_variants", force: :cascade do |t| + t.string "sku", default: "", null: false + t.decimal "weight", precision: 8, scale: 2, default: "0.0" + t.decimal "height", precision: 8, scale: 2 + t.decimal "width", precision: 8, scale: 2 + t.decimal "depth", precision: 8, scale: 2 + t.datetime "deleted_at" + t.boolean "is_master", default: false + t.bigint "product_id" + t.decimal "cost_price", precision: 10, scale: 2 + t.integer "position" + t.string "cost_currency" + t.boolean "track_inventory", default: true + t.bigint "tax_category_id" + t.datetime "updated_at", null: false + t.datetime "discontinue_on" + t.datetime "created_at", null: false + t.index ["deleted_at"], name: "index_spree_variants_on_deleted_at" + t.index ["discontinue_on"], name: "index_spree_variants_on_discontinue_on" + t.index ["is_master"], name: "index_spree_variants_on_is_master" + t.index ["position"], name: "index_spree_variants_on_position" + t.index ["product_id"], name: "index_spree_variants_on_product_id" + t.index ["sku"], name: "index_spree_variants_on_sku" + t.index ["tax_category_id"], name: "index_spree_variants_on_tax_category_id" + t.index ["track_inventory"], name: "index_spree_variants_on_track_inventory" + end + + create_table "spree_zone_members", force: :cascade do |t| + t.string "zoneable_type" + t.bigint "zoneable_id" + t.bigint "zone_id" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.index ["zone_id"], name: "index_spree_zone_members_on_zone_id" + t.index ["zoneable_id", "zoneable_type"], name: "index_spree_zone_members_on_zoneable_id_and_zoneable_type" + end + + create_table "spree_zones", force: :cascade do |t| + t.string "name" + t.string "description" + t.boolean "default_tax", default: false + t.integer "zone_members_count", default: 0 + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.string "kind", default: "state" + t.index ["default_tax"], name: "index_spree_zones_on_default_tax" + t.index ["kind"], name: "index_spree_zones_on_kind" + end + end +end diff --git a/db/migrate/20240523142433_add_metadata_to_spree_orders.spree.rb b/db/migrate/20240523142433_add_metadata_to_spree_orders.spree.rb new file mode 100644 index 0000000..52d4e34 --- /dev/null +++ b/db/migrate/20240523142433_add_metadata_to_spree_orders.spree.rb @@ -0,0 +1,14 @@ +# This migration comes from spree (originally 20210915064321) +class AddMetadataToSpreeOrders < ActiveRecord::Migration[5.2] + def change + change_table :spree_orders do |t| + if t.respond_to? :jsonb + add_column :spree_orders, :public_metadata, :jsonb + add_column :spree_orders, :private_metadata, :jsonb + else + add_column :spree_orders, :public_metadata, :json + add_column :spree_orders, :private_metadata, :json + end + end + end +end diff --git a/db/migrate/20240523142434_add_metadata_to_spree_products.spree.rb b/db/migrate/20240523142434_add_metadata_to_spree_products.spree.rb new file mode 100644 index 0000000..f536e3c --- /dev/null +++ b/db/migrate/20240523142434_add_metadata_to_spree_products.spree.rb @@ -0,0 +1,14 @@ +# This migration comes from spree (originally 20210915064322) +class AddMetadataToSpreeProducts < ActiveRecord::Migration[5.2] + def change + change_table :spree_products do |t| + if t.respond_to? :jsonb + add_column :spree_products, :public_metadata, :jsonb + add_column :spree_products, :private_metadata, :jsonb + else + add_column :spree_products, :public_metadata, :json + add_column :spree_products, :private_metadata, :json + end + end + end +end diff --git a/db/migrate/20240523142435_add_metadata_to_spree_variants.spree.rb b/db/migrate/20240523142435_add_metadata_to_spree_variants.spree.rb new file mode 100644 index 0000000..6db507f --- /dev/null +++ b/db/migrate/20240523142435_add_metadata_to_spree_variants.spree.rb @@ -0,0 +1,14 @@ +# This migration comes from spree (originally 20210915064323) +class AddMetadataToSpreeVariants < ActiveRecord::Migration[5.2] + def change + change_table :spree_variants do |t| + if t.respond_to? :jsonb + add_column :spree_variants, :public_metadata, :jsonb + add_column :spree_variants, :private_metadata, :jsonb + else + add_column :spree_variants, :public_metadata, :json + add_column :spree_variants, :private_metadata, :json + end + end + end +end diff --git a/db/migrate/20240523142436_add_metadata_to_spree_line_items.spree.rb b/db/migrate/20240523142436_add_metadata_to_spree_line_items.spree.rb new file mode 100644 index 0000000..86103f6 --- /dev/null +++ b/db/migrate/20240523142436_add_metadata_to_spree_line_items.spree.rb @@ -0,0 +1,14 @@ +# This migration comes from spree (originally 20210915064324) +class AddMetadataToSpreeLineItems < ActiveRecord::Migration[5.2] + def change + change_table :spree_line_items do |t| + if t.respond_to? :jsonb + add_column :spree_line_items, :public_metadata, :jsonb + add_column :spree_line_items, :private_metadata, :jsonb + else + add_column :spree_line_items, :public_metadata, :json + add_column :spree_line_items, :private_metadata, :json + end + end + end +end diff --git a/db/migrate/20240523142437_add_metadata_to_spree_shipments.spree.rb b/db/migrate/20240523142437_add_metadata_to_spree_shipments.spree.rb new file mode 100644 index 0000000..e56973b --- /dev/null +++ b/db/migrate/20240523142437_add_metadata_to_spree_shipments.spree.rb @@ -0,0 +1,14 @@ +# This migration comes from spree (originally 20210915064325) +class AddMetadataToSpreeShipments < ActiveRecord::Migration[5.2] + def change + change_table :spree_shipments do |t| + if t.respond_to? :jsonb + add_column :spree_shipments, :public_metadata, :jsonb + add_column :spree_shipments, :private_metadata, :jsonb + else + add_column :spree_shipments, :public_metadata, :json + add_column :spree_shipments, :private_metadata, :json + end + end + end +end diff --git a/db/migrate/20240523142438_add_metadata_to_spree_payments.spree.rb b/db/migrate/20240523142438_add_metadata_to_spree_payments.spree.rb new file mode 100644 index 0000000..42dd39d --- /dev/null +++ b/db/migrate/20240523142438_add_metadata_to_spree_payments.spree.rb @@ -0,0 +1,14 @@ +# This migration comes from spree (originally 20210915064326) +class AddMetadataToSpreePayments < ActiveRecord::Migration[5.2] + def change + change_table :spree_payments do |t| + if t.respond_to? :jsonb + add_column :spree_payments, :public_metadata, :jsonb + add_column :spree_payments, :private_metadata, :jsonb + else + add_column :spree_payments, :public_metadata, :json + add_column :spree_payments, :private_metadata, :json + end + end + end +end diff --git a/db/migrate/20240523142439_add_metadata_to_spree_taxons_and_taxonomies.spree.rb b/db/migrate/20240523142439_add_metadata_to_spree_taxons_and_taxonomies.spree.rb new file mode 100644 index 0000000..efa9153 --- /dev/null +++ b/db/migrate/20240523142439_add_metadata_to_spree_taxons_and_taxonomies.spree.rb @@ -0,0 +1,19 @@ +# This migration comes from spree (originally 20210915064327) +class AddMetadataToSpreeTaxonsAndTaxonomies < ActiveRecord::Migration[5.2] + def change + %i[ + spree_taxons + spree_taxonomies + ].each do |table_name| + change_table table_name do |t| + if t.respond_to? :jsonb + add_column table_name, :public_metadata, :jsonb + add_column table_name, :private_metadata, :jsonb + else + add_column table_name, :public_metadata, :json + add_column table_name, :private_metadata, :json + end + end + end + end +end diff --git a/db/migrate/20240523142440_add_metadata_to_spree_stock_transfers.spree.rb b/db/migrate/20240523142440_add_metadata_to_spree_stock_transfers.spree.rb new file mode 100644 index 0000000..3143291 --- /dev/null +++ b/db/migrate/20240523142440_add_metadata_to_spree_stock_transfers.spree.rb @@ -0,0 +1,14 @@ +# This migration comes from spree (originally 20210915064328) +class AddMetadataToSpreeStockTransfers < ActiveRecord::Migration[5.2] + def change + change_table :spree_stock_transfers do |t| + if t.respond_to? :jsonb + add_column :spree_stock_transfers, :public_metadata, :jsonb + add_column :spree_stock_transfers, :private_metadata, :jsonb + else + add_column :spree_stock_transfers, :public_metadata, :json + add_column :spree_stock_transfers, :private_metadata, :json + end + end + end +end diff --git a/db/migrate/20240523142441_add_metadata_to_spree_multiple_tables.spree.rb b/db/migrate/20240523142441_add_metadata_to_spree_multiple_tables.spree.rb new file mode 100644 index 0000000..732328d --- /dev/null +++ b/db/migrate/20240523142441_add_metadata_to_spree_multiple_tables.spree.rb @@ -0,0 +1,31 @@ +# This migration comes from spree (originally 20210915064329) +class AddMetadataToSpreeMultipleTables < ActiveRecord::Migration[5.2] + def change + %i[ + spree_assets + spree_option_types + spree_option_values + spree_properties + spree_promotions + spree_payment_methods + spree_shipping_methods + spree_prototypes + spree_refunds + spree_customer_returns + spree_users + spree_addresses + spree_credit_cards + spree_store_credits + ].each do |table_name| + change_table table_name do |t| + if t.respond_to? :jsonb + add_column table_name, :public_metadata, :jsonb + add_column table_name, :private_metadata, :jsonb + else + add_column table_name, :public_metadata, :json + add_column table_name, :private_metadata, :json + end + end + end + end +end diff --git a/db/migrate/20240523142442_add_deleted_at_to_spree_stores.spree.rb b/db/migrate/20240523142442_add_deleted_at_to_spree_stores.spree.rb new file mode 100644 index 0000000..5ee5ac0 --- /dev/null +++ b/db/migrate/20240523142442_add_deleted_at_to_spree_stores.spree.rb @@ -0,0 +1,9 @@ +# This migration comes from spree (originally 20210920090344) +class AddDeletedAtToSpreeStores < ActiveRecord::Migration[5.2] + def change + unless column_exists?(:spree_stores, :deleted_at) + add_column :spree_stores, :deleted_at, :datetime + add_index :spree_stores, :deleted_at + end + end +end diff --git a/db/migrate/20240523142443_rename_column_access_hash_to_token.spree.rb b/db/migrate/20240523142443_rename_column_access_hash_to_token.spree.rb new file mode 100644 index 0000000..44d49c9 --- /dev/null +++ b/db/migrate/20240523142443_rename_column_access_hash_to_token.spree.rb @@ -0,0 +1,9 @@ +# This migration comes from spree (originally 20210921070812) +class RenameColumnAccessHashToToken < ActiveRecord::Migration[5.2] + def change + if table_exists?(:spree_wishlists) + rename_column(:spree_wishlists, :access_hash, :token) if column_exists?(:spree_wishlists, :access_hash) + add_reference(:spree_wishlists, :store, index: true) unless column_exists?(:spree_wishlists, :store_id) + end + end +end diff --git a/db/migrate/20240523142444_create_spree_wishlists.spree.rb b/db/migrate/20240523142444_create_spree_wishlists.spree.rb new file mode 100644 index 0000000..a84edd9 --- /dev/null +++ b/db/migrate/20240523142444_create_spree_wishlists.spree.rb @@ -0,0 +1,19 @@ +# This migration comes from spree (originally 20210921070813) +class CreateSpreeWishlists < ActiveRecord::Migration[5.2] + def change + create_table :spree_wishlists, if_not_exists: true do |t| + t.belongs_to :user + t.belongs_to :store + + t.column :name, :string + t.column :token, :string, null: false + t.column :is_private, :boolean, default: true, null: false + t.column :is_default, :boolean, default: false, null: false + + t.timestamps + end + + add_index :spree_wishlists, :token, unique: true + add_index :spree_wishlists, [:user_id, :is_default] unless index_exists?(:spree_wishlists, [:user_id, :is_default]) + end +end diff --git a/db/migrate/20240523142445_create_spree_wished_products.spree.rb b/db/migrate/20240523142445_create_spree_wished_products.spree.rb new file mode 100644 index 0000000..5811a48 --- /dev/null +++ b/db/migrate/20240523142445_create_spree_wished_products.spree.rb @@ -0,0 +1,17 @@ +# This migration comes from spree (originally 20210921070814) +class CreateSpreeWishedProducts < ActiveRecord::Migration[5.2] + def change + create_table :spree_wished_products, if_not_exists: true do |t| + t.references :variant + t.belongs_to :wishlist + + t.column :quantity, :integer, default: 1, null: false + + t.timestamps + end + + add_index :spree_wished_products, [:variant_id, :wishlist_id], unique: true unless index_exists?(:spree_wished_products, [:variant_id, :wishlist_id]) + add_index :spree_wished_products, :variant_id unless index_exists?(:spree_wished_products, :variant_id) + add_index :spree_wished_products, :wishlist_id unless index_exists?(:spree_wished_products, :wishlist_id) + end +end diff --git a/db/migrate/20240523142446_rename_spree_wished_products_to_spree_wished_items.spree.rb b/db/migrate/20240523142446_rename_spree_wished_products_to_spree_wished_items.spree.rb new file mode 100644 index 0000000..a38e498 --- /dev/null +++ b/db/migrate/20240523142446_rename_spree_wished_products_to_spree_wished_items.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20210921070815) +class RenameSpreeWishedProductsToSpreeWishedItems < ActiveRecord::Migration[5.2] + def change + rename_table :spree_wished_products, :spree_wished_items + end +end diff --git a/db/migrate/20240523142447_add_unique_stock_item_stock_location_variant_deleted_at_index.spree.rb b/db/migrate/20240523142447_add_unique_stock_item_stock_location_variant_deleted_at_index.spree.rb new file mode 100644 index 0000000..24337f5 --- /dev/null +++ b/db/migrate/20240523142447_add_unique_stock_item_stock_location_variant_deleted_at_index.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20210921090344) +class AddUniqueStockItemStockLocationVariantDeletedAtIndex < ActiveRecord::Migration[5.2] + def change + add_index :spree_stock_items, [:stock_location_id, :variant_id, :deleted_at], name: 'stock_item_by_loc_var_id_deleted_at', unique: true + end +end diff --git a/db/migrate/20240523142448_create_stock_item_stock_location_id_variant_id_coalesce_deleted_at_unique_index.spree.rb b/db/migrate/20240523142448_create_stock_item_stock_location_id_variant_id_coalesce_deleted_at_unique_index.spree.rb new file mode 100644 index 0000000..0749478 --- /dev/null +++ b/db/migrate/20240523142448_create_stock_item_stock_location_id_variant_id_coalesce_deleted_at_unique_index.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20210929090344) +class CreateStockItemStockLocationIdVariantIdCoalesceDeletedAtUniqueIndex < ActiveRecord::Migration[5.2] + def change + # this migration was broken and is fixed in the following migration + end +end diff --git a/db/migrate/20240523142449_create_spree_digital_links.spree.rb b/db/migrate/20240523142449_create_spree_digital_links.spree.rb new file mode 100644 index 0000000..2340667 --- /dev/null +++ b/db/migrate/20240523142449_create_spree_digital_links.spree.rb @@ -0,0 +1,14 @@ +# This migration comes from spree (originally 20210929091444) +class CreateSpreeDigitalLinks < ActiveRecord::Migration[5.2] + def change + create_table :spree_digital_links, if_not_exists: true do |t| + t.belongs_to :digital + t.belongs_to :line_item + t.string :secret + t.integer :access_counter + + t.timestamps + end + add_index :spree_digital_links, :secret, unique: true unless index_exists?(:spree_digital_links, :secret) + end +end diff --git a/db/migrate/20240523142450_create_spree_digitals.spree.rb b/db/migrate/20240523142450_create_spree_digitals.spree.rb new file mode 100644 index 0000000..f6ae40b --- /dev/null +++ b/db/migrate/20240523142450_create_spree_digitals.spree.rb @@ -0,0 +1,10 @@ +# This migration comes from spree (originally 20210929093238) +class CreateSpreeDigitals < ActiveRecord::Migration[5.2] + def change + create_table :spree_digitals, if_not_exists: true do |t| + t.belongs_to :variant + + t.timestamps + end + end +end diff --git a/db/migrate/20240523142451_rename_secret_to_token_on_spree_digital_links.spree.rb b/db/migrate/20240523142451_rename_secret_to_token_on_spree_digital_links.spree.rb new file mode 100644 index 0000000..7c42f77 --- /dev/null +++ b/db/migrate/20240523142451_rename_secret_to_token_on_spree_digital_links.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20210930143043) +class RenameSecretToTokenOnSpreeDigitalLinks < ActiveRecord::Migration[5.2] + def change + rename_column :spree_digital_links, :secret, :token + end +end diff --git a/db/migrate/20240523142452_add_settings_to_spree_stores.spree.rb b/db/migrate/20240523142452_add_settings_to_spree_stores.spree.rb new file mode 100644 index 0000000..1dcb13f --- /dev/null +++ b/db/migrate/20240523142452_add_settings_to_spree_stores.spree.rb @@ -0,0 +1,12 @@ +# This migration comes from spree (originally 20210930155649) +class AddSettingsToSpreeStores < ActiveRecord::Migration[5.2] + def change + change_table :spree_stores do |t| + if t.respond_to? :jsonb + add_column :spree_stores, :settings, :jsonb + else + add_column :spree_stores, :settings, :json + end + end + end +end diff --git a/db/migrate/20240523142453_update_linkable_resource_types.spree.rb b/db/migrate/20240523142453_update_linkable_resource_types.spree.rb new file mode 100644 index 0000000..47e778c --- /dev/null +++ b/db/migrate/20240523142453_update_linkable_resource_types.spree.rb @@ -0,0 +1,11 @@ +# This migration comes from spree (originally 20211201202851) +class UpdateLinkableResourceTypes < ActiveRecord::Migration[5.2] + def change + change_column_default :spree_menu_items, :linked_resource_type, 'Spree::Linkable::Uri' + + Spree::MenuItem.where(linked_resource_type: 'URL').update_all(linked_resource_type: 'Spree::Linkable::Uri') + Spree::CmsSection.where(linked_resource_type: 'URL').update_all(linked_resource_type: 'Spree::Linkable::Uri') + Spree::MenuItem.where(linked_resource_type: 'Home Page').update_all(linked_resource_type: 'Spree::Linkable::Homepage') + Spree::CmsSection.where(linked_resource_type: 'Home Page').update_all(linked_resource_type: 'Spree::Linkable::Homepage') + end +end diff --git a/db/migrate/20240523142454_add_settings_to_payment_methods.spree.rb b/db/migrate/20240523142454_add_settings_to_payment_methods.spree.rb new file mode 100644 index 0000000..5c68a97 --- /dev/null +++ b/db/migrate/20240523142454_add_settings_to_payment_methods.spree.rb @@ -0,0 +1,12 @@ +# This migration comes from spree (originally 20211203082008) +class AddSettingsToPaymentMethods < ActiveRecord::Migration[5.2] + def change + change_table :spree_payment_methods do |t| + if t.respond_to? :jsonb + add_column :spree_payment_methods, :settings, :jsonb + else + add_column :spree_payment_methods, :settings, :json + end + end + end +end diff --git a/db/migrate/20240523142455_disable_propagate_all_variants_by_default.spree.rb b/db/migrate/20240523142455_disable_propagate_all_variants_by_default.spree.rb new file mode 100644 index 0000000..f859380 --- /dev/null +++ b/db/migrate/20240523142455_disable_propagate_all_variants_by_default.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20211229162122) +class DisablePropagateAllVariantsByDefault < ActiveRecord::Migration[5.2] + def change + change_column_default :spree_stock_locations, :propagate_all_variants, false + end +end diff --git a/db/migrate/20240523142456_add_status_and_make_active_at_to_spree_products.spree.rb b/db/migrate/20240523142456_add_status_and_make_active_at_to_spree_products.spree.rb new file mode 100644 index 0000000..763beb2 --- /dev/null +++ b/db/migrate/20240523142456_add_status_and_make_active_at_to_spree_products.spree.rb @@ -0,0 +1,8 @@ +# This migration comes from spree (originally 20220103082046) +class AddStatusAndMakeActiveAtToSpreeProducts < ActiveRecord::Migration[5.2] + def change + add_column :spree_products, :status, :string, null: false, default: 'draft' + add_index :spree_products, :status + add_index :spree_products, %i[status deleted_at] + end +end diff --git a/db/migrate/20240523142457_add_internal_note_to_spree_orders.spree.rb b/db/migrate/20240523142457_add_internal_note_to_spree_orders.spree.rb new file mode 100644 index 0000000..1efb621 --- /dev/null +++ b/db/migrate/20240523142457_add_internal_note_to_spree_orders.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20220106230929) +class AddInternalNoteToSpreeOrders < ActiveRecord::Migration[5.2] + def change + add_column :spree_orders, :internal_note, :text + end +end diff --git a/db/migrate/20240523142458_create_payment_sources.spree.rb b/db/migrate/20240523142458_create_payment_sources.spree.rb new file mode 100644 index 0000000..5b7322b --- /dev/null +++ b/db/migrate/20240523142458_create_payment_sources.spree.rb @@ -0,0 +1,23 @@ +# This migration comes from spree (originally 20220113052823) +class CreatePaymentSources < ActiveRecord::Migration[5.2] + def change + create_table :spree_payment_sources do |t| + t.string :gateway_payment_profile_id + t.string :type, index: true + + t.references :payment_method, index: true, foreign_key: { to_table: :spree_payment_methods } + t.references :user, index: true, foreign_key: { to_table: :spree_users } + + if t.respond_to? :jsonb + t.jsonb :public_metadata + t.jsonb :private_metadata + else + t.json :public_metadata + t.json :private_metadata + end + + t.index [:type, :gateway_payment_profile_id], unique: true, name: 'index_payment_sources_on_type_and_gateway_payment_profile_id' + t.timestamps + end + end +end diff --git a/db/migrate/20240523142459_add_make_active_at_to_spree_products.spree.rb b/db/migrate/20240523142459_add_make_active_at_to_spree_products.spree.rb new file mode 100644 index 0000000..c841893 --- /dev/null +++ b/db/migrate/20240523142459_add_make_active_at_to_spree_products.spree.rb @@ -0,0 +1,18 @@ +# This migration comes from spree (originally 20220117100333) +class AddMakeActiveAtToSpreeProducts < ActiveRecord::Migration[5.2] + def change + add_column :spree_products, :make_active_at, :datetime + add_index :spree_products, :make_active_at + + Spree::Product. + where('discontinue_on IS NULL or discontinue_on > ?', Time.current). + where('available_on <= ?', Time.current). + where(status: 'draft'). + update_all(status: 'active', updated_at: Time.current) + + Spree::Product. + where('discontinue_on <= ?', Time.current). + where.not(status: 'archived'). + update_all(status: 'archived', updated_at: Time.current) + end +end diff --git a/db/migrate/20240523142460_add_metadata_to_spree_tax_rates.spree.rb b/db/migrate/20240523142460_add_metadata_to_spree_tax_rates.spree.rb new file mode 100644 index 0000000..eed16c0 --- /dev/null +++ b/db/migrate/20240523142460_add_metadata_to_spree_tax_rates.spree.rb @@ -0,0 +1,14 @@ +# This migration comes from spree (originally 20220120092821) +class AddMetadataToSpreeTaxRates < ActiveRecord::Migration[5.2] + def change + change_table :spree_tax_rates do |t| + if t.respond_to? :jsonb + add_column :spree_tax_rates, :public_metadata, :jsonb + add_column :spree_tax_rates, :private_metadata, :jsonb + else + add_column :spree_tax_rates, :public_metadata, :json + add_column :spree_tax_rates, :private_metadata, :json + end + end + end +end diff --git a/db/migrate/20240523142461_add_first_name_and_last_name_to_spree_users.spree.rb b/db/migrate/20240523142461_add_first_name_and_last_name_to_spree_users.spree.rb new file mode 100644 index 0000000..33151ad --- /dev/null +++ b/db/migrate/20240523142461_add_first_name_and_last_name_to_spree_users.spree.rb @@ -0,0 +1,10 @@ +# This migration comes from spree (originally 20220201103922) +class AddFirstNameAndLastNameToSpreeUsers < ActiveRecord::Migration[5.2] + def change + if Spree.user_class.present? + users_table_name = Spree.user_class.table_name + add_column users_table_name, :first_name, :string unless column_exists?(users_table_name, :first_name) + add_column users_table_name, :last_name, :string unless column_exists?(users_table_name, :last_name) + end + end +end diff --git a/db/migrate/20240523142462_add_barcode_to_spree_variants.spree.rb b/db/migrate/20240523142462_add_barcode_to_spree_variants.spree.rb new file mode 100644 index 0000000..ab7c464 --- /dev/null +++ b/db/migrate/20240523142462_add_barcode_to_spree_variants.spree.rb @@ -0,0 +1,7 @@ +# This migration comes from spree (originally 20220222083546) +class AddBarcodeToSpreeVariants < ActiveRecord::Migration[5.2] + def change + add_column :spree_variants, :barcode, :string + add_index :spree_variants, :barcode + end +end diff --git a/db/migrate/20240523142463_fix_cms_pages_unique_indexes.spree.rb b/db/migrate/20240523142463_fix_cms_pages_unique_indexes.spree.rb new file mode 100644 index 0000000..30293c2 --- /dev/null +++ b/db/migrate/20240523142463_fix_cms_pages_unique_indexes.spree.rb @@ -0,0 +1,9 @@ +# This migration comes from spree (originally 20220329113557) +class FixCmsPagesUniqueIndexes < ActiveRecord::Migration[5.2] + def change + remove_index :spree_cms_pages, [:slug, :store_id, :deleted_at] + remove_index :spree_cms_pages, [:slug, :store_id], unique: true + + add_index :spree_cms_pages, [:slug, :store_id, :deleted_at], unique: true + end +end diff --git a/db/migrate/20240523142464_add_metadata_to_spree_stock_items.spree.rb b/db/migrate/20240523142464_add_metadata_to_spree_stock_items.spree.rb new file mode 100644 index 0000000..3a6c650 --- /dev/null +++ b/db/migrate/20240523142464_add_metadata_to_spree_stock_items.spree.rb @@ -0,0 +1,14 @@ +# This migration comes from spree (originally 20220613133029) +class AddMetadataToSpreeStockItems < ActiveRecord::Migration[5.2] + def change + change_table :spree_stock_items do |t| + if t.respond_to? :jsonb + add_column :spree_stock_items, :public_metadata, :jsonb + add_column :spree_stock_items, :private_metadata, :jsonb + else + add_column :spree_stock_items, :public_metadata, :json + add_column :spree_stock_items, :private_metadata, :json + end + end + end +end diff --git a/db/migrate/20240523142465_create_product_name_and_description_translations_for_mobility_table_backend.spree.rb b/db/migrate/20240523142465_create_product_name_and_description_translations_for_mobility_table_backend.spree.rb new file mode 100644 index 0000000..da045d6 --- /dev/null +++ b/db/migrate/20240523142465_create_product_name_and_description_translations_for_mobility_table_backend.spree.rb @@ -0,0 +1,28 @@ +# This migration comes from spree (originally 20220706112554) +class CreateProductNameAndDescriptionTranslationsForMobilityTableBackend < ActiveRecord::Migration[6.1] + def change + # create translation table only if spree_globalize has not already created it + if ActiveRecord::Base.connection.table_exists? 'spree_product_translations' + # manually check for index since Rails if_exists does not always work correctly + if ActiveRecord::Migration.connection.index_exists?(:spree_product_translations, :spree_product_id) + remove_index :spree_product_translations, name: "index_spree_product_translations_on_spree_product_id", if_exists: true + end + else + create_table :spree_product_translations do |t| + + # Translated attribute(s) + t.string :name + t.text :description + + t.string :locale, null: false + t.references :spree_product, null: false, foreign_key: true, index: false + + t.timestamps null: false + end + + add_index :spree_product_translations, :locale, name: :index_spree_product_translations_on_locale + end + + add_index :spree_product_translations, [:spree_product_id, :locale], name: :unique_product_id_per_locale, unique: true + end +end diff --git a/db/migrate/20240523142466_create_spree_product_translations_for_mobility.spree.rb b/db/migrate/20240523142466_create_spree_product_translations_for_mobility.spree.rb new file mode 100644 index 0000000..d6de3a3 --- /dev/null +++ b/db/migrate/20240523142466_create_spree_product_translations_for_mobility.spree.rb @@ -0,0 +1,8 @@ +# This migration comes from spree (originally 20220715083542) +class CreateSpreeProductTranslationsForMobility < ActiveRecord::Migration[6.1] + def change + add_column :spree_product_translations, :meta_description, :text, if_not_exists: true + add_column :spree_product_translations, :meta_keywords, :string, if_not_exists: true + add_column :spree_product_translations, :meta_title, :string, if_not_exists: true + end +end diff --git a/db/migrate/20240523142467_create_spree_taxon_name_and_description_translations_for_mobility_table_backend.spree.rb b/db/migrate/20240523142467_create_spree_taxon_name_and_description_translations_for_mobility_table_backend.spree.rb new file mode 100644 index 0000000..ef48a1d --- /dev/null +++ b/db/migrate/20240523142467_create_spree_taxon_name_and_description_translations_for_mobility_table_backend.spree.rb @@ -0,0 +1,28 @@ +# This migration comes from spree (originally 20220718100743) +class CreateSpreeTaxonNameAndDescriptionTranslationsForMobilityTableBackend < ActiveRecord::Migration[6.1] + def change + # create translation table only if spree_globalize has not already created it + if ActiveRecord::Base.connection.table_exists? 'spree_taxon_translations' + # manually check for index since Rails if_exists does not always work correctly + if ActiveRecord::Migration.connection.index_exists?(:spree_taxon_translations, :spree_taxon_id) + # replacing this with index on spree_taxon_id and locale + remove_index :spree_taxon_translations, name: "index_spree_taxon_translations_on_spree_taxon_id", if_exists: true + end + else + create_table :spree_taxon_translations do |t| + # Translated attribute(s) + t.string :name + t.text :description + + t.string :locale, null: false + t.references :spree_taxon, null: false, foreign_key: true, index: false + + t.timestamps null: false + end + + add_index :spree_taxon_translations, :locale, name: :index_spree_taxon_translations_on_locale + end + + add_index :spree_taxon_translations, [:spree_taxon_id, :locale], name: :index_spree_taxon_translations_on_spree_taxon_id_and_locale, unique: true + end +end diff --git a/db/migrate/20240523142468_add_locale_to_friendly_id_slugs.spree.rb b/db/migrate/20240523142468_add_locale_to_friendly_id_slugs.spree.rb new file mode 100644 index 0000000..fad7ed6 --- /dev/null +++ b/db/migrate/20240523142468_add_locale_to_friendly_id_slugs.spree.rb @@ -0,0 +1,12 @@ +# This migration comes from spree (originally 20220802070609) +class AddLocaleToFriendlyIdSlugs < ActiveRecord::Migration[6.1] + def change + add_column :friendly_id_slugs, :locale, :string, null: :false, after: :scope + + remove_index :friendly_id_slugs, [:slug, :sluggable_type] + add_index :friendly_id_slugs, [:slug, :sluggable_type, :locale], length: { slug: 140, sluggable_type: 50, locale: 2 } + remove_index :friendly_id_slugs, [:slug, :sluggable_type, :scope] + add_index :friendly_id_slugs, [:slug, :sluggable_type, :scope, :locale], length: { slug: 70, sluggable_type: 50, scope: 70, locale: 2 }, unique: true, name: :index_friendly_id_slugs_unique + add_index :friendly_id_slugs, :locale + end +end diff --git a/db/migrate/20240523142469_create_spree_product_slug_translations_for_mobility_table_backend.spree.rb b/db/migrate/20240523142469_create_spree_product_slug_translations_for_mobility_table_backend.spree.rb new file mode 100644 index 0000000..ba7afce --- /dev/null +++ b/db/migrate/20240523142469_create_spree_product_slug_translations_for_mobility_table_backend.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20220802073225) +class CreateSpreeProductSlugTranslationsForMobilityTableBackend < ActiveRecord::Migration[6.1] + def change + add_column :spree_product_translations, :slug, :string + end +end diff --git a/db/migrate/20240523142470_add_selected_locale_to_spree_users.spree.rb b/db/migrate/20240523142470_add_selected_locale_to_spree_users.spree.rb new file mode 100644 index 0000000..c97a247 --- /dev/null +++ b/db/migrate/20240523142470_add_selected_locale_to_spree_users.spree.rb @@ -0,0 +1,9 @@ +# This migration comes from spree (originally 20221215151408) +class AddSelectedLocaleToSpreeUsers < ActiveRecord::Migration[6.1] + def change + if Spree.user_class.present? + users_table_name = Spree.user_class.table_name + add_column users_table_name, :selected_locale, :string unless column_exists?(users_table_name, :selected_locale) + end + end +end diff --git a/db/migrate/20240523142471_add_deleted_at_to_product_translations.spree.rb b/db/migrate/20240523142471_add_deleted_at_to_product_translations.spree.rb new file mode 100644 index 0000000..d173526 --- /dev/null +++ b/db/migrate/20240523142471_add_deleted_at_to_product_translations.spree.rb @@ -0,0 +1,7 @@ +# This migration comes from spree (originally 20221219123957) +class AddDeletedAtToProductTranslations < ActiveRecord::Migration[6.1] + def change + add_column :spree_product_translations, :deleted_at, :datetime + add_index :spree_product_translations, :deleted_at + end +end diff --git a/db/migrate/20240523142472_add_uniqueness_constraint_to_product_translations.spree.rb b/db/migrate/20240523142472_add_uniqueness_constraint_to_product_translations.spree.rb new file mode 100644 index 0000000..cce1f04 --- /dev/null +++ b/db/migrate/20240523142472_add_uniqueness_constraint_to_product_translations.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20221220133432) +class AddUniquenessConstraintToProductTranslations < ActiveRecord::Migration[6.1] + def change + add_index :spree_product_translations, [:locale, :slug], unique: true, name: 'unique_slug_per_locale' + end +end diff --git a/db/migrate/20240523142473_create_spree_data_feed_settings.spree.rb b/db/migrate/20240523142473_create_spree_data_feed_settings.spree.rb new file mode 100644 index 0000000..1d67237 --- /dev/null +++ b/db/migrate/20240523142473_create_spree_data_feed_settings.spree.rb @@ -0,0 +1,15 @@ +# This migration comes from spree (originally 20221229132350) +class CreateSpreeDataFeedSettings < ActiveRecord::Migration[6.0] + def change + create_table :spree_data_feed_settings do |t| + t.references :spree_store + + t.string :name + t.string :provider + t.string :uuid, unique: true + t.boolean :enabled, default: true + + t.timestamps + end + end +end diff --git a/db/migrate/20240523142474_create_option_type_translations.spree.rb b/db/migrate/20240523142474_create_option_type_translations.spree.rb new file mode 100644 index 0000000..89c06ef --- /dev/null +++ b/db/migrate/20240523142474_create_option_type_translations.spree.rb @@ -0,0 +1,26 @@ +# This migration comes from spree (originally 20230103144439) +class CreateOptionTypeTranslations < ActiveRecord::Migration[6.1] + def change + if ActiveRecord::Base.connection.table_exists? 'spree_option_type_translations' + # manually check for index since Rails if_exists does not always work correctly + if ActiveRecord::Migration.connection.index_exists?(:spree_option_type_translations, :spree_option_type_id) + remove_index :spree_option_type_translations, name: "index_spree_option_type_translations_on_spree_option_type_id", if_exists: true + end + else + create_table :spree_option_type_translations do |t| + + # Translated attribute(s) + t.string :presentation + + t.string :locale, null: false + t.references :spree_option_type, null: false, foreign_key: true, index: false + + t.timestamps + end + + add_index :spree_option_type_translations, :locale, name: :index_spree_option_type_translations_on_locale + end + + add_index :spree_option_type_translations, [:spree_option_type_id, :locale], name: :unique_option_type_id_per_locale, unique: true + end +end diff --git a/db/migrate/20240523142475_create_option_value_translations.spree.rb b/db/migrate/20240523142475_create_option_value_translations.spree.rb new file mode 100644 index 0000000..11fc495 --- /dev/null +++ b/db/migrate/20240523142475_create_option_value_translations.spree.rb @@ -0,0 +1,26 @@ +# This migration comes from spree (originally 20230103151034) +class CreateOptionValueTranslations < ActiveRecord::Migration[6.1] + def change + if ActiveRecord::Base.connection.table_exists? 'spree_option_value_translations' + # manually check for index since Rails if_exists does not always work correctly + if ActiveRecord::Migration.connection.index_exists?(:spree_option_value_translations, :spree_option_value_id) + remove_index :spree_option_value_translations, column: :spree_option_value_id, if_exists: true + end + else + create_table :spree_option_value_translations do |t| + + # Translated attribute(s) + t.string :presentation + + t.string :locale, null: false + t.references :spree_option_value, null: false, foreign_key: true, index: false + + t.timestamps + end + + add_index :spree_option_value_translations, :locale, name: :index_spree_option_value_translations_on_locale + end + + add_index :spree_option_value_translations, [:spree_option_value_id, :locale], name: :unique_option_value_id_per_locale, unique: true + end +end diff --git a/db/migrate/20240523142476_create_product_property_translations.spree.rb b/db/migrate/20240523142476_create_product_property_translations.spree.rb new file mode 100644 index 0000000..e5869f9 --- /dev/null +++ b/db/migrate/20240523142476_create_product_property_translations.spree.rb @@ -0,0 +1,25 @@ +# This migration comes from spree (originally 20230109084253) +class CreateProductPropertyTranslations < ActiveRecord::Migration[6.1] + def change + if ActiveRecord::Base.connection.table_exists? 'spree_product_property_translations' + # manually check for index since Rails if_exists does not always work correctly + if ActiveRecord::Migration.connection.index_exists?(:spree_product_property_translations, :spree_product_property_id) + remove_index :spree_product_property_translations, column: :spree_product_property_id, if_exists: true + end + else + create_table :spree_product_property_translations do |t| + # Translated attribute(s) + t.string :value + + t.string :locale, null: false + t.references :spree_product_property, null: false, foreign_key: true, index: false + + t.timestamps + end + + add_index :spree_product_property_translations, :locale, name: :index_spree_product_property_translations_on_locale + end + + add_index :spree_product_property_translations, [:spree_product_property_id, :locale], name: :unique_product_property_id_per_locale, unique: true + end +end diff --git a/db/migrate/20240523142477_create_property_translations.spree.rb b/db/migrate/20240523142477_create_property_translations.spree.rb new file mode 100644 index 0000000..38e0525 --- /dev/null +++ b/db/migrate/20240523142477_create_property_translations.spree.rb @@ -0,0 +1,25 @@ +# This migration comes from spree (originally 20230109105943) +class CreatePropertyTranslations < ActiveRecord::Migration[6.1] + def change + if ActiveRecord::Base.connection.table_exists?('spree_property_translations') + # manually check for index since Rails if_exists does not always work correctly + if ActiveRecord::Migration.connection.index_exists?(:spree_property_translations, :spree_property_id) + remove_index :spree_property_translations, column: :spree_property_id, if_exists: true + end + else + create_table :spree_property_translations do |t| + # Translated attribute(s) + t.string :presentation + + t.string :locale, null: false + t.references :spree_property, null: false, foreign_key: true, index: false + + t.timestamps + end + + add_index :spree_property_translations, :locale, name: :index_spree_property_translations_on_locale + end + + add_index :spree_property_translations, [:spree_property_id, :locale], name: :unique_property_id_per_locale, unique: true + end +end diff --git a/db/migrate/20240523142478_backfill_friendly_id_slug_locale.spree.rb b/db/migrate/20240523142478_backfill_friendly_id_slug_locale.spree.rb new file mode 100644 index 0000000..d45edaa --- /dev/null +++ b/db/migrate/20240523142478_backfill_friendly_id_slug_locale.spree.rb @@ -0,0 +1,10 @@ +# This migration comes from spree (originally 20230110142344) +class BackfillFriendlyIdSlugLocale < ActiveRecord::Migration[6.1] + def up + FriendlyId::Slug.unscoped.update_all(locale: Spree::Store.default.default_locale) + end + + def down + FriendlyId::Slug.unscoped.update_all(locale: nil) + end +end diff --git a/db/migrate/20240523142479_add_additional_taxon_translation_fields.spree.rb b/db/migrate/20240523142479_add_additional_taxon_translation_fields.spree.rb new file mode 100644 index 0000000..4d29836 --- /dev/null +++ b/db/migrate/20240523142479_add_additional_taxon_translation_fields.spree.rb @@ -0,0 +1,9 @@ +# This migration comes from spree (originally 20230111121534) +class AddAdditionalTaxonTranslationFields < ActiveRecord::Migration[6.1] + def change + add_column :spree_taxon_translations, :meta_title, :string, if_not_exists: true + add_column :spree_taxon_translations, :meta_description, :string, if_not_exists: true + add_column :spree_taxon_translations, :meta_keywords, :string, if_not_exists: true + add_column :spree_taxon_translations, :permalink, :string, if_not_exists: true + end +end diff --git a/db/migrate/20240523142480_create_taxonomy_translations.spree.rb b/db/migrate/20240523142480_create_taxonomy_translations.spree.rb new file mode 100644 index 0000000..c58202d --- /dev/null +++ b/db/migrate/20240523142480_create_taxonomy_translations.spree.rb @@ -0,0 +1,25 @@ +# This migration comes from spree (originally 20230117115531) +class CreateTaxonomyTranslations < ActiveRecord::Migration[6.1] + def change + if ActiveRecord::Base.connection.table_exists?('spree_taxonomy_translations') + # manually check for index since Rails if_exists does not always work correctly + if ActiveRecord::Migration.connection.index_exists?(:spree_taxonomy_translations, :spree_taxonomy_id) + remove_index :spree_taxonomy_translations, column: :spree_taxonomy_id, if_exists: true + end + else + create_table :spree_taxonomy_translations do |t| + # Translated attribute(s) + t.string :name + + t.string :locale, null: false + t.references :spree_taxonomy, null: false, foreign_key: true, index: false + + t.timestamps null: false + end + + add_index :spree_taxonomy_translations, :locale, name: :index_spree_taxonomy_translations_on_locale + end + + add_index :spree_taxonomy_translations, [:spree_taxonomy_id, :locale], name: :index_spree_taxonomy_translations_on_spree_taxonomy_id_locale, unique: true + end +end diff --git a/db/migrate/20240523142481_create_store_translations.spree.rb b/db/migrate/20240523142481_create_store_translations.spree.rb new file mode 100644 index 0000000..fbb3a54 --- /dev/null +++ b/db/migrate/20240523142481_create_store_translations.spree.rb @@ -0,0 +1,51 @@ +# This migration comes from spree (originally 20230210142732) +class CreateStoreTranslations < ActiveRecord::Migration[6.1] + def change + if ActiveRecord::Base.connection.table_exists?('spree_store_translations') + add_new_translation_columns_to_globalize_table + else + create_table :spree_store_translations do |t| + # Translated attribute(s) + t.string :name + t.text :meta_description + t.text :meta_keywords + t.string :seo_title + t.string :facebook + t.string :twitter + t.string :instagram + t.string :customer_support_email + t.text :description + t.text :address + t.string :contact_phone + t.string :new_order_notifications_email + + t.string :locale, null: false + t.references :spree_store, null: false, foreign_key: true, index: false + + t.timestamps null: false + end + + add_index :spree_store_translations, :locale, name: :index_spree_store_translations_on_locale + end + + add_index :spree_store_translations, [:spree_store_id, :locale], name: :index_spree_store_translations_on_spree_store_id_locale, unique: true + end + + private + + def add_new_translation_columns_to_globalize_table + # manually check for index since Rails if_exists does not always work correctly + if ActiveRecord::Migration.connection.index_exists?(:spree_store_translations, :spree_store_id) + remove_index :spree_store_translations, column: :spree_store_id, if_exists: true + end + + add_column :spree_store_translations, :facebook, :string + add_column :spree_store_translations, :twitter, :string + add_column :spree_store_translations, :instagram, :string + add_column :spree_store_translations, :customer_support_email, :string + add_column :spree_store_translations, :description, :text + add_column :spree_store_translations, :address, :text + add_column :spree_store_translations, :contact_phone, :string + add_column :spree_store_translations, :new_order_notifications_email, :string + end +end diff --git a/db/migrate/20240523142482_add_deleted_at_to_store_translations.spree.rb b/db/migrate/20240523142482_add_deleted_at_to_store_translations.spree.rb new file mode 100644 index 0000000..9750211 --- /dev/null +++ b/db/migrate/20240523142482_add_deleted_at_to_store_translations.spree.rb @@ -0,0 +1,7 @@ +# This migration comes from spree (originally 20230210230434) +class AddDeletedAtToStoreTranslations < ActiveRecord::Migration[6.1] + def change + add_column :spree_store_translations, :deleted_at, :datetime + add_index :spree_store_translations, :deleted_at + end +end diff --git a/db/migrate/20240523142483_rename_data_feed_settings_table.spree.rb b/db/migrate/20240523142483_rename_data_feed_settings_table.spree.rb new file mode 100644 index 0000000..21df59d --- /dev/null +++ b/db/migrate/20240523142483_rename_data_feed_settings_table.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20230415155958) +class RenameDataFeedSettingsTable < ActiveRecord::Migration[6.1] + def change + rename_table :spree_data_feed_settings, :spree_data_feeds + end +end diff --git a/db/migrate/20240523142484_rename_data_feed_table_columns.spree.rb b/db/migrate/20240523142484_rename_data_feed_table_columns.spree.rb new file mode 100644 index 0000000..ad3ea23 --- /dev/null +++ b/db/migrate/20240523142484_rename_data_feed_table_columns.spree.rb @@ -0,0 +1,8 @@ +# This migration comes from spree (originally 20230415160828) +class RenameDataFeedTableColumns < ActiveRecord::Migration[6.1] + def change + rename_column :spree_data_feeds, :spree_store_id, :store_id + rename_column :spree_data_feeds, :enabled, :active + rename_column :spree_data_feeds, :uuid, :slug + end +end diff --git a/db/migrate/20240523142485_add_indexes_to_data_feeds_table.spree.rb b/db/migrate/20240523142485_add_indexes_to_data_feeds_table.spree.rb new file mode 100644 index 0000000..82b3065 --- /dev/null +++ b/db/migrate/20240523142485_add_indexes_to_data_feeds_table.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20230415161226) +class AddIndexesToDataFeedsTable < ActiveRecord::Migration[6.1] + def change + add_index :spree_data_feeds, [:store_id, :slug, :provider] + end +end diff --git a/db/migrate/20240523142486_rename_data_feeds_column_provider_to_type.spree.rb b/db/migrate/20240523142486_rename_data_feeds_column_provider_to_type.spree.rb new file mode 100644 index 0000000..913bb91 --- /dev/null +++ b/db/migrate/20240523142486_rename_data_feeds_column_provider_to_type.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20230512094803) +class RenameDataFeedsColumnProviderToType < ActiveRecord::Migration[6.1] + def change + rename_column :spree_data_feeds, :provider, :type + end +end diff --git a/db/migrate/20240523142487_fix_spree_stock_item_unique_index.spree.rb b/db/migrate/20240523142487_fix_spree_stock_item_unique_index.spree.rb new file mode 100644 index 0000000..9bd845b --- /dev/null +++ b/db/migrate/20240523142487_fix_spree_stock_item_unique_index.spree.rb @@ -0,0 +1,36 @@ +# This migration comes from spree (originally 20240303174340) +class FixSpreeStockItemUniqueIndex < ActiveRecord::Migration[6.1] + def change + remove_index :spree_stock_items, name: 'stock_item_by_loc_var_id_deleted_at' if index_exists?(:spree_stock_items, [:stock_location_id, :variant_id], name: 'stock_item_by_loc_var_id_deleted_at') + + unless index_exists?(:spree_stock_items, ['variant_id', 'stock_location_id'], name: 'index_spree_stock_items_unique_without_deleted_at') + # MySQL doesn't support partial indexes + if ActiveRecord::Base.connection.adapter_name == 'Mysql2' + reversible do |dir| + dir.up do + execute <<-SQL + CREATE UNIQUE INDEX index_spree_stock_items_unique_without_deleted_at + ON spree_stock_items( + stock_location_id, + variant_id, + (COALESCE(deleted_at, CAST('1970-01-01' AS DATETIME))) + ); + SQL + end + + dir.down do + remove_index :spree_stock_items, name: :index_spree_stock_items_unique_without_deleted_at + end + end + else + add_index( + :spree_stock_items, + ['variant_id', 'stock_location_id'], + name: 'index_spree_stock_items_unique_without_deleted_at', + unique: true, + where: 'deleted_at IS NULL', + ) + end + end + end +end diff --git a/db/migrate/20240523142488_add_weight_and_dimension_units_to_spree_variants.spree.rb b/db/migrate/20240523142488_add_weight_and_dimension_units_to_spree_variants.spree.rb new file mode 100644 index 0000000..e7e405b --- /dev/null +++ b/db/migrate/20240523142488_add_weight_and_dimension_units_to_spree_variants.spree.rb @@ -0,0 +1,7 @@ +# This migration comes from spree (originally 20240514105216) +class AddWeightAndDimensionUnitsToSpreeVariants < ActiveRecord::Migration[6.1] + def change + add_column :spree_variants, :weight_unit, :string, if_not_exists: true + add_column :spree_variants, :dimensions_unit, :string, if_not_exists: true + end +end diff --git a/db/migrate/20240523142489_add_api_key_to_spree_users.spree_api.rb b/db/migrate/20240523142489_add_api_key_to_spree_users.spree_api.rb new file mode 100644 index 0000000..87d38cc --- /dev/null +++ b/db/migrate/20240523142489_add_api_key_to_spree_users.spree_api.rb @@ -0,0 +1,8 @@ +# This migration comes from spree_api (originally 20100107141738) +class AddApiKeyToSpreeUsers < ActiveRecord::Migration[4.2] + def change + unless defined?(User) + add_column :spree_users, :api_key, :string, limit: 40 + end + end +end diff --git a/db/migrate/20240523142490_resize_api_key_field.spree_api.rb b/db/migrate/20240523142490_resize_api_key_field.spree_api.rb new file mode 100644 index 0000000..4282004 --- /dev/null +++ b/db/migrate/20240523142490_resize_api_key_field.spree_api.rb @@ -0,0 +1,8 @@ +# This migration comes from spree_api (originally 20120411123334) +class ResizeApiKeyField < ActiveRecord::Migration[4.2] + def change + unless defined?(User) + change_column :spree_users, :api_key, :string, limit: 48 + end + end +end diff --git a/db/migrate/20240523142491_rename_api_key_to_spree_api_key.spree_api.rb b/db/migrate/20240523142491_rename_api_key_to_spree_api_key.spree_api.rb new file mode 100644 index 0000000..60747db --- /dev/null +++ b/db/migrate/20240523142491_rename_api_key_to_spree_api_key.spree_api.rb @@ -0,0 +1,8 @@ +# This migration comes from spree_api (originally 20120530054546) +class RenameApiKeyToSpreeApiKey < ActiveRecord::Migration[4.2] + def change + unless defined?(User) + rename_column :spree_users, :api_key, :spree_api_key + end + end +end diff --git a/db/migrate/20240523142492_add_index_to_user_spree_api_key.spree_api.rb b/db/migrate/20240523142492_add_index_to_user_spree_api_key.spree_api.rb new file mode 100644 index 0000000..ab7b732 --- /dev/null +++ b/db/migrate/20240523142492_add_index_to_user_spree_api_key.spree_api.rb @@ -0,0 +1,8 @@ +# This migration comes from spree_api (originally 20131017162334) +class AddIndexToUserSpreeApiKey < ActiveRecord::Migration[4.2] + def change + unless defined?(User) + add_index :spree_users, :spree_api_key + end + end +end diff --git a/db/migrate/20240523142493_create_doorkeeper_tables.spree_api.rb b/db/migrate/20240523142493_create_doorkeeper_tables.spree_api.rb new file mode 100644 index 0000000..2494d8e --- /dev/null +++ b/db/migrate/20240523142493_create_doorkeeper_tables.spree_api.rb @@ -0,0 +1,70 @@ +# This migration comes from spree_api (originally 20180320110726) +class CreateDoorkeeperTables < ActiveRecord::Migration[5.1] + def change + create_table :spree_oauth_applications do |t| + t.string :name, null: false + t.string :uid, null: false + t.string :secret, null: false + t.text :redirect_uri, null: false + t.string :scopes, null: false, default: '' + t.boolean :confidential, null: false, default: true + t.timestamps null: false + end + + add_index :spree_oauth_applications, :uid, unique: true + + create_table :spree_oauth_access_grants do |t| + t.integer :resource_owner_id, null: false + t.references :application, null: false + t.string :token, null: false + t.integer :expires_in, null: false + t.text :redirect_uri, null: false + t.datetime :created_at, null: false + t.datetime :revoked_at + t.string :scopes + end + + add_index :spree_oauth_access_grants, :token, unique: true + add_foreign_key( + :spree_oauth_access_grants, + :spree_oauth_applications, + column: :application_id + ) + + create_table :spree_oauth_access_tokens do |t| + t.integer :resource_owner_id + t.references :application + + # If you use a custom token generator you may need to change this column + # from string to text, so that it accepts tokens larger than 255 + # characters. More info on custom token generators in: + # https://github.com/doorkeeper-gem/doorkeeper/tree/v3.0.0.rc1#custom-access-token-generator + # + # t.text :token, null: false + t.string :token, null: false + + t.string :refresh_token + t.integer :expires_in + t.datetime :revoked_at + t.datetime :created_at, null: false + t.string :scopes + + # If there is a previous_refresh_token column, + # refresh tokens will be revoked after a related access token is used. + # If there is no previous_refresh_token column, + # previous tokens are revoked as soon as a new access token is created. + # Comment out this line if you'd rather have refresh tokens + # instantly revoked. + t.string :previous_refresh_token, null: false, default: "" + end + + add_index :spree_oauth_access_tokens, :token, unique: true + add_index :spree_oauth_access_tokens, :resource_owner_id + add_index :spree_oauth_access_tokens, :refresh_token, unique: true + add_foreign_key( + :spree_oauth_access_tokens, + :spree_oauth_applications, + column: :application_id + ) + end +end diff --git a/db/migrate/20240523142494_change_integer_id_columns_type.spree_api.rb b/db/migrate/20240523142494_change_integer_id_columns_type.spree_api.rb new file mode 100644 index 0000000..e225743 --- /dev/null +++ b/db/migrate/20240523142494_change_integer_id_columns_type.spree_api.rb @@ -0,0 +1,10 @@ +# This migration comes from spree_api (originally 20210727102516) +class ChangeIntegerIdColumnsType < ActiveRecord::Migration[5.2] + def change + change_column :spree_oauth_access_grants, :resource_owner_id, :bigint + change_column :spree_oauth_access_grants, :application_id, :bigint + + change_column :spree_oauth_access_tokens, :resource_owner_id, :bigint + change_column :spree_oauth_access_tokens, :application_id, :bigint + end +end diff --git a/db/migrate/20240523142495_create_spree_webhooks_tables.spree_api.rb b/db/migrate/20240523142495_create_spree_webhooks_tables.spree_api.rb new file mode 100644 index 0000000..a18b5e4 --- /dev/null +++ b/db/migrate/20240523142495_create_spree_webhooks_tables.spree_api.rb @@ -0,0 +1,17 @@ +# This migration comes from spree_api (originally 20210902162826) +class CreateSpreeWebhooksTables < ActiveRecord::Migration[5.2] + def change + create_table :spree_webhooks_subscribers do |t| + t.string :url, null: false + t.boolean :active, default: false, index: true + + if t.respond_to? :jsonb + t.jsonb :subscriptions + else + t.json :subscriptions + end + + t.timestamps + end + end +end diff --git a/db/migrate/20240523142496_enable_polymorphic_resource_owner.spree_api.rb b/db/migrate/20240523142496_enable_polymorphic_resource_owner.spree_api.rb new file mode 100644 index 0000000..539122c --- /dev/null +++ b/db/migrate/20240523142496_enable_polymorphic_resource_owner.spree_api.rb @@ -0,0 +1,22 @@ +# This migration comes from spree_api (originally 20210919183228) +class EnablePolymorphicResourceOwner < ActiveRecord::Migration[5.2] + def change + add_column :spree_oauth_access_tokens, :resource_owner_type, :string + add_column :spree_oauth_access_grants, :resource_owner_type, :string + change_column_null :spree_oauth_access_grants, :resource_owner_type, false + + add_index :spree_oauth_access_tokens, + [:resource_owner_id, :resource_owner_type], + name: 'polymorphic_owner_oauth_access_tokens' + + add_index :spree_oauth_access_grants, + [:resource_owner_id, :resource_owner_type], + name: 'polymorphic_owner_oauth_access_grants' + + Spree::OauthAccessToken.reset_column_information + Spree::OauthAccessToken.update_all(resource_owner_type: Spree.user_class) + + Spree::OauthAccessGrant.reset_column_information + Spree::OauthAccessGrant.update_all(resource_owner_type: Spree.user_class) + end +end diff --git a/db/migrate/20240523142497_create_spree_webhooks_events.spree_api.rb b/db/migrate/20240523142497_create_spree_webhooks_events.spree_api.rb new file mode 100644 index 0000000..6f4de51 --- /dev/null +++ b/db/migrate/20240523142497_create_spree_webhooks_events.spree_api.rb @@ -0,0 +1,15 @@ +# This migration comes from spree_api (originally 20211025162826) +class CreateSpreeWebhooksEvents < ActiveRecord::Migration[5.2] + def change + create_table :spree_webhooks_events do |t| + t.integer "execution_time" + t.string "name", null: false + t.string "request_errors" + t.string "response_code", index: true + t.belongs_to "subscriber", null: false, index: true + t.boolean "success", index: true + t.string "url", null: false + t.timestamps + end + end +end diff --git a/db/migrate/20240523142498_add_secret_key_to_spree_webhooks_subscribers.spree_api.rb b/db/migrate/20240523142498_add_secret_key_to_spree_webhooks_subscribers.spree_api.rb new file mode 100644 index 0000000..ac03bdd --- /dev/null +++ b/db/migrate/20240523142498_add_secret_key_to_spree_webhooks_subscribers.spree_api.rb @@ -0,0 +1,6 @@ +# This migration comes from spree_api (originally 20221221122100) +class AddSecretKeyToSpreeWebhooksSubscribers < ActiveRecord::Migration[6.1] + def change + add_column :spree_webhooks_subscribers, :secret_key, :string, null: true + end +end diff --git a/db/migrate/20240523142499_backfill_secret_key_for_spree_webhooks_subscribers.spree_api.rb b/db/migrate/20240523142499_backfill_secret_key_for_spree_webhooks_subscribers.spree_api.rb new file mode 100644 index 0000000..199a71e --- /dev/null +++ b/db/migrate/20240523142499_backfill_secret_key_for_spree_webhooks_subscribers.spree_api.rb @@ -0,0 +1,6 @@ +# This migration comes from spree_api (originally 20230116204600) +class BackfillSecretKeyForSpreeWebhooksSubscribers < ActiveRecord::Migration[6.1] + def change + Spree::Webhooks::Subscriber.where(secret_key: nil).find_each(&:regenerate_secret_key) + end +end diff --git a/db/migrate/20240523142500_change_secret_key_to_non_null_column.spree_api.rb b/db/migrate/20240523142500_change_secret_key_to_non_null_column.spree_api.rb new file mode 100644 index 0000000..b83d876 --- /dev/null +++ b/db/migrate/20240523142500_change_secret_key_to_non_null_column.spree_api.rb @@ -0,0 +1,6 @@ +# This migration comes from spree_api (originally 20230116205000) +class ChangeSecretKeyToNonNullColumn < ActiveRecord::Migration[6.1] + def change + change_column_null :spree_webhooks_subscribers, :secret_key, false + end +end diff --git a/db/migrate/20240523142501_create_users.spree_auth.rb b/db/migrate/20240523142501_create_users.spree_auth.rb new file mode 100644 index 0000000..c06e70a --- /dev/null +++ b/db/migrate/20240523142501_create_users.spree_auth.rb @@ -0,0 +1,30 @@ +# This migration comes from spree_auth (originally 20101026184949) +class CreateUsers < SpreeExtension::Migration[4.2] + def up + unless data_source_exists?("spree_users") + create_table "spree_users", force: true do |t| + t.string "crypted_password", limit: 128 + t.string "salt", limit: 128 + t.string "email" + t.string "remember_token" + t.string "remember_token_expires_at" + t.string "persistence_token" + t.string "single_access_token" + t.string "perishable_token" + t.integer "login_count", default: 0, null: false + t.integer "failed_login_count", default: 0, null: false + t.datetime "last_request_at" + t.datetime "current_login_at" + t.datetime "last_login_at" + t.string "current_login_ip" + t.string "last_login_ip" + t.string "login" + t.integer "ship_address_id" + t.integer "bill_address_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "openid_identifier" + end + end + end +end diff --git a/db/migrate/20240523142502_rename_columns_for_devise.spree_auth.rb b/db/migrate/20240523142502_rename_columns_for_devise.spree_auth.rb new file mode 100644 index 0000000..e417608 --- /dev/null +++ b/db/migrate/20240523142502_rename_columns_for_devise.spree_auth.rb @@ -0,0 +1,38 @@ +# This migration comes from spree_auth (originally 20101026184950) +class RenameColumnsForDevise < SpreeExtension::Migration[4.2] + def up + return if column_exists?(:spree_users, :password_salt) + rename_column :spree_users, :crypted_password, :encrypted_password + rename_column :spree_users, :salt, :password_salt + rename_column :spree_users, :remember_token_expires_at, :remember_created_at + rename_column :spree_users, :login_count, :sign_in_count + rename_column :spree_users, :failed_login_count, :failed_attempts + rename_column :spree_users, :single_access_token, :reset_password_token + rename_column :spree_users, :current_login_at, :current_sign_in_at + rename_column :spree_users, :last_login_at, :last_sign_in_at + rename_column :spree_users, :current_login_ip, :current_sign_in_ip + rename_column :spree_users, :last_login_ip, :last_sign_in_ip + add_column :spree_users, :authentication_token, :string + add_column :spree_users, :unlock_token, :string + add_column :spree_users, :locked_at, :datetime + remove_column :spree_users, :openid_identifier + end + + def down + remove_column :spree_users, :authentication_token + remove_column :spree_users, :locked_at + remove_column :spree_users, :unlock_token + rename_column :spree_users, :last_sign_in_ip, :last_login_ip + rename_column :spree_users, :current_sign_in_ip, :current_login_ip + rename_column :spree_users, :last_sign_in_at, :last_login_at + rename_column :spree_users, :current_sign_in_at, :current_login_at + rename_column :spree_users, :reset_password_token, :single_access_token + rename_column :spree_users, :failed_attempts, :failed_login_count + rename_column :spree_users, :sign_in_count, :login_count + rename_column :spree_users, :remember_created_at, :remember_token_expires_at + rename_column :spree_users, :password_salt, :salt + rename_column :spree_users, :encrypted_password, :crypted_password + add_column :spree_users, :unlock_token, :string + add_column :spree_users, :openid_identifier, :string + end +end diff --git a/db/migrate/20240523142503_convert_user_remember_field.spree_auth.rb b/db/migrate/20240523142503_convert_user_remember_field.spree_auth.rb new file mode 100644 index 0000000..00fa1bb --- /dev/null +++ b/db/migrate/20240523142503_convert_user_remember_field.spree_auth.rb @@ -0,0 +1,12 @@ +# This migration comes from spree_auth (originally 20101214150824) +class ConvertUserRememberField < SpreeExtension::Migration[4.2] + def up + remove_column :spree_users, :remember_created_at + add_column :spree_users, :remember_created_at, :datetime + end + + def down + remove_column :spree_users, :remember_created_at + add_column :spree_users, :remember_created_at, :string + end +end diff --git a/db/migrate/20240523142504_add_reset_password_sent_at_to_spree_users.spree_auth.rb b/db/migrate/20240523142504_add_reset_password_sent_at_to_spree_users.spree_auth.rb new file mode 100644 index 0000000..e4158a1 --- /dev/null +++ b/db/migrate/20240523142504_add_reset_password_sent_at_to_spree_users.spree_auth.rb @@ -0,0 +1,9 @@ +# This migration comes from spree_auth (originally 20120203010234) +class AddResetPasswordSentAtToSpreeUsers < SpreeExtension::Migration[4.2] + def change + Spree.user_class.reset_column_information + unless Spree.user_class.column_names.include?("reset_password_sent_at") + add_column :spree_users, :reset_password_sent_at, :datetime + end + end +end diff --git a/db/migrate/20240523142505_make_users_email_index_unique.spree_auth.rb b/db/migrate/20240523142505_make_users_email_index_unique.spree_auth.rb new file mode 100644 index 0000000..5a12c06 --- /dev/null +++ b/db/migrate/20240523142505_make_users_email_index_unique.spree_auth.rb @@ -0,0 +1,10 @@ +# This migration comes from spree_auth (originally 20120605211305) +class MakeUsersEmailIndexUnique < SpreeExtension::Migration[4.2] + def up + add_index "spree_users", ["email"], name: "email_idx_unique", unique: true + end + + def down + remove_index "spree_users", name: "email_idx_unique" + end +end diff --git a/db/migrate/20240523142506_add_deleted_at_to_users.spree_auth.rb b/db/migrate/20240523142506_add_deleted_at_to_users.spree_auth.rb new file mode 100644 index 0000000..e2c9901 --- /dev/null +++ b/db/migrate/20240523142506_add_deleted_at_to_users.spree_auth.rb @@ -0,0 +1,7 @@ +# This migration comes from spree_auth (originally 20140904000425) +class AddDeletedAtToUsers < SpreeExtension::Migration[4.2] + def change + add_column :spree_users, :deleted_at, :datetime + add_index :spree_users, :deleted_at + end +end diff --git a/db/migrate/20240523142507_add_confirmable_to_users.spree_auth.rb b/db/migrate/20240523142507_add_confirmable_to_users.spree_auth.rb new file mode 100644 index 0000000..84bed06 --- /dev/null +++ b/db/migrate/20240523142507_add_confirmable_to_users.spree_auth.rb @@ -0,0 +1,8 @@ +# This migration comes from spree_auth (originally 20141002154641) +class AddConfirmableToUsers < SpreeExtension::Migration[4.2] + def change + add_column :spree_users, :confirmation_token, :string + add_column :spree_users, :confirmed_at, :datetime + add_column :spree_users, :confirmation_sent_at, :datetime + end +end diff --git a/db/migrate/20240523142508_add_missing_indices_on_user.spree_auth.rb b/db/migrate/20240523142508_add_missing_indices_on_user.spree_auth.rb new file mode 100644 index 0000000..4559432 --- /dev/null +++ b/db/migrate/20240523142508_add_missing_indices_on_user.spree_auth.rb @@ -0,0 +1,11 @@ +# This migration comes from spree_auth (originally 20150416152553) +class AddMissingIndicesOnUser < SpreeExtension::Migration[4.2] + def change + unless index_exists?(:spree_users, :bill_address_id) + add_index :spree_users, :bill_address_id + end + unless index_exists?(:spree_users, :ship_address_id) + add_index :spree_users, :ship_address_id + end + end +end diff --git a/db/migrate/20240523142509_change_type_of_ship_address_id_and_bill_address_id_for_spree_users.spree_auth.rb b/db/migrate/20240523142509_change_type_of_ship_address_id_and_bill_address_id_for_spree_users.spree_auth.rb new file mode 100644 index 0000000..6896ca4 --- /dev/null +++ b/db/migrate/20240523142509_change_type_of_ship_address_id_and_bill_address_id_for_spree_users.spree_auth.rb @@ -0,0 +1,9 @@ +# This migration comes from spree_auth (originally 20210728103922) +class ChangeTypeOfShipAddressIdAndBillAddressIdForSpreeUsers < ActiveRecord::Migration[4.2] + def change + change_table(:spree_users) do |t| + t.change :ship_address_id, :bigint + t.change :bill_address_id, :bigint + end + end +end diff --git a/db/migrate/20240523142510_add_spree_check_payment_source.spree_gateway.rb b/db/migrate/20240523142510_add_spree_check_payment_source.spree_gateway.rb new file mode 100644 index 0000000..7c1d359 --- /dev/null +++ b/db/migrate/20240523142510_add_spree_check_payment_source.spree_gateway.rb @@ -0,0 +1,23 @@ +# This migration comes from spree_gateway (originally 20200317135551) +class AddSpreeCheckPaymentSource < ActiveRecord::Migration[5.1] + def change + create_table :spree_checks do |t| + t.references :payment_method + t.references :user + t.string 'account_holder_name' + t.string 'account_holder_type' + t.string 'routing_number' + t.string 'account_number' + t.string 'account_type', default: 'checking' + t.string 'status' + t.string 'last_digits' + t.string 'gateway_customer_profile_id' + t.string 'gateway_payment_profile_id' + + t.datetime 'created_at', null: false + t.datetime 'updated_at', null: false + t.datetime 'deleted_at' + end + add_index :spree_payment_methods, :id + end +end diff --git a/db/migrate/20240523142511_add_intent_key_to_payment.spree_gateway.rb b/db/migrate/20240523142511_add_intent_key_to_payment.spree_gateway.rb new file mode 100644 index 0000000..ba9718e --- /dev/null +++ b/db/migrate/20240523142511_add_intent_key_to_payment.spree_gateway.rb @@ -0,0 +1,6 @@ +# This migration comes from spree_gateway (originally 20200422114908) +class AddIntentKeyToPayment < ActiveRecord::Migration[5.2] + def change + add_column :spree_payments, :intent_client_key, :string + end +end diff --git a/db/schema.rb b/db/schema.rb new file mode 100644 index 0000000..7e22693 --- /dev/null +++ b/db/schema.rb @@ -0,0 +1,1744 @@ +# 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. +# +# This file is the source Rails uses to define your schema when running `bin/rails +# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to +# be faster and is potentially less error prone than running all of your +# migrations from scratch. Old migrations may fail to apply correctly if those +# migrations use external dependencies or application code. +# +# It's strongly recommended that you check this file into your version control system. + +ActiveRecord::Schema[7.1].define(version: 2024_05_23_142511) do + # These are extensions that must be enabled in order to support this database + enable_extension "plpgsql" + + create_table "action_mailbox_inbound_emails", force: :cascade do |t| + t.integer "status", default: 0, null: false + t.string "message_id", null: false + t.string "message_checksum", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["message_id", "message_checksum"], name: "index_action_mailbox_inbound_emails_uniqueness", unique: true + end + + create_table "action_text_rich_texts", force: :cascade do |t| + t.string "name", null: false + t.text "body" + t.string "record_type", null: false + t.bigint "record_id", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["record_type", "record_id", "name"], name: "index_action_text_rich_texts_uniqueness", unique: true + end + + create_table "active_storage_attachments", force: :cascade do |t| + t.string "name", null: false + t.string "record_type", null: false + t.bigint "record_id", null: false + t.bigint "blob_id", null: false + t.datetime "created_at", null: false + t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id" + t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true + end + + create_table "active_storage_blobs", force: :cascade do |t| + t.string "key", null: false + t.string "filename", null: false + t.string "content_type" + t.text "metadata" + t.string "service_name", null: false + t.bigint "byte_size", null: false + t.string "checksum" + t.datetime "created_at", null: false + t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true + end + + create_table "active_storage_variant_records", force: :cascade do |t| + t.bigint "blob_id", null: false + t.string "variation_digest", null: false + t.index ["blob_id", "variation_digest"], name: "index_active_storage_variant_records_uniqueness", unique: true + end + + create_table "friendly_id_slugs", force: :cascade do |t| + t.string "slug", null: false + t.bigint "sluggable_id", null: false + t.string "sluggable_type", limit: 50 + t.string "scope" + t.datetime "created_at", precision: nil + t.datetime "deleted_at", precision: nil + t.string "locale" + t.index ["deleted_at"], name: "index_friendly_id_slugs_on_deleted_at" + t.index ["locale"], name: "index_friendly_id_slugs_on_locale" + t.index ["slug", "sluggable_type", "locale"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type_and_locale" + t.index ["slug", "sluggable_type", "scope", "locale"], name: "index_friendly_id_slugs_unique", unique: true + t.index ["sluggable_id"], name: "index_friendly_id_slugs_on_sluggable_id" + t.index ["sluggable_type"], name: "index_friendly_id_slugs_on_sluggable_type" + end + + create_table "solid_cache_entries", force: :cascade do |t| + t.binary "key", null: false + t.binary "value", null: false + t.datetime "created_at", null: false + t.bigint "key_hash", null: false + t.integer "byte_size", null: false + t.index ["byte_size"], name: "index_solid_cache_entries_on_byte_size" + t.index ["key_hash", "byte_size"], name: "index_solid_cache_entries_on_key_hash_and_byte_size" + t.index ["key_hash"], name: "index_solid_cache_entries_on_key_hash", unique: true + end + + create_table "solid_queue_blocked_executions", force: :cascade do |t| + t.bigint "job_id", null: false + t.string "queue_name", null: false + t.integer "priority", default: 0, null: false + t.string "concurrency_key", null: false + t.datetime "expires_at", null: false + t.datetime "created_at", null: false + t.index ["concurrency_key", "priority", "job_id"], name: "index_solid_queue_blocked_executions_for_release" + t.index ["expires_at", "concurrency_key"], name: "index_solid_queue_blocked_executions_for_maintenance" + t.index ["job_id"], name: "index_solid_queue_blocked_executions_on_job_id", unique: true + end + + create_table "solid_queue_claimed_executions", force: :cascade do |t| + t.bigint "job_id", null: false + t.bigint "process_id" + t.datetime "created_at", null: false + t.index ["job_id"], name: "index_solid_queue_claimed_executions_on_job_id", unique: true + t.index ["process_id", "job_id"], name: "index_solid_queue_claimed_executions_on_process_id_and_job_id" + end + + create_table "solid_queue_failed_executions", force: :cascade do |t| + t.bigint "job_id", null: false + t.text "error" + t.datetime "created_at", null: false + t.index ["job_id"], name: "index_solid_queue_failed_executions_on_job_id", unique: true + end + + create_table "solid_queue_jobs", force: :cascade do |t| + t.string "queue_name", null: false + t.string "class_name", null: false + t.text "arguments" + t.integer "priority", default: 0, null: false + t.string "active_job_id" + t.datetime "scheduled_at" + t.datetime "finished_at" + t.string "concurrency_key" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["active_job_id"], name: "index_solid_queue_jobs_on_active_job_id" + t.index ["class_name"], name: "index_solid_queue_jobs_on_class_name" + t.index ["finished_at"], name: "index_solid_queue_jobs_on_finished_at" + t.index ["queue_name", "finished_at"], name: "index_solid_queue_jobs_for_filtering" + t.index ["scheduled_at", "finished_at"], name: "index_solid_queue_jobs_for_alerting" + end + + create_table "solid_queue_pauses", force: :cascade do |t| + t.string "queue_name", null: false + t.datetime "created_at", null: false + t.index ["queue_name"], name: "index_solid_queue_pauses_on_queue_name", unique: true + end + + create_table "solid_queue_processes", force: :cascade do |t| + t.string "kind", null: false + t.datetime "last_heartbeat_at", null: false + t.bigint "supervisor_id" + t.integer "pid", null: false + t.string "hostname" + t.text "metadata" + t.datetime "created_at", null: false + t.index ["last_heartbeat_at"], name: "index_solid_queue_processes_on_last_heartbeat_at" + t.index ["supervisor_id"], name: "index_solid_queue_processes_on_supervisor_id" + end + + create_table "solid_queue_ready_executions", force: :cascade do |t| + t.bigint "job_id", null: false + t.string "queue_name", null: false + t.integer "priority", default: 0, null: false + t.datetime "created_at", null: false + t.index ["job_id"], name: "index_solid_queue_ready_executions_on_job_id", unique: true + t.index ["priority", "job_id"], name: "index_solid_queue_poll_all" + t.index ["queue_name", "priority", "job_id"], name: "index_solid_queue_poll_by_queue" + end + + create_table "solid_queue_recurring_executions", force: :cascade do |t| + t.bigint "job_id", null: false + t.string "task_key", null: false + t.datetime "run_at", null: false + t.datetime "created_at", null: false + t.index ["job_id"], name: "index_solid_queue_recurring_executions_on_job_id", unique: true + t.index ["task_key", "run_at"], name: "index_solid_queue_recurring_executions_on_task_key_and_run_at", unique: true + end + + create_table "solid_queue_scheduled_executions", force: :cascade do |t| + t.bigint "job_id", null: false + t.string "queue_name", null: false + t.integer "priority", default: 0, null: false + t.datetime "scheduled_at", null: false + t.datetime "created_at", null: false + t.index ["job_id"], name: "index_solid_queue_scheduled_executions_on_job_id", unique: true + t.index ["scheduled_at", "priority", "job_id"], name: "index_solid_queue_dispatch_all" + end + + create_table "solid_queue_semaphores", force: :cascade do |t| + t.string "key", null: false + t.integer "value", default: 1, null: false + t.datetime "expires_at", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["expires_at"], name: "index_solid_queue_semaphores_on_expires_at" + t.index ["key", "value"], name: "index_solid_queue_semaphores_on_key_and_value" + t.index ["key"], name: "index_solid_queue_semaphores_on_key", unique: true + end + + create_table "spree_addresses", force: :cascade do |t| + t.string "firstname" + t.string "lastname" + t.string "address1" + t.string "address2" + t.string "city" + t.string "zipcode" + t.string "phone" + t.string "state_name" + t.string "alternative_phone" + t.string "company" + t.bigint "state_id" + t.bigint "country_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.bigint "user_id" + t.datetime "deleted_at", precision: nil + t.string "label" + t.jsonb "public_metadata" + t.jsonb "private_metadata" + t.index ["country_id"], name: "index_spree_addresses_on_country_id" + t.index ["deleted_at"], name: "index_spree_addresses_on_deleted_at" + t.index ["firstname"], name: "index_addresses_on_firstname" + t.index ["lastname"], name: "index_addresses_on_lastname" + t.index ["state_id"], name: "index_spree_addresses_on_state_id" + t.index ["user_id"], name: "index_spree_addresses_on_user_id" + end + + create_table "spree_adjustments", force: :cascade do |t| + t.string "source_type" + t.bigint "source_id" + t.string "adjustable_type" + t.bigint "adjustable_id" + t.decimal "amount", precision: 10, scale: 2 + t.string "label" + t.boolean "mandatory" + t.boolean "eligible", default: true + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "state" + t.bigint "order_id", null: false + t.boolean "included", default: false + t.index ["adjustable_id", "adjustable_type"], name: "index_spree_adjustments_on_adjustable_id_and_adjustable_type" + t.index ["eligible"], name: "index_spree_adjustments_on_eligible" + t.index ["order_id"], name: "index_spree_adjustments_on_order_id" + t.index ["source_id", "source_type"], name: "index_spree_adjustments_on_source_id_and_source_type" + end + + create_table "spree_assets", force: :cascade do |t| + t.string "viewable_type" + t.bigint "viewable_id" + t.integer "attachment_width" + t.integer "attachment_height" + t.integer "attachment_file_size" + t.integer "position" + t.string "attachment_content_type" + t.string "attachment_file_name" + t.string "type", limit: 75 + t.datetime "attachment_updated_at", precision: nil + t.text "alt" + t.datetime "created_at", precision: nil + t.datetime "updated_at", precision: nil + t.jsonb "public_metadata" + t.jsonb "private_metadata" + t.index ["position"], name: "index_spree_assets_on_position" + t.index ["viewable_id"], name: "index_assets_on_viewable_id" + t.index ["viewable_type", "type"], name: "index_assets_on_viewable_type_and_type" + end + + create_table "spree_calculators", force: :cascade do |t| + t.string "type" + t.string "calculable_type" + t.bigint "calculable_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.text "preferences" + t.datetime "deleted_at", precision: nil + t.index ["calculable_id", "calculable_type"], name: "index_spree_calculators_on_calculable_id_and_calculable_type" + t.index ["deleted_at"], name: "index_spree_calculators_on_deleted_at" + t.index ["id", "type"], name: "index_spree_calculators_on_id_and_type" + end + + create_table "spree_checks", force: :cascade do |t| + t.bigint "payment_method_id" + t.bigint "user_id" + t.string "account_holder_name" + t.string "account_holder_type" + t.string "routing_number" + t.string "account_number" + t.string "account_type", default: "checking" + t.string "status" + t.string "last_digits" + t.string "gateway_customer_profile_id" + t.string "gateway_payment_profile_id" + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false + t.datetime "deleted_at", precision: nil + t.index ["payment_method_id"], name: "index_spree_checks_on_payment_method_id" + t.index ["user_id"], name: "index_spree_checks_on_user_id" + end + + create_table "spree_cms_pages", force: :cascade do |t| + t.string "title", null: false + t.string "meta_title" + t.text "content" + t.text "meta_description" + t.boolean "visible", default: true + t.string "slug" + t.string "type" + t.string "locale" + t.datetime "deleted_at", precision: nil + t.bigint "store_id" + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false + t.index ["deleted_at"], name: "index_spree_cms_pages_on_deleted_at" + t.index ["slug", "store_id", "deleted_at"], name: "index_spree_cms_pages_on_slug_and_store_id_and_deleted_at", unique: true + t.index ["store_id", "locale", "type"], name: "index_spree_cms_pages_on_store_id_and_locale_and_type" + t.index ["store_id"], name: "index_spree_cms_pages_on_store_id" + t.index ["title", "type", "store_id"], name: "index_spree_cms_pages_on_title_and_type_and_store_id" + t.index ["visible"], name: "index_spree_cms_pages_on_visible" + end + + create_table "spree_cms_sections", force: :cascade do |t| + t.string "name", null: false + t.text "content" + t.text "settings" + t.string "fit" + t.string "destination" + t.string "type" + t.integer "position" + t.string "linked_resource_type" + t.bigint "linked_resource_id" + t.bigint "cms_page_id" + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false + t.index ["cms_page_id"], name: "index_spree_cms_sections_on_cms_page_id" + t.index ["linked_resource_type", "linked_resource_id"], name: "index_spree_cms_sections_on_linked_resource" + t.index ["position"], name: "index_spree_cms_sections_on_position" + t.index ["type"], name: "index_spree_cms_sections_on_type" + end + + create_table "spree_countries", force: :cascade do |t| + t.string "iso_name" + t.string "iso", null: false + t.string "iso3", null: false + t.string "name" + t.integer "numcode" + t.boolean "states_required", default: false + t.datetime "updated_at", precision: nil + t.boolean "zipcode_required", default: true + t.datetime "created_at", precision: nil + t.index ["iso"], name: "index_spree_countries_on_iso", unique: true + t.index ["iso3"], name: "index_spree_countries_on_iso3", unique: true + t.index ["iso_name"], name: "index_spree_countries_on_iso_name", unique: true + t.index ["name"], name: "index_spree_countries_on_name", unique: true + end + + create_table "spree_credit_cards", force: :cascade do |t| + t.string "month" + t.string "year" + t.string "cc_type" + t.string "last_digits" + t.bigint "address_id" + t.string "gateway_customer_profile_id" + t.string "gateway_payment_profile_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "name" + t.bigint "user_id" + t.bigint "payment_method_id" + t.boolean "default", default: false, null: false + t.datetime "deleted_at", precision: nil + t.jsonb "public_metadata" + t.jsonb "private_metadata" + t.index ["address_id"], name: "index_spree_credit_cards_on_address_id" + t.index ["deleted_at"], name: "index_spree_credit_cards_on_deleted_at" + t.index ["payment_method_id"], name: "index_spree_credit_cards_on_payment_method_id" + t.index ["user_id"], name: "index_spree_credit_cards_on_user_id" + end + + create_table "spree_customer_returns", force: :cascade do |t| + t.string "number" + t.bigint "stock_location_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.bigint "store_id" + t.jsonb "public_metadata" + t.jsonb "private_metadata" + t.index ["number"], name: "index_spree_customer_returns_on_number", unique: true + t.index ["stock_location_id"], name: "index_spree_customer_returns_on_stock_location_id" + t.index ["store_id"], name: "index_spree_customer_returns_on_store_id" + end + + create_table "spree_data_feeds", force: :cascade do |t| + t.bigint "store_id" + t.string "name" + t.string "type" + t.string "slug" + t.boolean "active", default: true + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["store_id", "slug", "type"], name: "index_spree_data_feeds_on_store_id_and_slug_and_type" + t.index ["store_id"], name: "index_spree_data_feeds_on_store_id" + end + + create_table "spree_digital_links", force: :cascade do |t| + t.bigint "digital_id" + t.bigint "line_item_id" + t.string "token" + t.integer "access_counter" + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false + t.index ["digital_id"], name: "index_spree_digital_links_on_digital_id" + t.index ["line_item_id"], name: "index_spree_digital_links_on_line_item_id" + t.index ["token"], name: "index_spree_digital_links_on_token", unique: true + end + + create_table "spree_digitals", force: :cascade do |t| + t.bigint "variant_id" + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false + t.index ["variant_id"], name: "index_spree_digitals_on_variant_id" + end + + create_table "spree_gateways", force: :cascade do |t| + t.string "type" + t.string "name" + t.text "description" + t.boolean "active", default: true + t.string "environment", default: "development" + t.string "server", default: "test" + t.boolean "test_mode", default: true + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.text "preferences" + t.index ["active"], name: "index_spree_gateways_on_active" + t.index ["test_mode"], name: "index_spree_gateways_on_test_mode" + end + + create_table "spree_inventory_units", force: :cascade do |t| + t.string "state" + t.bigint "variant_id" + t.bigint "order_id" + t.bigint "shipment_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.boolean "pending", default: true + t.bigint "line_item_id" + t.integer "quantity", default: 1 + t.bigint "original_return_item_id" + t.index ["line_item_id"], name: "index_spree_inventory_units_on_line_item_id" + t.index ["order_id"], name: "index_inventory_units_on_order_id" + t.index ["original_return_item_id"], name: "index_spree_inventory_units_on_original_return_item_id" + t.index ["shipment_id"], name: "index_inventory_units_on_shipment_id" + t.index ["variant_id"], name: "index_inventory_units_on_variant_id" + end + + create_table "spree_line_items", force: :cascade do |t| + t.bigint "variant_id" + t.bigint "order_id" + t.integer "quantity", null: false + t.decimal "price", precision: 10, scale: 2, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "currency" + t.decimal "cost_price", precision: 10, scale: 2 + t.bigint "tax_category_id" + t.decimal "adjustment_total", precision: 10, scale: 2, default: "0.0" + t.decimal "additional_tax_total", precision: 10, scale: 2, default: "0.0" + t.decimal "promo_total", precision: 10, scale: 2, default: "0.0" + t.decimal "included_tax_total", precision: 10, scale: 2, default: "0.0", null: false + t.decimal "pre_tax_amount", precision: 12, scale: 4, default: "0.0", null: false + t.decimal "taxable_adjustment_total", precision: 10, scale: 2, default: "0.0", null: false + t.decimal "non_taxable_adjustment_total", precision: 10, scale: 2, default: "0.0", null: false + t.jsonb "public_metadata" + t.jsonb "private_metadata" + t.index ["order_id"], name: "index_spree_line_items_on_order_id" + t.index ["tax_category_id"], name: "index_spree_line_items_on_tax_category_id" + t.index ["variant_id"], name: "index_spree_line_items_on_variant_id" + end + + create_table "spree_log_entries", force: :cascade do |t| + t.string "source_type" + t.bigint "source_id" + t.text "details" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["source_id", "source_type"], name: "index_spree_log_entries_on_source_id_and_source_type" + end + + create_table "spree_menu_items", force: :cascade do |t| + t.string "name", null: false + t.string "subtitle" + t.string "destination" + t.boolean "new_window", default: false + t.string "item_type" + t.string "linked_resource_type", default: "Spree::Linkable::Uri" + t.bigint "linked_resource_id" + t.string "code" + t.bigint "parent_id" + t.bigint "lft", null: false + t.bigint "rgt", null: false + t.integer "depth", default: 0, null: false + t.bigint "menu_id" + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false + t.index ["code"], name: "index_spree_menu_items_on_code" + t.index ["depth"], name: "index_spree_menu_items_on_depth" + t.index ["item_type"], name: "index_spree_menu_items_on_item_type" + t.index ["lft"], name: "index_spree_menu_items_on_lft" + t.index ["linked_resource_type", "linked_resource_id"], name: "index_spree_menu_items_on_linked_resource" + t.index ["menu_id"], name: "index_spree_menu_items_on_menu_id" + t.index ["parent_id"], name: "index_spree_menu_items_on_parent_id" + t.index ["rgt"], name: "index_spree_menu_items_on_rgt" + end + + create_table "spree_menus", force: :cascade do |t| + t.string "name" + t.string "location" + t.string "locale" + t.bigint "store_id" + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false + t.index ["locale"], name: "index_spree_menus_on_locale" + t.index ["store_id", "location", "locale"], name: "index_spree_menus_on_store_id_and_location_and_locale", unique: true + t.index ["store_id"], name: "index_spree_menus_on_store_id" + end + + create_table "spree_oauth_access_grants", force: :cascade do |t| + t.bigint "resource_owner_id", null: false + t.bigint "application_id", null: false + t.string "token", null: false + t.integer "expires_in", null: false + t.text "redirect_uri", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "revoked_at", precision: nil + t.string "scopes" + t.string "resource_owner_type", null: false + t.index ["application_id"], name: "index_spree_oauth_access_grants_on_application_id" + t.index ["resource_owner_id", "resource_owner_type"], name: "polymorphic_owner_oauth_access_grants" + t.index ["token"], name: "index_spree_oauth_access_grants_on_token", unique: true + end + + create_table "spree_oauth_access_tokens", force: :cascade do |t| + t.bigint "resource_owner_id" + t.bigint "application_id" + t.string "token", null: false + t.string "refresh_token" + t.integer "expires_in" + t.datetime "revoked_at", precision: nil + t.datetime "created_at", precision: nil, null: false + t.string "scopes" + t.string "previous_refresh_token", default: "", null: false + t.string "resource_owner_type" + t.index ["application_id"], name: "index_spree_oauth_access_tokens_on_application_id" + t.index ["refresh_token"], name: "index_spree_oauth_access_tokens_on_refresh_token", unique: true + t.index ["resource_owner_id", "resource_owner_type"], name: "polymorphic_owner_oauth_access_tokens" + t.index ["resource_owner_id"], name: "index_spree_oauth_access_tokens_on_resource_owner_id" + t.index ["token"], name: "index_spree_oauth_access_tokens_on_token", unique: true + end + + create_table "spree_oauth_applications", force: :cascade do |t| + t.string "name", null: false + t.string "uid", null: false + t.string "secret", null: false + t.text "redirect_uri", null: false + t.string "scopes", default: "", null: false + t.boolean "confidential", default: true, null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false + t.index ["uid"], name: "index_spree_oauth_applications_on_uid", unique: true + end + + create_table "spree_option_type_prototypes", force: :cascade do |t| + t.bigint "prototype_id" + t.bigint "option_type_id" + t.datetime "created_at", precision: nil + t.datetime "updated_at", precision: nil + t.index ["option_type_id"], name: "index_spree_option_type_prototypes_on_option_type_id" + t.index ["prototype_id", "option_type_id"], name: "spree_option_type_prototypes_prototype_id_option_type_id", unique: true + t.index ["prototype_id"], name: "index_spree_option_type_prototypes_on_prototype_id" + end + + create_table "spree_option_type_translations", force: :cascade do |t| + t.string "presentation" + t.string "locale", null: false + t.bigint "spree_option_type_id", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["locale"], name: "index_spree_option_type_translations_on_locale" + t.index ["spree_option_type_id", "locale"], name: "unique_option_type_id_per_locale", unique: true + end + + create_table "spree_option_types", force: :cascade do |t| + t.string "name", limit: 100 + t.string "presentation", limit: 100 + t.integer "position", default: 0, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.boolean "filterable", default: true, null: false + t.jsonb "public_metadata" + t.jsonb "private_metadata" + t.index ["filterable"], name: "index_spree_option_types_on_filterable" + t.index ["name"], name: "index_spree_option_types_on_name" + t.index ["position"], name: "index_spree_option_types_on_position" + end + + create_table "spree_option_value_translations", force: :cascade do |t| + t.string "presentation" + t.string "locale", null: false + t.bigint "spree_option_value_id", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["locale"], name: "index_spree_option_value_translations_on_locale" + t.index ["spree_option_value_id", "locale"], name: "unique_option_value_id_per_locale", unique: true + end + + create_table "spree_option_value_variants", force: :cascade do |t| + t.bigint "variant_id" + t.bigint "option_value_id" + t.datetime "created_at", precision: nil + t.datetime "updated_at", precision: nil + t.index ["option_value_id"], name: "index_spree_option_value_variants_on_option_value_id" + t.index ["variant_id", "option_value_id"], name: "index_option_values_variants_on_variant_id_and_option_value_id", unique: true + t.index ["variant_id"], name: "index_spree_option_value_variants_on_variant_id" + end + + create_table "spree_option_values", force: :cascade do |t| + t.integer "position" + t.string "name" + t.string "presentation" + t.bigint "option_type_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.jsonb "public_metadata" + t.jsonb "private_metadata" + t.index ["name"], name: "index_spree_option_values_on_name" + t.index ["option_type_id"], name: "index_spree_option_values_on_option_type_id" + t.index ["position"], name: "index_spree_option_values_on_position" + end + + create_table "spree_order_promotions", force: :cascade do |t| + t.bigint "order_id" + t.bigint "promotion_id" + t.datetime "created_at", precision: nil + t.datetime "updated_at", precision: nil + t.index ["order_id"], name: "index_spree_order_promotions_on_order_id" + t.index ["promotion_id", "order_id"], name: "index_spree_order_promotions_on_promotion_id_and_order_id" + t.index ["promotion_id"], name: "index_spree_order_promotions_on_promotion_id" + end + + create_table "spree_orders", force: :cascade do |t| + t.string "number", limit: 32 + t.decimal "item_total", precision: 10, scale: 2, default: "0.0", null: false + t.decimal "total", precision: 10, scale: 2, default: "0.0", null: false + t.string "state" + t.decimal "adjustment_total", precision: 10, scale: 2, default: "0.0", null: false + t.bigint "user_id" + t.datetime "completed_at", precision: nil + t.bigint "bill_address_id" + t.bigint "ship_address_id" + t.decimal "payment_total", precision: 10, scale: 2, default: "0.0" + t.string "shipment_state" + t.string "payment_state" + t.string "email" + t.text "special_instructions" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "currency" + t.string "last_ip_address" + t.bigint "created_by_id" + t.decimal "shipment_total", precision: 10, scale: 2, default: "0.0", null: false + t.decimal "additional_tax_total", precision: 10, scale: 2, default: "0.0" + t.decimal "promo_total", precision: 10, scale: 2, default: "0.0" + t.string "channel", default: "spree" + t.decimal "included_tax_total", precision: 10, scale: 2, default: "0.0", null: false + t.integer "item_count", default: 0 + t.bigint "approver_id" + t.datetime "approved_at", precision: nil + t.boolean "confirmation_delivered", default: false + t.boolean "considered_risky", default: false + t.string "token" + t.datetime "canceled_at", precision: nil + t.bigint "canceler_id" + t.bigint "store_id" + t.integer "state_lock_version", default: 0, null: false + t.decimal "taxable_adjustment_total", precision: 10, scale: 2, default: "0.0", null: false + t.decimal "non_taxable_adjustment_total", precision: 10, scale: 2, default: "0.0", null: false + t.boolean "store_owner_notification_delivered" + t.jsonb "public_metadata" + t.jsonb "private_metadata" + t.text "internal_note" + t.index ["approver_id"], name: "index_spree_orders_on_approver_id" + t.index ["bill_address_id"], name: "index_spree_orders_on_bill_address_id" + t.index ["canceler_id"], name: "index_spree_orders_on_canceler_id" + t.index ["completed_at"], name: "index_spree_orders_on_completed_at" + t.index ["confirmation_delivered"], name: "index_spree_orders_on_confirmation_delivered" + t.index ["considered_risky"], name: "index_spree_orders_on_considered_risky" + t.index ["created_by_id"], name: "index_spree_orders_on_created_by_id" + t.index ["number"], name: "index_spree_orders_on_number", unique: true + t.index ["ship_address_id"], name: "index_spree_orders_on_ship_address_id" + t.index ["store_id"], name: "index_spree_orders_on_store_id" + t.index ["token"], name: "index_spree_orders_on_token" + t.index ["user_id", "created_by_id"], name: "index_spree_orders_on_user_id_and_created_by_id" + end + + create_table "spree_payment_capture_events", force: :cascade do |t| + t.decimal "amount", precision: 10, scale: 2, default: "0.0" + t.bigint "payment_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["payment_id"], name: "index_spree_payment_capture_events_on_payment_id" + end + + create_table "spree_payment_methods", force: :cascade do |t| + t.string "type" + t.string "name" + t.text "description" + t.boolean "active", default: true + t.datetime "deleted_at", precision: nil + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "display_on", default: "both" + t.boolean "auto_capture" + t.text "preferences" + t.integer "position", default: 0 + t.jsonb "public_metadata" + t.jsonb "private_metadata" + t.jsonb "settings" + t.index ["id", "type"], name: "index_spree_payment_methods_on_id_and_type" + t.index ["id"], name: "index_spree_payment_methods_on_id" + end + + create_table "spree_payment_methods_stores", id: false, force: :cascade do |t| + t.bigint "payment_method_id" + t.bigint "store_id" + t.index ["payment_method_id", "store_id"], name: "payment_mentod_id_store_id_unique_index", unique: true + t.index ["payment_method_id"], name: "index_spree_payment_methods_stores_on_payment_method_id" + t.index ["store_id"], name: "index_spree_payment_methods_stores_on_store_id" + end + + create_table "spree_payment_sources", force: :cascade do |t| + t.string "gateway_payment_profile_id" + t.string "type" + t.bigint "payment_method_id" + t.bigint "user_id" + t.jsonb "public_metadata" + t.jsonb "private_metadata" + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false + t.index ["payment_method_id"], name: "index_spree_payment_sources_on_payment_method_id" + t.index ["type", "gateway_payment_profile_id"], name: "index_payment_sources_on_type_and_gateway_payment_profile_id", unique: true + t.index ["type"], name: "index_spree_payment_sources_on_type" + t.index ["user_id"], name: "index_spree_payment_sources_on_user_id" + end + + create_table "spree_payments", force: :cascade do |t| + t.decimal "amount", precision: 10, scale: 2, default: "0.0", null: false + t.bigint "order_id" + t.string "source_type" + t.bigint "source_id" + t.bigint "payment_method_id" + t.string "state" + t.string "response_code" + t.string "avs_response" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "number" + t.string "cvv_response_code" + t.string "cvv_response_message" + t.jsonb "public_metadata" + t.jsonb "private_metadata" + t.string "intent_client_key" + t.index ["number"], name: "index_spree_payments_on_number", unique: true + t.index ["order_id"], name: "index_spree_payments_on_order_id" + t.index ["payment_method_id"], name: "index_spree_payments_on_payment_method_id" + t.index ["source_id", "source_type"], name: "index_spree_payments_on_source_id_and_source_type" + end + + create_table "spree_preferences", force: :cascade do |t| + t.text "value" + t.string "key" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["key"], name: "index_spree_preferences_on_key", unique: true + end + + create_table "spree_prices", force: :cascade do |t| + t.bigint "variant_id", null: false + t.decimal "amount", precision: 10, scale: 2 + t.string "currency" + t.datetime "deleted_at", precision: nil + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false + t.decimal "compare_at_amount", precision: 10, scale: 2 + t.index ["deleted_at"], name: "index_spree_prices_on_deleted_at" + t.index ["variant_id", "currency"], name: "index_spree_prices_on_variant_id_and_currency" + t.index ["variant_id"], name: "index_spree_prices_on_variant_id" + end + + create_table "spree_product_option_types", force: :cascade do |t| + t.integer "position" + t.bigint "product_id" + t.bigint "option_type_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["option_type_id"], name: "index_spree_product_option_types_on_option_type_id" + t.index ["position"], name: "index_spree_product_option_types_on_position" + t.index ["product_id"], name: "index_spree_product_option_types_on_product_id" + end + + create_table "spree_product_promotion_rules", force: :cascade do |t| + t.bigint "product_id" + t.bigint "promotion_rule_id" + t.datetime "created_at", precision: nil + t.datetime "updated_at", precision: nil + t.index ["product_id"], name: "index_products_promotion_rules_on_product_id" + t.index ["promotion_rule_id", "product_id"], name: "index_products_promotion_rules_on_promotion_rule_and_product" + end + + create_table "spree_product_properties", force: :cascade do |t| + t.string "value" + t.bigint "product_id" + t.bigint "property_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "position", default: 0 + t.boolean "show_property", default: true + t.string "filter_param" + t.index ["filter_param"], name: "index_spree_product_properties_on_filter_param" + t.index ["position"], name: "index_spree_product_properties_on_position" + t.index ["product_id"], name: "index_product_properties_on_product_id" + t.index ["property_id", "product_id"], name: "index_spree_product_properties_on_property_id_and_product_id", unique: true + t.index ["property_id"], name: "index_spree_product_properties_on_property_id" + end + + create_table "spree_product_property_translations", force: :cascade do |t| + t.string "value" + t.string "locale", null: false + t.bigint "spree_product_property_id", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["locale"], name: "index_spree_product_property_translations_on_locale" + t.index ["spree_product_property_id", "locale"], name: "unique_product_property_id_per_locale", unique: true + end + + create_table "spree_product_translations", force: :cascade do |t| + t.string "name" + t.text "description" + t.string "locale", null: false + t.bigint "spree_product_id", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.text "meta_description" + t.string "meta_keywords" + t.string "meta_title" + t.string "slug" + t.datetime "deleted_at", precision: nil + t.index ["deleted_at"], name: "index_spree_product_translations_on_deleted_at" + t.index ["locale", "slug"], name: "unique_slug_per_locale", unique: true + t.index ["locale"], name: "index_spree_product_translations_on_locale" + t.index ["spree_product_id", "locale"], name: "unique_product_id_per_locale", unique: true + end + + create_table "spree_products", force: :cascade do |t| + t.string "name", default: "", null: false + t.text "description" + t.datetime "available_on", precision: nil + t.datetime "deleted_at", precision: nil + t.string "slug" + t.text "meta_description" + t.string "meta_keywords" + t.bigint "tax_category_id" + t.bigint "shipping_category_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.boolean "promotionable", default: true + t.string "meta_title" + t.datetime "discontinue_on", precision: nil + t.jsonb "public_metadata" + t.jsonb "private_metadata" + t.string "status", default: "draft", null: false + t.datetime "make_active_at", precision: nil + t.index ["available_on"], name: "index_spree_products_on_available_on" + t.index ["deleted_at"], name: "index_spree_products_on_deleted_at" + t.index ["discontinue_on"], name: "index_spree_products_on_discontinue_on" + t.index ["make_active_at"], name: "index_spree_products_on_make_active_at" + t.index ["name"], name: "index_spree_products_on_name" + t.index ["shipping_category_id"], name: "index_spree_products_on_shipping_category_id" + t.index ["slug"], name: "index_spree_products_on_slug", unique: true + t.index ["status", "deleted_at"], name: "index_spree_products_on_status_and_deleted_at" + t.index ["status"], name: "index_spree_products_on_status" + t.index ["tax_category_id"], name: "index_spree_products_on_tax_category_id" + end + + create_table "spree_products_stores", force: :cascade do |t| + t.bigint "product_id" + t.bigint "store_id" + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false + t.index ["product_id", "store_id"], name: "index_spree_products_stores_on_product_id_and_store_id", unique: true + t.index ["product_id"], name: "index_spree_products_stores_on_product_id" + t.index ["store_id"], name: "index_spree_products_stores_on_store_id" + end + + create_table "spree_products_taxons", force: :cascade do |t| + t.bigint "product_id" + t.bigint "taxon_id" + t.integer "position" + t.datetime "created_at", precision: nil + t.datetime "updated_at", precision: nil + t.index ["position"], name: "index_spree_products_taxons_on_position" + t.index ["product_id", "taxon_id"], name: "index_spree_products_taxons_on_product_id_and_taxon_id", unique: true + t.index ["product_id"], name: "index_spree_products_taxons_on_product_id" + t.index ["taxon_id"], name: "index_spree_products_taxons_on_taxon_id" + end + + create_table "spree_promotion_action_line_items", force: :cascade do |t| + t.bigint "promotion_action_id" + t.bigint "variant_id" + t.integer "quantity", default: 1 + t.datetime "created_at", precision: nil + t.datetime "updated_at", precision: nil + t.index ["promotion_action_id"], name: "index_spree_promotion_action_line_items_on_promotion_action_id" + t.index ["variant_id"], name: "index_spree_promotion_action_line_items_on_variant_id" + end + + create_table "spree_promotion_actions", force: :cascade do |t| + t.bigint "promotion_id" + t.integer "position" + t.string "type" + t.datetime "deleted_at", precision: nil + t.datetime "created_at", precision: nil + t.datetime "updated_at", precision: nil + t.index ["deleted_at"], name: "index_spree_promotion_actions_on_deleted_at" + t.index ["id", "type"], name: "index_spree_promotion_actions_on_id_and_type" + t.index ["promotion_id"], name: "index_spree_promotion_actions_on_promotion_id" + end + + create_table "spree_promotion_categories", force: :cascade do |t| + t.string "name" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "code" + end + + create_table "spree_promotion_rule_taxons", force: :cascade do |t| + t.bigint "taxon_id" + t.bigint "promotion_rule_id" + t.datetime "created_at", precision: nil + t.datetime "updated_at", precision: nil + t.index ["promotion_rule_id"], name: "index_spree_promotion_rule_taxons_on_promotion_rule_id" + t.index ["taxon_id"], name: "index_spree_promotion_rule_taxons_on_taxon_id" + end + + create_table "spree_promotion_rule_users", force: :cascade do |t| + t.bigint "user_id" + t.bigint "promotion_rule_id" + t.datetime "created_at", precision: nil + t.datetime "updated_at", precision: nil + t.index ["promotion_rule_id"], name: "index_promotion_rules_users_on_promotion_rule_id" + t.index ["user_id", "promotion_rule_id"], name: "index_promotion_rules_users_on_user_id_and_promotion_rule_id" + end + + create_table "spree_promotion_rules", force: :cascade do |t| + t.bigint "promotion_id" + t.bigint "user_id" + t.bigint "product_group_id" + t.string "type" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "code" + t.text "preferences" + t.index ["product_group_id"], name: "index_promotion_rules_on_product_group_id" + t.index ["promotion_id"], name: "index_spree_promotion_rules_on_promotion_id" + t.index ["user_id"], name: "index_promotion_rules_on_user_id" + end + + create_table "spree_promotions", force: :cascade do |t| + t.string "description" + t.datetime "expires_at", precision: nil + t.datetime "starts_at", precision: nil + t.string "name" + t.string "type" + t.integer "usage_limit" + t.string "match_policy", default: "all" + t.string "code" + t.boolean "advertise", default: false + t.string "path" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.bigint "promotion_category_id" + t.jsonb "public_metadata" + t.jsonb "private_metadata" + t.index ["advertise"], name: "index_spree_promotions_on_advertise" + t.index ["code"], name: "index_spree_promotions_on_code" + t.index ["expires_at"], name: "index_spree_promotions_on_expires_at" + t.index ["id", "type"], name: "index_spree_promotions_on_id_and_type" + t.index ["path"], name: "index_spree_promotions_on_path" + t.index ["promotion_category_id"], name: "index_spree_promotions_on_promotion_category_id" + t.index ["starts_at"], name: "index_spree_promotions_on_starts_at" + end + + create_table "spree_promotions_stores", force: :cascade do |t| + t.bigint "promotion_id" + t.bigint "store_id" + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false + t.index ["promotion_id", "store_id"], name: "index_spree_promotions_stores_on_promotion_id_and_store_id", unique: true + t.index ["promotion_id"], name: "index_spree_promotions_stores_on_promotion_id" + t.index ["store_id"], name: "index_spree_promotions_stores_on_store_id" + end + + create_table "spree_properties", force: :cascade do |t| + t.string "name" + t.string "presentation", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.boolean "filterable", default: false, null: false + t.string "filter_param" + t.jsonb "public_metadata" + t.jsonb "private_metadata" + t.index ["filter_param"], name: "index_spree_properties_on_filter_param" + t.index ["filterable"], name: "index_spree_properties_on_filterable" + t.index ["name"], name: "index_spree_properties_on_name" + end + + create_table "spree_property_prototypes", force: :cascade do |t| + t.bigint "prototype_id" + t.bigint "property_id" + t.datetime "created_at", precision: nil + t.datetime "updated_at", precision: nil + t.index ["property_id"], name: "index_spree_property_prototypes_on_property_id" + t.index ["prototype_id", "property_id"], name: "index_property_prototypes_on_prototype_id_and_property_id", unique: true + t.index ["prototype_id"], name: "index_spree_property_prototypes_on_prototype_id" + end + + create_table "spree_property_translations", force: :cascade do |t| + t.string "presentation" + t.string "locale", null: false + t.bigint "spree_property_id", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["locale"], name: "index_spree_property_translations_on_locale" + t.index ["spree_property_id", "locale"], name: "unique_property_id_per_locale", unique: true + end + + create_table "spree_prototype_taxons", force: :cascade do |t| + t.bigint "taxon_id" + t.bigint "prototype_id" + t.datetime "created_at", precision: nil + t.datetime "updated_at", precision: nil + t.index ["prototype_id", "taxon_id"], name: "index_spree_prototype_taxons_on_prototype_id_and_taxon_id" + t.index ["prototype_id"], name: "index_spree_prototype_taxons_on_prototype_id" + t.index ["taxon_id"], name: "index_spree_prototype_taxons_on_taxon_id" + end + + create_table "spree_prototypes", force: :cascade do |t| + t.string "name" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.jsonb "public_metadata" + t.jsonb "private_metadata" + end + + create_table "spree_refund_reasons", force: :cascade do |t| + t.string "name" + t.boolean "active", default: true + t.boolean "mutable", default: true + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["name"], name: "index_spree_refund_reasons_on_name", unique: true + end + + create_table "spree_refunds", force: :cascade do |t| + t.bigint "payment_id" + t.decimal "amount", precision: 10, scale: 2, default: "0.0", null: false + t.string "transaction_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.bigint "refund_reason_id" + t.bigint "reimbursement_id" + t.jsonb "public_metadata" + t.jsonb "private_metadata" + t.index ["payment_id"], name: "index_spree_refunds_on_payment_id" + t.index ["refund_reason_id"], name: "index_refunds_on_refund_reason_id" + t.index ["reimbursement_id"], name: "index_spree_refunds_on_reimbursement_id" + end + + create_table "spree_reimbursement_credits", force: :cascade do |t| + t.decimal "amount", precision: 10, scale: 2, default: "0.0", null: false + t.bigint "reimbursement_id" + t.bigint "creditable_id" + t.string "creditable_type" + t.datetime "created_at", precision: nil + t.datetime "updated_at", precision: nil + t.index ["creditable_id", "creditable_type"], name: "index_reimbursement_credits_on_creditable_id_and_type" + t.index ["reimbursement_id"], name: "index_spree_reimbursement_credits_on_reimbursement_id" + end + + create_table "spree_reimbursement_types", force: :cascade do |t| + t.string "name" + t.boolean "active", default: true + t.boolean "mutable", default: true + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "type" + t.index ["name"], name: "index_spree_reimbursement_types_on_name", unique: true + t.index ["type"], name: "index_spree_reimbursement_types_on_type" + end + + create_table "spree_reimbursements", force: :cascade do |t| + t.string "number" + t.string "reimbursement_status" + t.bigint "customer_return_id" + t.bigint "order_id" + t.decimal "total", precision: 10, scale: 2 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["customer_return_id"], name: "index_spree_reimbursements_on_customer_return_id" + t.index ["number"], name: "index_spree_reimbursements_on_number", unique: true + t.index ["order_id"], name: "index_spree_reimbursements_on_order_id" + end + + create_table "spree_return_authorization_reasons", force: :cascade do |t| + t.string "name" + t.boolean "active", default: true + t.boolean "mutable", default: true + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["name"], name: "index_spree_return_authorization_reasons_on_name", unique: true + end + + create_table "spree_return_authorizations", force: :cascade do |t| + t.string "number" + t.string "state" + t.bigint "order_id" + t.text "memo" + t.datetime "created_at", precision: nil + t.datetime "updated_at", precision: nil + t.bigint "stock_location_id" + t.bigint "return_authorization_reason_id" + t.index ["number"], name: "index_spree_return_authorizations_on_number", unique: true + t.index ["order_id"], name: "index_spree_return_authorizations_on_order_id" + t.index ["return_authorization_reason_id"], name: "index_return_authorizations_on_return_authorization_reason_id" + t.index ["stock_location_id"], name: "index_spree_return_authorizations_on_stock_location_id" + end + + create_table "spree_return_items", force: :cascade do |t| + t.bigint "return_authorization_id" + t.bigint "inventory_unit_id" + t.bigint "exchange_variant_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.decimal "pre_tax_amount", precision: 12, scale: 4, default: "0.0", null: false + t.decimal "included_tax_total", precision: 12, scale: 4, default: "0.0", null: false + t.decimal "additional_tax_total", precision: 12, scale: 4, default: "0.0", null: false + t.string "reception_status" + t.string "acceptance_status" + t.bigint "customer_return_id" + t.bigint "reimbursement_id" + t.text "acceptance_status_errors" + t.bigint "preferred_reimbursement_type_id" + t.bigint "override_reimbursement_type_id" + t.boolean "resellable", default: true, null: false + t.index ["customer_return_id"], name: "index_return_items_on_customer_return_id" + t.index ["exchange_variant_id"], name: "index_spree_return_items_on_exchange_variant_id" + t.index ["inventory_unit_id"], name: "index_spree_return_items_on_inventory_unit_id" + t.index ["override_reimbursement_type_id"], name: "index_spree_return_items_on_override_reimbursement_type_id" + t.index ["preferred_reimbursement_type_id"], name: "index_spree_return_items_on_preferred_reimbursement_type_id" + t.index ["reimbursement_id"], name: "index_spree_return_items_on_reimbursement_id" + t.index ["return_authorization_id"], name: "index_spree_return_items_on_return_authorization_id" + end + + create_table "spree_role_users", force: :cascade do |t| + t.bigint "role_id" + t.bigint "user_id" + t.datetime "created_at", precision: nil + t.datetime "updated_at", precision: nil + t.index ["role_id"], name: "index_spree_role_users_on_role_id" + t.index ["user_id"], name: "index_spree_role_users_on_user_id" + end + + create_table "spree_roles", force: :cascade do |t| + t.string "name" + t.datetime "created_at", precision: nil + t.datetime "updated_at", precision: nil + t.index ["name"], name: "index_spree_roles_on_name", unique: true + end + + create_table "spree_shipments", force: :cascade do |t| + t.string "tracking" + t.string "number" + t.decimal "cost", precision: 10, scale: 2, default: "0.0" + t.datetime "shipped_at", precision: nil + t.bigint "order_id" + t.bigint "address_id" + t.string "state" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.bigint "stock_location_id" + t.decimal "adjustment_total", precision: 10, scale: 2, default: "0.0" + t.decimal "additional_tax_total", precision: 10, scale: 2, default: "0.0" + t.decimal "promo_total", precision: 10, scale: 2, default: "0.0" + t.decimal "included_tax_total", precision: 10, scale: 2, default: "0.0", null: false + t.decimal "pre_tax_amount", precision: 12, scale: 4, default: "0.0", null: false + t.decimal "taxable_adjustment_total", precision: 10, scale: 2, default: "0.0", null: false + t.decimal "non_taxable_adjustment_total", precision: 10, scale: 2, default: "0.0", null: false + t.jsonb "public_metadata" + t.jsonb "private_metadata" + t.index ["address_id"], name: "index_spree_shipments_on_address_id" + t.index ["number"], name: "index_spree_shipments_on_number", unique: true + t.index ["order_id"], name: "index_spree_shipments_on_order_id" + t.index ["stock_location_id"], name: "index_spree_shipments_on_stock_location_id" + end + + create_table "spree_shipping_categories", force: :cascade do |t| + t.string "name" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["name"], name: "index_spree_shipping_categories_on_name" + end + + create_table "spree_shipping_method_categories", force: :cascade do |t| + t.bigint "shipping_method_id", null: false + t.bigint "shipping_category_id", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["shipping_category_id", "shipping_method_id"], name: "unique_spree_shipping_method_categories", unique: true + t.index ["shipping_category_id"], name: "index_spree_shipping_method_categories_on_shipping_category_id" + t.index ["shipping_method_id"], name: "index_spree_shipping_method_categories_on_shipping_method_id" + end + + create_table "spree_shipping_method_zones", force: :cascade do |t| + t.bigint "shipping_method_id" + t.bigint "zone_id" + t.datetime "created_at", precision: nil + t.datetime "updated_at", precision: nil + t.index ["shipping_method_id"], name: "index_spree_shipping_method_zones_on_shipping_method_id" + t.index ["zone_id"], name: "index_spree_shipping_method_zones_on_zone_id" + end + + create_table "spree_shipping_methods", force: :cascade do |t| + t.string "name" + t.string "display_on" + t.datetime "deleted_at", precision: nil + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "tracking_url" + t.string "admin_name" + t.bigint "tax_category_id" + t.string "code" + t.jsonb "public_metadata" + t.jsonb "private_metadata" + t.index ["deleted_at"], name: "index_spree_shipping_methods_on_deleted_at" + t.index ["tax_category_id"], name: "index_spree_shipping_methods_on_tax_category_id" + end + + create_table "spree_shipping_rates", force: :cascade do |t| + t.bigint "shipment_id" + t.bigint "shipping_method_id" + t.boolean "selected", default: false + t.decimal "cost", precision: 8, scale: 2, default: "0.0" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.bigint "tax_rate_id" + t.index ["selected"], name: "index_spree_shipping_rates_on_selected" + t.index ["shipment_id", "shipping_method_id"], name: "spree_shipping_rates_join_index", unique: true + t.index ["shipment_id"], name: "index_spree_shipping_rates_on_shipment_id" + t.index ["shipping_method_id"], name: "index_spree_shipping_rates_on_shipping_method_id" + t.index ["tax_rate_id"], name: "index_spree_shipping_rates_on_tax_rate_id" + end + + create_table "spree_state_changes", force: :cascade do |t| + t.string "name" + t.string "previous_state" + t.bigint "stateful_id" + t.bigint "user_id" + t.string "stateful_type" + t.string "next_state" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["stateful_id", "stateful_type"], name: "index_spree_state_changes_on_stateful_id_and_stateful_type" + end + + create_table "spree_states", force: :cascade do |t| + t.string "name" + t.string "abbr" + t.bigint "country_id" + t.datetime "updated_at", precision: nil + t.datetime "created_at", precision: nil + t.index ["country_id"], name: "index_spree_states_on_country_id" + end + + create_table "spree_stock_items", force: :cascade do |t| + t.bigint "stock_location_id" + t.bigint "variant_id" + t.integer "count_on_hand", default: 0, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.boolean "backorderable", default: false + t.datetime "deleted_at", precision: nil + t.jsonb "public_metadata" + t.jsonb "private_metadata" + t.index ["backorderable"], name: "index_spree_stock_items_on_backorderable" + t.index ["deleted_at"], name: "index_spree_stock_items_on_deleted_at" + t.index ["stock_location_id", "variant_id", "deleted_at"], name: "stock_item_by_loc_var_id_deleted_at", unique: true + t.index ["stock_location_id", "variant_id"], name: "stock_item_by_loc_and_var_id" + t.index ["stock_location_id"], name: "index_spree_stock_items_on_stock_location_id" + t.index ["variant_id", "stock_location_id"], name: "index_spree_stock_items_unique_without_deleted_at", unique: true, where: "(deleted_at IS NULL)" + t.index ["variant_id"], name: "index_spree_stock_items_on_variant_id" + end + + create_table "spree_stock_locations", force: :cascade do |t| + t.string "name" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.boolean "default", default: false, null: false + t.string "address1" + t.string "address2" + t.string "city" + t.bigint "state_id" + t.string "state_name" + t.bigint "country_id" + t.string "zipcode" + t.string "phone" + t.boolean "active", default: true + t.boolean "backorderable_default", default: false + t.boolean "propagate_all_variants", default: false + t.string "admin_name" + t.index ["active"], name: "index_spree_stock_locations_on_active" + t.index ["backorderable_default"], name: "index_spree_stock_locations_on_backorderable_default" + t.index ["country_id"], name: "index_spree_stock_locations_on_country_id" + t.index ["propagate_all_variants"], name: "index_spree_stock_locations_on_propagate_all_variants" + t.index ["state_id"], name: "index_spree_stock_locations_on_state_id" + end + + create_table "spree_stock_movements", force: :cascade do |t| + t.bigint "stock_item_id" + t.integer "quantity", default: 0 + t.string "action" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "originator_type" + t.bigint "originator_id" + t.index ["originator_id", "originator_type"], name: "index_stock_movements_on_originator_id_and_originator_type" + t.index ["stock_item_id"], name: "index_spree_stock_movements_on_stock_item_id" + end + + create_table "spree_stock_transfers", force: :cascade do |t| + t.string "type" + t.string "reference" + t.bigint "source_location_id" + t.bigint "destination_location_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "number" + t.jsonb "public_metadata" + t.jsonb "private_metadata" + t.index ["destination_location_id"], name: "index_spree_stock_transfers_on_destination_location_id" + t.index ["number"], name: "index_spree_stock_transfers_on_number", unique: true + t.index ["source_location_id"], name: "index_spree_stock_transfers_on_source_location_id" + end + + create_table "spree_store_credit_categories", force: :cascade do |t| + t.string "name" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "spree_store_credit_events", force: :cascade do |t| + t.bigint "store_credit_id", null: false + t.string "action", null: false + t.decimal "amount", precision: 8, scale: 2 + t.string "authorization_code", null: false + t.decimal "user_total_amount", precision: 8, scale: 2, default: "0.0", null: false + t.bigint "originator_id" + t.string "originator_type" + t.datetime "deleted_at", precision: nil + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["originator_id", "originator_type"], name: "spree_store_credit_events_originator" + t.index ["store_credit_id"], name: "index_spree_store_credit_events_on_store_credit_id" + end + + create_table "spree_store_credit_types", force: :cascade do |t| + t.string "name" + t.integer "priority" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["priority"], name: "index_spree_store_credit_types_on_priority" + end + + create_table "spree_store_credits", force: :cascade do |t| + t.bigint "user_id" + t.bigint "category_id" + t.bigint "created_by_id" + t.decimal "amount", precision: 8, scale: 2, default: "0.0", null: false + t.decimal "amount_used", precision: 8, scale: 2, default: "0.0", null: false + t.text "memo" + t.datetime "deleted_at", precision: nil + t.string "currency" + t.decimal "amount_authorized", precision: 8, scale: 2, default: "0.0", null: false + t.bigint "originator_id" + t.string "originator_type" + t.bigint "type_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.bigint "store_id" + t.jsonb "public_metadata" + t.jsonb "private_metadata" + t.index ["deleted_at"], name: "index_spree_store_credits_on_deleted_at" + t.index ["originator_id", "originator_type"], name: "spree_store_credits_originator" + t.index ["store_id"], name: "index_spree_store_credits_on_store_id" + t.index ["type_id"], name: "index_spree_store_credits_on_type_id" + t.index ["user_id"], name: "index_spree_store_credits_on_user_id" + end + + create_table "spree_store_translations", force: :cascade do |t| + t.string "name" + t.text "meta_description" + t.text "meta_keywords" + t.string "seo_title" + t.string "facebook" + t.string "twitter" + t.string "instagram" + t.string "customer_support_email" + t.text "description" + t.text "address" + t.string "contact_phone" + t.string "new_order_notifications_email" + t.string "locale", null: false + t.bigint "spree_store_id", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.datetime "deleted_at", precision: nil + t.index ["deleted_at"], name: "index_spree_store_translations_on_deleted_at" + t.index ["locale"], name: "index_spree_store_translations_on_locale" + t.index ["spree_store_id", "locale"], name: "index_spree_store_translations_on_spree_store_id_locale", unique: true + end + + create_table "spree_stores", force: :cascade do |t| + t.string "name" + t.string "url" + t.text "meta_description" + t.text "meta_keywords" + t.string "seo_title" + t.string "mail_from_address" + t.string "default_currency" + t.string "code" + t.boolean "default", default: false, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "supported_currencies" + t.string "facebook" + t.string "twitter" + t.string "instagram" + t.string "default_locale" + t.string "customer_support_email" + t.bigint "default_country_id" + t.text "description" + t.text "address" + t.string "contact_phone" + t.string "new_order_notifications_email" + t.bigint "checkout_zone_id" + t.string "seo_robots" + t.string "supported_locales" + t.datetime "deleted_at", precision: nil + t.jsonb "settings" + t.index ["code"], name: "index_spree_stores_on_code", unique: true + t.index ["default"], name: "index_spree_stores_on_default" + t.index ["deleted_at"], name: "index_spree_stores_on_deleted_at" + t.index ["url"], name: "index_spree_stores_on_url" + end + + create_table "spree_tax_categories", force: :cascade do |t| + t.string "name" + t.string "description" + t.boolean "is_default", default: false + t.datetime "deleted_at", precision: nil + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "tax_code" + t.index ["deleted_at"], name: "index_spree_tax_categories_on_deleted_at" + t.index ["is_default"], name: "index_spree_tax_categories_on_is_default" + end + + create_table "spree_tax_rates", force: :cascade do |t| + t.decimal "amount", precision: 8, scale: 5 + t.bigint "zone_id" + t.bigint "tax_category_id" + t.boolean "included_in_price", default: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "name" + t.boolean "show_rate_in_label", default: true + t.datetime "deleted_at", precision: nil + t.jsonb "public_metadata" + t.jsonb "private_metadata" + t.index ["deleted_at"], name: "index_spree_tax_rates_on_deleted_at" + t.index ["included_in_price"], name: "index_spree_tax_rates_on_included_in_price" + t.index ["show_rate_in_label"], name: "index_spree_tax_rates_on_show_rate_in_label" + t.index ["tax_category_id"], name: "index_spree_tax_rates_on_tax_category_id" + t.index ["zone_id"], name: "index_spree_tax_rates_on_zone_id" + end + + create_table "spree_taxon_translations", force: :cascade do |t| + t.string "name" + t.text "description" + t.string "locale", null: false + t.bigint "spree_taxon_id", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "meta_title" + t.string "meta_description" + t.string "meta_keywords" + t.string "permalink" + t.index ["locale"], name: "index_spree_taxon_translations_on_locale" + t.index ["spree_taxon_id", "locale"], name: "index_spree_taxon_translations_on_spree_taxon_id_and_locale", unique: true + end + + create_table "spree_taxonomies", force: :cascade do |t| + t.string "name", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "position", default: 0 + t.bigint "store_id" + t.jsonb "public_metadata" + t.jsonb "private_metadata" + t.index ["name", "store_id"], name: "index_spree_taxonomies_on_name_and_store_id", unique: true + t.index ["position"], name: "index_spree_taxonomies_on_position" + t.index ["store_id"], name: "index_spree_taxonomies_on_store_id" + end + + create_table "spree_taxonomy_translations", force: :cascade do |t| + t.string "name" + t.string "locale", null: false + t.bigint "spree_taxonomy_id", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["locale"], name: "index_spree_taxonomy_translations_on_locale" + t.index ["spree_taxonomy_id", "locale"], name: "index_spree_taxonomy_translations_on_spree_taxonomy_id_locale", unique: true + end + + create_table "spree_taxons", force: :cascade do |t| + t.bigint "parent_id" + t.integer "position", default: 0 + t.string "name", null: false + t.string "permalink" + t.bigint "taxonomy_id" + t.bigint "lft" + t.bigint "rgt" + t.text "description" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "meta_title" + t.string "meta_description" + t.string "meta_keywords" + t.integer "depth" + t.boolean "hide_from_nav", default: false + t.jsonb "public_metadata" + t.jsonb "private_metadata" + t.index ["lft"], name: "index_spree_taxons_on_lft" + t.index ["name", "parent_id", "taxonomy_id"], name: "index_spree_taxons_on_name_and_parent_id_and_taxonomy_id", unique: true + t.index ["name"], name: "index_spree_taxons_on_name" + t.index ["parent_id"], name: "index_taxons_on_parent_id" + t.index ["permalink", "parent_id", "taxonomy_id"], name: "index_spree_taxons_on_permalink_and_parent_id_and_taxonomy_id", unique: true + t.index ["permalink"], name: "index_taxons_on_permalink" + t.index ["position"], name: "index_spree_taxons_on_position" + t.index ["rgt"], name: "index_spree_taxons_on_rgt" + t.index ["taxonomy_id"], name: "index_taxons_on_taxonomy_id" + end + + create_table "spree_trackers", force: :cascade do |t| + t.string "analytics_id" + t.boolean "active", default: true + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "engine", default: 0, null: false + t.index ["active"], name: "index_spree_trackers_on_active" + end + + create_table "spree_users", force: :cascade do |t| + t.string "encrypted_password", limit: 128 + t.string "password_salt", limit: 128 + t.string "email" + t.string "remember_token" + t.string "persistence_token" + t.string "reset_password_token" + t.string "perishable_token" + t.integer "sign_in_count", default: 0, null: false + t.integer "failed_attempts", default: 0, null: false + t.datetime "last_request_at", precision: nil + t.datetime "current_sign_in_at", precision: nil + t.datetime "last_sign_in_at", precision: nil + t.string "current_sign_in_ip" + t.string "last_sign_in_ip" + t.string "login" + t.bigint "ship_address_id" + t.bigint "bill_address_id" + t.string "authentication_token" + t.string "unlock_token" + t.datetime "locked_at", precision: nil + t.datetime "reset_password_sent_at", precision: nil + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.jsonb "public_metadata" + t.jsonb "private_metadata" + t.string "first_name" + t.string "last_name" + t.string "selected_locale" + t.string "spree_api_key", limit: 48 + t.datetime "remember_created_at", precision: nil + t.datetime "deleted_at", precision: nil + t.string "confirmation_token" + t.datetime "confirmed_at", precision: nil + t.datetime "confirmation_sent_at", precision: nil + t.index ["bill_address_id"], name: "index_spree_users_on_bill_address_id" + t.index ["deleted_at"], name: "index_spree_users_on_deleted_at" + t.index ["email"], name: "email_idx_unique", unique: true + t.index ["ship_address_id"], name: "index_spree_users_on_ship_address_id" + t.index ["spree_api_key"], name: "index_spree_users_on_spree_api_key" + end + + create_table "spree_variants", force: :cascade do |t| + t.string "sku", default: "", null: false + t.decimal "weight", precision: 8, scale: 2, default: "0.0" + t.decimal "height", precision: 8, scale: 2 + t.decimal "width", precision: 8, scale: 2 + t.decimal "depth", precision: 8, scale: 2 + t.datetime "deleted_at", precision: nil + t.boolean "is_master", default: false + t.bigint "product_id" + t.decimal "cost_price", precision: 10, scale: 2 + t.integer "position" + t.string "cost_currency" + t.boolean "track_inventory", default: true + t.bigint "tax_category_id" + t.datetime "updated_at", precision: nil, null: false + t.datetime "discontinue_on", precision: nil + t.datetime "created_at", precision: nil, null: false + t.jsonb "public_metadata" + t.jsonb "private_metadata" + t.string "barcode" + t.string "weight_unit" + t.string "dimensions_unit" + t.index ["barcode"], name: "index_spree_variants_on_barcode" + t.index ["deleted_at"], name: "index_spree_variants_on_deleted_at" + t.index ["discontinue_on"], name: "index_spree_variants_on_discontinue_on" + t.index ["is_master"], name: "index_spree_variants_on_is_master" + t.index ["position"], name: "index_spree_variants_on_position" + t.index ["product_id"], name: "index_spree_variants_on_product_id" + t.index ["sku"], name: "index_spree_variants_on_sku" + t.index ["tax_category_id"], name: "index_spree_variants_on_tax_category_id" + t.index ["track_inventory"], name: "index_spree_variants_on_track_inventory" + end + + create_table "spree_webhooks_events", force: :cascade do |t| + t.integer "execution_time" + t.string "name", null: false + t.string "request_errors" + t.string "response_code" + t.bigint "subscriber_id", null: false + t.boolean "success" + t.string "url", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false + t.index ["response_code"], name: "index_spree_webhooks_events_on_response_code" + t.index ["subscriber_id"], name: "index_spree_webhooks_events_on_subscriber_id" + t.index ["success"], name: "index_spree_webhooks_events_on_success" + end + + create_table "spree_webhooks_subscribers", force: :cascade do |t| + t.string "url", null: false + t.boolean "active", default: false + t.jsonb "subscriptions" + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false + t.string "secret_key", null: false + t.index ["active"], name: "index_spree_webhooks_subscribers_on_active" + end + + create_table "spree_wished_items", force: :cascade do |t| + t.bigint "variant_id" + t.bigint "wishlist_id" + t.integer "quantity", default: 1, null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false + t.index ["variant_id", "wishlist_id"], name: "index_spree_wished_items_on_variant_id_and_wishlist_id", unique: true + t.index ["variant_id"], name: "index_spree_wished_items_on_variant_id" + t.index ["wishlist_id"], name: "index_spree_wished_items_on_wishlist_id" + end + + create_table "spree_wishlists", force: :cascade do |t| + t.bigint "user_id" + t.bigint "store_id" + t.string "name" + t.string "token", null: false + t.boolean "is_private", default: true, null: false + t.boolean "is_default", default: false, null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false + t.index ["store_id"], name: "index_spree_wishlists_on_store_id" + t.index ["token"], name: "index_spree_wishlists_on_token", unique: true + t.index ["user_id", "is_default"], name: "index_spree_wishlists_on_user_id_and_is_default" + t.index ["user_id"], name: "index_spree_wishlists_on_user_id" + end + + create_table "spree_zone_members", force: :cascade do |t| + t.string "zoneable_type" + t.bigint "zoneable_id" + t.bigint "zone_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["zone_id"], name: "index_spree_zone_members_on_zone_id" + t.index ["zoneable_id", "zoneable_type"], name: "index_spree_zone_members_on_zoneable_id_and_zoneable_type" + end + + create_table "spree_zones", force: :cascade do |t| + t.string "name" + t.string "description" + t.boolean "default_tax", default: false + t.integer "zone_members_count", default: 0 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "kind", default: "state" + t.index ["default_tax"], name: "index_spree_zones_on_default_tax" + t.index ["kind"], name: "index_spree_zones_on_kind" + end + + add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id" + add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id" + add_foreign_key "solid_queue_blocked_executions", "solid_queue_jobs", column: "job_id", on_delete: :cascade + add_foreign_key "solid_queue_claimed_executions", "solid_queue_jobs", column: "job_id", on_delete: :cascade + add_foreign_key "solid_queue_failed_executions", "solid_queue_jobs", column: "job_id", on_delete: :cascade + add_foreign_key "solid_queue_ready_executions", "solid_queue_jobs", column: "job_id", on_delete: :cascade + add_foreign_key "solid_queue_recurring_executions", "solid_queue_jobs", column: "job_id", on_delete: :cascade + add_foreign_key "solid_queue_scheduled_executions", "solid_queue_jobs", column: "job_id", on_delete: :cascade + add_foreign_key "spree_oauth_access_grants", "spree_oauth_applications", column: "application_id" + add_foreign_key "spree_oauth_access_tokens", "spree_oauth_applications", column: "application_id" + add_foreign_key "spree_option_type_translations", "spree_option_types" + add_foreign_key "spree_option_value_translations", "spree_option_values" + add_foreign_key "spree_payment_sources", "spree_payment_methods", column: "payment_method_id" + add_foreign_key "spree_payment_sources", "spree_users", column: "user_id" + add_foreign_key "spree_product_property_translations", "spree_product_properties" + add_foreign_key "spree_product_translations", "spree_products" + add_foreign_key "spree_property_translations", "spree_properties" + add_foreign_key "spree_store_translations", "spree_stores" + add_foreign_key "spree_taxon_translations", "spree_taxons" + add_foreign_key "spree_taxonomy_translations", "spree_taxonomies" +end diff --git a/db/seeds.rb b/db/seeds.rb new file mode 100644 index 0000000..ef18913 --- /dev/null +++ b/db/seeds.rb @@ -0,0 +1,12 @@ +# This file should ensure the existence of records required to run the application in every environment (production, +# development, test). The code here should be idempotent so that it can be executed at any point in every environment. +# The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup). +# +# Example: +# +# ["Action", "Comedy", "Drama", "Horror"].each do |genre_name| +# MovieGenre.find_or_create_by!(name: genre_name) +# end + +Spree::Core::Engine.load_seed if defined?(Spree::Core) +Spree::Auth::Engine.load_seed if defined?(Spree::Auth) diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..b2e1aaa --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,20 @@ +version: '3.7' +services: + postgres: + image: postgres:latest + environment: + POSTGRES_HOST_AUTH_METHOD: trust + volumes: + - 'postgres:/var/lib/postgresql/data' + ports: + - "5432:5432" + redis: + image: redis:latest + ports: + - "6379:6379" + volumes: + - 'redis:/data' + +volumes: + redis: + postgres: \ No newline at end of file diff --git a/lib/assets/.keep b/lib/assets/.keep new file mode 100644 index 0000000..e69de29 diff --git a/lib/tasks/.keep b/lib/tasks/.keep new file mode 100644 index 0000000..e69de29 diff --git a/log/.keep b/log/.keep new file mode 100644 index 0000000..e69de29 diff --git a/public/404.html b/public/404.html new file mode 100644 index 0000000..2be3af2 --- /dev/null +++ b/public/404.html @@ -0,0 +1,67 @@ + + + + The page you were looking for doesn't exist (404) + + + + + + +
+
+

The page you were looking for doesn't exist.

+

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

+
+

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

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

The change you wanted was rejected.

+

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

+
+

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

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

We're sorry, but something went wrong.

+
+

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

+
+ + diff --git a/public/apple-touch-icon-precomposed.png b/public/apple-touch-icon-precomposed.png new file mode 100644 index 0000000..e69de29 diff --git a/public/apple-touch-icon.png b/public/apple-touch-icon.png new file mode 100644 index 0000000..e69de29 diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000..e69de29 diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 0000000..1acafb7 --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,12 @@ +# See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file +User-agent: * +Disallow: /checkout +Disallow: /cart +Disallow: /orders +Disallow: /user +Disallow: /account +Disallow: /api +Disallow: /password +Disallow: /api_tokens +Disallow: /cart_link +Disallow: /account_link diff --git a/render.yaml b/render.yaml new file mode 100644 index 0000000..01e30f2 --- /dev/null +++ b/render.yaml @@ -0,0 +1,57 @@ +databases: + - name: spree-db + databaseName: spree + user: spree + +services: + - type: web + name: spree-web + runtime: ruby + plan: standard + buildCommand: "./bin/render-build.sh" + preDeployCommand: "bundle exec rails db:migrate && bundle exec rails db:seed" + startCommand: "bundle exec rails server" + envVars: + - key: DATABASE_URL + fromDatabase: + name: spree-db + property: connectionString + - key: REDIS_URL + fromService: + type: redis + name: spree-redis + property: connectionString + - fromGroup: spree-settings + - type: worker + name: spree-worker + runtime: ruby + buildCommand: "./bin/render-build.sh" + startCommand: "bundle exec rake solid_queue:start" + envVars: + - key: DATABASE_URL + fromDatabase: + name: spree-db + property: connectionString + - key: REDIS_URL + fromService: + type: redis + name: spree-redis + property: connectionString + - fromGroup: spree-settings + - type: redis # we only need redis for action cable, in future Rails versions this will be optional + name: spree-redis + ipAllowList: [] # only allow internal connections + +envVarGroups: + - name: spree-settings + envVars: + - key: SECRET_KEY_BASE # for production installs comment out this lines + generateValue: true # for production installs comment out this lines + #- key: RAILS_MASTER_KEY # for production installs uncomment this line + # sync: false # for production installs uncomment this line + - key: ADMIN_EMAIL + value: 'spree@example.com' + - key: ADMIN_PASSWORD + value: 'spree123' + - key: AUTO_ACCEPT + value: 'true' \ No newline at end of file diff --git a/storage/.keep b/storage/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/application_system_test_case.rb b/test/application_system_test_case.rb new file mode 100644 index 0000000..d19212a --- /dev/null +++ b/test/application_system_test_case.rb @@ -0,0 +1,5 @@ +require "test_helper" + +class ApplicationSystemTestCase < ActionDispatch::SystemTestCase + driven_by :selenium, using: :chrome, screen_size: [1400, 1400] +end diff --git a/test/channels/application_cable/connection_test.rb b/test/channels/application_cable/connection_test.rb new file mode 100644 index 0000000..6340bf9 --- /dev/null +++ b/test/channels/application_cable/connection_test.rb @@ -0,0 +1,13 @@ +require "test_helper" + +module ApplicationCable + class ConnectionTest < ActionCable::Connection::TestCase + # test "connects with cookies" do + # cookies.signed[:user_id] = 42 + # + # connect + # + # assert_equal connection.user_id, "42" + # end + end +end diff --git a/test/controllers/.keep b/test/controllers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/fixtures/files/.keep b/test/fixtures/files/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/helpers/.keep b/test/helpers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/integration/.keep b/test/integration/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/mailers/.keep b/test/mailers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/models/.keep b/test/models/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/system/.keep b/test/system/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/test_helper.rb b/test/test_helper.rb new file mode 100644 index 0000000..0c22470 --- /dev/null +++ b/test/test_helper.rb @@ -0,0 +1,15 @@ +ENV["RAILS_ENV"] ||= "test" +require_relative "../config/environment" +require "rails/test_help" + +module ActiveSupport + class TestCase + # Run tests in parallel with specified workers + parallelize(workers: :number_of_processors) + + # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. + fixtures :all + + # Add more helper methods to be used by all tests here... + end +end diff --git a/tmp/.keep b/tmp/.keep new file mode 100644 index 0000000..e69de29 diff --git a/tmp/pids/.keep b/tmp/pids/.keep new file mode 100644 index 0000000..e69de29 diff --git a/tmp/storage/.keep b/tmp/storage/.keep new file mode 100644 index 0000000..e69de29 diff --git a/vendor/.keep b/vendor/.keep new file mode 100644 index 0000000..e69de29 diff --git a/vendor/assets/javascripts/spree/backend/all.js b/vendor/assets/javascripts/spree/backend/all.js new file mode 100644 index 0000000..80edc71 --- /dev/null +++ b/vendor/assets/javascripts/spree/backend/all.js @@ -0,0 +1,8 @@ +// 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 spree/backend +//= require_tree . diff --git a/vendor/assets/javascripts/spree/frontend/all.js b/vendor/assets/javascripts/spree/frontend/all.js new file mode 100644 index 0000000..ce24237 --- /dev/null +++ b/vendor/assets/javascripts/spree/frontend/all.js @@ -0,0 +1,8 @@ +// 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 spree/frontend +//= require_tree . diff --git a/vendor/assets/stylesheets/spree/backend/all.css b/vendor/assets/stylesheets/spree/backend/all.css new file mode 100644 index 0000000..20f0f98 --- /dev/null +++ b/vendor/assets/stylesheets/spree/backend/all.css @@ -0,0 +1,9 @@ +/* + * This is a manifest file that'll automatically include all the stylesheets available in this directory + * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at + * the top of the compiled file, but it's generally better to create a new file per style scope. + * + *= require spree/backend + *= require_self + *= require_tree . +*/ diff --git a/vendor/assets/stylesheets/spree/frontend/all.css b/vendor/assets/stylesheets/spree/frontend/all.css new file mode 100644 index 0000000..ed0e956 --- /dev/null +++ b/vendor/assets/stylesheets/spree/frontend/all.css @@ -0,0 +1,9 @@ +/* + * This is a manifest file that'll automatically include all the stylesheets available in this directory + * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at + * the top of the compiled file, but it's generally better to create a new file per style scope. + * + *= require spree/frontend + *= require_self + *= require_tree . +*/ diff --git a/vendor/javascript/.keep b/vendor/javascript/.keep new file mode 100644 index 0000000..e69de29