Sha256: eae8431afaf5ea7f45cb767191c5131b06ae649b7714053a7c8d1b770af73279

Contents?: true

Size: 321 Bytes

Versions: 1

Compression:

Stored size: 321 Bytes

Contents

class CreateTags < ActiveRecord::Migration[7.0]
  def change
    create_table :tags do |t|
      t.string :name, null: false
      t.references :subcategory, null: false, index: true
    end

    create_join_table :items, :tags do |t|
      t.index [:item_id, :tag_id]
      t.index [:tag_id, :item_id]
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
activeadmin-ajax_filter-0.7.0 test_app/blog/db/migrate/20230425060708_create_tags.rb