spree_purchase_order 3.2.0.rc1 → 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/views/spree/admin/payments/source_views/_purchaseorder.html.erb +13 -0
- data/app/views/spree/checkout/payment/_purchaseorder.html.erb +2 -2
- data/config/locales/en.yml +2 -0
- data/lib/spree_purchase_order/version.rb +1 -1
- data/spec/dummy/app/models/application_record.rb +3 -0
- data/spec/dummy/db/migrate/20180516181839_spree_one_two.spree.rb +482 -0
- data/spec/dummy/db/migrate/20180516181840_spree_promo_one_two.spree.rb +46 -0
- data/spec/dummy/db/migrate/20180516181841_add_tax_rate_label.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181842_add_toggle_tax_rate_display.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181843_remove_unused_preference_columns.spree.rb +9 -0
- data/spec/dummy/db/migrate/20180516181844_add_lock_version_to_variant.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181845_add_states_required_to_countries.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181846_add_on_demand_to_product_and_variant.spree.rb +7 -0
- data/spec/dummy/db/migrate/20180516181847_remove_not_null_constraint_from_products_on_hand.spree.rb +12 -0
- data/spec/dummy/db/migrate/20180516181848_split_prices_from_variants.spree.rb +32 -0
- data/spec/dummy/db/migrate/20180516181849_remove_not_null_from_spree_prices_amount.spree.rb +10 -0
- data/spec/dummy/db/migrate/20180516181850_add_currency_to_line_items.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181851_add_currency_to_orders.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181852_add_cost_currency_to_variants.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181853_remove_display_on_from_payment_methods.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181854_add_position_to_taxonomies.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181855_add_last_ip_to_spree_orders.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181856_add_state_to_spree_adjustments.spree.rb +7 -0
- data/spec/dummy/db/migrate/20180516181857_add_display_on_to_spree_payment_methods.spree.rb +10 -0
- data/spec/dummy/db/migrate/20180516181858_add_position_to_product_properties.spree.rb +7 -0
- data/spec/dummy/db/migrate/20180516181859_add_identifier_to_spree_payments.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181860_add_order_id_index_to_payments.spree.rb +10 -0
- data/spec/dummy/db/migrate/20180516181861_add_primary_to_spree_products_taxons.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181862_create_spree_stock_items.spree.rb +15 -0
- data/spec/dummy/db/migrate/20180516181863_create_spree_stock_locations.spree.rb +12 -0
- data/spec/dummy/db/migrate/20180516181864_create_default_stock.spree.rb +34 -0
- data/spec/dummy/db/migrate/20180516181865_add_order_id_index_to_shipments.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181866_change_meta_description_on_spree_products_to_text.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181867_add_stock_location_id_to_spree_shipments.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181868_add_pending_to_inventory_unit.spree.rb +7 -0
- data/spec/dummy/db/migrate/20180516181869_remove_on_demand_from_product_and_variant.spree.rb +7 -0
- data/spec/dummy/db/migrate/20180516181870_create_shipping_method_zone.spree.rb +22 -0
- data/spec/dummy/db/migrate/20180516181871_remove_shipping_category_id_from_shipping_method.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181872_create_shipping_method_categories.spree.rb +14 -0
- data/spec/dummy/db/migrate/20180516181873_add_tracking_url_to_spree_shipping_methods.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181874_create_spree_shipping_rates.spree.rb +25 -0
- data/spec/dummy/db/migrate/20180516181875_remove_category_match_attributes_from_shipping_method.spree.rb +8 -0
- data/spec/dummy/db/migrate/20180516181876_create_stock_movements.spree.rb +13 -0
- data/spec/dummy/db/migrate/20180516181877_add_address_fields_to_stock_location.spree.rb +23 -0
- data/spec/dummy/db/migrate/20180516181878_add_active_field_to_stock_locations.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181879_add_backorderable_to_stock_item.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181880_add_default_quantity_to_stock_movement.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181881_add_source_and_destination_to_stock_movements.spree.rb +9 -0
- data/spec/dummy/db/migrate/20180516181882_change_orders_total_precision.spree.rb +9 -0
- data/spec/dummy/db/migrate/20180516181883_change_spree_payments_amount_precision.spree.rb +8 -0
- data/spec/dummy/db/migrate/20180516181884_change_spree_return_authorization_amount_precision.spree.rb +8 -0
- data/spec/dummy/db/migrate/20180516181885_change_adjustments_amount_precision.spree.rb +8 -0
- data/spec/dummy/db/migrate/20180516181886_add_originator_to_stock_movement.spree.rb +8 -0
- data/spec/dummy/db/migrate/20180516181887_drop_source_and_destination_from_stock_movement.spree.rb +16 -0
- data/spec/dummy/db/migrate/20180516181888_migrate_inventory_unit_sold_to_on_hand.spree.rb +10 -0
- data/spec/dummy/db/migrate/20180516181889_add_stock_location_to_rma.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181890_update_shipment_state_for_canceled_orders.spree.rb +16 -0
- data/spec/dummy/db/migrate/20180516181891_add_seo_metas_to_taxons.spree.rb +10 -0
- data/spec/dummy/db/migrate/20180516181892_remove_stock_item_and_variant_lock.spree.rb +15 -0
- data/spec/dummy/db/migrate/20180516181893_add_name_to_spree_credit_cards.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181894_update_name_fields_on_spree_credit_cards.spree.rb +14 -0
- data/spec/dummy/db/migrate/20180516181895_add_index_to_source_columns_on_adjustments.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181896_update_adjustment_states.spree.rb +17 -0
- data/spec/dummy/db/migrate/20180516181897_add_shipping_rates_to_shipments.spree.rb +16 -0
- data/spec/dummy/db/migrate/20180516181898_create_spree_stock_transfers.spree.rb +15 -0
- data/spec/dummy/db/migrate/20180516181899_drop_products_count_on_hand.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181900_set_default_shipping_rate_cost.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181901_add_number_to_stock_transfer.spree.rb +24 -0
- data/spec/dummy/db/migrate/20180516181902_add_sku_index_to_spree_variants.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181903_add_backorderable_default_to_spree_stock_location.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181904_add_propage_all_variants_to_spree_stock_location.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181905_rename_shipping_methods_zones_to_spree_shipping_methods_zones.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181906_add_user_id_index_to_spree_orders.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181907_add_updated_at_to_spree_countries.spree.rb +10 -0
- data/spec/dummy/db/migrate/20180516181908_add_updated_at_to_spree_states.spree.rb +10 -0
- data/spec/dummy/db/migrate/20180516181909_add_cvv_result_code_and_cvv_result_message_to_spree_payments.spree.rb +7 -0
- data/spec/dummy/db/migrate/20180516181910_add_unique_index_to_permalink_on_spree_products.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181911_add_unique_index_to_orders_shipments_and_stock_transfers.spree.rb +8 -0
- data/spec/dummy/db/migrate/20180516181912_add_deleted_at_to_spree_tax_rates.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181913_remove_lock_version_from_inventory_units.spree.rb +7 -0
- data/spec/dummy/db/migrate/20180516181914_add_cost_price_to_line_item.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181915_set_backorderable_to_default_to_false.spree.rb +7 -0
- data/spec/dummy/db/migrate/20180516181916_add_created_by_id_to_spree_orders.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181917_index_completed_at_on_spree_orders.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181918_add_tax_category_id_to_spree_line_items.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181919_migrate_tax_categories_to_line_items.spree.rb +11 -0
- data/spec/dummy/db/migrate/20180516181920_drop_spree_mail_methods.spree.rb +13 -0
- data/spec/dummy/db/migrate/20180516181921_set_default_stock_location_on_shipments.spree.rb +9 -0
- data/spec/dummy/db/migrate/20180516181922_upgrade_adjustments.spree.rb +41 -0
- data/spec/dummy/db/migrate/20180516181923_rename_adjustment_fields.spree.rb +15 -0
- data/spec/dummy/db/migrate/20180516181924_add_admin_name_column_to_spree_shipping_methods.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181925_add_admin_name_column_to_spree_stock_locations.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181926_add_shipment_total_to_spree_orders.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181927_expand_order_number_size.spree.rb +10 -0
- data/spec/dummy/db/migrate/20180516181928_rename_activators_to_promotions.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181929_add_adjustment_total_to_line_items.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181930_add_adjustment_total_to_shipments.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181931_add_depth_to_spree_taxons.spree.rb +17 -0
- data/spec/dummy/db/migrate/20180516181932_add_tax_total_to_line_items_shipments_and_orders.spree.rb +9 -0
- data/spec/dummy/db/migrate/20180516181933_add_shipping_category_to_shipping_methods_and_products.spree.rb +16 -0
- data/spec/dummy/db/migrate/20180516181934_migrate_old_shipping_calculators.spree.rb +20 -0
- data/spec/dummy/db/migrate/20180516181935_add_code_to_spree_promotion_rules.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181936_change_states_required_for_countries.spree.rb +10 -0
- data/spec/dummy/db/migrate/20180516181937_add_deleted_at_to_spree_stock_items.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181938_remove_promotions_event_name_field.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181939_add_promo_total_to_line_items_and_shipments_and_orders.spree.rb +8 -0
- data/spec/dummy/db/migrate/20180516181940_remove_unused_credit_card_fields.spree.rb +17 -0
- data/spec/dummy/db/migrate/20180516181941_add_track_inventory_to_variant.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181942_add_tax_category_to_variants.spree.rb +7 -0
- data/spec/dummy/db/migrate/20180516181943_add_channel_to_spree_orders.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181944_add_included_to_adjustments.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181945_rename_tax_total_fields.spree.rb +12 -0
- data/spec/dummy/db/migrate/20180516181946_add_line_item_id_to_spree_inventory_units.spree.rb +22 -0
- data/spec/dummy/db/migrate/20180516181947_add_updated_at_to_variants.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181948_add_position_to_classifications.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181949_create_spree_orders_promotions.spree.rb +9 -0
- data/spec/dummy/db/migrate/20180516181950_unique_shipping_method_categories.spree.rb +25 -0
- data/spec/dummy/db/migrate/20180516181951_add_item_count_to_spree_orders.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181952_remove_value_type_from_spree_preferences.spree.rb +9 -0
- data/spec/dummy/db/migrate/20180516181953_rename_permalink_to_slug_for_products.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181954_add_index_to_variant_id_and_currency_on_prices.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181955_rename_activator_id_in_rules_and_actions_to_promotion_id.spree.rb +7 -0
- data/spec/dummy/db/migrate/20180516181956_add_deleted_at_to_spree_prices.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181957_add_approver_id_and_approved_at_to_orders.spree.rb +7 -0
- data/spec/dummy/db/migrate/20180516181958_add_confirmation_delivered_to_spree_orders.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181959_add_auto_capture_to_payment_methods.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181960_create_spree_payment_capture_events.spree.rb +13 -0
- data/spec/dummy/db/migrate/20180516181961_add_uncaptured_amount_to_payments.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181962_default_variant_weight_to_zero.spree.rb +12 -0
- data/spec/dummy/db/migrate/20180516181963_add_tax_category_id_to_shipping_methods.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181964_add_tax_rate_id_to_shipping_rates.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181965_add_pre_tax_amount_to_line_items_and_shipments.spree.rb +7 -0
- data/spec/dummy/db/migrate/20180516181966_add_more_indexes.spree.rb +14 -0
- data/spec/dummy/db/migrate/20180516181967_add_considered_risky_to_orders.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181968_add_preference_store_to_everything.spree.rb +9 -0
- data/spec/dummy/db/migrate/20180516181969_add_user_id_to_spree_credit_cards.spree.rb +14 -0
- data/spec/dummy/db/migrate/20180516181970_migrate_old_preferences.spree.rb +24 -0
- data/spec/dummy/db/migrate/20180516181971_create_spree_stores.spree.rb +26 -0
- data/spec/dummy/db/migrate/20180516181972_create_store_from_preferences.spree.rb +38 -0
- data/spec/dummy/db/migrate/20180516181973_add_timestamps_to_spree_assets.spree.rb +7 -0
- data/spec/dummy/db/migrate/20180516181974_create_spree_taxons_promotion_rules.spree.rb +9 -0
- data/spec/dummy/db/migrate/20180516181975_add_additional_store_fields.spree.rb +9 -0
- data/spec/dummy/db/migrate/20180516181976_add_many_missing_indexes.spree.rb +19 -0
- data/spec/dummy/db/migrate/20180516181977_correct_some_polymorphic_index_and_add_more_missing.spree.rb +67 -0
- data/spec/dummy/db/migrate/20180516181978_add_user_id_created_by_id_index_to_order.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181979_change_spree_price_amount_precision.spree.rb +9 -0
- data/spec/dummy/db/migrate/20180516181980_add_token_to_spree_orders.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181981_move_order_token_from_tokenized_permission.spree.rb +30 -0
- data/spec/dummy/db/migrate/20180516181982_set_shipment_total_for_users_upgrading.spree.rb +11 -0
- data/spec/dummy/db/migrate/20180516181983_drop_credit_card_first_name_and_last_name.spree.rb +7 -0
- data/spec/dummy/db/migrate/20180516181984_add_deleted_at_to_spree_promotion_actions.spree.rb +7 -0
- data/spec/dummy/db/migrate/20180516181985_remove_uncaptured_amount_from_spree_payments.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181986_create_spree_refunds.spree.rb +13 -0
- data/spec/dummy/db/migrate/20180516181987_create_spree_return_authorization_inventory_unit.spree.rb +13 -0
- data/spec/dummy/db/migrate/20180516181988_rename_return_authorization_inventory_unit_to_return_items.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181989_backfill_line_item_pre_tax_amount.spree.rb +11 -0
- data/spec/dummy/db/migrate/20180516181990_recreate_spree_return_authorizations.spree.rb +56 -0
- data/spec/dummy/db/migrate/20180516181991_add_amount_fields_to_return_items.spree.rb +8 -0
- data/spec/dummy/db/migrate/20180516181992_drop_return_authorization_amount.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181993_create_spree_return_authorization_reasons.spree.rb +29 -0
- data/spec/dummy/db/migrate/20180516181994_create_spree_refund_reasons.spree.rb +15 -0
- data/spec/dummy/db/migrate/20180516181995_rename_return_authorization_reason.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516181996_create_spree_promotion_categories.spree.rb +12 -0
- data/spec/dummy/db/migrate/20180516181997_drop_received_at_on_return_items.spree.rb +10 -0
- data/spec/dummy/db/migrate/20180516181998_add_reception_and_acceptance_status_to_return_items.spree.rb +7 -0
- data/spec/dummy/db/migrate/20180516181999_create_default_refund_reason.spree.rb +10 -0
- data/spec/dummy/db/migrate/20180516182000_add_default_to_spree_stock_locations.spree.rb +8 -0
- data/spec/dummy/db/migrate/20180516182001_create_spree_customer_returns.spree.rb +10 -0
- data/spec/dummy/db/migrate/20180516182002_add_customer_return_id_to_return_item.spree.rb +7 -0
- data/spec/dummy/db/migrate/20180516182003_create_friendly_id_slugs.spree.rb +16 -0
- data/spec/dummy/db/migrate/20180516182004_rename_spree_refund_return_authorization_id.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516182005_increase_return_item_pre_tax_amount_precision.spree.rb +14 -0
- data/spec/dummy/db/migrate/20180516182006_copy_product_slugs_to_slug_history.spree.rb +16 -0
- data/spec/dummy/db/migrate/20180516182007_create_spree_reimbursements.spree.rb +22 -0
- data/spec/dummy/db/migrate/20180516182008_add_promotionable_to_spree_products.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516182009_add_exchange_inventory_unit_foreign_keys.spree.rb +8 -0
- data/spec/dummy/db/migrate/20180516182010_add_acceptance_status_errors_to_return_item.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516182011_create_spree_reimbursement_types.spree.rb +21 -0
- data/spec/dummy/db/migrate/20180516182012_add_default_to_shipment_cost.spree.rb +11 -0
- data/spec/dummy/db/migrate/20180516182013_add_default_to_spree_credit_cards.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516182014_make_existing_credit_cards_default.spree.rb +11 -0
- data/spec/dummy/db/migrate/20180516182015_add_type_to_reimbursement_type.spree.rb +10 -0
- data/spec/dummy/db/migrate/20180516182016_create_spree_reimbursement_credits.spree.rb +11 -0
- data/spec/dummy/db/migrate/20180516182017_add_meta_title_to_spree_products.spree.rb +8 -0
- data/spec/dummy/db/migrate/20180516182018_add_kind_to_zone.spree.rb +12 -0
- data/spec/dummy/db/migrate/20180516182019_add_code_to_spree_tax_categories.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516182020_default_pre_tax_amount_should_be_zero.spree.rb +7 -0
- data/spec/dummy/db/migrate/20180516182021_add_code_to_spree_shipping_methods.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516182022_add_cancel_audit_fields_to_spree_orders.spree.rb +7 -0
- data/spec/dummy/db/migrate/20180516182023_add_store_id_to_orders.spree.rb +9 -0
- data/spec/dummy/db/migrate/20180516182024_create_spree_taxons_prototypes.spree.rb +9 -0
- data/spec/dummy/db/migrate/20180516182025_add_state_lock_version_to_order.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516182026_add_counter_cache_from_spree_variants_to_spree_stock_items.spree.rb +9 -0
- data/spec/dummy/db/migrate/20180516182027_fix_adjustment_order_presence.spree.rb +14 -0
- data/spec/dummy/db/migrate/20180516182028_update_classifications_positions.spree.rb +10 -0
- data/spec/dummy/db/migrate/20180516182029_add_guest_token_index_to_spree_orders.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516182030_remove_token_permissions_table.spree.rb +7 -0
- data/spec/dummy/db/migrate/20180516182031_remove_extra_products_slug_index.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516182032_update_product_slug_index.spree.rb +7 -0
- data/spec/dummy/db/migrate/20180516182033_rename_identifier_to_number_for_payment.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516182034_create_spree_store_credits.spree.rb +25 -0
- data/spec/dummy/db/migrate/20180516182035_create_spree_store_credit_categories.spree.rb +9 -0
- data/spec/dummy/db/migrate/20180516182036_create_spree_store_credit_events.spree.rb +18 -0
- data/spec/dummy/db/migrate/20180516182037_create_spree_store_credit_types.spree.rb +11 -0
- data/spec/dummy/db/migrate/20180516182038_remove_environment_from_payment_method.spree.rb +7 -0
- data/spec/dummy/db/migrate/20180516182039_add_resellable_to_return_items.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516182040_add_code_to_spree_promotion_categories.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516182041_remove_environment_from_tracker.spree.rb +7 -0
- data/spec/dummy/db/migrate/20180516182042_remove_spree_configurations.spree.rb +17 -0
- data/spec/dummy/db/migrate/20180516182043_add_index_to_spree_stock_items_variant_id.spree.rb +14 -0
- data/spec/dummy/db/migrate/20180516182044_ensure_payments_have_numbers.spree.rb +10 -0
- data/spec/dummy/db/migrate/20180516182045_add_missing_indexes_on_spree_tables.spree.rb +68 -0
- data/spec/dummy/db/migrate/20180516182046_remove_duplicated_indexes_from_multi_columns.spree.rb +19 -0
- data/spec/dummy/db/migrate/20180516182047_remove_user_index_from_spree_state_changes.spree.rb +15 -0
- data/spec/dummy/db/migrate/20180516182048_fix_adjustment_order_id.spree.rb +71 -0
- data/spec/dummy/db/migrate/20180516182049_add_position_to_spree_payment_methods.spree.rb +6 -0
- data/spec/dummy/db/migrate/20180516182050_add_deleted_at_to_friendly_id_slugs.spree.rb +7 -0
- data/spec/dummy/db/migrate/20180516182051_increase_scale_on_pre_tax_amounts.spree.rb +17 -0
- data/spec/dummy/db/migrate/20180516182052_add_taxable_adjustment_total_to_line_item.spree.rb +20 -0
- data/spec/dummy/db/migrate/20180516182053_migrate_payment_methods_display.spree.rb +13 -0
- data/spec/dummy/db/migrate/20180516182054_enable_acts_as_paranoid_on_calculators.spree.rb +7 -0
- data/spec/dummy/db/migrate/20180516182055_spree_payment_method_store_credits.spree.rb +13 -0
- data/spec/dummy/db/migrate/20180516182056_rename_has_and_belongs_to_associations_to_model_names.spree.rb +19 -0
- data/spec/dummy/db/migrate/20180516182057_spree_store_credit_types.spree.rb +12 -0
- data/spec/dummy/db/migrate/20180516182058_add_discontinued_to_products_and_variants.spree.rb +69 -0
- data/spec/dummy/db/migrate/20180516182059_remove_shipping_method_id_from_spree_orders.spree.rb +14 -0
- data/spec/dummy/db/migrate/20180516182060_add_id_column_to_earlier_habtm_tables.spree.rb +17 -0
- data/spec/dummy/db/migrate/20180516182061_add_indexes.spree.rb +15 -0
- data/spec/dummy/db/migrate/20180516182062_remove_counter_cache_from_spree_variants_to_spree_stock_items.spree.rb +11 -0
- data/spec/dummy/db/migrate/20180516182063_acts_as_taggable_on_spree_migration.spree.rb +41 -0
- data/spec/dummy/db/migrate/20180516182064_change_collation_for_spree_tag_names.spree.rb +10 -0
- data/spec/dummy/db/migrate/20180516182065_add_missing_indexes_to_spree_taggings.spree.rb +15 -0
- data/spec/dummy/db/migrate/20180516182066_add_zipcode_required_to_spree_countries.spree.rb +8 -0
- data/spec/dummy/db/migrate/20180516182067_add_created_at_to_variant.spree.rb +9 -0
- data/spec/dummy/db/migrate/20180516182068_add_null_false_to_spree_variants_timestamps.spree.rb +7 -0
- data/spec/dummy/db/migrate/20180516182069_create_spree_purchase_orders.spree_purchase_order.rb +11 -0
- data/spec/dummy/db/migrate/20180516182070_add_payment_method_id_to_spree_purchase_orders.spree_purchase_order.rb +7 -0
- data/spec/dummy/db/migrate/20180516182071_add_user_id_to_spree_purchase_orders.spree_purchase_order.rb +7 -0
- data/spec/dummy/db/schema.rb +1027 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/test.log +27686 -0
- data/spec/dummy/tmp/cache/17E/D61/spree%2Fapp_configuration%2Fdefault_seo_title +1 -0
- data/spec/dummy/tmp/cache/334/AA1/spree%2Fapp_configuration%2Fdefault_meta_keywords +1 -0
- data/spec/dummy/tmp/cache/3A7/4A1/spree%2Fapp_configuration%2Faddress_requires_state +1 -0
- data/spec/dummy/tmp/cache/460/D81/spree%2Fapp_configuration%2Fdefault_meta_description +1 -0
- data/spec/dummy/tmp/cache/DD9/320/spree%2Fapp_configuration%2Fsite_url +1 -0
- data/spec/dummy/tmp/cache/DDD/2D0/spree%2Fapp_configuration%2Fcurrency +1 -0
- data/spec/dummy/tmp/cache/E27/320/spree%2Fapp_configuration%2Fsite_name +1 -0
- data/spec/dummy/tmp/cache/E9B/7F0/spree%2Fapp_configuration%2Fmails_from +1 -0
- data/spec/factories/purchase_orders.rb +1 -1
- data/spec/spec_helper.rb +2 -2
- metadata +498 -7
@@ -0,0 +1,71 @@
|
|
1
|
+
# This migration comes from spree (originally 20150515211137)
|
2
|
+
class FixAdjustmentOrderId < ActiveRecord::Migration[4.2]
|
3
|
+
def change
|
4
|
+
say 'Populate order_id from adjustable_id where appropriate'
|
5
|
+
execute(<<-SQL.squish)
|
6
|
+
UPDATE
|
7
|
+
spree_adjustments
|
8
|
+
SET
|
9
|
+
order_id = adjustable_id
|
10
|
+
WHERE
|
11
|
+
adjustable_type = 'Spree::Order'
|
12
|
+
;
|
13
|
+
SQL
|
14
|
+
|
15
|
+
# Submitter of change does not care about MySQL, as it is not officially supported.
|
16
|
+
# Still spree officials decided to provide a working code path for MySQL users, hence
|
17
|
+
# submitter made a AR code path he could validate on PostgreSQL.
|
18
|
+
#
|
19
|
+
# Whoever runs a big enough MySQL installation where the AR solution hurts:
|
20
|
+
# Will have to write a better MySQL specific equivalent.
|
21
|
+
if Spree::Order.connection.adapter_name.eql?('MySQL')
|
22
|
+
Spree::Adjustment.where(adjustable_type: 'Spree::LineItem').find_each do |adjustment|
|
23
|
+
adjustment.update_columns(order_id: Spree::LineItem.find(adjustment.adjustable_id).order_id)
|
24
|
+
end
|
25
|
+
else
|
26
|
+
execute(<<-SQL.squish)
|
27
|
+
UPDATE
|
28
|
+
spree_adjustments
|
29
|
+
SET
|
30
|
+
order_id =
|
31
|
+
(SELECT order_id FROM spree_line_items WHERE spree_line_items.id = spree_adjustments.adjustable_id)
|
32
|
+
WHERE
|
33
|
+
adjustable_type = 'Spree::LineItem'
|
34
|
+
SQL
|
35
|
+
end
|
36
|
+
|
37
|
+
say 'Fix schema for spree_adjustments order_id column'
|
38
|
+
change_table :spree_adjustments do |t|
|
39
|
+
t.change :order_id, :integer, null: false
|
40
|
+
end
|
41
|
+
|
42
|
+
# Improved schema for postgresql, uncomment if you like it:
|
43
|
+
#
|
44
|
+
# # Negated Logical implication.
|
45
|
+
# #
|
46
|
+
# # When adjustable_type is 'Spree::Order' (p) the adjustable_id must be order_id (q).
|
47
|
+
# #
|
48
|
+
# # When adjustable_type is NOT 'Spree::Order' the adjustable id allowed to be any value (including of order_id in
|
49
|
+
# # case foreign keys match). XOR does not work here.
|
50
|
+
# #
|
51
|
+
# # Postgresql does not have an operator for logical implication. So we need to build the following truth table
|
52
|
+
# # via AND with OR:
|
53
|
+
# #
|
54
|
+
# # p q | CHECK = !(p -> q)
|
55
|
+
# # -----------
|
56
|
+
# # t t | t
|
57
|
+
# # t f | f
|
58
|
+
# # f t | t
|
59
|
+
# # f f | t
|
60
|
+
# #
|
61
|
+
# # According to de-morgans law the logical implication q -> p is equivalent to !p || q
|
62
|
+
# #
|
63
|
+
# execute(<<-SQL.squish)
|
64
|
+
# ALTER TABLE ONLY spree_adjustments
|
65
|
+
# ADD CONSTRAINT fk_spree_adjustments FOREIGN KEY (order_id)
|
66
|
+
# REFERENCES spree_orders(id) ON UPDATE RESTRICT ON DELETE RESTRICT,
|
67
|
+
# ADD CONSTRAINT check_spree_adjustments_order_id CHECK
|
68
|
+
# (adjustable_type <> 'Spree::Order' OR order_id = adjustable_id);
|
69
|
+
# SQL
|
70
|
+
end
|
71
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# This migration comes from spree (originally 20150609093816)
|
2
|
+
class IncreaseScaleOnPreTaxAmounts < ActiveRecord::Migration[4.2]
|
3
|
+
def change
|
4
|
+
# set pre_tax_amount on shipments to discounted_amount - included_tax_total
|
5
|
+
# so that the null: false option on the shipment pre_tax_amount doesn't generate
|
6
|
+
# errors.
|
7
|
+
#
|
8
|
+
execute(<<-SQL)
|
9
|
+
UPDATE spree_shipments
|
10
|
+
SET pre_tax_amount = (cost + promo_total) - included_tax_total
|
11
|
+
WHERE pre_tax_amount IS NULL;
|
12
|
+
SQL
|
13
|
+
|
14
|
+
change_column :spree_line_items, :pre_tax_amount, :decimal, precision: 12, scale: 4, default: 0.0, null: false
|
15
|
+
change_column :spree_shipments, :pre_tax_amount, :decimal, precision: 12, scale: 4, default: 0.0, null: false
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# This migration comes from spree (originally 20150626181949)
|
2
|
+
class AddTaxableAdjustmentTotalToLineItem < ActiveRecord::Migration[4.2]
|
3
|
+
def change
|
4
|
+
add_column :spree_line_items, :taxable_adjustment_total, :decimal,
|
5
|
+
precision: 10, scale: 2, default: 0.0, null: false
|
6
|
+
add_column :spree_line_items, :non_taxable_adjustment_total, :decimal,
|
7
|
+
precision: 10, scale: 2, default: 0.0, null: false
|
8
|
+
|
9
|
+
add_column :spree_shipments, :taxable_adjustment_total, :decimal,
|
10
|
+
precision: 10, scale: 2, default: 0.0, null: false
|
11
|
+
add_column :spree_shipments, :non_taxable_adjustment_total, :decimal,
|
12
|
+
precision: 10, scale: 2, default: 0.0, null: false
|
13
|
+
|
14
|
+
add_column :spree_orders, :taxable_adjustment_total, :decimal,
|
15
|
+
precision: 10, scale: 2, default: 0.0, null: false
|
16
|
+
add_column :spree_orders, :non_taxable_adjustment_total, :decimal,
|
17
|
+
precision: 10, scale: 2, default: 0.0, null: false
|
18
|
+
# TODO migration that updates old orders
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# This migration comes from spree (originally 20150627090949)
|
2
|
+
class MigratePaymentMethodsDisplay < ActiveRecord::Migration[4.2]
|
3
|
+
def change
|
4
|
+
Spree::PaymentMethod.all.each do |method|
|
5
|
+
if method.display_on.blank?
|
6
|
+
method.display_on = "both"
|
7
|
+
method.save
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
change_column :spree_payment_methods, :display_on, :string, default: "both"
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# This migration comes from spree (originally 20150714154102)
|
2
|
+
class SpreePaymentMethodStoreCredits < ActiveRecord::Migration[4.2]
|
3
|
+
def up
|
4
|
+
# Reload to pick up new position column for acts_as_list
|
5
|
+
Spree::PaymentMethod.reset_column_information
|
6
|
+
Spree::PaymentMethod::StoreCredit.find_or_create_by(name: 'Store Credit', description: 'Store Credit',
|
7
|
+
active: true, display_on: 'back_end')
|
8
|
+
end
|
9
|
+
|
10
|
+
def down
|
11
|
+
Spree::PaymentMethod.find_by(type: 'Spree::PaymentMethod::StoreCredit', name: 'Store Credit').try(&:destroy)
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# This migration comes from spree (originally 20150726141425)
|
2
|
+
class RenameHasAndBelongsToAssociationsToModelNames < ActiveRecord::Migration[4.2]
|
3
|
+
def change
|
4
|
+
{
|
5
|
+
'spree_option_types_prototypes' => 'spree_option_type_prototypes',
|
6
|
+
'spree_option_values_variants' => 'spree_option_value_variants',
|
7
|
+
'spree_orders_promotions' => 'spree_order_promotions',
|
8
|
+
'spree_products_promotion_rules' => 'spree_product_promotion_rules',
|
9
|
+
'spree_taxons_promotion_rules' => 'spree_promotion_rule_taxons',
|
10
|
+
'spree_promotion_rules_users' => 'spree_promotion_rule_users',
|
11
|
+
'spree_properties_prototypes' => 'spree_property_prototypes',
|
12
|
+
'spree_taxons_prototypes' => 'spree_prototype_taxons',
|
13
|
+
'spree_roles_users' => 'spree_role_users',
|
14
|
+
'spree_shipping_methods_zones' => 'spree_shipping_method_zones'
|
15
|
+
}.each do |old_name, new_name|
|
16
|
+
rename_table old_name, new_name
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# This migration comes from spree (originally 20150727191614)
|
2
|
+
class SpreeStoreCreditTypes < ActiveRecord::Migration[4.2]
|
3
|
+
def up
|
4
|
+
Spree::StoreCreditType.find_or_create_by(name: 'Expiring', priority: 1)
|
5
|
+
Spree::StoreCreditType.find_or_create_by(name: 'Non-expiring', priority: 2)
|
6
|
+
end
|
7
|
+
|
8
|
+
def down
|
9
|
+
Spree::StoreCreditType.find_by(name: 'Expiring').try(&:destroy)
|
10
|
+
Spree::StoreCreditType.find_by(name: 'Non-expiring').try(&:destroy)
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
# This migration comes from spree (originally 20150819154308)
|
2
|
+
class AddDiscontinuedToProductsAndVariants < ActiveRecord::Migration[4.2]
|
3
|
+
def up
|
4
|
+
add_column :spree_products, :discontinue_on, :datetime, after: :available_on
|
5
|
+
add_column :spree_variants, :discontinue_on, :datetime, after: :deleted_at
|
6
|
+
|
7
|
+
add_index :spree_products, :discontinue_on
|
8
|
+
add_index :spree_variants, :discontinue_on
|
9
|
+
|
10
|
+
puts "Warning: This migration changes the meaning of 'deleted'. Before this change, 'deleted' meant products that were no longer being sold in your store. After this change, you can only delete a product or variant if it has not already been sold to a customer (a model-level check enforces this). Instead, you should use the new field 'discontinue_on' for products or variants which were sold in the past but no longer for sale. This fixes bugs when other objects are attached to deleted products and variants. (Even though acts_as_paranoid gem keeps the records in the database, most associations are automatically scoped to exclude the deleted records.) In thew meaning of 'deleted,' you can still use the delete function on products & variants which are *truly user-error mistakes*, specifically before an order has been placed or the items have gone on sale. You also must use the soft-delete function (which still works after this change) to clean up slug (product) and SKU (variant) duplicates. Otherwise, you should generally over ever need to discontinue products.
|
11
|
+
|
12
|
+
Data Fix: We will attempt to reverse engineer the old meaning of 'deleted' (no longer for sale) to the new database field 'discontinue_on'. However, since Slugs and SKUs cannot be duplicated on Products and Variants, we cannot gaurantee this to be foolproof if you have deteled Products and Variants that have duplicate Slugs or SKUs in non-deleted records. In these cases, we recommend you use the additional rake task to clean up your old records (see rake db:fix_orphan_line_items). If you have such records, this migration will leave them in place, preferring the non-deleted records over the deleted ones. However, since old line items will still be associated with deleted objects, you will still the bugs in your app until you run:
|
13
|
+
|
14
|
+
rake db:fix_orphan_line_items
|
15
|
+
|
16
|
+
We will print out a report of the data we are fixing now: "
|
17
|
+
|
18
|
+
Spree::Product.only_deleted.each do |product|
|
19
|
+
# determine if there is a slug duplicate
|
20
|
+
the_dup = Spree::Product.find_by(slug: product.slug)
|
21
|
+
if the_dup.nil?
|
22
|
+
# check to see if there are line items attached to any variants
|
23
|
+
if Spree::Variant.with_deleted.where(product_id: product.id).map(&:line_items).any?
|
24
|
+
puts "recovering deleted product id #{product.id} ... this will un-delete the record and set it to be discontinued"
|
25
|
+
|
26
|
+
old_deleted = product.deleted_at
|
27
|
+
product.update_column(:deleted_at, nil) # for some reason .recover doesn't appear to be a method
|
28
|
+
product.update_column(:discontinue_on, old_deleted)
|
29
|
+
else
|
30
|
+
puts "leaving product id #{product.id} deleted because there are no line items attached to it..."
|
31
|
+
end
|
32
|
+
else
|
33
|
+
puts "leaving product id #{product.id} deleted because there is a duplicate slug for '#{product.slug}' (product id #{the_dup.id}) "
|
34
|
+
if product.variants.map(&:line_items).any?
|
35
|
+
puts "WARNING: You may still have bugs with product id #{product.id} (#{product.name}) until you run rake db:fix_orphan_line_items"
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
Spree::Variant.only_deleted.each do |variant|
|
41
|
+
# determine if there is a slug duplicate
|
42
|
+
the_dup = Spree::Variant.find_by(sku: variant.sku)
|
43
|
+
if the_dup.nil?
|
44
|
+
# check to see if there are line items attached to any variants
|
45
|
+
if variant.line_items.any?
|
46
|
+
puts "recovering deleted variant id #{variant.id} ... this will un-delete the record and set it to be discontinued"
|
47
|
+
old_deleted = variant.deleted_at
|
48
|
+
variant.update_column(:deleted_at, nil) # for some reason .recover doesn't appear to be a method
|
49
|
+
variant.update_column(:discontinue_on, old_deleted)
|
50
|
+
else
|
51
|
+
puts "leaving variant id #{variant.id} deleted because there are no line items attached to it..."
|
52
|
+
end
|
53
|
+
else
|
54
|
+
puts "leaving variant id #{variant.id} deleted because there is a duplicate SKU for '#{variant.sku}' (variant id #{the_dup.id}) "
|
55
|
+
if variant.line_items.any?
|
56
|
+
puts "WARNING: You may still have bugs with variant id #{variant.id} (#{variant.name}) until you run rake db:fix_orphan_line_items"
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
def down
|
63
|
+
execute "UPDATE spree_products SET deleted_at = discontinue_on WHERE deleted_at IS NULL"
|
64
|
+
execute "UPDATE spree_variants SET deleted_at = discontinue_on WHERE deleted_at IS NULL"
|
65
|
+
|
66
|
+
remove_column :spree_products, :discontinue_on
|
67
|
+
remove_column :spree_variants, :discontinue_on
|
68
|
+
end
|
69
|
+
end
|
data/spec/dummy/db/migrate/20180516182059_remove_shipping_method_id_from_spree_orders.spree.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
# This migration comes from spree (originally 20151220072838)
|
2
|
+
class RemoveShippingMethodIdFromSpreeOrders < ActiveRecord::Migration[4.2]
|
3
|
+
def up
|
4
|
+
if column_exists?(:spree_orders, :shipping_method_id, :integer)
|
5
|
+
remove_column :spree_orders, :shipping_method_id, :integer
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
def down
|
10
|
+
unless column_exists?(:spree_orders, :shipping_method_id, :integer)
|
11
|
+
add_column :spree_orders, :shipping_method_id, :integer
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# This migration comes from spree (originally 20160207191757)
|
2
|
+
class AddIdColumnToEarlierHabtmTables < ActiveRecord::Migration[4.2]
|
3
|
+
def up
|
4
|
+
add_column :spree_option_type_prototypes, :id, :primary_key
|
5
|
+
add_column :spree_option_value_variants, :id, :primary_key
|
6
|
+
add_column :spree_order_promotions, :id, :primary_key
|
7
|
+
add_column :spree_product_promotion_rules, :id, :primary_key
|
8
|
+
add_column :spree_promotion_rule_users, :id, :primary_key
|
9
|
+
add_column :spree_property_prototypes, :id, :primary_key
|
10
|
+
add_column :spree_role_users, :id, :primary_key
|
11
|
+
add_column :spree_shipping_method_zones, :id, :primary_key
|
12
|
+
end
|
13
|
+
|
14
|
+
def down
|
15
|
+
raise ActiveRecord::IrreversibleMigration
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# This migration comes from spree (originally 20160219165458)
|
2
|
+
class AddIndexes < ActiveRecord::Migration[4.2]
|
3
|
+
def change
|
4
|
+
add_index :spree_assets, :position
|
5
|
+
add_index :spree_option_types, :name
|
6
|
+
add_index :spree_option_values, :name
|
7
|
+
add_index :spree_prices, :variant_id
|
8
|
+
add_index :spree_properties, :name
|
9
|
+
add_index :spree_roles, :name
|
10
|
+
add_index :spree_shipping_categories, :name
|
11
|
+
add_index :spree_taxons, :lft
|
12
|
+
add_index :spree_taxons, :rgt
|
13
|
+
add_index :spree_taxons, :name
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# This migration comes from spree (originally 20160509064646)
|
2
|
+
class RemoveCounterCacheFromSpreeVariantsToSpreeStockItems < ActiveRecord::Migration[4.2]
|
3
|
+
def up
|
4
|
+
if column_exists?(:spree_variants, :stock_items_count)
|
5
|
+
remove_column :spree_variants, :stock_items_count
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
def down
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# This migration comes from spree (originally 20160511071954)
|
2
|
+
class ActsAsTaggableOnSpreeMigration < ActiveRecord::Migration[4.2]
|
3
|
+
def self.up
|
4
|
+
create_table :spree_tags do |t|
|
5
|
+
t.string :name
|
6
|
+
t.integer :taggings_count, default: 0
|
7
|
+
end
|
8
|
+
|
9
|
+
create_table :spree_taggings do |t|
|
10
|
+
t.references :tag
|
11
|
+
|
12
|
+
# You should make sure that the column created is
|
13
|
+
# long enough to store the required class names.
|
14
|
+
t.references :taggable, polymorphic: true
|
15
|
+
t.references :tagger, polymorphic: true
|
16
|
+
|
17
|
+
# Limit is created to prevent MySQL error on index
|
18
|
+
# length for MyISAM table type: http://bit.ly/vgW2Ql
|
19
|
+
t.string :context, limit: 128
|
20
|
+
|
21
|
+
t.datetime :created_at
|
22
|
+
end
|
23
|
+
|
24
|
+
add_index :spree_tags, :name, unique: true
|
25
|
+
add_index :spree_taggings,
|
26
|
+
[
|
27
|
+
:tag_id,
|
28
|
+
:taggable_id,
|
29
|
+
:taggable_type,
|
30
|
+
:context,
|
31
|
+
:tagger_id,
|
32
|
+
:tagger_type
|
33
|
+
],
|
34
|
+
unique: true, name: "spree_taggings_idx"
|
35
|
+
end
|
36
|
+
|
37
|
+
def self.down
|
38
|
+
drop_table :spree_taggings
|
39
|
+
drop_table :spree_tags
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# This migration comes from spree (originally 20160511072249)
|
2
|
+
# This migration is added to circumvent issue #623 and have special characters
|
3
|
+
# work properly
|
4
|
+
class ChangeCollationForSpreeTagNames < ActiveRecord::Migration[4.2]
|
5
|
+
def up
|
6
|
+
if ActsAsTaggableOn::Utils.using_mysql?
|
7
|
+
execute("ALTER TABLE spree_tags MODIFY name varchar(255) CHARACTER SET utf8 COLLATE utf8_bin;")
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# This migration comes from spree (originally 20160511072335)
|
2
|
+
class AddMissingIndexesToSpreeTaggings < ActiveRecord::Migration[4.2]
|
3
|
+
def change
|
4
|
+
add_index :spree_taggings, :tag_id
|
5
|
+
add_index :spree_taggings, :taggable_id
|
6
|
+
add_index :spree_taggings, :taggable_type
|
7
|
+
add_index :spree_taggings, :tagger_id
|
8
|
+
add_index :spree_taggings, :context
|
9
|
+
|
10
|
+
add_index :spree_taggings, [:tagger_id, :tagger_type]
|
11
|
+
add_index :spree_taggings,
|
12
|
+
[:taggable_id, :taggable_type, :tagger_id, :context],
|
13
|
+
name: "spree_taggings_idy"
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# This migration comes from spree (originally 20160608090604)
|
2
|
+
class AddZipcodeRequiredToSpreeCountries < ActiveRecord::Migration[4.2]
|
3
|
+
def change
|
4
|
+
add_column :spree_countries, :zipcode_required, :boolean, default: true
|
5
|
+
Spree::Country.reset_column_information
|
6
|
+
Spree::Country.where(iso: Spree::Address::NO_ZIPCODE_ISO_CODES).update_all(zipcode_required: false)
|
7
|
+
end
|
8
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# This migration comes from spree (originally 20161014145148)
|
2
|
+
class AddCreatedAtToVariant < ActiveRecord::Migration[5.0]
|
3
|
+
def change
|
4
|
+
add_column :spree_variants, :created_at, :datetime
|
5
|
+
Spree::Variant.reset_column_information
|
6
|
+
Spree::Variant.unscoped.where.not(updated_at: nil).update_all('created_at = updated_at')
|
7
|
+
Spree::Variant.unscoped.where(updated_at: nil).update_all(created_at: Time.current, updated_at: Time.current)
|
8
|
+
end
|
9
|
+
end
|
data/spec/dummy/db/migrate/20180516182068_add_null_false_to_spree_variants_timestamps.spree.rb
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
# This migration comes from spree (originally 20161014152814)
|
2
|
+
class AddNullFalseToSpreeVariantsTimestamps < ActiveRecord::Migration[5.0]
|
3
|
+
def change
|
4
|
+
change_column_null :spree_variants, :created_at, false
|
5
|
+
change_column_null :spree_variants, :updated_at, false
|
6
|
+
end
|
7
|
+
end
|
data/spec/dummy/db/migrate/20180516182069_create_spree_purchase_orders.spree_purchase_order.rb
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
# This migration comes from spree_purchase_order (originally 20160111123141)
|
2
|
+
class CreateSpreePurchaseOrders < ActiveRecord::Migration
|
3
|
+
def change
|
4
|
+
create_table :spree_purchase_orders do |t|
|
5
|
+
t.string :po_number
|
6
|
+
t.string :organization_name
|
7
|
+
|
8
|
+
t.timestamps
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|