lib/generators/partisan/templates/migration.rb in partisan-0.4.1 vs lib/generators/partisan/templates/migration.rb in partisan-0.4.2
- old
+ new
@@ -2,14 +2,15 @@
def up
create_table :follows do |t|
t.references :followable, polymorphic: true
t.references :follower, polymorphic: true
- t.timestamps
+ t.timestamps null: false
end
- add_index :follows, ['follower_id', 'follower_type'], name: 'index_partisan_followers'
+ add_index :follows, ['follower_id', 'follower_type'], name: 'index_partisan_followers'
add_index :follows, ['followable_id', 'followable_type'], name: 'index_partisan_followables'
+ add_index :follows, ['follower_id', 'follower_type', 'followable_id', 'follower_type'], name: 'index_partisan_unique_follow', unique: true
end
def down
drop_table :follows
end