lib/generators/sharp_social/templates/migration.rb in sharp_social-0.0.1 vs lib/generators/sharp_social/templates/migration.rb in sharp_social-0.1.1
- old
+ new
@@ -1,17 +1,9 @@
# Migration responsible for creating a table with activities
class CreateSharpSocial < ActiveRecord::Migration
# Create table
def self.up
- create_table :activities do |t|
- t.references :actor, :polymorphic => true, :null => false
- t.text :content
- t.timestamps
- end
-
- add_index :activities, [:actor_id, :actor_type]
-
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.timestamps
@@ -20,9 +12,8 @@
add_index :follows, ["actor_id", "actor_type"]
add_index :follows, ["follower_id", "follower_type"]
end
def self.down
- drop_table :activities
drop_table :follows
end
end