Class: CreateFriendships
- Inherits:
-
ActiveRecord::Migration
- Object
- ActiveRecord::Migration
- CreateFriendships
- Defined in:
- lib/generators/amistad/install/templates/create_friendships.rb
Class Method Summary collapse
Class Method Details
.down ⇒ Object
13 14 15 |
# File 'lib/generators/amistad/install/templates/create_friendships.rb', line 13 def self.down drop_table :friendships end |
.up ⇒ Object
2 3 4 5 6 7 8 9 10 11 |
# File 'lib/generators/amistad/install/templates/create_friendships.rb', line 2 def self.up create_table :friendships do |t| t.integer :friendable_id t.integer :friend_id t.integer :blocker_id t.boolean :pending, :default => true end add_index :friendships, [:friendable_id, :friend_id], :unique => true end |