Sha256: f510301dde1c0e7dcf2f8f25b3e99114c6e633f77e3c1c168c8ba5f55568d1c9

Contents?: true

Size: 566 Bytes

Versions: 10

Compression:

Stored size: 566 Bytes

Contents

class HasMachineTagsMigration < ActiveRecord::Migration
  def self.up
    create_table :tags do |t|
      t.string :name
      t.string :namespace
      t.string :predicate
      t.string :value
      t.datetime :created_at
    end
    
    create_table :taggings do |t|
      t.integer :tag_id
      t.integer :taggable_id
      t.string :taggable_type
      t.datetime :created_at
    end
    
    add_index :taggings, :tag_id
    add_index :taggings, [:taggable_id, :taggable_type]
  end
  
  def self.down
    drop_table :taggings
    drop_table :tags
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
cldwalker-has_machine_tags-0.1.2 generators/has_machine_tags_migration/templates/migration.rb
cldwalker-has_machine_tags-0.1.3 generators/has_machine_tags_migration/templates/migration.rb
cldwalker-has_machine_tags-0.1.4 generators/has_machine_tags_migration/templates/migration.rb
cldwalker-has_machine_tags-0.1.5 generators/has_machine_tags_migration/templates/migration.rb
has_machine_tags-0.2.2 generators/has_machine_tags_migration/templates/migration.rb
has_machine_tags-0.2.1 generators/has_machine_tags_migration/templates/migration.rb
has_machine_tags-0.2.0 generators/has_machine_tags_migration/templates/migration.rb
has_machine_tags-0.1.8 generators/has_machine_tags_migration/templates/migration.rb
has_machine_tags-0.1.7 generators/has_machine_tags_migration/templates/migration.rb
has_machine_tags-0.1.6 generators/has_machine_tags_migration/templates/migration.rb