FEATURE: tag groups

This commit is contained in:
Neil Lalonde
2016-06-06 14:18:15 -04:00
parent a3f1daca5d
commit f3f6c2f98f
30 changed files with 434 additions and 67 deletions

View File

@ -0,0 +1,17 @@
class CreateTagGroups < ActiveRecord::Migration
def change
create_table :tag_groups do |t|
t.string :name, null: false
t.integer :tag_count, null: false, default: 0
t.timestamps
end
create_table :tag_group_memberships do |t|
t.references :tag, null: false
t.references :tag_group, null: false
t.timestamps
end
add_index :tag_group_memberships, [:tag_group_id, :tag_id], unique: true
end
end