Sha256: f475220e0f15a7ee1a36cf462cc2b49be1a8debbad87d60c4374f28cc85205ef
Contents?: true
Size: 539 Bytes
Versions: 2
Compression:
Stored size: 539 Bytes
Contents
class IsTaggableMigration < ActiveRecord::Migration def self.up create_table :tags do |t| t.string :name, :default => '' t.string :kind, :default => '' end create_table :taggings do |t| t.integer :tag_id t.string :taggable_type, :default => '' t.integer :taggable_id end add_index :tags, [:name, :kind] 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
2 entries across 2 versions & 1 rubygems