Sha256: 209711c64e03d2f8c764fab20cef08e97cb8982f8d9e48b4101c71e74f13ef6f

Contents?: true

Size: 861 Bytes

Versions: 14

Compression:

Stored size: 861 Bytes

Contents

class TagalongMigration < ActiveRecord::Migration
  def self.up
    create_table :tagalong_tags do |t|
      t.string :name
      t.integer :number_of_references
      t.integer :tagger_id
      t.string :tagger_type

      t.timestamps
    end

    add_index :tagalong_tags, :tagger_id
    add_index :tagalong_tags, :tagger_type
    add_index :tagalong_tags, [:tagger_id, :tagger_type]

    create_table :tagalong_taggings do |t|
      t.integer :tagalong_tag_id
      t.integer :taggable_id
      t.string :taggable_type

      t.timestamps
    end

    add_index :tagalong_taggings, :tagalong_tag_id
    add_index :tagalong_taggings, :taggable_id
    add_index :tagalong_taggings, :taggable_type
    add_index :tagalong_taggings, [:taggable_id, :taggable_type]
  end

  def self.down
    drop_table :tagalong_tags
    drop_table :tagalong_taggings
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
tagalong-0.1.4 lib/generators/tagalong/migration/templates/active_record/migration.rb
tagalong-0.1.3 lib/generators/tagalong/migration/templates/active_record/migration.rb
tagalong-0.1.2 lib/generators/tagalong/migration/templates/active_record/migration.rb
tagalong-0.1.1 lib/generators/tagalong/migration/templates/active_record/migration.rb
tagalong-0.1.0 lib/generators/tagalong/migration/templates/active_record/migration.rb
tagalong-0.0.9 lib/generators/tagalong/migration/templates/active_record/migration.rb
tagalong-0.0.8 lib/generators/tagalong/migration/templates/active_record/migration.rb
tagalong-0.0.7 lib/generators/tagalong/migration/templates/active_record/migration.rb
tagalong-0.0.6 lib/generators/tagalong/migration/templates/active_record/migration.rb
tagalong-0.0.5 lib/generators/tagalong/migration/templates/active_record/migration.rb
tagalong-0.0.4 lib/generators/tagalong/migration/templates/active_record/migration.rb
tagalong-0.0.3 lib/generators/tagalong/migration/templates/active_record/migration.rb
tagalong-0.0.2 lib/generators/tagalong/migration/templates/active_record/migration.rb
tagalong-0.0.1 lib/generators/tagalong/migration/templates/active_record/migration.rb