Sha256: 28d1a41254e1c236c8c814780284a260353646ac34ee2a06a90117910f9f2a35

Contents?: true

Size: 669 Bytes

Versions: 2

Compression:

Stored size: 669 Bytes

Contents

# Migration file for migrating over all necessay tables to use acts_as_taggable_simple.
#
# == Tables
#
# === Tags
# * name - the String representation of the tag
#
# === Taggings
# * taggable - the record being tagged
# * tag - the tag that is associated with the record
#
class ActsAsTaggableSimpleMigration < ActiveRecord::Migration
  def self.up #:nodoc:
    create_table :tags do |t|
      t.string :name
    end

    add_index :tags, :name, :unique => true

    create_table :taggings do |t|
      t.references :taggable, :polymorphic => true
      t.references :tag
    end
  end

  def self.down #:nodoc:
    drop_table :tagging

    drop_table :tags
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
acts_as_taggable_simple-0.0.4 lib/generators/acts_as_taggable_simple/migration/templates/active_record/migration.rb
acts_as_taggable_simple-0.0.3 lib/generators/acts_as_taggable_simple/migration/templates/active_record/migration.rb