spree_order_reporting 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (362) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +26 -0
  3. data/README.md +100 -0
  4. data/Rakefile +38 -0
  5. data/app/assets/javascripts/spree/backend/order_reporting.js +2 -0
  6. data/app/assets/javascripts/spree/frontend/order_reporting.js +2 -0
  7. data/app/assets/stylesheets/spree/backend/order_reporting.css +4 -0
  8. data/app/assets/stylesheets/spree/frontend/order_reporting.css +4 -0
  9. data/app/jobs/order_reporting/recurring_report_delayed_job.rb +11 -0
  10. data/config/locales/en.yml +5 -0
  11. data/config/routes.rb +3 -0
  12. data/lib/generators/order_reporting/install/install_generator.rb +30 -0
  13. data/lib/order_reporting.rb +27 -0
  14. data/lib/order_reporting/engine.rb +20 -0
  15. data/lib/order_reporting/factories.rb +6 -0
  16. data/lib/order_reporting/queries/latest_orders_query.rb +7 -0
  17. data/lib/order_reporting/report.rb +25 -0
  18. data/lib/order_reporting/schedulers/delayed_job_scheduler.rb +8 -0
  19. data/lib/order_reporting/version.rb +3 -0
  20. data/lib/solidus_order_reporting.rb +2 -0
  21. data/lib/spree_order_reporting.rb +2 -0
  22. data/spec/dummy/README.rdoc +28 -0
  23. data/spec/dummy/Rakefile +6 -0
  24. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  25. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  26. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  27. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  28. data/spec/dummy/bin/bundle +3 -0
  29. data/spec/dummy/bin/delayed_job +5 -0
  30. data/spec/dummy/bin/rails +4 -0
  31. data/spec/dummy/bin/rake +4 -0
  32. data/spec/dummy/bin/setup +29 -0
  33. data/spec/dummy/config.ru +4 -0
  34. data/spec/dummy/config/application.rb +59 -0
  35. data/spec/dummy/config/boot.rb +6 -0
  36. data/spec/dummy/config/database.yml +12 -0
  37. data/spec/dummy/config/environment.rb +5 -0
  38. data/spec/dummy/config/environments/development.rb +41 -0
  39. data/spec/dummy/config/environments/production.rb +79 -0
  40. data/spec/dummy/config/environments/test.rb +34 -0
  41. data/spec/dummy/config/initializers/assets.rb +11 -0
  42. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  43. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
  44. data/spec/dummy/config/initializers/custom_user.rb +1 -0
  45. data/spec/dummy/config/initializers/devise.rb +3 -0
  46. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  47. data/spec/dummy/config/initializers/inflections.rb +16 -0
  48. data/spec/dummy/config/initializers/mime_types.rb +4 -0
  49. data/spec/dummy/config/initializers/session_store.rb +3 -0
  50. data/spec/dummy/config/initializers/spree.rb +57 -0
  51. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  52. data/spec/dummy/config/locales/en.yml +23 -0
  53. data/spec/dummy/config/routes.rb +9 -0
  54. data/spec/dummy/config/secrets.yml +22 -0
  55. data/spec/dummy/db/migrate/20160706112305_spree_one_two.spree.rb +482 -0
  56. data/spec/dummy/db/migrate/20160706112306_spree_promo_one_two.spree.rb +46 -0
  57. data/spec/dummy/db/migrate/20160706112307_add_tax_rate_label.spree.rb +6 -0
  58. data/spec/dummy/db/migrate/20160706112308_add_toggle_tax_rate_display.spree.rb +6 -0
  59. data/spec/dummy/db/migrate/20160706112309_remove_unused_preference_columns.spree.rb +9 -0
  60. data/spec/dummy/db/migrate/20160706112310_add_lock_version_to_variant.spree.rb +6 -0
  61. data/spec/dummy/db/migrate/20160706112311_add_states_required_to_countries.spree.rb +6 -0
  62. data/spec/dummy/db/migrate/20160706112312_add_on_demand_to_product_and_variant.spree.rb +7 -0
  63. data/spec/dummy/db/migrate/20160706112313_remove_not_null_constraint_from_products_on_hand.spree.rb +12 -0
  64. data/spec/dummy/db/migrate/20160706112314_split_prices_from_variants.spree.rb +32 -0
  65. data/spec/dummy/db/migrate/20160706112315_remove_not_null_from_spree_prices_amount.spree.rb +10 -0
  66. data/spec/dummy/db/migrate/20160706112316_add_currency_to_line_items.spree.rb +6 -0
  67. data/spec/dummy/db/migrate/20160706112317_add_currency_to_orders.spree.rb +6 -0
  68. data/spec/dummy/db/migrate/20160706112318_add_cost_currency_to_variants.spree.rb +6 -0
  69. data/spec/dummy/db/migrate/20160706112319_remove_display_on_from_payment_methods.spree.rb +6 -0
  70. data/spec/dummy/db/migrate/20160706112320_add_position_to_taxonomies.spree.rb +6 -0
  71. data/spec/dummy/db/migrate/20160706112321_add_last_ip_to_spree_orders.spree.rb +6 -0
  72. data/spec/dummy/db/migrate/20160706112322_add_state_to_spree_adjustments.spree.rb +7 -0
  73. data/spec/dummy/db/migrate/20160706112323_add_display_on_to_spree_payment_methods.spree.rb +10 -0
  74. data/spec/dummy/db/migrate/20160706112324_add_position_to_product_properties.spree.rb +7 -0
  75. data/spec/dummy/db/migrate/20160706112325_add_identifier_to_spree_payments.spree.rb +6 -0
  76. data/spec/dummy/db/migrate/20160706112326_add_order_id_index_to_payments.spree.rb +10 -0
  77. data/spec/dummy/db/migrate/20160706112327_add_primary_to_spree_products_taxons.spree.rb +6 -0
  78. data/spec/dummy/db/migrate/20160706112328_create_spree_stock_items.spree.rb +15 -0
  79. data/spec/dummy/db/migrate/20160706112329_create_spree_stock_locations.spree.rb +12 -0
  80. data/spec/dummy/db/migrate/20160706112330_create_default_stock.spree.rb +35 -0
  81. data/spec/dummy/db/migrate/20160706112331_add_order_id_index_to_shipments.spree.rb +6 -0
  82. data/spec/dummy/db/migrate/20160706112332_change_meta_description_on_spree_products_to_text.spree.rb +6 -0
  83. data/spec/dummy/db/migrate/20160706112333_add_stock_location_id_to_spree_shipments.spree.rb +6 -0
  84. data/spec/dummy/db/migrate/20160706112334_add_pending_to_inventory_unit.spree.rb +7 -0
  85. data/spec/dummy/db/migrate/20160706112335_remove_on_demand_from_product_and_variant.spree.rb +7 -0
  86. data/spec/dummy/db/migrate/20160706112336_create_shipping_method_zone.spree.rb +22 -0
  87. data/spec/dummy/db/migrate/20160706112337_remove_shipping_category_id_from_shipping_method.spree.rb +6 -0
  88. data/spec/dummy/db/migrate/20160706112338_create_shipping_method_categories.spree.rb +14 -0
  89. data/spec/dummy/db/migrate/20160706112339_add_tracking_url_to_spree_shipping_methods.spree.rb +6 -0
  90. data/spec/dummy/db/migrate/20160706112340_create_spree_shipping_rates.spree.rb +25 -0
  91. data/spec/dummy/db/migrate/20160706112341_remove_category_match_attributes_from_shipping_method.spree.rb +8 -0
  92. data/spec/dummy/db/migrate/20160706112342_create_stock_movements.spree.rb +13 -0
  93. data/spec/dummy/db/migrate/20160706112343_add_address_fields_to_stock_location.spree.rb +23 -0
  94. data/spec/dummy/db/migrate/20160706112344_add_active_field_to_stock_locations.spree.rb +6 -0
  95. data/spec/dummy/db/migrate/20160706112345_add_backorderable_to_stock_item.spree.rb +6 -0
  96. data/spec/dummy/db/migrate/20160706112346_add_default_quantity_to_stock_movement.spree.rb +6 -0
  97. data/spec/dummy/db/migrate/20160706112347_add_source_and_destination_to_stock_movements.spree.rb +9 -0
  98. data/spec/dummy/db/migrate/20160706112348_change_orders_total_precision.spree.rb +9 -0
  99. data/spec/dummy/db/migrate/20160706112349_change_spree_payments_amount_precision.spree.rb +8 -0
  100. data/spec/dummy/db/migrate/20160706112350_change_spree_return_authorization_amount_precision.spree.rb +8 -0
  101. data/spec/dummy/db/migrate/20160706112351_change_adjustments_amount_precision.spree.rb +8 -0
  102. data/spec/dummy/db/migrate/20160706112352_add_originator_to_stock_movement.spree.rb +8 -0
  103. data/spec/dummy/db/migrate/20160706112353_drop_source_and_destination_from_stock_movement.spree.rb +16 -0
  104. data/spec/dummy/db/migrate/20160706112354_migrate_inventory_unit_sold_to_on_hand.spree.rb +10 -0
  105. data/spec/dummy/db/migrate/20160706112355_add_stock_location_to_rma.spree.rb +6 -0
  106. data/spec/dummy/db/migrate/20160706112356_update_shipment_state_for_canceled_orders.spree.rb +16 -0
  107. data/spec/dummy/db/migrate/20160706112357_add_seo_metas_to_taxons.spree.rb +10 -0
  108. data/spec/dummy/db/migrate/20160706112358_remove_stock_item_and_variant_lock.spree.rb +15 -0
  109. data/spec/dummy/db/migrate/20160706112359_add_name_to_spree_credit_cards.spree.rb +6 -0
  110. data/spec/dummy/db/migrate/20160706112360_update_name_fields_on_spree_credit_cards.spree.rb +14 -0
  111. data/spec/dummy/db/migrate/20160706112361_add_index_to_source_columns_on_adjustments.spree.rb +6 -0
  112. data/spec/dummy/db/migrate/20160706112362_update_adjustment_states.spree.rb +17 -0
  113. data/spec/dummy/db/migrate/20160706112363_add_shipping_rates_to_shipments.spree.rb +16 -0
  114. data/spec/dummy/db/migrate/20160706112364_create_spree_stock_transfers.spree.rb +15 -0
  115. data/spec/dummy/db/migrate/20160706112365_drop_products_count_on_hand.spree.rb +6 -0
  116. data/spec/dummy/db/migrate/20160706112366_set_default_shipping_rate_cost.spree.rb +6 -0
  117. data/spec/dummy/db/migrate/20160706112367_add_number_to_stock_transfer.spree.rb +24 -0
  118. data/spec/dummy/db/migrate/20160706112368_add_sku_index_to_spree_variants.spree.rb +6 -0
  119. data/spec/dummy/db/migrate/20160706112369_add_backorderable_default_to_spree_stock_location.spree.rb +6 -0
  120. data/spec/dummy/db/migrate/20160706112370_add_propage_all_variants_to_spree_stock_location.spree.rb +6 -0
  121. data/spec/dummy/db/migrate/20160706112371_rename_shipping_methods_zones_to_spree_shipping_methods_zones.spree.rb +6 -0
  122. data/spec/dummy/db/migrate/20160706112372_add_user_id_index_to_spree_orders.spree.rb +6 -0
  123. data/spec/dummy/db/migrate/20160706112373_add_updated_at_to_spree_countries.spree.rb +10 -0
  124. data/spec/dummy/db/migrate/20160706112374_add_updated_at_to_spree_states.spree.rb +10 -0
  125. data/spec/dummy/db/migrate/20160706112375_add_cvv_result_code_and_cvv_result_message_to_spree_payments.spree.rb +7 -0
  126. data/spec/dummy/db/migrate/20160706112376_add_unique_index_to_permalink_on_spree_products.spree.rb +6 -0
  127. data/spec/dummy/db/migrate/20160706112377_add_unique_index_to_orders_shipments_and_stock_transfers.spree.rb +8 -0
  128. data/spec/dummy/db/migrate/20160706112378_add_deleted_at_to_spree_tax_rates.spree.rb +6 -0
  129. data/spec/dummy/db/migrate/20160706112379_remove_lock_version_from_inventory_units.spree.rb +7 -0
  130. data/spec/dummy/db/migrate/20160706112380_add_cost_price_to_line_item.spree.rb +6 -0
  131. data/spec/dummy/db/migrate/20160706112381_set_backorderable_to_default_to_false.spree.rb +7 -0
  132. data/spec/dummy/db/migrate/20160706112382_add_created_by_id_to_spree_orders.spree.rb +6 -0
  133. data/spec/dummy/db/migrate/20160706112383_index_completed_at_on_spree_orders.spree.rb +6 -0
  134. data/spec/dummy/db/migrate/20160706112384_add_tax_category_id_to_spree_line_items.spree.rb +6 -0
  135. data/spec/dummy/db/migrate/20160706112385_migrate_tax_categories_to_line_items.spree.rb +11 -0
  136. data/spec/dummy/db/migrate/20160706112386_drop_spree_mail_methods.spree.rb +13 -0
  137. data/spec/dummy/db/migrate/20160706112387_set_default_stock_location_on_shipments.spree.rb +9 -0
  138. data/spec/dummy/db/migrate/20160706112388_upgrade_adjustments.spree.rb +41 -0
  139. data/spec/dummy/db/migrate/20160706112389_rename_adjustment_fields.spree.rb +15 -0
  140. data/spec/dummy/db/migrate/20160706112390_add_admin_name_column_to_spree_shipping_methods.spree.rb +6 -0
  141. data/spec/dummy/db/migrate/20160706112391_add_admin_name_column_to_spree_stock_locations.spree.rb +6 -0
  142. data/spec/dummy/db/migrate/20160706112392_add_shipment_total_to_spree_orders.spree.rb +6 -0
  143. data/spec/dummy/db/migrate/20160706112393_expand_order_number_size.spree.rb +10 -0
  144. data/spec/dummy/db/migrate/20160706112394_rename_activators_to_promotions.spree.rb +6 -0
  145. data/spec/dummy/db/migrate/20160706112395_add_adjustment_total_to_line_items.spree.rb +6 -0
  146. data/spec/dummy/db/migrate/20160706112396_add_adjustment_total_to_shipments.spree.rb +6 -0
  147. data/spec/dummy/db/migrate/20160706112397_add_depth_to_spree_taxons.spree.rb +17 -0
  148. data/spec/dummy/db/migrate/20160706112398_add_tax_total_to_line_items_shipments_and_orders.spree.rb +9 -0
  149. data/spec/dummy/db/migrate/20160706112399_add_shipping_category_to_shipping_methods_and_products.spree.rb +16 -0
  150. data/spec/dummy/db/migrate/20160706112400_migrate_old_shipping_calculators.spree.rb +20 -0
  151. data/spec/dummy/db/migrate/20160706112401_add_code_to_spree_promotion_rules.spree.rb +6 -0
  152. data/spec/dummy/db/migrate/20160706112402_change_states_required_for_countries.spree.rb +10 -0
  153. data/spec/dummy/db/migrate/20160706112403_add_deleted_at_to_spree_stock_items.spree.rb +6 -0
  154. data/spec/dummy/db/migrate/20160706112404_remove_promotions_event_name_field.spree.rb +6 -0
  155. data/spec/dummy/db/migrate/20160706112405_add_promo_total_to_line_items_and_shipments_and_orders.spree.rb +8 -0
  156. data/spec/dummy/db/migrate/20160706112406_remove_unused_credit_card_fields.spree.rb +17 -0
  157. data/spec/dummy/db/migrate/20160706112407_add_track_inventory_to_variant.spree.rb +6 -0
  158. data/spec/dummy/db/migrate/20160706112408_add_tax_category_to_variants.spree.rb +7 -0
  159. data/spec/dummy/db/migrate/20160706112409_add_channel_to_spree_orders.spree.rb +6 -0
  160. data/spec/dummy/db/migrate/20160706112410_add_included_to_adjustments.spree.rb +6 -0
  161. data/spec/dummy/db/migrate/20160706112411_rename_tax_total_fields.spree.rb +12 -0
  162. data/spec/dummy/db/migrate/20160706112412_add_line_item_id_to_spree_inventory_units.spree.rb +22 -0
  163. data/spec/dummy/db/migrate/20160706112413_add_updated_at_to_variants.spree.rb +6 -0
  164. data/spec/dummy/db/migrate/20160706112414_add_position_to_classifications.spree.rb +6 -0
  165. data/spec/dummy/db/migrate/20160706112415_create_spree_orders_promotions.spree.rb +9 -0
  166. data/spec/dummy/db/migrate/20160706112416_unique_shipping_method_categories.spree.rb +25 -0
  167. data/spec/dummy/db/migrate/20160706112417_add_item_count_to_spree_orders.spree.rb +6 -0
  168. data/spec/dummy/db/migrate/20160706112418_remove_value_type_from_spree_preferences.spree.rb +9 -0
  169. data/spec/dummy/db/migrate/20160706112419_rename_permalink_to_slug_for_products.spree.rb +6 -0
  170. data/spec/dummy/db/migrate/20160706112420_add_index_to_variant_id_and_currency_on_prices.spree.rb +6 -0
  171. data/spec/dummy/db/migrate/20160706112421_rename_activator_id_in_rules_and_actions_to_promotion_id.spree.rb +7 -0
  172. data/spec/dummy/db/migrate/20160706112422_add_deleted_at_to_spree_prices.spree.rb +6 -0
  173. data/spec/dummy/db/migrate/20160706112423_add_approver_id_and_approved_at_to_orders.spree.rb +7 -0
  174. data/spec/dummy/db/migrate/20160706112424_add_confirmation_delivered_to_spree_orders.spree.rb +6 -0
  175. data/spec/dummy/db/migrate/20160706112425_add_auto_capture_to_payment_methods.spree.rb +6 -0
  176. data/spec/dummy/db/migrate/20160706112426_create_spree_payment_capture_events.spree.rb +13 -0
  177. data/spec/dummy/db/migrate/20160706112427_add_uncaptured_amount_to_payments.spree.rb +6 -0
  178. data/spec/dummy/db/migrate/20160706112428_default_variant_weight_to_zero.spree.rb +12 -0
  179. data/spec/dummy/db/migrate/20160706112429_add_tax_category_id_to_shipping_methods.spree.rb +6 -0
  180. data/spec/dummy/db/migrate/20160706112430_add_tax_rate_id_to_shipping_rates.spree.rb +6 -0
  181. data/spec/dummy/db/migrate/20160706112431_add_pre_tax_amount_to_line_items_and_shipments.spree.rb +7 -0
  182. data/spec/dummy/db/migrate/20160706112432_add_more_indexes.spree.rb +14 -0
  183. data/spec/dummy/db/migrate/20160706112433_add_considered_risky_to_orders.spree.rb +6 -0
  184. data/spec/dummy/db/migrate/20160706112434_add_preference_store_to_everything.spree.rb +9 -0
  185. data/spec/dummy/db/migrate/20160706112435_add_user_id_to_spree_credit_cards.spree.rb +14 -0
  186. data/spec/dummy/db/migrate/20160706112436_migrate_old_preferences.spree.rb +52 -0
  187. data/spec/dummy/db/migrate/20160706112437_create_spree_stores.spree.rb +26 -0
  188. data/spec/dummy/db/migrate/20160706112438_create_store_from_preferences.spree.rb +34 -0
  189. data/spec/dummy/db/migrate/20160706112439_add_timestamps_to_spree_assets.spree.rb +7 -0
  190. data/spec/dummy/db/migrate/20160706112440_create_spree_taxons_promotion_rules.spree.rb +9 -0
  191. data/spec/dummy/db/migrate/20160706112441_add_additional_store_fields.spree.rb +9 -0
  192. data/spec/dummy/db/migrate/20160706112442_add_many_missing_indexes.spree.rb +20 -0
  193. data/spec/dummy/db/migrate/20160706112443_correct_some_polymorphic_index_and_add_more_missing.spree.rb +66 -0
  194. data/spec/dummy/db/migrate/20160706112444_add_user_id_created_by_id_index_to_order.spree.rb +6 -0
  195. data/spec/dummy/db/migrate/20160706112445_change_spree_price_amount_precision.spree.rb +9 -0
  196. data/spec/dummy/db/migrate/20160706112446_add_token_to_spree_orders.spree.rb +6 -0
  197. data/spec/dummy/db/migrate/20160706112447_move_order_token_from_tokenized_permission.spree.rb +30 -0
  198. data/spec/dummy/db/migrate/20160706112448_set_shipment_total_for_users_upgrading.spree.rb +11 -0
  199. data/spec/dummy/db/migrate/20160706112449_drop_credit_card_first_name_and_last_name.spree.rb +7 -0
  200. data/spec/dummy/db/migrate/20160706112450_add_deleted_at_to_spree_promotion_actions.spree.rb +7 -0
  201. data/spec/dummy/db/migrate/20160706112451_remove_uncaptured_amount_from_spree_payments.spree.rb +6 -0
  202. data/spec/dummy/db/migrate/20160706112452_create_spree_refunds.spree.rb +13 -0
  203. data/spec/dummy/db/migrate/20160706112453_create_spree_return_authorization_inventory_unit.spree.rb +13 -0
  204. data/spec/dummy/db/migrate/20160706112454_rename_return_authorization_inventory_unit_to_return_items.spree.rb +6 -0
  205. data/spec/dummy/db/migrate/20160706112455_create_order_mutex.spree.rb +12 -0
  206. data/spec/dummy/db/migrate/20160706112456_backfill_line_item_pre_tax_amount.spree.rb +11 -0
  207. data/spec/dummy/db/migrate/20160706112457_recreate_spree_return_authorizations.spree.rb +56 -0
  208. data/spec/dummy/db/migrate/20160706112458_add_amount_fields_to_return_items.spree.rb +8 -0
  209. data/spec/dummy/db/migrate/20160706112459_drop_return_authorization_amount.spree.rb +6 -0
  210. data/spec/dummy/db/migrate/20160706112460_create_spree_return_authorization_reasons.spree.rb +33 -0
  211. data/spec/dummy/db/migrate/20160706112461_create_spree_refund_reasons.spree.rb +15 -0
  212. data/spec/dummy/db/migrate/20160706112462_rename_return_authorization_reason.spree.rb +6 -0
  213. data/spec/dummy/db/migrate/20160706112463_create_spree_promotion_categories.spree.rb +12 -0
  214. data/spec/dummy/db/migrate/20160706112464_drop_received_at_on_return_items.spree.rb +10 -0
  215. data/spec/dummy/db/migrate/20160706112465_add_reception_and_acceptance_status_to_return_items.spree.rb +7 -0
  216. data/spec/dummy/db/migrate/20160706112466_create_default_refund_reason.spree.rb +10 -0
  217. data/spec/dummy/db/migrate/20160706112467_add_default_to_spree_stock_locations.spree.rb +8 -0
  218. data/spec/dummy/db/migrate/20160706112468_create_spree_customer_returns.spree.rb +10 -0
  219. data/spec/dummy/db/migrate/20160706112469_add_customer_return_id_to_return_item.spree.rb +7 -0
  220. data/spec/dummy/db/migrate/20160706112470_create_friendly_id_slugs.spree.rb +16 -0
  221. data/spec/dummy/db/migrate/20160706112471_rename_spree_refund_return_authorization_id.spree.rb +6 -0
  222. data/spec/dummy/db/migrate/20160706112472_increase_return_item_pre_tax_amount_precision.spree.rb +14 -0
  223. data/spec/dummy/db/migrate/20160706112473_copy_product_slugs_to_slug_history.spree.rb +16 -0
  224. data/spec/dummy/db/migrate/20160706112474_create_spree_reimbursements.spree.rb +22 -0
  225. data/spec/dummy/db/migrate/20160706112475_add_promotionable_to_spree_products.spree.rb +6 -0
  226. data/spec/dummy/db/migrate/20160706112476_add_exchange_inventory_unit_foreign_keys.spree.rb +8 -0
  227. data/spec/dummy/db/migrate/20160706112477_add_acceptance_status_errors_to_return_item.spree.rb +6 -0
  228. data/spec/dummy/db/migrate/20160706112478_create_spree_reimbursement_types.spree.rb +21 -0
  229. data/spec/dummy/db/migrate/20160706112479_add_default_to_shipment_cost.spree.rb +11 -0
  230. data/spec/dummy/db/migrate/20160706112480_add_default_to_spree_credit_cards.spree.rb +6 -0
  231. data/spec/dummy/db/migrate/20160706112481_make_existing_credit_cards_default.spree.rb +11 -0
  232. data/spec/dummy/db/migrate/20160706112482_add_type_to_reimbursement_type.spree.rb +10 -0
  233. data/spec/dummy/db/migrate/20160706112483_create_spree_reimbursement_credits.spree.rb +11 -0
  234. data/spec/dummy/db/migrate/20160706112484_add_meta_title_to_spree_products.spree.rb +8 -0
  235. data/spec/dummy/db/migrate/20160706112485_add_code_to_spree_tax_categories.spree.rb +6 -0
  236. data/spec/dummy/db/migrate/20160706112486_default_pre_tax_amount_should_be_zero.spree.rb +7 -0
  237. data/spec/dummy/db/migrate/20160706112487_add_code_to_spree_shipping_methods.spree.rb +6 -0
  238. data/spec/dummy/db/migrate/20160706112488_add_cancel_audit_fields_to_spree_orders.spree.rb +7 -0
  239. data/spec/dummy/db/migrate/20160706112489_add_store_id_to_orders.spree.rb +13 -0
  240. data/spec/dummy/db/migrate/20160706112490_create_spree_taxons_prototypes.spree.rb +9 -0
  241. data/spec/dummy/db/migrate/20160706112491_add_counter_cache_from_spree_variants_to_spree_stock_items.spree.rb +9 -0
  242. data/spec/dummy/db/migrate/20160706112492_fix_adjustment_order_presence.spree.rb +14 -0
  243. data/spec/dummy/db/migrate/20160706112493_update_classifications_positions.spree.rb +10 -0
  244. data/spec/dummy/db/migrate/20160706112494_add_guest_token_index_to_spree_orders.spree.rb +6 -0
  245. data/spec/dummy/db/migrate/20160706112495_remove_extra_products_slug_index.spree.rb +6 -0
  246. data/spec/dummy/db/migrate/20160706112496_update_product_slug_index.spree.rb +9 -0
  247. data/spec/dummy/db/migrate/20160706112497_add_default_column_to_price.spree.rb +6 -0
  248. data/spec/dummy/db/migrate/20160706112498_add_position_to_stock_location.spree.rb +6 -0
  249. data/spec/dummy/db/migrate/20160706112499_create_spree_promotion_codes.spree.rb +14 -0
  250. data/spec/dummy/db/migrate/20160706112500_create_adjustment_promotion_code_association.spree.rb +7 -0
  251. data/spec/dummy/db/migrate/20160706112501_remove_environment_from_payment_method.spree.rb +7 -0
  252. data/spec/dummy/db/migrate/20160706112502_add_restock_inventory_to_stock_location.spree.rb +6 -0
  253. data/spec/dummy/db/migrate/20160706112503_add_code_to_spree_promotion_categories.spree.rb +6 -0
  254. data/spec/dummy/db/migrate/20160706112504_create_order_stock_locations.spree.rb +13 -0
  255. data/spec/dummy/db/migrate/20160706112505_remove_environment_from_tracker.spree.rb +7 -0
  256. data/spec/dummy/db/migrate/20160706112506_add_fulfillable_to_stock_location.spree.rb +6 -0
  257. data/spec/dummy/db/migrate/20160706112507_add_code_to_refund_reason.spree.rb +6 -0
  258. data/spec/dummy/db/migrate/20160706112508_add_promotion_code_id_to_orders_promotions.spree.rb +8 -0
  259. data/spec/dummy/db/migrate/20160706112509_add_approver_name_to_spree_orders.spree.rb +6 -0
  260. data/spec/dummy/db/migrate/20160706112510_move_promotion_code_to_promotion_code_value.spree.rb +66 -0
  261. data/spec/dummy/db/migrate/20160706112511_downcase_promotion_codes_values.spree.rb +12 -0
  262. data/spec/dummy/db/migrate/20160706112512_add_order_ids_to_adjustments_where_missing.spree.rb +10 -0
  263. data/spec/dummy/db/migrate/20160706112513_add_per_code_usage_limit_to_promotions.spree.rb +6 -0
  264. data/spec/dummy/db/migrate/20160706112514_remove_usage_limit_from_promotion_codes.spree.rb +6 -0
  265. data/spec/dummy/db/migrate/20160706112515_add_timestamps_to_order_promotions.spree.rb +7 -0
  266. data/spec/dummy/db/migrate/20160706112516_create_spree_cartons.spree.rb +25 -0
  267. data/spec/dummy/db/migrate/20160706112517_add_timestamps_to_spree_roles_users.spree.rb +8 -0
  268. data/spec/dummy/db/migrate/20160706112518_remove_considered_risky_from_spree_orders.spree.rb +6 -0
  269. data/spec/dummy/db/migrate/20160706112519_add_index_to_inventory_units_carton_id.spree.rb +6 -0
  270. data/spec/dummy/db/migrate/20160706112520_add_imported_from_shipment_id_to_cartons.spree.rb +9 -0
  271. data/spec/dummy/db/migrate/20160706112521_copy_shipped_shipments_to_cartons.spree.rb +14 -0
  272. data/spec/dummy/db/migrate/20160706112522_create_spree_user_stock_locations.spree.rb +11 -0
  273. data/spec/dummy/db/migrate/20160706112523_add_stock_location_code.spree.rb +6 -0
  274. data/spec/dummy/db/migrate/20160706112524_create_unit_cancels.spree.rb +11 -0
  275. data/spec/dummy/db/migrate/20160706112525_add_fields_to_stock_transfer.spree.rb +13 -0
  276. data/spec/dummy/db/migrate/20160706112526_create_transfer_items.spree.rb +15 -0
  277. data/spec/dummy/db/migrate/20160706112527_drop_stock_transfer_type.spree.rb +11 -0
  278. data/spec/dummy/db/migrate/20160706112528_add_stock_transfer_finalized_at.spree.rb +9 -0
  279. data/spec/dummy/db/migrate/20160706112529_rename_stock_transfer_reference.spree.rb +6 -0
  280. data/spec/dummy/db/migrate/20160706112530_create_line_item_actions.spree.rb +11 -0
  281. data/spec/dummy/db/migrate/20160706112531_create_spree_store_credit_categories.spree.rb +11 -0
  282. data/spec/dummy/db/migrate/20160706112532_create_spree_store_credits.spree.rb +20 -0
  283. data/spec/dummy/db/migrate/20160706112533_create_spree_store_credit_events.spree.rb +18 -0
  284. data/spec/dummy/db/migrate/20160706112534_create_spree_store_credit_payment_method.spree.rb +22 -0
  285. data/spec/dummy/db/migrate/20160706112535_create_store_credit_types.spree.rb +18 -0
  286. data/spec/dummy/db/migrate/20160706112536_create_store_credit_reimbursement_type.spree.rb +6 -0
  287. data/spec/dummy/db/migrate/20160706112537_add_resellable_to_return_items.spree.rb +6 -0
  288. data/spec/dummy/db/migrate/20160706112538_add_invalidated_at_to_spree_store_credits.spree.rb +6 -0
  289. data/spec/dummy/db/migrate/20160706112539_migrate_deleted_store_credits_to_invalidated.spree.rb +14 -0
  290. data/spec/dummy/db/migrate/20160706112540_add_check_stock_on_transfer.spree.rb +6 -0
  291. data/spec/dummy/db/migrate/20160706112541_fix_adjustment_order_id.spree.rb +81 -0
  292. data/spec/dummy/db/migrate/20160706112542_delete_inventory_units_without_shipment.spree.rb +26 -0
  293. data/spec/dummy/db/migrate/20160706112543_add_deleted_at_to_stock_transfers.spree.rb +6 -0
  294. data/spec/dummy/db/migrate/20160706112544_add_deleted_at_to_transfer_items.spree.rb +6 -0
  295. data/spec/dummy/db/migrate/20160706112545_increase_scale_on_pre_tax_amounts.spree.rb +27 -0
  296. data/spec/dummy/db/migrate/20160706112546_add_preferences_to_promotion_actions.spree.rb +6 -0
  297. data/spec/dummy/db/migrate/20160706112547_add_id_to_spree_option_values_variants.spree.rb +6 -0
  298. data/spec/dummy/db/migrate/20160706112548_add_frontend_viewable_to_spree_orders.spree.rb +6 -0
  299. data/spec/dummy/db/migrate/20160706112549_remove_spree_configurations.spree.rb +16 -0
  300. data/spec/dummy/db/migrate/20160706112550_add_preference_source_to_spree_payment_methods.spree.rb +6 -0
  301. data/spec/dummy/db/migrate/20160706112551_remove_credit_card_address_id.spree.rb +8 -0
  302. data/spec/dummy/db/migrate/20160706112552_create_spree_store_credit_update_reasons.spree.rb +9 -0
  303. data/spec/dummy/db/migrate/20160706112553_create_adjustment_reason.spree.rb +19 -0
  304. data/spec/dummy/db/migrate/20160706112554_add_update_reason_to_store_credit_events.spree.rb +6 -0
  305. data/spec/dummy/db/migrate/20160706112555_add_return_authorization_reason_id_to_return_items.spree.rb +8 -0
  306. data/spec/dummy/db/migrate/20160706112556_seed_store_credit_update_reasons.spree.rb +10 -0
  307. data/spec/dummy/db/migrate/20160706112557_remove_shipping_method_id_from_spree_orders.spree.rb +10 -0
  308. data/spec/dummy/db/migrate/20160706112558_remove_counter_cache_from_spree_variants_to_spree_stock_items.spree.rb +11 -0
  309. data/spec/dummy/db/migrate/20160706112559_add_address_id_to_credit_card.spree.rb +6 -0
  310. data/spec/dummy/db/migrate/20160706112560_copy_order_bill_address_to_credit_card.spree.rb +13 -0
  311. data/spec/dummy/db/migrate/20160706112561_remove_unnecessary_indexes.spree.rb +65 -0
  312. data/spec/dummy/db/migrate/20160706112562_remove_state_lock_version_from_order.spree.rb +12 -0
  313. data/spec/dummy/db/migrate/20160706112563_add_spree_user_addresses.spree.rb +17 -0
  314. data/spec/dummy/db/migrate/20160706112564_add_id_and_timestamp_to_promotion_rule_user.spree.rb +14 -0
  315. data/spec/dummy/db/migrate/20160706112565_remove_mandatory_from_adjustments.spree.rb +6 -0
  316. data/spec/dummy/db/migrate/20160706112566_add_finalized_to_spree_adjustments.spree.rb +12 -0
  317. data/spec/dummy/db/migrate/20160706112567_add_store_payment_methods.spree.rb +11 -0
  318. data/spec/dummy/db/migrate/20160706112568_convert_habtm_to_hmt_for_shipping_methods_zones.spree.rb +18 -0
  319. data/spec/dummy/db/migrate/20160706112569_convert_habtm_to_hmt_for_products_promotion_rules.spree.rb +18 -0
  320. data/spec/dummy/db/migrate/20160706112570_drop_spree_gateways.spree.rb +21 -0
  321. data/spec/dummy/db/migrate/20160706112571_convert_habtm_to_hmt_for_taxon_prototypes.spree.rb +16 -0
  322. data/spec/dummy/db/migrate/20160706112572_create_variant_properties_and_rules.spree.rb +29 -0
  323. data/spec/dummy/db/migrate/20160706112573_add_foreign_keys_for_taxons_prototypes.spree.rb +7 -0
  324. data/spec/dummy/db/migrate/20160706112574_remove_token_permissions_table.spree.rb +17 -0
  325. data/spec/dummy/db/migrate/20160706112575_rename_identifier_to_number_for_payment.spree.rb +8 -0
  326. data/spec/dummy/db/migrate/20160706112576_add_foreign_keys_for_product_promotion_rules.spree.rb +10 -0
  327. data/spec/dummy/db/migrate/20160706112577_add_sale_to_spree_promotions.spree.rb +7 -0
  328. data/spec/dummy/db/migrate/20160706112578_convert_sale_promotions.spree.rb +29 -0
  329. data/spec/dummy/db/migrate/20160706112579_convert_habtm_to_hmt_for_properties_prototypes.spree.rb +18 -0
  330. data/spec/dummy/db/migrate/20160706112580_convert_habtm_to_hmt_for_option_type_prototypes.spree.rb +18 -0
  331. data/spec/dummy/db/migrate/20160706112581_convert_habtm_to_hmt_for_taxons_promotion_rules.spree.rb +16 -0
  332. data/spec/dummy/db/migrate/20160706112582_add_stock_item_unique_index.spree.rb +10 -0
  333. data/spec/dummy/db/migrate/20160706112583_add_api_key_to_spree_users.spree_api.rb +8 -0
  334. data/spec/dummy/db/migrate/20160706112584_resize_api_key_field.spree_api.rb +8 -0
  335. data/spec/dummy/db/migrate/20160706112585_rename_api_key_to_spree_api_key.spree_api.rb +8 -0
  336. data/spec/dummy/db/migrate/20160706112586_add_index_to_user_spree_api_key.spree_api.rb +8 -0
  337. data/spec/dummy/db/migrate/20160706112587_create_users.solidus_auth.rb +30 -0
  338. data/spec/dummy/db/migrate/20160706112588_rename_columns_for_devise.solidus_auth.rb +38 -0
  339. data/spec/dummy/db/migrate/20160706112589_convert_user_remember_field.solidus_auth.rb +12 -0
  340. data/spec/dummy/db/migrate/20160706112590_add_reset_password_sent_at_to_spree_users.solidus_auth.rb +9 -0
  341. data/spec/dummy/db/migrate/20160706112591_make_users_email_index_unique.solidus_auth.rb +10 -0
  342. data/spec/dummy/db/migrate/20160706112592_add_deleted_at_to_users.solidus_auth.rb +7 -0
  343. data/spec/dummy/db/migrate/20160706112593_add_confirmable_to_users.solidus_auth.rb +8 -0
  344. data/spec/dummy/db/migrate/20160706112594_create_delayed_jobs.rb +22 -0
  345. data/spec/dummy/db/schema.rb +1206 -0
  346. data/spec/dummy/db/seeds.rb +11 -0
  347. data/spec/dummy/db/spree_test.sqlite3 +0 -0
  348. data/spec/dummy/log/test.log +15214 -0
  349. data/spec/dummy/public/404.html +67 -0
  350. data/spec/dummy/public/422.html +67 -0
  351. data/spec/dummy/public/500.html +66 -0
  352. data/spec/dummy/public/favicon.ico +0 -0
  353. data/spec/dummy/tmp/cache/F65/550/spree%2Fauth_configuration%2Fconfirmable +1 -0
  354. data/spec/dummy/vendor/assets/javascripts/spree/backend/all.js +10 -0
  355. data/spec/dummy/vendor/assets/javascripts/spree/frontend/all.js +10 -0
  356. data/spec/dummy/vendor/assets/stylesheets/spree/backend/all.css +9 -0
  357. data/spec/dummy/vendor/assets/stylesheets/spree/frontend/all.css +9 -0
  358. data/spec/features/recurring_reports_spec.rb +23 -0
  359. data/spec/features/specifying_criteria_spec.rb +21 -0
  360. data/spec/spec_helper.rb +88 -0
  361. data/spec/unit/lib/order_reporting/delayed_job_scheduler_spec.rb +18 -0
  362. metadata +925 -0
@@ -0,0 +1,16 @@
1
+ # This migration comes from spree (originally 20150826002555)
2
+ class ConvertHabtmToHmtForTaxonPrototypes < ActiveRecord::Migration
3
+ def up
4
+ add_column :spree_taxons_prototypes, :created_at, :datetime
5
+ add_column :spree_taxons_prototypes, :updated_at, :datetime
6
+
7
+ rename_table :spree_taxons_prototypes, :spree_prototype_taxons
8
+ end
9
+
10
+ def down
11
+ rename_table :spree_prototype_taxons, :spree_taxons_prototypes
12
+
13
+ remove_column :spree_taxons_prototypes, :created_at, :datetime
14
+ remove_column :spree_taxons_prototypes, :updated_at, :datetime
15
+ end
16
+ end
@@ -0,0 +1,29 @@
1
+ # This migration comes from spree (originally 20150909123605)
2
+ class CreateVariantPropertiesAndRules < ActiveRecord::Migration
3
+ def change
4
+ create_table :spree_variant_property_rules do |t|
5
+ t.references :product
6
+ t.timestamps null: false
7
+ end
8
+
9
+ add_index :spree_variant_property_rules, :product_id
10
+
11
+ create_table :spree_variant_property_rule_conditions do |t|
12
+ t.references :option_value
13
+ t.references :variant_property_rule
14
+ t.timestamps null: false
15
+ end
16
+
17
+ add_index :spree_variant_property_rule_conditions, [:variant_property_rule_id, :option_value_id], name: "index_spree_variant_prop_rule_conditions_on_rule_and_optval"
18
+
19
+ create_table :spree_variant_property_rule_values do |t|
20
+ t.text :value
21
+ t.integer :position, default: 0
22
+ t.references :property
23
+ t.references :variant_property_rule
24
+ end
25
+
26
+ add_index :spree_variant_property_rule_values, :property_id
27
+ add_index :spree_variant_property_rule_values, :variant_property_rule_id, name: "index_spree_variant_property_rule_values_on_rule"
28
+ end
29
+ end
@@ -0,0 +1,7 @@
1
+ # This migration comes from spree (originally 20151010003252)
2
+ class AddForeignKeysForTaxonsPrototypes < ActiveRecord::Migration
3
+ def change
4
+ add_foreign_key :spree_prototype_taxons, :spree_taxons, column: :taxon_id
5
+ add_foreign_key :spree_prototype_taxons, :spree_prototypes, column: :prototype_id
6
+ end
7
+ end
@@ -0,0 +1,17 @@
1
+ # This migration comes from spree (originally 20151013222921)
2
+ # This is named the same as the migration in spree 3.0 so it will not be copied
3
+ # if that has already been run.
4
+ class RemoveTokenPermissionsTable < ActiveRecord::Migration
5
+ def up
6
+ drop_table :spree_tokenized_permissions
7
+ end
8
+
9
+ def down
10
+ create_table "spree_tokenized_permissions" do |t|
11
+ t.integer "permissable_id"
12
+ t.string "permissable_type"
13
+ t.string "token"
14
+ t.timestamps null: true
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,8 @@
1
+ # This migration comes from spree (originally 20151014213349)
2
+ # This file has the same name as the spree 3.0 migration to prevent it from
3
+ # being run twice for those users.
4
+ class RenameIdentifierToNumberForPayment < ActiveRecord::Migration
5
+ def change
6
+ rename_column :spree_payments, :identifier, :number
7
+ end
8
+ end
@@ -0,0 +1,10 @@
1
+ # This migration comes from spree (originally 20151015203732)
2
+ class AddForeignKeysForProductPromotionRules < ActiveRecord::Migration
3
+ def change
4
+ add_foreign_key :spree_product_promotion_rules, :spree_products,
5
+ column: :product_id
6
+
7
+ add_foreign_key :spree_product_promotion_rules, :spree_promotion_rules,
8
+ column: :promotion_rule_id
9
+ end
10
+ end
@@ -0,0 +1,7 @@
1
+ # This migration comes from spree (originally 20151021113730)
2
+ class AddSaleToSpreePromotions < ActiveRecord::Migration
3
+ def change
4
+ add_column :spree_promotions, :apply_automatically, :boolean, default: false
5
+ add_index :spree_promotions, :apply_automatically
6
+ end
7
+ end
@@ -0,0 +1,29 @@
1
+ # This migration comes from spree (originally 20151021163309)
2
+ class ConvertSalePromotions < ActiveRecord::Migration
3
+ def up
4
+ sale_promotions.update_all(apply_automatically: true)
5
+ end
6
+
7
+ def down
8
+ # intentionally left blank
9
+ end
10
+
11
+ private
12
+
13
+ def sale_promotions
14
+ promo_table = Spree::Promotion.arel_table
15
+ code_table = Spree::PromotionCode.arel_table
16
+
17
+ promotion_code_join = promo_table.join(code_table, Arel::Nodes::OuterJoin).on(
18
+ promo_table[:id].eq(code_table[:promotion_id])
19
+ ).join_sources
20
+
21
+ Spree::Promotion.includes(:promotion_rules).
22
+ joins(promotion_code_join).
23
+ where(
24
+ code_table[:value].eq(nil).and(
25
+ promo_table[:path].eq(nil)
26
+ )
27
+ ).distinct
28
+ end
29
+ end
@@ -0,0 +1,18 @@
1
+ # This migration comes from spree (originally 20151117063249)
2
+ class ConvertHabtmToHmtForPropertiesPrototypes < ActiveRecord::Migration
3
+ def up
4
+ add_column :spree_properties_prototypes, :id, :primary_key
5
+ add_column :spree_properties_prototypes, :created_at, :datetime
6
+ add_column :spree_properties_prototypes, :updated_at, :datetime
7
+
8
+ rename_table :spree_properties_prototypes, :spree_property_prototypes
9
+ end
10
+
11
+ def down
12
+ rename_table :spree_property_prototypes, :spree_properties_prototypes
13
+
14
+ remove_column :spree_properties_prototypes, :id, :primary_key
15
+ remove_column :spree_properties_prototypes, :created_at, :datetime
16
+ remove_column :spree_properties_prototypes, :updated_at, :datetime
17
+ end
18
+ end
@@ -0,0 +1,18 @@
1
+ # This migration comes from spree (originally 20151124062500)
2
+ class ConvertHabtmToHmtForOptionTypePrototypes < ActiveRecord::Migration
3
+ def up
4
+ add_column :spree_option_types_prototypes, :id, :primary_key
5
+ add_column :spree_option_types_prototypes, :created_at, :datetime
6
+ add_column :spree_option_types_prototypes, :updated_at, :datetime
7
+
8
+ rename_table :spree_option_types_prototypes, :spree_option_type_prototypes
9
+ end
10
+
11
+ def down
12
+ remove_column :spree_option_types_prototypes, :id
13
+ remove_column :spree_option_types_prototypes, :created_at
14
+ remove_column :spree_option_types_prototypes, :updated_at
15
+
16
+ rename_table :spree_option_type_prototypes, :spree_option_types_prototypes
17
+ end
18
+ end
@@ -0,0 +1,16 @@
1
+ # This migration comes from spree (originally 20151126063028)
2
+ class ConvertHabtmToHmtForTaxonsPromotionRules < ActiveRecord::Migration
3
+ def up
4
+ add_column :spree_taxons_promotion_rules, :created_at, :datetime
5
+ add_column :spree_taxons_promotion_rules, :updated_at, :datetime
6
+
7
+ rename_table :spree_taxons_promotion_rules, :spree_promotion_rule_taxons
8
+ end
9
+
10
+ def down
11
+ rename_table :spree_promotion_rule_taxons, :spree_taxons_promotion_rules
12
+
13
+ remove_column :spree_taxons_promotion_rules, :created_at, :datetime
14
+ remove_column :spree_taxons_promotion_rules, :updated_at, :datetime
15
+ end
16
+ end
@@ -0,0 +1,10 @@
1
+ # This migration comes from spree (originally 20151219020209)
2
+ class AddStockItemUniqueIndex < ActiveRecord::Migration
3
+ def change
4
+ # Add a database-level uniqueness constraint for databases that support it
5
+ # (postgres & sqlite)
6
+ if connection.adapter_name =~ /postgres|sqlite/i
7
+ add_index 'spree_stock_items', ['variant_id', 'stock_location_id'], where: 'deleted_at is null', unique: true
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,8 @@
1
+ # This migration comes from spree_api (originally 20100107141738)
2
+ class AddApiKeyToSpreeUsers < ActiveRecord::Migration
3
+ def change
4
+ unless defined?(User)
5
+ add_column :spree_users, :api_key, :string, :limit => 40
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ # This migration comes from spree_api (originally 20120411123334)
2
+ class ResizeApiKeyField < ActiveRecord::Migration
3
+ def change
4
+ unless defined?(User)
5
+ change_column :spree_users, :api_key, :string, :limit => 48
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ # This migration comes from spree_api (originally 20120530054546)
2
+ class RenameApiKeyToSpreeApiKey < ActiveRecord::Migration
3
+ def change
4
+ unless defined?(User)
5
+ rename_column :spree_users, :api_key, :spree_api_key
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ # This migration comes from spree_api (originally 20131017162334)
2
+ class AddIndexToUserSpreeApiKey < ActiveRecord::Migration
3
+ def change
4
+ unless defined?(User)
5
+ add_index :spree_users, :spree_api_key
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,30 @@
1
+ # This migration comes from solidus_auth (originally 20101026184949)
2
+ class CreateUsers < ActiveRecord::Migration
3
+ def up
4
+ unless table_exists?("spree_users")
5
+ create_table "spree_users", :force => true do |t|
6
+ t.string "crypted_password", :limit => 128
7
+ t.string "salt", :limit => 128
8
+ t.string "email"
9
+ t.string "remember_token"
10
+ t.string "remember_token_expires_at"
11
+ t.string "persistence_token"
12
+ t.string "single_access_token"
13
+ t.string "perishable_token"
14
+ t.integer "login_count", :default => 0, :null => false
15
+ t.integer "failed_login_count", :default => 0, :null => false
16
+ t.datetime "last_request_at"
17
+ t.datetime "current_login_at"
18
+ t.datetime "last_login_at"
19
+ t.string "current_login_ip"
20
+ t.string "last_login_ip"
21
+ t.string "login"
22
+ t.integer "ship_address_id"
23
+ t.integer "bill_address_id"
24
+ t.datetime "created_at", :null => false
25
+ t.datetime "updated_at", :null => false
26
+ t.string "openid_identifier"
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,38 @@
1
+ # This migration comes from solidus_auth (originally 20101026184950)
2
+ class RenameColumnsForDevise < ActiveRecord::Migration
3
+ def up
4
+ return if column_exists?(:spree_users, :password_salt)
5
+ rename_column :spree_users, :crypted_password, :encrypted_password
6
+ rename_column :spree_users, :salt, :password_salt
7
+ rename_column :spree_users, :remember_token_expires_at, :remember_created_at
8
+ rename_column :spree_users, :login_count, :sign_in_count
9
+ rename_column :spree_users, :failed_login_count, :failed_attempts
10
+ rename_column :spree_users, :single_access_token, :reset_password_token
11
+ rename_column :spree_users, :current_login_at, :current_sign_in_at
12
+ rename_column :spree_users, :last_login_at, :last_sign_in_at
13
+ rename_column :spree_users, :current_login_ip, :current_sign_in_ip
14
+ rename_column :spree_users, :last_login_ip, :last_sign_in_ip
15
+ add_column :spree_users, :authentication_token, :string
16
+ add_column :spree_users, :unlock_token, :string
17
+ add_column :spree_users, :locked_at, :datetime
18
+ remove_column :spree_users, :openid_identifier
19
+ end
20
+
21
+ def down
22
+ remove_column :spree_users, :authentication_token
23
+ remove_column :spree_users, :locked_at
24
+ remove_column :spree_users, :unlock_token
25
+ rename_column :spree_users, :last_sign_in_ip, :last_login_ip
26
+ rename_column :spree_users, :current_sign_in_ip, :current_login_ip
27
+ rename_column :spree_users, :last_sign_in_at, :last_login_at
28
+ rename_column :spree_users, :current_sign_in_at, :current_login_at
29
+ rename_column :spree_users, :reset_password_token, :single_access_token
30
+ rename_column :spree_users, :failed_attempts, :failed_login_count
31
+ rename_column :spree_users, :sign_in_count, :login_count
32
+ rename_column :spree_users, :remember_created_at, :remember_token_expires_at
33
+ rename_column :spree_users, :password_salt, :salt
34
+ rename_column :spree_users, :encrypted_password, :crypted_password
35
+ add_column :spree_users, :unlock_token, :string
36
+ add_column :spree_users, :openid_identifier, :string
37
+ end
38
+ end
@@ -0,0 +1,12 @@
1
+ # This migration comes from solidus_auth (originally 20101214150824)
2
+ class ConvertUserRememberField < ActiveRecord::Migration
3
+ def up
4
+ remove_column :spree_users, :remember_created_at
5
+ add_column :spree_users, :remember_created_at, :datetime
6
+ end
7
+
8
+ def down
9
+ remove_column :spree_users, :remember_created_at
10
+ add_column :spree_users, :remember_created_at, :string
11
+ end
12
+ end
@@ -0,0 +1,9 @@
1
+ # This migration comes from solidus_auth (originally 20120203010234)
2
+ class AddResetPasswordSentAtToSpreeUsers < ActiveRecord::Migration
3
+ def change
4
+ Spree::User.reset_column_information
5
+ unless Spree::User.column_names.include?("reset_password_sent_at")
6
+ add_column :spree_users, :reset_password_sent_at, :datetime
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,10 @@
1
+ # This migration comes from solidus_auth (originally 20120605211305)
2
+ class MakeUsersEmailIndexUnique < ActiveRecord::Migration
3
+ def up
4
+ add_index "spree_users", ["email"], :name => "email_idx_unique", :unique => true
5
+ end
6
+
7
+ def down
8
+ remove_index "spree_users", :name => "email_idx_unique"
9
+ end
10
+ end
@@ -0,0 +1,7 @@
1
+ # This migration comes from solidus_auth (originally 20140904000425)
2
+ class AddDeletedAtToUsers < ActiveRecord::Migration
3
+ def change
4
+ add_column :spree_users, :deleted_at, :datetime
5
+ add_index :spree_users, :deleted_at
6
+ end
7
+ end
@@ -0,0 +1,8 @@
1
+ # This migration comes from solidus_auth (originally 20141002154641)
2
+ class AddConfirmableToUsers < ActiveRecord::Migration
3
+ def change
4
+ add_column :spree_users, :confirmation_token, :string
5
+ add_column :spree_users, :confirmed_at, :datetime
6
+ add_column :spree_users, :confirmation_sent_at, :datetime
7
+ end
8
+ end
@@ -0,0 +1,22 @@
1
+ class CreateDelayedJobs < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :delayed_jobs, force: true do |table|
4
+ table.integer :priority, default: 0, null: false # Allows some jobs to jump to the front of the queue
5
+ table.integer :attempts, default: 0, null: false # Provides for retries, but still fail eventually.
6
+ table.text :handler, null: false # YAML-encoded string of the object that will do work
7
+ table.text :last_error # reason for last failure (See Note below)
8
+ table.datetime :run_at # When to run. Could be Time.zone.now for immediately, or sometime in the future.
9
+ table.datetime :locked_at # Set when a client is working on this object
10
+ table.datetime :failed_at # Set when all retries have failed (actually, by default, the record is deleted instead)
11
+ table.string :locked_by # Who is working on this object (if locked)
12
+ table.string :queue # The name of the queue this job is in
13
+ table.timestamps null: true
14
+ end
15
+
16
+ add_index :delayed_jobs, [:priority, :run_at], name: "delayed_jobs_priority"
17
+ end
18
+
19
+ def self.down
20
+ drop_table :delayed_jobs
21
+ end
22
+ end
@@ -0,0 +1,1206 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended that you check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(version: 20160706112594) do
15
+
16
+ create_table "delayed_jobs", force: :cascade do |t|
17
+ t.integer "priority", default: 0, null: false
18
+ t.integer "attempts", default: 0, null: false
19
+ t.text "handler", null: false
20
+ t.text "last_error"
21
+ t.datetime "run_at"
22
+ t.datetime "locked_at"
23
+ t.datetime "failed_at"
24
+ t.string "locked_by"
25
+ t.string "queue"
26
+ t.datetime "created_at"
27
+ t.datetime "updated_at"
28
+ end
29
+
30
+ add_index "delayed_jobs", ["priority", "run_at"], name: "delayed_jobs_priority"
31
+
32
+ create_table "friendly_id_slugs", force: :cascade do |t|
33
+ t.string "slug", null: false
34
+ t.integer "sluggable_id", null: false
35
+ t.string "sluggable_type", limit: 50
36
+ t.string "scope"
37
+ t.datetime "created_at"
38
+ end
39
+
40
+ add_index "friendly_id_slugs", ["slug", "sluggable_type", "scope"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope", unique: true
41
+ add_index "friendly_id_slugs", ["slug", "sluggable_type"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type"
42
+ add_index "friendly_id_slugs", ["sluggable_id"], name: "index_friendly_id_slugs_on_sluggable_id"
43
+ add_index "friendly_id_slugs", ["sluggable_type"], name: "index_friendly_id_slugs_on_sluggable_type"
44
+
45
+ create_table "spree_addresses", force: :cascade do |t|
46
+ t.string "firstname"
47
+ t.string "lastname"
48
+ t.string "address1"
49
+ t.string "address2"
50
+ t.string "city"
51
+ t.string "zipcode"
52
+ t.string "phone"
53
+ t.string "state_name"
54
+ t.string "alternative_phone"
55
+ t.string "company"
56
+ t.integer "state_id"
57
+ t.integer "country_id"
58
+ t.datetime "created_at"
59
+ t.datetime "updated_at"
60
+ end
61
+
62
+ add_index "spree_addresses", ["country_id"], name: "index_spree_addresses_on_country_id"
63
+ add_index "spree_addresses", ["firstname"], name: "index_addresses_on_firstname"
64
+ add_index "spree_addresses", ["lastname"], name: "index_addresses_on_lastname"
65
+ add_index "spree_addresses", ["state_id"], name: "index_spree_addresses_on_state_id"
66
+
67
+ create_table "spree_adjustment_reasons", force: :cascade do |t|
68
+ t.string "name"
69
+ t.string "code"
70
+ t.boolean "active", default: true
71
+ t.datetime "created_at"
72
+ t.datetime "updated_at"
73
+ end
74
+
75
+ add_index "spree_adjustment_reasons", ["active"], name: "index_spree_adjustment_reasons_on_active"
76
+ add_index "spree_adjustment_reasons", ["code"], name: "index_spree_adjustment_reasons_on_code"
77
+
78
+ create_table "spree_adjustments", force: :cascade do |t|
79
+ t.integer "source_id"
80
+ t.string "source_type"
81
+ t.integer "adjustable_id", null: false
82
+ t.string "adjustable_type"
83
+ t.decimal "amount", precision: 10, scale: 2
84
+ t.string "label"
85
+ t.boolean "eligible", default: true
86
+ t.datetime "created_at"
87
+ t.datetime "updated_at"
88
+ t.integer "order_id", null: false
89
+ t.boolean "included", default: false
90
+ t.integer "promotion_code_id"
91
+ t.integer "adjustment_reason_id"
92
+ t.boolean "finalized"
93
+ end
94
+
95
+ add_index "spree_adjustments", ["adjustable_id", "adjustable_type"], name: "index_spree_adjustments_on_adjustable_id_and_adjustable_type"
96
+ add_index "spree_adjustments", ["adjustable_id"], name: "index_adjustments_on_order_id"
97
+ add_index "spree_adjustments", ["eligible"], name: "index_spree_adjustments_on_eligible"
98
+ add_index "spree_adjustments", ["order_id"], name: "index_spree_adjustments_on_order_id"
99
+ add_index "spree_adjustments", ["promotion_code_id"], name: "index_spree_adjustments_on_promotion_code_id"
100
+ add_index "spree_adjustments", ["source_id", "source_type"], name: "index_spree_adjustments_on_source_id_and_source_type"
101
+
102
+ create_table "spree_assets", force: :cascade do |t|
103
+ t.integer "viewable_id"
104
+ t.string "viewable_type"
105
+ t.integer "attachment_width"
106
+ t.integer "attachment_height"
107
+ t.integer "attachment_file_size"
108
+ t.integer "position"
109
+ t.string "attachment_content_type"
110
+ t.string "attachment_file_name"
111
+ t.string "type", limit: 75
112
+ t.datetime "attachment_updated_at"
113
+ t.text "alt"
114
+ t.datetime "created_at"
115
+ t.datetime "updated_at"
116
+ end
117
+
118
+ add_index "spree_assets", ["viewable_id"], name: "index_assets_on_viewable_id"
119
+ add_index "spree_assets", ["viewable_type", "type"], name: "index_assets_on_viewable_type_and_type"
120
+
121
+ create_table "spree_calculators", force: :cascade do |t|
122
+ t.string "type"
123
+ t.integer "calculable_id"
124
+ t.string "calculable_type"
125
+ t.datetime "created_at"
126
+ t.datetime "updated_at"
127
+ t.text "preferences"
128
+ end
129
+
130
+ add_index "spree_calculators", ["calculable_id", "calculable_type"], name: "index_spree_calculators_on_calculable_id_and_calculable_type"
131
+ add_index "spree_calculators", ["id", "type"], name: "index_spree_calculators_on_id_and_type"
132
+
133
+ create_table "spree_cartons", force: :cascade do |t|
134
+ t.string "number"
135
+ t.string "external_number"
136
+ t.integer "stock_location_id"
137
+ t.integer "address_id"
138
+ t.integer "shipping_method_id"
139
+ t.string "tracking"
140
+ t.datetime "shipped_at"
141
+ t.datetime "created_at"
142
+ t.datetime "updated_at"
143
+ t.integer "imported_from_shipment_id"
144
+ end
145
+
146
+ add_index "spree_cartons", ["external_number"], name: "index_spree_cartons_on_external_number"
147
+ add_index "spree_cartons", ["imported_from_shipment_id"], name: "index_spree_cartons_on_imported_from_shipment_id", unique: true
148
+ add_index "spree_cartons", ["number"], name: "index_spree_cartons_on_number", unique: true
149
+ add_index "spree_cartons", ["stock_location_id"], name: "index_spree_cartons_on_stock_location_id"
150
+
151
+ create_table "spree_countries", force: :cascade do |t|
152
+ t.string "iso_name"
153
+ t.string "iso"
154
+ t.string "iso3"
155
+ t.string "name"
156
+ t.integer "numcode"
157
+ t.boolean "states_required", default: false
158
+ t.datetime "updated_at"
159
+ end
160
+
161
+ create_table "spree_credit_cards", force: :cascade do |t|
162
+ t.string "month"
163
+ t.string "year"
164
+ t.string "cc_type"
165
+ t.string "last_digits"
166
+ t.string "gateway_customer_profile_id"
167
+ t.string "gateway_payment_profile_id"
168
+ t.datetime "created_at"
169
+ t.datetime "updated_at"
170
+ t.string "name"
171
+ t.integer "user_id"
172
+ t.integer "payment_method_id"
173
+ t.boolean "default", default: false, null: false
174
+ t.integer "address_id"
175
+ end
176
+
177
+ add_index "spree_credit_cards", ["payment_method_id"], name: "index_spree_credit_cards_on_payment_method_id"
178
+ add_index "spree_credit_cards", ["user_id"], name: "index_spree_credit_cards_on_user_id"
179
+
180
+ create_table "spree_customer_returns", force: :cascade do |t|
181
+ t.string "number"
182
+ t.integer "stock_location_id"
183
+ t.datetime "created_at"
184
+ t.datetime "updated_at"
185
+ end
186
+
187
+ create_table "spree_inventory_units", force: :cascade do |t|
188
+ t.string "state"
189
+ t.integer "variant_id"
190
+ t.integer "order_id"
191
+ t.integer "shipment_id"
192
+ t.datetime "created_at"
193
+ t.datetime "updated_at"
194
+ t.boolean "pending", default: true
195
+ t.integer "line_item_id"
196
+ t.integer "carton_id"
197
+ end
198
+
199
+ add_index "spree_inventory_units", ["carton_id"], name: "index_spree_inventory_units_on_carton_id"
200
+ add_index "spree_inventory_units", ["line_item_id"], name: "index_spree_inventory_units_on_line_item_id"
201
+ add_index "spree_inventory_units", ["order_id"], name: "index_inventory_units_on_order_id"
202
+ add_index "spree_inventory_units", ["shipment_id"], name: "index_inventory_units_on_shipment_id"
203
+ add_index "spree_inventory_units", ["variant_id"], name: "index_inventory_units_on_variant_id"
204
+
205
+ create_table "spree_line_item_actions", force: :cascade do |t|
206
+ t.integer "line_item_id", null: false
207
+ t.integer "action_id", null: false
208
+ t.integer "quantity", default: 0
209
+ t.datetime "created_at"
210
+ t.datetime "updated_at"
211
+ end
212
+
213
+ add_index "spree_line_item_actions", ["action_id"], name: "index_spree_line_item_actions_on_action_id"
214
+ add_index "spree_line_item_actions", ["line_item_id"], name: "index_spree_line_item_actions_on_line_item_id"
215
+
216
+ create_table "spree_line_items", force: :cascade do |t|
217
+ t.integer "variant_id"
218
+ t.integer "order_id"
219
+ t.integer "quantity", null: false
220
+ t.decimal "price", precision: 10, scale: 2, null: false
221
+ t.datetime "created_at"
222
+ t.datetime "updated_at"
223
+ t.string "currency"
224
+ t.decimal "cost_price", precision: 10, scale: 2
225
+ t.integer "tax_category_id"
226
+ t.decimal "adjustment_total", precision: 10, scale: 2, default: 0.0
227
+ t.decimal "additional_tax_total", precision: 10, scale: 2, default: 0.0
228
+ t.decimal "promo_total", precision: 10, scale: 2, default: 0.0
229
+ t.decimal "included_tax_total", precision: 10, scale: 2, default: 0.0, null: false
230
+ t.decimal "pre_tax_amount", precision: 12, scale: 4, default: 0.0, null: false
231
+ end
232
+
233
+ add_index "spree_line_items", ["order_id"], name: "index_spree_line_items_on_order_id"
234
+ add_index "spree_line_items", ["variant_id"], name: "index_spree_line_items_on_variant_id"
235
+
236
+ create_table "spree_log_entries", force: :cascade do |t|
237
+ t.integer "source_id"
238
+ t.string "source_type"
239
+ t.text "details"
240
+ t.datetime "created_at"
241
+ t.datetime "updated_at"
242
+ end
243
+
244
+ add_index "spree_log_entries", ["source_id", "source_type"], name: "index_spree_log_entries_on_source_id_and_source_type"
245
+
246
+ create_table "spree_option_type_prototypes", force: :cascade do |t|
247
+ t.integer "prototype_id"
248
+ t.integer "option_type_id"
249
+ t.datetime "created_at"
250
+ t.datetime "updated_at"
251
+ end
252
+
253
+ create_table "spree_option_types", force: :cascade do |t|
254
+ t.string "name", limit: 100
255
+ t.string "presentation", limit: 100
256
+ t.integer "position", default: 0, null: false
257
+ t.datetime "created_at"
258
+ t.datetime "updated_at"
259
+ end
260
+
261
+ add_index "spree_option_types", ["position"], name: "index_spree_option_types_on_position"
262
+
263
+ create_table "spree_option_values", force: :cascade do |t|
264
+ t.integer "position"
265
+ t.string "name"
266
+ t.string "presentation"
267
+ t.integer "option_type_id"
268
+ t.datetime "created_at"
269
+ t.datetime "updated_at"
270
+ end
271
+
272
+ add_index "spree_option_values", ["option_type_id"], name: "index_spree_option_values_on_option_type_id"
273
+ add_index "spree_option_values", ["position"], name: "index_spree_option_values_on_position"
274
+
275
+ create_table "spree_option_values_variants", force: :cascade do |t|
276
+ t.integer "variant_id"
277
+ t.integer "option_value_id"
278
+ end
279
+
280
+ add_index "spree_option_values_variants", ["variant_id", "option_value_id"], name: "index_option_values_variants_on_variant_id_and_option_value_id"
281
+ add_index "spree_option_values_variants", ["variant_id"], name: "index_spree_option_values_variants_on_variant_id"
282
+
283
+ create_table "spree_order_mutexes", force: :cascade do |t|
284
+ t.integer "order_id", null: false
285
+ t.datetime "created_at"
286
+ end
287
+
288
+ add_index "spree_order_mutexes", ["order_id"], name: "index_spree_order_mutexes_on_order_id", unique: true
289
+
290
+ create_table "spree_order_stock_locations", force: :cascade do |t|
291
+ t.integer "order_id"
292
+ t.integer "variant_id"
293
+ t.integer "quantity"
294
+ t.integer "stock_location_id"
295
+ t.boolean "shipment_fulfilled", default: false, null: false
296
+ t.datetime "created_at"
297
+ t.datetime "updated_at"
298
+ end
299
+
300
+ create_table "spree_orders", force: :cascade do |t|
301
+ t.string "number", limit: 32
302
+ t.decimal "item_total", precision: 10, scale: 2, default: 0.0, null: false
303
+ t.decimal "total", precision: 10, scale: 2, default: 0.0, null: false
304
+ t.string "state"
305
+ t.decimal "adjustment_total", precision: 10, scale: 2, default: 0.0, null: false
306
+ t.integer "user_id"
307
+ t.datetime "completed_at"
308
+ t.integer "bill_address_id"
309
+ t.integer "ship_address_id"
310
+ t.decimal "payment_total", precision: 10, scale: 2, default: 0.0
311
+ t.string "shipment_state"
312
+ t.string "payment_state"
313
+ t.string "email"
314
+ t.text "special_instructions"
315
+ t.datetime "created_at"
316
+ t.datetime "updated_at"
317
+ t.string "currency"
318
+ t.string "last_ip_address"
319
+ t.integer "created_by_id"
320
+ t.decimal "shipment_total", precision: 10, scale: 2, default: 0.0, null: false
321
+ t.decimal "additional_tax_total", precision: 10, scale: 2, default: 0.0
322
+ t.decimal "promo_total", precision: 10, scale: 2, default: 0.0
323
+ t.string "channel", default: "spree"
324
+ t.decimal "included_tax_total", precision: 10, scale: 2, default: 0.0, null: false
325
+ t.integer "item_count", default: 0
326
+ t.integer "approver_id"
327
+ t.datetime "approved_at"
328
+ t.boolean "confirmation_delivered", default: false
329
+ t.string "guest_token"
330
+ t.datetime "canceled_at"
331
+ t.integer "canceler_id"
332
+ t.integer "store_id"
333
+ t.string "approver_name"
334
+ t.boolean "frontend_viewable", default: true, null: false
335
+ end
336
+
337
+ add_index "spree_orders", ["approver_id"], name: "index_spree_orders_on_approver_id"
338
+ add_index "spree_orders", ["bill_address_id"], name: "index_spree_orders_on_bill_address_id"
339
+ add_index "spree_orders", ["completed_at"], name: "index_spree_orders_on_completed_at"
340
+ add_index "spree_orders", ["created_by_id"], name: "index_spree_orders_on_created_by_id"
341
+ add_index "spree_orders", ["guest_token"], name: "index_spree_orders_on_guest_token"
342
+ add_index "spree_orders", ["number"], name: "index_spree_orders_on_number"
343
+ add_index "spree_orders", ["ship_address_id"], name: "index_spree_orders_on_ship_address_id"
344
+ add_index "spree_orders", ["user_id", "created_by_id"], name: "index_spree_orders_on_user_id_and_created_by_id"
345
+ add_index "spree_orders", ["user_id"], name: "index_spree_orders_on_user_id"
346
+
347
+ create_table "spree_orders_promotions", force: :cascade do |t|
348
+ t.integer "order_id"
349
+ t.integer "promotion_id"
350
+ t.integer "promotion_code_id"
351
+ t.datetime "created_at"
352
+ t.datetime "updated_at"
353
+ end
354
+
355
+ add_index "spree_orders_promotions", ["order_id", "promotion_id"], name: "index_spree_orders_promotions_on_order_id_and_promotion_id"
356
+ add_index "spree_orders_promotions", ["promotion_code_id"], name: "index_spree_orders_promotions_on_promotion_code_id"
357
+
358
+ create_table "spree_payment_capture_events", force: :cascade do |t|
359
+ t.decimal "amount", precision: 10, scale: 2, default: 0.0
360
+ t.integer "payment_id"
361
+ t.datetime "created_at"
362
+ t.datetime "updated_at"
363
+ end
364
+
365
+ add_index "spree_payment_capture_events", ["payment_id"], name: "index_spree_payment_capture_events_on_payment_id"
366
+
367
+ create_table "spree_payment_methods", force: :cascade do |t|
368
+ t.string "type"
369
+ t.string "name"
370
+ t.text "description"
371
+ t.boolean "active", default: true
372
+ t.datetime "deleted_at"
373
+ t.datetime "created_at"
374
+ t.datetime "updated_at"
375
+ t.string "display_on"
376
+ t.boolean "auto_capture"
377
+ t.text "preferences"
378
+ t.string "preference_source"
379
+ end
380
+
381
+ add_index "spree_payment_methods", ["id", "type"], name: "index_spree_payment_methods_on_id_and_type"
382
+
383
+ create_table "spree_payments", force: :cascade do |t|
384
+ t.decimal "amount", precision: 10, scale: 2, default: 0.0, null: false
385
+ t.integer "order_id"
386
+ t.integer "source_id"
387
+ t.string "source_type"
388
+ t.integer "payment_method_id"
389
+ t.string "state"
390
+ t.string "response_code"
391
+ t.string "avs_response"
392
+ t.datetime "created_at"
393
+ t.datetime "updated_at"
394
+ t.string "number"
395
+ t.string "cvv_response_code"
396
+ t.string "cvv_response_message"
397
+ end
398
+
399
+ add_index "spree_payments", ["order_id"], name: "index_spree_payments_on_order_id"
400
+ add_index "spree_payments", ["payment_method_id"], name: "index_spree_payments_on_payment_method_id"
401
+ add_index "spree_payments", ["source_id", "source_type"], name: "index_spree_payments_on_source_id_and_source_type"
402
+
403
+ create_table "spree_preferences", force: :cascade do |t|
404
+ t.text "value"
405
+ t.string "key"
406
+ t.datetime "created_at"
407
+ t.datetime "updated_at"
408
+ end
409
+
410
+ add_index "spree_preferences", ["key"], name: "index_spree_preferences_on_key", unique: true
411
+
412
+ create_table "spree_prices", force: :cascade do |t|
413
+ t.integer "variant_id", null: false
414
+ t.decimal "amount", precision: 10, scale: 2
415
+ t.string "currency"
416
+ t.datetime "deleted_at"
417
+ t.boolean "is_default", default: true, null: false
418
+ end
419
+
420
+ add_index "spree_prices", ["variant_id", "currency"], name: "index_spree_prices_on_variant_id_and_currency"
421
+
422
+ create_table "spree_product_option_types", force: :cascade do |t|
423
+ t.integer "position"
424
+ t.integer "product_id"
425
+ t.integer "option_type_id"
426
+ t.datetime "created_at"
427
+ t.datetime "updated_at"
428
+ end
429
+
430
+ add_index "spree_product_option_types", ["option_type_id"], name: "index_spree_product_option_types_on_option_type_id"
431
+ add_index "spree_product_option_types", ["position"], name: "index_spree_product_option_types_on_position"
432
+ add_index "spree_product_option_types", ["product_id"], name: "index_spree_product_option_types_on_product_id"
433
+
434
+ create_table "spree_product_promotion_rules", force: :cascade do |t|
435
+ t.integer "product_id"
436
+ t.integer "promotion_rule_id"
437
+ t.datetime "created_at"
438
+ t.datetime "updated_at"
439
+ end
440
+
441
+ add_index "spree_product_promotion_rules", ["product_id"], name: "index_products_promotion_rules_on_product_id"
442
+ add_index "spree_product_promotion_rules", ["promotion_rule_id"], name: "index_products_promotion_rules_on_promotion_rule_id"
443
+
444
+ create_table "spree_product_properties", force: :cascade do |t|
445
+ t.string "value"
446
+ t.integer "product_id"
447
+ t.integer "property_id"
448
+ t.datetime "created_at"
449
+ t.datetime "updated_at"
450
+ t.integer "position", default: 0
451
+ end
452
+
453
+ add_index "spree_product_properties", ["position"], name: "index_spree_product_properties_on_position"
454
+ add_index "spree_product_properties", ["product_id"], name: "index_product_properties_on_product_id"
455
+ add_index "spree_product_properties", ["property_id"], name: "index_spree_product_properties_on_property_id"
456
+
457
+ create_table "spree_products", force: :cascade do |t|
458
+ t.string "name", default: "", null: false
459
+ t.text "description"
460
+ t.datetime "available_on"
461
+ t.datetime "deleted_at"
462
+ t.string "slug"
463
+ t.text "meta_description"
464
+ t.string "meta_keywords"
465
+ t.integer "tax_category_id"
466
+ t.integer "shipping_category_id"
467
+ t.datetime "created_at"
468
+ t.datetime "updated_at"
469
+ t.boolean "promotionable", default: true
470
+ t.string "meta_title"
471
+ end
472
+
473
+ add_index "spree_products", ["available_on"], name: "index_spree_products_on_available_on"
474
+ add_index "spree_products", ["deleted_at"], name: "index_spree_products_on_deleted_at"
475
+ add_index "spree_products", ["name"], name: "index_spree_products_on_name"
476
+ add_index "spree_products", ["slug"], name: "index_spree_products_on_slug", unique: true
477
+
478
+ create_table "spree_products_taxons", force: :cascade do |t|
479
+ t.integer "product_id"
480
+ t.integer "taxon_id"
481
+ t.integer "position"
482
+ end
483
+
484
+ add_index "spree_products_taxons", ["position"], name: "index_spree_products_taxons_on_position"
485
+ add_index "spree_products_taxons", ["product_id"], name: "index_spree_products_taxons_on_product_id"
486
+ add_index "spree_products_taxons", ["taxon_id"], name: "index_spree_products_taxons_on_taxon_id"
487
+
488
+ create_table "spree_promotion_action_line_items", force: :cascade do |t|
489
+ t.integer "promotion_action_id"
490
+ t.integer "variant_id"
491
+ t.integer "quantity", default: 1
492
+ end
493
+
494
+ add_index "spree_promotion_action_line_items", ["promotion_action_id"], name: "index_spree_promotion_action_line_items_on_promotion_action_id"
495
+ add_index "spree_promotion_action_line_items", ["variant_id"], name: "index_spree_promotion_action_line_items_on_variant_id"
496
+
497
+ create_table "spree_promotion_actions", force: :cascade do |t|
498
+ t.integer "promotion_id"
499
+ t.integer "position"
500
+ t.string "type"
501
+ t.datetime "deleted_at"
502
+ t.text "preferences"
503
+ end
504
+
505
+ add_index "spree_promotion_actions", ["deleted_at"], name: "index_spree_promotion_actions_on_deleted_at"
506
+ add_index "spree_promotion_actions", ["id", "type"], name: "index_spree_promotion_actions_on_id_and_type"
507
+ add_index "spree_promotion_actions", ["promotion_id"], name: "index_spree_promotion_actions_on_promotion_id"
508
+
509
+ create_table "spree_promotion_categories", force: :cascade do |t|
510
+ t.string "name"
511
+ t.datetime "created_at"
512
+ t.datetime "updated_at"
513
+ t.string "code"
514
+ end
515
+
516
+ create_table "spree_promotion_codes", force: :cascade do |t|
517
+ t.integer "promotion_id", null: false
518
+ t.string "value", null: false
519
+ t.datetime "created_at"
520
+ t.datetime "updated_at"
521
+ end
522
+
523
+ add_index "spree_promotion_codes", ["promotion_id"], name: "index_spree_promotion_codes_on_promotion_id"
524
+ add_index "spree_promotion_codes", ["value"], name: "index_spree_promotion_codes_on_value", unique: true
525
+
526
+ create_table "spree_promotion_rule_taxons", force: :cascade do |t|
527
+ t.integer "taxon_id"
528
+ t.integer "promotion_rule_id"
529
+ t.datetime "created_at"
530
+ t.datetime "updated_at"
531
+ end
532
+
533
+ add_index "spree_promotion_rule_taxons", ["promotion_rule_id"], name: "index_spree_promotion_rule_taxons_on_promotion_rule_id"
534
+ add_index "spree_promotion_rule_taxons", ["taxon_id"], name: "index_spree_promotion_rule_taxons_on_taxon_id"
535
+
536
+ create_table "spree_promotion_rules", force: :cascade do |t|
537
+ t.integer "promotion_id"
538
+ t.integer "user_id"
539
+ t.integer "product_group_id"
540
+ t.string "type"
541
+ t.datetime "created_at"
542
+ t.datetime "updated_at"
543
+ t.string "code"
544
+ t.text "preferences"
545
+ end
546
+
547
+ add_index "spree_promotion_rules", ["product_group_id"], name: "index_promotion_rules_on_product_group_id"
548
+ add_index "spree_promotion_rules", ["promotion_id"], name: "index_spree_promotion_rules_on_promotion_id"
549
+ add_index "spree_promotion_rules", ["user_id"], name: "index_promotion_rules_on_user_id"
550
+
551
+ create_table "spree_promotion_rules_users", force: :cascade do |t|
552
+ t.integer "user_id"
553
+ t.integer "promotion_rule_id"
554
+ t.datetime "created_at"
555
+ t.datetime "updated_at"
556
+ end
557
+
558
+ add_index "spree_promotion_rules_users", ["promotion_rule_id"], name: "index_promotion_rules_users_on_promotion_rule_id"
559
+ add_index "spree_promotion_rules_users", ["user_id"], name: "index_promotion_rules_users_on_user_id"
560
+
561
+ create_table "spree_promotions", force: :cascade do |t|
562
+ t.string "description"
563
+ t.datetime "expires_at"
564
+ t.datetime "starts_at"
565
+ t.string "name"
566
+ t.string "type"
567
+ t.integer "usage_limit"
568
+ t.string "match_policy", default: "all"
569
+ t.string "code"
570
+ t.boolean "advertise", default: false
571
+ t.string "path"
572
+ t.datetime "created_at"
573
+ t.datetime "updated_at"
574
+ t.integer "promotion_category_id"
575
+ t.integer "per_code_usage_limit"
576
+ t.boolean "apply_automatically", default: false
577
+ end
578
+
579
+ add_index "spree_promotions", ["advertise"], name: "index_spree_promotions_on_advertise"
580
+ add_index "spree_promotions", ["apply_automatically"], name: "index_spree_promotions_on_apply_automatically"
581
+ add_index "spree_promotions", ["code"], name: "index_spree_promotions_on_code"
582
+ add_index "spree_promotions", ["expires_at"], name: "index_spree_promotions_on_expires_at"
583
+ add_index "spree_promotions", ["id", "type"], name: "index_spree_promotions_on_id_and_type"
584
+ add_index "spree_promotions", ["promotion_category_id"], name: "index_spree_promotions_on_promotion_category_id"
585
+ add_index "spree_promotions", ["starts_at"], name: "index_spree_promotions_on_starts_at"
586
+
587
+ create_table "spree_properties", force: :cascade do |t|
588
+ t.string "name"
589
+ t.string "presentation", null: false
590
+ t.datetime "created_at"
591
+ t.datetime "updated_at"
592
+ end
593
+
594
+ create_table "spree_property_prototypes", force: :cascade do |t|
595
+ t.integer "prototype_id"
596
+ t.integer "property_id"
597
+ t.datetime "created_at"
598
+ t.datetime "updated_at"
599
+ end
600
+
601
+ create_table "spree_prototype_taxons", force: :cascade do |t|
602
+ t.integer "taxon_id"
603
+ t.integer "prototype_id"
604
+ t.datetime "created_at"
605
+ t.datetime "updated_at"
606
+ end
607
+
608
+ add_index "spree_prototype_taxons", ["prototype_id"], name: "index_spree_prototype_taxons_on_prototype_id"
609
+ add_index "spree_prototype_taxons", ["taxon_id"], name: "index_spree_prototype_taxons_on_taxon_id"
610
+
611
+ create_table "spree_prototypes", force: :cascade do |t|
612
+ t.string "name"
613
+ t.datetime "created_at"
614
+ t.datetime "updated_at"
615
+ end
616
+
617
+ create_table "spree_refund_reasons", force: :cascade do |t|
618
+ t.string "name"
619
+ t.boolean "active", default: true
620
+ t.boolean "mutable", default: true
621
+ t.datetime "created_at"
622
+ t.datetime "updated_at"
623
+ t.string "code"
624
+ end
625
+
626
+ create_table "spree_refunds", force: :cascade do |t|
627
+ t.integer "payment_id"
628
+ t.decimal "amount", precision: 10, scale: 2, default: 0.0, null: false
629
+ t.string "transaction_id"
630
+ t.datetime "created_at"
631
+ t.datetime "updated_at"
632
+ t.integer "refund_reason_id"
633
+ t.integer "reimbursement_id"
634
+ end
635
+
636
+ add_index "spree_refunds", ["refund_reason_id"], name: "index_refunds_on_refund_reason_id"
637
+
638
+ create_table "spree_reimbursement_credits", force: :cascade do |t|
639
+ t.decimal "amount", precision: 10, scale: 2, default: 0.0, null: false
640
+ t.integer "reimbursement_id"
641
+ t.integer "creditable_id"
642
+ t.string "creditable_type"
643
+ end
644
+
645
+ create_table "spree_reimbursement_types", force: :cascade do |t|
646
+ t.string "name"
647
+ t.boolean "active", default: true
648
+ t.boolean "mutable", default: true
649
+ t.datetime "created_at"
650
+ t.datetime "updated_at"
651
+ t.string "type"
652
+ end
653
+
654
+ add_index "spree_reimbursement_types", ["type"], name: "index_spree_reimbursement_types_on_type"
655
+
656
+ create_table "spree_reimbursements", force: :cascade do |t|
657
+ t.string "number"
658
+ t.string "reimbursement_status"
659
+ t.integer "customer_return_id"
660
+ t.integer "order_id"
661
+ t.decimal "total", precision: 10, scale: 2
662
+ t.datetime "created_at"
663
+ t.datetime "updated_at"
664
+ end
665
+
666
+ add_index "spree_reimbursements", ["customer_return_id"], name: "index_spree_reimbursements_on_customer_return_id"
667
+ add_index "spree_reimbursements", ["order_id"], name: "index_spree_reimbursements_on_order_id"
668
+
669
+ create_table "spree_return_authorizations", force: :cascade do |t|
670
+ t.string "number"
671
+ t.string "state"
672
+ t.integer "order_id"
673
+ t.text "memo"
674
+ t.datetime "created_at"
675
+ t.datetime "updated_at"
676
+ t.integer "stock_location_id"
677
+ t.integer "return_reason_id"
678
+ end
679
+
680
+ add_index "spree_return_authorizations", ["return_reason_id"], name: "index_return_authorizations_on_return_authorization_reason_id"
681
+
682
+ create_table "spree_return_items", force: :cascade do |t|
683
+ t.integer "return_authorization_id"
684
+ t.integer "inventory_unit_id"
685
+ t.integer "exchange_variant_id"
686
+ t.datetime "created_at"
687
+ t.datetime "updated_at"
688
+ t.decimal "pre_tax_amount", precision: 12, scale: 4, default: 0.0, null: false
689
+ t.decimal "included_tax_total", precision: 12, scale: 4, default: 0.0, null: false
690
+ t.decimal "additional_tax_total", precision: 12, scale: 4, default: 0.0, null: false
691
+ t.string "reception_status"
692
+ t.string "acceptance_status"
693
+ t.integer "customer_return_id"
694
+ t.integer "reimbursement_id"
695
+ t.integer "exchange_inventory_unit_id"
696
+ t.text "acceptance_status_errors"
697
+ t.integer "preferred_reimbursement_type_id"
698
+ t.integer "override_reimbursement_type_id"
699
+ t.boolean "resellable", default: true, null: false
700
+ t.integer "return_reason_id"
701
+ end
702
+
703
+ add_index "spree_return_items", ["customer_return_id"], name: "index_return_items_on_customer_return_id"
704
+ add_index "spree_return_items", ["exchange_inventory_unit_id"], name: "index_spree_return_items_on_exchange_inventory_unit_id"
705
+
706
+ create_table "spree_return_reasons", force: :cascade do |t|
707
+ t.string "name"
708
+ t.boolean "active", default: true
709
+ t.boolean "mutable", default: true
710
+ t.datetime "created_at"
711
+ t.datetime "updated_at"
712
+ end
713
+
714
+ create_table "spree_roles", force: :cascade do |t|
715
+ t.string "name"
716
+ end
717
+
718
+ create_table "spree_roles_users", force: :cascade do |t|
719
+ t.integer "role_id"
720
+ t.integer "user_id"
721
+ t.datetime "created_at"
722
+ t.datetime "updated_at"
723
+ end
724
+
725
+ add_index "spree_roles_users", ["role_id"], name: "index_spree_roles_users_on_role_id"
726
+ add_index "spree_roles_users", ["user_id"], name: "index_spree_roles_users_on_user_id"
727
+
728
+ create_table "spree_shipments", force: :cascade do |t|
729
+ t.string "tracking"
730
+ t.string "number"
731
+ t.decimal "cost", precision: 10, scale: 2, default: 0.0
732
+ t.datetime "shipped_at"
733
+ t.integer "order_id"
734
+ t.integer "address_id"
735
+ t.string "state"
736
+ t.datetime "created_at"
737
+ t.datetime "updated_at"
738
+ t.integer "stock_location_id"
739
+ t.decimal "adjustment_total", precision: 10, scale: 2, default: 0.0
740
+ t.decimal "additional_tax_total", precision: 10, scale: 2, default: 0.0
741
+ t.decimal "promo_total", precision: 10, scale: 2, default: 0.0
742
+ t.decimal "included_tax_total", precision: 10, scale: 2, default: 0.0, null: false
743
+ t.decimal "pre_tax_amount", precision: 12, scale: 4, default: 0.0, null: false
744
+ end
745
+
746
+ add_index "spree_shipments", ["address_id"], name: "index_spree_shipments_on_address_id"
747
+ add_index "spree_shipments", ["number"], name: "index_shipments_on_number"
748
+ add_index "spree_shipments", ["order_id"], name: "index_spree_shipments_on_order_id"
749
+ add_index "spree_shipments", ["stock_location_id"], name: "index_spree_shipments_on_stock_location_id"
750
+
751
+ create_table "spree_shipping_categories", force: :cascade do |t|
752
+ t.string "name"
753
+ t.datetime "created_at"
754
+ t.datetime "updated_at"
755
+ end
756
+
757
+ create_table "spree_shipping_method_categories", force: :cascade do |t|
758
+ t.integer "shipping_method_id", null: false
759
+ t.integer "shipping_category_id", null: false
760
+ t.datetime "created_at"
761
+ t.datetime "updated_at"
762
+ end
763
+
764
+ add_index "spree_shipping_method_categories", ["shipping_category_id", "shipping_method_id"], name: "unique_spree_shipping_method_categories", unique: true
765
+ add_index "spree_shipping_method_categories", ["shipping_method_id"], name: "index_spree_shipping_method_categories_on_shipping_method_id"
766
+
767
+ create_table "spree_shipping_method_zones", force: :cascade do |t|
768
+ t.integer "shipping_method_id"
769
+ t.integer "zone_id"
770
+ t.datetime "created_at"
771
+ t.datetime "updated_at"
772
+ end
773
+
774
+ create_table "spree_shipping_methods", force: :cascade do |t|
775
+ t.string "name"
776
+ t.string "display_on"
777
+ t.datetime "deleted_at"
778
+ t.datetime "created_at"
779
+ t.datetime "updated_at"
780
+ t.string "tracking_url"
781
+ t.string "admin_name"
782
+ t.integer "tax_category_id"
783
+ t.string "code"
784
+ end
785
+
786
+ add_index "spree_shipping_methods", ["tax_category_id"], name: "index_spree_shipping_methods_on_tax_category_id"
787
+
788
+ create_table "spree_shipping_rates", force: :cascade do |t|
789
+ t.integer "shipment_id"
790
+ t.integer "shipping_method_id"
791
+ t.boolean "selected", default: false
792
+ t.decimal "cost", precision: 8, scale: 2, default: 0.0
793
+ t.datetime "created_at"
794
+ t.datetime "updated_at"
795
+ t.integer "tax_rate_id"
796
+ end
797
+
798
+ add_index "spree_shipping_rates", ["shipment_id", "shipping_method_id"], name: "spree_shipping_rates_join_index", unique: true
799
+
800
+ create_table "spree_state_changes", force: :cascade do |t|
801
+ t.string "name"
802
+ t.string "previous_state"
803
+ t.integer "stateful_id"
804
+ t.integer "user_id"
805
+ t.string "stateful_type"
806
+ t.string "next_state"
807
+ t.datetime "created_at"
808
+ t.datetime "updated_at"
809
+ end
810
+
811
+ add_index "spree_state_changes", ["stateful_id", "stateful_type"], name: "index_spree_state_changes_on_stateful_id_and_stateful_type"
812
+ add_index "spree_state_changes", ["user_id"], name: "index_spree_state_changes_on_user_id"
813
+
814
+ create_table "spree_states", force: :cascade do |t|
815
+ t.string "name"
816
+ t.string "abbr"
817
+ t.integer "country_id"
818
+ t.datetime "updated_at"
819
+ end
820
+
821
+ add_index "spree_states", ["country_id"], name: "index_spree_states_on_country_id"
822
+
823
+ create_table "spree_stock_items", force: :cascade do |t|
824
+ t.integer "stock_location_id"
825
+ t.integer "variant_id"
826
+ t.integer "count_on_hand", default: 0, null: false
827
+ t.datetime "created_at"
828
+ t.datetime "updated_at"
829
+ t.boolean "backorderable", default: false
830
+ t.datetime "deleted_at"
831
+ end
832
+
833
+ add_index "spree_stock_items", ["deleted_at"], name: "index_spree_stock_items_on_deleted_at"
834
+ add_index "spree_stock_items", ["stock_location_id", "variant_id"], name: "stock_item_by_loc_and_var_id"
835
+ add_index "spree_stock_items", ["stock_location_id"], name: "index_spree_stock_items_on_stock_location_id"
836
+ add_index "spree_stock_items", ["variant_id", "stock_location_id"], name: "index_spree_stock_items_on_variant_id_and_stock_location_id", unique: true, where: "deleted_at is null"
837
+
838
+ create_table "spree_stock_locations", force: :cascade do |t|
839
+ t.string "name"
840
+ t.datetime "created_at"
841
+ t.datetime "updated_at"
842
+ t.boolean "default", default: false, null: false
843
+ t.string "address1"
844
+ t.string "address2"
845
+ t.string "city"
846
+ t.integer "state_id"
847
+ t.string "state_name"
848
+ t.integer "country_id"
849
+ t.string "zipcode"
850
+ t.string "phone"
851
+ t.boolean "active", default: true
852
+ t.boolean "backorderable_default", default: false
853
+ t.boolean "propagate_all_variants", default: true
854
+ t.string "admin_name"
855
+ t.integer "position", default: 0
856
+ t.boolean "restock_inventory", default: true, null: false
857
+ t.boolean "fulfillable", default: true, null: false
858
+ t.string "code"
859
+ t.boolean "check_stock_on_transfer", default: true
860
+ end
861
+
862
+ add_index "spree_stock_locations", ["country_id"], name: "index_spree_stock_locations_on_country_id"
863
+ add_index "spree_stock_locations", ["state_id"], name: "index_spree_stock_locations_on_state_id"
864
+
865
+ create_table "spree_stock_movements", force: :cascade do |t|
866
+ t.integer "stock_item_id"
867
+ t.integer "quantity", default: 0
868
+ t.string "action"
869
+ t.datetime "created_at", null: false
870
+ t.datetime "updated_at", null: false
871
+ t.integer "originator_id"
872
+ t.string "originator_type"
873
+ end
874
+
875
+ add_index "spree_stock_movements", ["stock_item_id"], name: "index_spree_stock_movements_on_stock_item_id"
876
+
877
+ create_table "spree_stock_transfers", force: :cascade do |t|
878
+ t.string "description"
879
+ t.integer "source_location_id"
880
+ t.integer "destination_location_id"
881
+ t.datetime "created_at"
882
+ t.datetime "updated_at"
883
+ t.string "number"
884
+ t.datetime "shipped_at"
885
+ t.datetime "closed_at"
886
+ t.string "tracking_number"
887
+ t.integer "created_by_id"
888
+ t.integer "closed_by_id"
889
+ t.datetime "finalized_at"
890
+ t.integer "finalized_by_id"
891
+ t.datetime "deleted_at"
892
+ end
893
+
894
+ add_index "spree_stock_transfers", ["closed_at"], name: "index_spree_stock_transfers_on_closed_at"
895
+ add_index "spree_stock_transfers", ["destination_location_id"], name: "index_spree_stock_transfers_on_destination_location_id"
896
+ add_index "spree_stock_transfers", ["finalized_at"], name: "index_spree_stock_transfers_on_finalized_at"
897
+ add_index "spree_stock_transfers", ["number"], name: "index_spree_stock_transfers_on_number"
898
+ add_index "spree_stock_transfers", ["shipped_at"], name: "index_spree_stock_transfers_on_shipped_at"
899
+ add_index "spree_stock_transfers", ["source_location_id"], name: "index_spree_stock_transfers_on_source_location_id"
900
+
901
+ create_table "spree_store_credit_categories", force: :cascade do |t|
902
+ t.string "name"
903
+ t.datetime "created_at"
904
+ t.datetime "updated_at"
905
+ end
906
+
907
+ create_table "spree_store_credit_events", force: :cascade do |t|
908
+ t.integer "store_credit_id", null: false
909
+ t.string "action", null: false
910
+ t.decimal "amount", precision: 8, scale: 2
911
+ t.decimal "user_total_amount", precision: 8, scale: 2, default: 0.0, null: false
912
+ t.string "authorization_code", null: false
913
+ t.datetime "deleted_at"
914
+ t.integer "originator_id"
915
+ t.string "originator_type"
916
+ t.datetime "created_at"
917
+ t.datetime "updated_at"
918
+ t.integer "update_reason_id"
919
+ end
920
+
921
+ add_index "spree_store_credit_events", ["deleted_at"], name: "index_spree_store_credit_events_on_deleted_at"
922
+ add_index "spree_store_credit_events", ["store_credit_id"], name: "index_spree_store_credit_events_on_store_credit_id"
923
+
924
+ create_table "spree_store_credit_types", force: :cascade do |t|
925
+ t.string "name"
926
+ t.integer "priority"
927
+ t.datetime "created_at"
928
+ t.datetime "updated_at"
929
+ end
930
+
931
+ add_index "spree_store_credit_types", ["priority"], name: "index_spree_store_credit_types_on_priority"
932
+
933
+ create_table "spree_store_credit_update_reasons", force: :cascade do |t|
934
+ t.string "name"
935
+ t.datetime "created_at"
936
+ t.datetime "updated_at"
937
+ end
938
+
939
+ create_table "spree_store_credits", force: :cascade do |t|
940
+ t.integer "user_id"
941
+ t.integer "category_id"
942
+ t.integer "created_by_id"
943
+ t.decimal "amount", precision: 8, scale: 2, default: 0.0, null: false
944
+ t.decimal "amount_used", precision: 8, scale: 2, default: 0.0, null: false
945
+ t.decimal "amount_authorized", precision: 8, scale: 2, default: 0.0, null: false
946
+ t.string "currency"
947
+ t.text "memo"
948
+ t.datetime "spree_store_credits"
949
+ t.datetime "deleted_at"
950
+ t.datetime "created_at"
951
+ t.datetime "updated_at"
952
+ t.integer "type_id"
953
+ t.datetime "invalidated_at"
954
+ end
955
+
956
+ add_index "spree_store_credits", ["deleted_at"], name: "index_spree_store_credits_on_deleted_at"
957
+ add_index "spree_store_credits", ["type_id"], name: "index_spree_store_credits_on_type_id"
958
+ add_index "spree_store_credits", ["user_id"], name: "index_spree_store_credits_on_user_id"
959
+
960
+ create_table "spree_store_payment_methods", force: :cascade do |t|
961
+ t.integer "store_id", null: false
962
+ t.integer "payment_method_id", null: false
963
+ t.datetime "created_at", null: false
964
+ t.datetime "updated_at", null: false
965
+ end
966
+
967
+ add_index "spree_store_payment_methods", ["payment_method_id"], name: "index_spree_store_payment_methods_on_payment_method_id"
968
+ add_index "spree_store_payment_methods", ["store_id"], name: "index_spree_store_payment_methods_on_store_id"
969
+
970
+ create_table "spree_stores", force: :cascade do |t|
971
+ t.string "name"
972
+ t.string "url"
973
+ t.text "meta_description"
974
+ t.text "meta_keywords"
975
+ t.string "seo_title"
976
+ t.string "mail_from_address"
977
+ t.string "default_currency"
978
+ t.string "code"
979
+ t.boolean "default", default: false, null: false
980
+ t.datetime "created_at"
981
+ t.datetime "updated_at"
982
+ end
983
+
984
+ add_index "spree_stores", ["code"], name: "index_spree_stores_on_code"
985
+ add_index "spree_stores", ["default"], name: "index_spree_stores_on_default"
986
+
987
+ create_table "spree_tax_categories", force: :cascade do |t|
988
+ t.string "name"
989
+ t.string "description"
990
+ t.boolean "is_default", default: false
991
+ t.datetime "deleted_at"
992
+ t.datetime "created_at"
993
+ t.datetime "updated_at"
994
+ t.string "tax_code"
995
+ end
996
+
997
+ create_table "spree_tax_rates", force: :cascade do |t|
998
+ t.decimal "amount", precision: 8, scale: 5
999
+ t.integer "zone_id"
1000
+ t.integer "tax_category_id"
1001
+ t.boolean "included_in_price", default: false
1002
+ t.datetime "created_at"
1003
+ t.datetime "updated_at"
1004
+ t.string "name"
1005
+ t.boolean "show_rate_in_label", default: true
1006
+ t.datetime "deleted_at"
1007
+ end
1008
+
1009
+ add_index "spree_tax_rates", ["deleted_at"], name: "index_spree_tax_rates_on_deleted_at"
1010
+ add_index "spree_tax_rates", ["tax_category_id"], name: "index_spree_tax_rates_on_tax_category_id"
1011
+ add_index "spree_tax_rates", ["zone_id"], name: "index_spree_tax_rates_on_zone_id"
1012
+
1013
+ create_table "spree_taxonomies", force: :cascade do |t|
1014
+ t.string "name", null: false
1015
+ t.datetime "created_at"
1016
+ t.datetime "updated_at"
1017
+ t.integer "position", default: 0
1018
+ end
1019
+
1020
+ add_index "spree_taxonomies", ["position"], name: "index_spree_taxonomies_on_position"
1021
+
1022
+ create_table "spree_taxons", force: :cascade do |t|
1023
+ t.integer "parent_id"
1024
+ t.integer "position", default: 0
1025
+ t.string "name", null: false
1026
+ t.string "permalink"
1027
+ t.integer "taxonomy_id"
1028
+ t.integer "lft"
1029
+ t.integer "rgt"
1030
+ t.string "icon_file_name"
1031
+ t.string "icon_content_type"
1032
+ t.integer "icon_file_size"
1033
+ t.datetime "icon_updated_at"
1034
+ t.text "description"
1035
+ t.datetime "created_at"
1036
+ t.datetime "updated_at"
1037
+ t.string "meta_title"
1038
+ t.string "meta_description"
1039
+ t.string "meta_keywords"
1040
+ t.integer "depth"
1041
+ end
1042
+
1043
+ add_index "spree_taxons", ["parent_id"], name: "index_taxons_on_parent_id"
1044
+ add_index "spree_taxons", ["permalink"], name: "index_taxons_on_permalink"
1045
+ add_index "spree_taxons", ["position"], name: "index_spree_taxons_on_position"
1046
+ add_index "spree_taxons", ["taxonomy_id"], name: "index_taxons_on_taxonomy_id"
1047
+
1048
+ create_table "spree_trackers", force: :cascade do |t|
1049
+ t.string "analytics_id"
1050
+ t.boolean "active", default: true
1051
+ t.datetime "created_at"
1052
+ t.datetime "updated_at"
1053
+ end
1054
+
1055
+ create_table "spree_transfer_items", force: :cascade do |t|
1056
+ t.integer "variant_id", null: false
1057
+ t.integer "stock_transfer_id", null: false
1058
+ t.integer "expected_quantity", default: 0, null: false
1059
+ t.integer "received_quantity", default: 0, null: false
1060
+ t.datetime "created_at"
1061
+ t.datetime "updated_at"
1062
+ t.datetime "deleted_at"
1063
+ end
1064
+
1065
+ add_index "spree_transfer_items", ["stock_transfer_id"], name: "index_spree_transfer_items_on_stock_transfer_id"
1066
+ add_index "spree_transfer_items", ["variant_id"], name: "index_spree_transfer_items_on_variant_id"
1067
+
1068
+ create_table "spree_unit_cancels", force: :cascade do |t|
1069
+ t.integer "inventory_unit_id", null: false
1070
+ t.string "reason"
1071
+ t.string "created_by"
1072
+ t.datetime "created_at"
1073
+ t.datetime "updated_at"
1074
+ end
1075
+
1076
+ add_index "spree_unit_cancels", ["inventory_unit_id"], name: "index_spree_unit_cancels_on_inventory_unit_id"
1077
+
1078
+ create_table "spree_user_addresses", force: :cascade do |t|
1079
+ t.integer "user_id", null: false
1080
+ t.integer "address_id", null: false
1081
+ t.boolean "default", default: false
1082
+ t.boolean "archived", default: false
1083
+ t.datetime "created_at", null: false
1084
+ t.datetime "updated_at", null: false
1085
+ end
1086
+
1087
+ add_index "spree_user_addresses", ["address_id"], name: "index_spree_user_addresses_on_address_id"
1088
+ add_index "spree_user_addresses", ["user_id", "address_id"], name: "index_spree_user_addresses_on_user_id_and_address_id", unique: true
1089
+ add_index "spree_user_addresses", ["user_id"], name: "index_spree_user_addresses_on_user_id"
1090
+
1091
+ create_table "spree_user_stock_locations", force: :cascade do |t|
1092
+ t.integer "user_id"
1093
+ t.integer "stock_location_id"
1094
+ t.datetime "created_at"
1095
+ t.datetime "updated_at"
1096
+ end
1097
+
1098
+ add_index "spree_user_stock_locations", ["user_id"], name: "index_spree_user_stock_locations_on_user_id"
1099
+
1100
+ create_table "spree_users", force: :cascade do |t|
1101
+ t.string "encrypted_password", limit: 128
1102
+ t.string "password_salt", limit: 128
1103
+ t.string "email"
1104
+ t.string "remember_token"
1105
+ t.string "persistence_token"
1106
+ t.string "reset_password_token"
1107
+ t.string "perishable_token"
1108
+ t.integer "sign_in_count", default: 0, null: false
1109
+ t.integer "failed_attempts", default: 0, null: false
1110
+ t.datetime "last_request_at"
1111
+ t.datetime "current_sign_in_at"
1112
+ t.datetime "last_sign_in_at"
1113
+ t.string "current_sign_in_ip"
1114
+ t.string "last_sign_in_ip"
1115
+ t.string "login"
1116
+ t.integer "ship_address_id"
1117
+ t.integer "bill_address_id"
1118
+ t.string "authentication_token"
1119
+ t.string "unlock_token"
1120
+ t.datetime "locked_at"
1121
+ t.datetime "reset_password_sent_at"
1122
+ t.datetime "created_at"
1123
+ t.datetime "updated_at"
1124
+ t.string "spree_api_key", limit: 48
1125
+ t.datetime "remember_created_at"
1126
+ t.datetime "deleted_at"
1127
+ t.string "confirmation_token"
1128
+ t.datetime "confirmed_at"
1129
+ t.datetime "confirmation_sent_at"
1130
+ end
1131
+
1132
+ add_index "spree_users", ["deleted_at"], name: "index_spree_users_on_deleted_at"
1133
+ add_index "spree_users", ["email"], name: "email_idx_unique", unique: true
1134
+ add_index "spree_users", ["spree_api_key"], name: "index_spree_users_on_spree_api_key"
1135
+
1136
+ create_table "spree_variant_property_rule_conditions", force: :cascade do |t|
1137
+ t.integer "option_value_id"
1138
+ t.integer "variant_property_rule_id"
1139
+ t.datetime "created_at", null: false
1140
+ t.datetime "updated_at", null: false
1141
+ end
1142
+
1143
+ add_index "spree_variant_property_rule_conditions", ["variant_property_rule_id", "option_value_id"], name: "index_spree_variant_prop_rule_conditions_on_rule_and_optval"
1144
+
1145
+ create_table "spree_variant_property_rule_values", force: :cascade do |t|
1146
+ t.text "value"
1147
+ t.integer "position", default: 0
1148
+ t.integer "property_id"
1149
+ t.integer "variant_property_rule_id"
1150
+ end
1151
+
1152
+ add_index "spree_variant_property_rule_values", ["property_id"], name: "index_spree_variant_property_rule_values_on_property_id"
1153
+ add_index "spree_variant_property_rule_values", ["variant_property_rule_id"], name: "index_spree_variant_property_rule_values_on_rule"
1154
+
1155
+ create_table "spree_variant_property_rules", force: :cascade do |t|
1156
+ t.integer "product_id"
1157
+ t.datetime "created_at", null: false
1158
+ t.datetime "updated_at", null: false
1159
+ end
1160
+
1161
+ add_index "spree_variant_property_rules", ["product_id"], name: "index_spree_variant_property_rules_on_product_id"
1162
+
1163
+ create_table "spree_variants", force: :cascade do |t|
1164
+ t.string "sku", default: "", null: false
1165
+ t.decimal "weight", precision: 8, scale: 2, default: 0.0
1166
+ t.decimal "height", precision: 8, scale: 2
1167
+ t.decimal "width", precision: 8, scale: 2
1168
+ t.decimal "depth", precision: 8, scale: 2
1169
+ t.datetime "deleted_at"
1170
+ t.boolean "is_master", default: false
1171
+ t.integer "product_id"
1172
+ t.decimal "cost_price", precision: 10, scale: 2
1173
+ t.integer "position"
1174
+ t.string "cost_currency"
1175
+ t.boolean "track_inventory", default: true
1176
+ t.integer "tax_category_id"
1177
+ t.datetime "updated_at"
1178
+ end
1179
+
1180
+ add_index "spree_variants", ["position"], name: "index_spree_variants_on_position"
1181
+ add_index "spree_variants", ["product_id"], name: "index_spree_variants_on_product_id"
1182
+ add_index "spree_variants", ["sku"], name: "index_spree_variants_on_sku"
1183
+ add_index "spree_variants", ["tax_category_id"], name: "index_spree_variants_on_tax_category_id"
1184
+ add_index "spree_variants", ["track_inventory"], name: "index_spree_variants_on_track_inventory"
1185
+
1186
+ create_table "spree_zone_members", force: :cascade do |t|
1187
+ t.integer "zoneable_id"
1188
+ t.string "zoneable_type"
1189
+ t.integer "zone_id"
1190
+ t.datetime "created_at"
1191
+ t.datetime "updated_at"
1192
+ end
1193
+
1194
+ add_index "spree_zone_members", ["zone_id"], name: "index_spree_zone_members_on_zone_id"
1195
+ add_index "spree_zone_members", ["zoneable_id", "zoneable_type"], name: "index_spree_zone_members_on_zoneable_id_and_zoneable_type"
1196
+
1197
+ create_table "spree_zones", force: :cascade do |t|
1198
+ t.string "name"
1199
+ t.string "description"
1200
+ t.boolean "default_tax", default: false
1201
+ t.integer "zone_members_count", default: 0
1202
+ t.datetime "created_at"
1203
+ t.datetime "updated_at"
1204
+ end
1205
+
1206
+ end