Sha256: 773f0b4f17d6d5a3a67ec525ab2b43117bcd14b64fb5eee827d00731bed00425

Contents?: true

Size: 860 Bytes

Versions: 1

Compression:

Stored size: 860 Bytes

Contents

class UpdateColumnCommentsForConditionTaxons < ActiveRecord::Migration[7.1]
  def up
    if connection.supports_comments?
      change_table_comment(:friendly_condition_taxons, friendly_condition_taxons_table_comment)
      change_column_comment(:friendly_condition_taxons, :condition_id, condition_id_comment)
    end
  end

  private

  def friendly_condition_taxons_table_comment
    <<~COMMENT
      Join table between conditions and taxons. Only used if the promotion condition's type is SolidusFriendlyPromotion::Conditions::Taxon or
      SolidusFriendlyPromotion::Conditions::LineItemTaxon. Represents those taxons that the promotion condition matches on using its any/all/none
      or include/exclude match policy.
    COMMENT
  end

  def condition_id_comment
    <<~COMMENT
      Foreign key to the friendly_conditions table.
    COMMENT
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
solidus_friendly_promotions-1.9.0 db/migrate/20240612120411_update_column_comments_for_condition_taxons.rb