Sha256: 7facf1a43d2a64cacf5573210275f9c9611e2507cb4d8ee91080f93d3c89733a
Contents?: true
Size: 678 Bytes
Versions: 6
Compression:
Stored size: 678 Bytes
Contents
class GutentagTables < ActiveRecord::Migration def up create_table :taggings do |t| t.integer :tag_id, :null => false t.integer :taggable_id, :null => false t.string :taggable_type, :null => false t.timestamps end add_index :taggings, :tag_id add_index :taggings, [:taggable_type, :taggable_id] add_index :taggings, [:taggable_type, :taggable_id, :tag_id], :unique => true, :name => 'unique_taggings' create_table :tags do |t| t.string :name, :null => false t.timestamps end add_index :tags, :name, :unique => true end def down drop_table :tags drop_table :taggings end end
Version data entries
6 entries across 6 versions & 1 rubygems