about summary refs log tree commit diff
path: root/db
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2019-08-07 01:08:07 -0500
committermultiple creatures <dev@multiple-creature.party>2019-08-07 01:08:34 -0500
commitef04f3879ac3bd7ec6dddd6cb843c8cdb79a1175 (patch)
tree719373d32c084e20d878e9de13a034946c5663b3 /db
parenta8475313b8e81f1e91ee446599a9b7b78716f30c (diff)
add option to automatically space out boosts over configurable random intervals
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20190806195913_create_queued_boosts.rb11
-rw-r--r--db/schema.rb14
2 files changed, 24 insertions, 1 deletions
diff --git a/db/migrate/20190806195913_create_queued_boosts.rb b/db/migrate/20190806195913_create_queued_boosts.rb
new file mode 100644
index 000000000..1b20c9ffa
--- /dev/null
+++ b/db/migrate/20190806195913_create_queued_boosts.rb
@@ -0,0 +1,11 @@
+class CreateQueuedBoosts < ActiveRecord::Migration[5.2]
+  def change
+    create_table :queued_boosts do |t|
+      t.references :account, foreign_key: { on_delete: :cascade }
+      t.references :status, foreign_key: { on_delete: :cascade }
+      t.timestamps
+    end
+
+    add_index :queued_boosts, [:account_id, :status_id], unique: true
+  end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 3c2664db5..a57ac2fd3 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_08_05_203816) do
+ActiveRecord::Schema.define(version: 2019_08_06_195913) do
 
   # These are extensions that must be enabled in order to support this database
   enable_extension "plpgsql"
@@ -554,6 +554,16 @@ ActiveRecord::Schema.define(version: 2019_08_05_203816) do
     t.index ["status_id", "preview_card_id"], name: "index_preview_cards_statuses_on_status_id_and_preview_card_id"
   end
 
+  create_table "queued_boosts", force: :cascade do |t|
+    t.bigint "account_id"
+    t.bigint "status_id"
+    t.datetime "created_at", null: false
+    t.datetime "updated_at", null: false
+    t.index ["account_id", "status_id"], name: "index_queued_boosts_on_account_id_and_status_id", unique: true
+    t.index ["account_id"], name: "index_queued_boosts_on_account_id"
+    t.index ["status_id"], name: "index_queued_boosts_on_status_id"
+  end
+
   create_table "relays", force: :cascade do |t|
     t.string "inbox_url", default: "", null: false
     t.string "follow_activity_id"
@@ -861,6 +871,8 @@ ActiveRecord::Schema.define(version: 2019_08_05_203816) do
   add_foreign_key "poll_votes", "polls", on_delete: :cascade
   add_foreign_key "polls", "accounts", on_delete: :cascade
   add_foreign_key "polls", "statuses", on_delete: :cascade
+  add_foreign_key "queued_boosts", "accounts", on_delete: :cascade
+  add_foreign_key "queued_boosts", "statuses", on_delete: :cascade
   add_foreign_key "report_notes", "accounts", on_delete: :cascade
   add_foreign_key "report_notes", "reports", on_delete: :cascade
   add_foreign_key "reports", "accounts", column: "action_taken_by_account_id", name: "fk_bca45b75fd", on_delete: :nullify