Sha256: 5079252daa95772a9ef5de30112483eac951e176e7b8f0f784d0ce91fa578a7d

Contents?: true

Size: 1.54 KB

Versions: 9

Compression:

Stored size: 1.54 KB

Contents

# frozen_string_literal: true

class AddDbCommentsToFriendlyPromotionRulesStores < ActiveRecord::Migration[6.1]
  def up
    if connection.supports_comments?
      change_table_comment(:friendly_promotion_rules_stores, friendly_promotion_rules_stores_table_comment)
      change_column_comment(:friendly_promotion_rules_stores, :id, id_comment)
      change_column_comment(:friendly_promotion_rules_stores, :store_id, store_id_comment)
      change_column_comment(:friendly_promotion_rules_stores, :promotion_rule_id, promotion_rule_id_comment)
      change_column_comment(:friendly_promotion_rules_stores, :created_at, created_at_comment)
      change_column_comment(:friendly_promotion_rules_stores, :updated_at, updated_at_comment)
    end
  end

  private

  def friendly_promotion_rules_stores_table_comment
    <<~COMMENT
      Join table between promotion rules and stores. Only used with the promotion rule "Store", which checks that an order
      has been placed in a particular Spree::Store instance.
    COMMENT
  end

  def id_comment
    <<~COMMENT
      Primary key of this table.
    COMMENT
  end

  def store_id_comment
    <<~COMMENT
      Foreign key to the spree_stores table.
    COMMENT
  end

  def promotion_rule_id_comment
    <<~COMMENT
      Foreign key to the friendly_promotion_rules table.
    COMMENT
  end

  def created_at_comment
    <<~COMMENT
      Timestamp indicating when this record was created.
    COMMENT
  end

  def updated_at_comment
    <<~COMMENT
      Timestamp indicating when this record was last updated.
    COMMENT
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
solidus_friendly_promotions-1.9.3 db/migrate/20231011184205_add_db_comments_to_friendly_promotion_rules_stores.rb
solidus_friendly_promotions-1.9.2 db/migrate/20231011184205_add_db_comments_to_friendly_promotion_rules_stores.rb
solidus_friendly_promotions-1.9.1 db/migrate/20231011184205_add_db_comments_to_friendly_promotion_rules_stores.rb
solidus_friendly_promotions-1.9.0 db/migrate/20231011184205_add_db_comments_to_friendly_promotion_rules_stores.rb
solidus_friendly_promotions-1.0.0 db/migrate/20231011184205_add_db_comments_to_friendly_promotion_rules_stores.rb
solidus_friendly_promotions-1.0.0.rc.3 db/migrate/20231011184205_add_db_comments_to_friendly_promotion_rules_stores.rb
solidus_friendly_promotions-1.0.0.rc.2 db/migrate/20231011184205_add_db_comments_to_friendly_promotion_rules_stores.rb
solidus_friendly_promotions-1.0.0.rc.1 db/migrate/20231011184205_add_db_comments_to_friendly_promotion_rules_stores.rb
solidus_friendly_promotions-1.0.0.pre db/migrate/20231011184205_add_db_comments_to_friendly_promotion_rules_stores.rb