about summary refs log tree commit diff
path: root/db
diff options
context:
space:
mode:
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20171005102658_create_account_moderation_notes.rb12
-rw-r--r--db/schema.rb11
2 files changed, 23 insertions, 0 deletions
diff --git a/db/migrate/20171005102658_create_account_moderation_notes.rb b/db/migrate/20171005102658_create_account_moderation_notes.rb
new file mode 100644
index 000000000..d1802b5b3
--- /dev/null
+++ b/db/migrate/20171005102658_create_account_moderation_notes.rb
@@ -0,0 +1,12 @@
+class CreateAccountModerationNotes < ActiveRecord::Migration[5.1]
+  def change
+    create_table :account_moderation_notes do |t|
+      t.text :content, null: false
+      t.references :account
+      t.references :target_account
+
+      t.timestamps
+    end
+    add_foreign_key :account_moderation_notes, :accounts, column: :target_account_id
+  end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 7180d3515..91f1b1acb 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -23,6 +23,16 @@ ActiveRecord::Schema.define(version: 20171006142024) do
     t.index ["account_id", "domain"], name: "index_account_domain_blocks_on_account_id_and_domain", unique: true
   end
 
+  create_table "account_moderation_notes", force: :cascade do |t|
+    t.text "content", null: false
+    t.bigint "account_id"
+    t.bigint "target_account_id"
+    t.datetime "created_at", null: false
+    t.datetime "updated_at", null: false
+    t.index ["account_id"], name: "index_account_moderation_notes_on_account_id"
+    t.index ["target_account_id"], name: "index_account_moderation_notes_on_target_account_id"
+  end
+
   create_table "accounts", force: :cascade do |t|
     t.string "username", default: "", null: false
     t.string "domain"
@@ -449,6 +459,7 @@ ActiveRecord::Schema.define(version: 20171006142024) do
   end
 
   add_foreign_key "account_domain_blocks", "accounts", name: "fk_206c6029bd", on_delete: :cascade
+  add_foreign_key "account_moderation_notes", "accounts", column: "target_account_id"
   add_foreign_key "blocks", "accounts", column: "target_account_id", name: "fk_9571bfabc1", on_delete: :cascade
   add_foreign_key "blocks", "accounts", name: "fk_4269e03e65", on_delete: :cascade
   add_foreign_key "conversation_mutes", "accounts", name: "fk_225b4212bb", on_delete: :cascade