Sha256: ef4b1441d5c072df29936039f67bd7d45aa44c4a6ae0994e07e4fcb97e84346e

Contents?: true

Size: 941 Bytes

Versions: 25

Compression:

Stored size: 941 Bytes

Contents

# A migration to add tables for Tag and Tagging. This file is automatically generated and added to your app if you run the tagging generator included with has_many_polymorphs.

class CreateTagsAndTaggings < ActiveRecord::Migration

  # Add the new tables.
  def self.up
    create_table :tags do |t|
      t.column :name, :string, :null => false
    end
    add_index :tags, :name, :unique => true

    create_table :taggings do |t|
      t.column :<%= parent_association_name -%>_id, :integer, :null => false
      t.column :taggable_id, :integer, :null => false
      t.column :taggable_type, :string, :null => false
      # t.column :position, :integer # Uncomment this if you need to use <tt>acts_as_list</tt>.
    end
    add_index :taggings, [:<%= parent_association_name -%>_id, :taggable_id, :taggable_type], :unique => true    
  end

  # Remove the tables.
  def self.down
    drop_table :tags
    drop_table :taggings
  end

end

Version data entries

25 entries across 25 versions & 4 rubygems

Version Path
radiant-tags-extension-1.6.10 vendor/plugins/has_many_polymorphs/generators/tagging/templates/migration.rb
johnsbrn-has_many_polymorphs-2.13.1 generators/tagging/templates/migration.rb
johnsbrn-has_many_polymorphs-2.13.3 generators/tagging/templates/migration.rb
johnsbrn-has_many_polymorphs-2.13.4 generators/tagging/templates/migration.rb
johnsbrn-has_many_polymorphs-2.13 generators/tagging/templates/migration.rb
radiant-tags-extension-1.6.9 vendor/plugins/has_many_polymorphs/generators/tagging/templates/migration.rb
radiant-tags-extension-1.6.8 vendor/plugins/has_many_polymorphs/generators/tagging/templates/migration.rb
radiant-tags-extension-1.6.7 vendor/plugins/has_many_polymorphs/generators/tagging/templates/migration.rb
radiant-tags-extension-1.6.6 vendor/plugins/has_many_polymorphs/generators/tagging/templates/migration.rb
radiant-tags-extension-1.6.5 vendor/plugins/has_many_polymorphs/generators/tagging/templates/migration.rb
radiant-tags-extension-1.6.4 vendor/plugins/has_many_polymorphs/generators/tagging/templates/migration.rb
radiant-tags-extension-1.6.3 vendor/plugins/has_many_polymorphs/generators/tagging/templates/migration.rb
radiant-tags-extension-1.6.2 vendor/plugins/has_many_polymorphs/generators/tagging/templates/migration.rb
radiant-tags-extension-1.6.1 vendor/plugins/has_many_polymorphs/generators/tagging/templates/migration.rb
radiant-tags-extension-1.6.0 vendor/plugins/has_many_polymorphs/generators/tagging/templates/migration.rb
radiant-tags-extension-1.5.1 vendor/plugins/has_many_polymorphs/generators/tagging/templates/migration.rb
has_many_polymorphs-2.10 generators/tagging/templates/migration.rb
has_many_polymorphs-2.11 generators/tagging/templates/migration.rb
has_many_polymorphs-2.2 generators/tagging/templates/migration.rb
has_many_polymorphs-2.9 generators/tagging/templates/migration.rb