Class: CreateSharpSocial
- Inherits:
-
ActiveRecord::Migration
- Object
- ActiveRecord::Migration
- CreateSharpSocial
- Defined in:
- lib/generators/sharp_social/templates/migration.rb
Overview
Migration responsible for creating a table with activities
Class Method Summary collapse
- .down ⇒ Object
-
.up ⇒ Object
Create table.
Class Method Details
.down ⇒ Object
16 17 18 |
# File 'lib/generators/sharp_social/templates/migration.rb', line 16 def self.down drop_table :follows end |
.up ⇒ Object
Create table
4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/generators/sharp_social/templates/migration.rb', line 4 def self.up create_table :follows, :force => true do |t| t.references :actor, :polymorphic => true, :null => false t.references :follower, :polymorphic => true, :null => false t.boolean :blocked, :default => false, :null => false t. end add_index :follows, ["actor_id", "actor_type"] add_index :follows, ["follower_id", "follower_type"] end |