about summary refs log tree commit diff
path: root/db
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2019-12-12 04:38:56 -0600
committermultiple creatures <dev@multiple-creature.party>2019-12-12 04:38:56 -0600
commita8713ee8b73ef63dab45c3c4db949dbfc49a6381 (patch)
tree51bc07def409119d246bbbcf4e123ebc0572470a /db
parent90373b7f3190e86882e764d9cf595f7345a97245 (diff)
add ability for post authors to kick jerks out of their threads
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20191212043419_create_conversation_kicks.rb10
-rw-r--r--db/schema.rb12
2 files changed, 21 insertions, 1 deletions
diff --git a/db/migrate/20191212043419_create_conversation_kicks.rb b/db/migrate/20191212043419_create_conversation_kicks.rb
new file mode 100644
index 000000000..533114845
--- /dev/null
+++ b/db/migrate/20191212043419_create_conversation_kicks.rb
@@ -0,0 +1,10 @@
+class CreateConversationKicks < ActiveRecord::Migration[5.2]
+  def change
+    create_table :conversation_kicks do |t|
+      t.references :account, null: false, foreign_key: {on_delete: :cascade}
+      t.references :conversation, null: false, foreign_key: {on_delete: :cascade}
+    end
+
+    add_index :conversation_kicks, [:account_id, :conversation_id], unique: true
+  end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 47b792a8b..603203c4f 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: 2019_12_12_022653) do
+ActiveRecord::Schema.define(version: 2019_12_12_043419) do
 
   # These are extensions that must be enabled in order to support this database
   enable_extension "pg_trgm"
@@ -218,6 +218,14 @@ ActiveRecord::Schema.define(version: 2019_12_12_022653) do
     t.index ["status_id"], name: "index_bookmarks_on_status_id"
   end
 
+  create_table "conversation_kicks", force: :cascade do |t|
+    t.bigint "account_id", null: false
+    t.bigint "conversation_id", null: false
+    t.index ["account_id", "conversation_id"], name: "index_conversation_kicks_on_account_id_and_conversation_id", unique: true
+    t.index ["account_id"], name: "index_conversation_kicks_on_account_id"
+    t.index ["conversation_id"], name: "index_conversation_kicks_on_conversation_id"
+  end
+
   create_table "conversation_mutes", force: :cascade do |t|
     t.bigint "conversation_id", null: false
     t.bigint "account_id", null: false
@@ -846,6 +854,8 @@ ActiveRecord::Schema.define(version: 2019_12_12_022653) do
   add_foreign_key "blocks", "accounts", name: "fk_4269e03e65", on_delete: :cascade
   add_foreign_key "bookmarks", "accounts", on_delete: :cascade
   add_foreign_key "bookmarks", "statuses", on_delete: :cascade
+  add_foreign_key "conversation_kicks", "accounts", on_delete: :cascade
+  add_foreign_key "conversation_kicks", "conversations", on_delete: :cascade
   add_foreign_key "conversation_mutes", "accounts", name: "fk_225b4212bb", on_delete: :cascade
   add_foreign_key "conversation_mutes", "conversations", on_delete: :cascade
   add_foreign_key "custom_filters", "accounts", on_delete: :cascade