diff options
Diffstat (limited to 'db/migrate')
-rw-r--r-- | db/migrate/20161105130633_create_statuses_tags_join_table.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/db/migrate/20161105130633_create_statuses_tags_join_table.rb b/db/migrate/20161105130633_create_statuses_tags_join_table.rb new file mode 100644 index 000000000..8a436c6ea --- /dev/null +++ b/db/migrate/20161105130633_create_statuses_tags_join_table.rb @@ -0,0 +1,8 @@ +class CreateStatusesTagsJoinTable < ActiveRecord::Migration[5.0] + def change + create_join_table :statuses, :tags do |t| + t.index :tag_id + t.index [:tag_id, :status_id], unique: true + end + end +end |