about summary refs log tree commit diff
path: root/db
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
parent62292797eccc5bcf47abae9f4daaa2c186660644 (diff)
Adding hashtags
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20161105130633_create_statuses_tags_join_table.rb8
-rw-r--r--db/schema.rb9
2 files changed, 16 insertions, 1 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
diff --git a/db/schema.rb b/db/schema.rb
index 3d0182ba9..a2d05b1bd 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,7 +10,7 @@
 #
 # It's strongly recommended that you check this file into your version control system.
 
-ActiveRecord::Schema.define(version: 20161104173623) do
+ActiveRecord::Schema.define(version: 20161105130633) do
 
   # These are extensions that must be enabled in order to support this database
   enable_extension "plpgsql"
@@ -160,6 +160,13 @@ ActiveRecord::Schema.define(version: 20161104173623) do
     t.index ["uri"], name: "index_statuses_on_uri", unique: true, using: :btree
   end
 
+  create_table "statuses_tags", id: false, force: :cascade do |t|
+    t.integer "status_id", null: false
+    t.integer "tag_id",    null: false
+    t.index ["tag_id", "status_id"], name: "index_statuses_tags_on_tag_id_and_status_id", unique: true, using: :btree
+    t.index ["tag_id"], name: "index_statuses_tags_on_tag_id", using: :btree
+  end
+
   create_table "stream_entries", force: :cascade do |t|
     t.integer  "account_id"
     t.integer  "activity_id"