Sha256: b590d8a872acf8a3a10bb5e2b35333b126ab6ed637e5074b3e2b1d66dcd06852

Contents?: true

Size: 907 Bytes

Versions: 4

Compression:

Stored size: 907 Bytes

Contents

class UpdateColumnCommentsForBenefits < ActiveRecord::Migration[6.1]
  def up
    if connection.supports_comments?
      change_table_comment(:friendly_benefits, friendly_benefits_table_comment)
      change_column_comment(:friendly_benefits, :type, type_comment)
      change_column_comment(:friendly_benefits, :preferences, preferences_comment)
    end
  end

  private

  def friendly_benefits_table_comment
    <<~COMMENT
      Single Table inheritance table. Represents what to do to an order when the linked promotion is eligible.
      Promotions can have many benefits.
    COMMENT
  end

  def type_comment
    <<~COMMENT
      A class name representing which benefit this represents.
      Usually SolidusFriendlyPromotions::Benefits::Adjust{LineItem,Shipment}.
    COMMENT
  end

  def preferences_comment
    <<~COMMENT
      Preferences for this benefit. Serialized YAML.
    COMMENT
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
solidus_friendly_promotions-1.9.3 db/migrate/20240612113608_update_column_comments_for_benefits.rb
solidus_friendly_promotions-1.9.2 db/migrate/20240612113608_update_column_comments_for_benefits.rb
solidus_friendly_promotions-1.9.1 db/migrate/20240612113608_update_column_comments_for_benefits.rb
solidus_friendly_promotions-1.9.0 db/migrate/20240612113608_update_column_comments_for_benefits.rb