Class: Solidus::Migrations::PromotionWithCodeHandlers::RaiseException

Inherits:
Base
  • Object
show all
Defined in:
lib/solidus/migrations/promotions_with_code_handlers.rb

Instance Attribute Summary

Attributes inherited from Base

#migration_context, #promotions

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Solidus::Migrations::PromotionWithCodeHandlers::Base

Instance Method Details

#callObject

Raises:

  • (StandardError)


20
21
22
23
24
25
26
27
28
29
30
# File 'lib/solidus/migrations/promotions_with_code_handlers.rb', line 20

def call
  # Please note that this will block the current migration and rollback all
  # the previous ones run with the same "rails db:migrate" command.
  #
  raise StandardError, "You are trying to drop 'code' column from "\
    "spree_promotions table but you have at least one record with that "\
    "column filled. Please take care of that or you could lose data. See:" \
    "\n" \
    "https://github.com/solidusio/solidus/pull/3028"\
    "\n"
end