about summary refs log tree commit diff
path: root/db/migrate
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-11-05 15:20:05 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-11-05 17:13:14 +0100
commit48b9619439818ecb344ae33c9c31a55ecb1aa27a (patch)
treeef350e3ebf2563adbe4d57778a08f561d912415f /db/migrate
parent62292797eccc5bcf47abae9f4daaa2c186660644 (diff)
Adding hashtags
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20161105130633_create_statuses_tags_join_table.rb8
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