Sha256: ee767d470d42704fd191f66607ae6bbd884cfdaa461c4d8ff1b92db9470e16a5

Contents?: true

Size: 1.12 KB

Versions: 9

Compression:

Stored size: 1.12 KB

Contents

# This migration comes from spree (originally 20160511071954)
class ActsAsTaggableOnSpreeMigration < ActiveRecord::Migration[4.2]
  def self.up
    create_table :spree_tags do |t|
      t.string :name
      t.integer :taggings_count, default: 0
    end

    create_table :spree_taggings do |t|
      t.references :tag

      # You should make sure that the column created is
      # long enough to store the required class names.
      t.references :taggable, polymorphic: true
      t.references :tagger, polymorphic: true

      # Limit is created to prevent MySQL error on index
      # length for MyISAM table type: http://bit.ly/vgW2Ql
      t.string :context, limit: 128

      t.datetime :created_at
    end

    add_index :spree_tags, :name, unique: true
    add_index :spree_taggings,
              [
                :tag_id,
                :taggable_id,
                :taggable_type,
                :context,
                :tagger_id,
                :tagger_type
              ],
              unique: true, name: "spree_taggings_idx"
  end

  def self.down
    drop_table :spree_taggings
    drop_table :spree_tags
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
spree_purchase_order-3.7.0 spec/dummy/db/migrate/20191113195934_acts_as_taggable_on_spree_migration.spree.rb
spree_billing_sisow-0.9.2 spec/dummy/db/migrate/20190729091875_acts_as_taggable_on_spree_migration.spree.rb
spree_billing_sisow-0.9.1 spec/dummy/db/migrate/20190729091875_acts_as_taggable_on_spree_migration.spree.rb
spree_purchase_order-3.6.0 spec/dummy/db/migrate/20180516182063_acts_as_taggable_on_spree_migration.spree.rb
spree_purchase_order-3.5.0 spec/dummy/db/migrate/20180516182063_acts_as_taggable_on_spree_migration.spree.rb
spree_purchase_order-3.5.0.rc1 spec/dummy/db/migrate/20180516182063_acts_as_taggable_on_spree_migration.spree.rb
spree_purchase_order-3.4.0 spec/dummy/db/migrate/20180516182063_acts_as_taggable_on_spree_migration.spree.rb
spree_purchase_order-3.3.0 spec/dummy/db/migrate/20180516182063_acts_as_taggable_on_spree_migration.spree.rb
spree_purchase_order-3.2.0 spec/dummy/db/migrate/20180516182063_acts_as_taggable_on_spree_migration.spree.rb