Sha256: 2f04e6368ac78226dbb3b2663c6dac2ff9d5d69704a2ddbab27802b4f35f603b

Contents?: true

Size: 885 Bytes

Versions: 21

Compression:

Stored size: 885 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 :tag_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, [:tag_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

21 entries across 21 versions & 4 rubygems

Version Path
calagator-1.0.0 db/migrate/20080705164959_create_tags_and_taggings.rb
grokus-1.0.0.9 db/migrate/20080705164959_create_tags_and_taggings.rb
grokus-1.0.0.8 db/migrate/20080705164959_create_tags_and_taggings.rb
grokus-1.0.0.7 db/migrate/20080705164959_create_tags_and_taggings.rb
grokus-1.0.0.6 db/migrate/20080705164959_create_tags_and_taggings.rb
grokus-1.0.0.5 db/migrate/20080705164959_create_tags_and_taggings.rb
grokus-1.0.0.3 db/migrate/20080705164959_create_tags_and_taggings.rb
grokus-1.0.0.2 db/migrate/20080705164959_create_tags_and_taggings.rb
grokus-1.0.0.1 db/migrate/20080705164959_create_tags_and_taggings.rb
calagator-1.0.0.rc3 db/migrate/20080705164959_create_tags_and_taggings.rb
calagator-1.0.0.rc2 db/migrate/20080705164959_create_tags_and_taggings.rb
calagator-1.0.0.rc1 db/migrate/20080705164959_create_tags_and_taggings.rb
calagator-0.0.1.pre1 db/migrate/20080705164959_create_tags_and_taggings.rb
railscart-0.0.1 starter-app/db/migrate/002_create_tags_and_taggings.rb
railscart-0.0.2 starter_app/db/migrate/002_create_tags_and_taggings.rb
railscart-0.0.4 starter_app/db/migrate/003_create_tags_and_taggings.rb
railscart-0.0.3 starter_app/db/migrate/002_create_tags_and_taggings.rb
spree-0.0.5 starter-app/db/migrate/003_create_tags_and_taggings.rb
spree-0.0.6 starter-app/db/migrate/003_create_tags_and_taggings.rb
spree-0.0.7 starter-app/db/migrate/003_create_tags_and_taggings.rb