mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
FEATURE: tag groups
This commit is contained in:
17
db/migrate/20160602164008_create_tag_groups.rb
Normal file
17
db/migrate/20160602164008_create_tag_groups.rb
Normal 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
|
Reference in New Issue
Block a user