Favorite groups

This commit is contained in:
Toks
2015-06-23 15:25:54 -04:00
parent e1dc51e026
commit 04fa5596e2
27 changed files with 574 additions and 15 deletions

View File

@@ -0,0 +1,19 @@
class CreateFavoriteGroups < ActiveRecord::Migration
def self.up
create_table :favorite_groups do |t|
t.text :name, :null => false
t.integer :creator_id, :null => false
t.text :post_ids, :null => false, :default => ""
t.integer :post_count, :null => false, :default => 0
t.timestamps
end
execute "create index index_favorite_groups_on_lower_name on favorite_groups (lower(name))"
add_index :favorite_groups, :creator_id
end
def self.down
drop_table :favorite_groups
end
end