about summary refs log tree commit diff
path: root/db/migrate
diff options
context:
space:
mode:
authorFire Demon <firedemon@creature.cafe>2020-07-31 21:39:29 -0500
committerFire Demon <firedemon@creature.cafe>2020-08-30 05:45:16 -0500
commit52b500e482180b20bb988c09c07c39a492512c31 (patch)
treef271a673bcc6c4a18a8ecaf77cec7f4cbadd0182 /db/migrate
parentd21652f4f0a1c756402a11826ccd93cb6081be59 (diff)
[Feature, Database] Add migrations and models for queued boosts, delayed publishing, and self-destructing posts
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20200731163700_create_destructing_statuses.rb11
-rw-r--r--db/migrate/20200731205913_create_queued_boosts.rb10
-rw-r--r--db/migrate/20200731211100_create_publishing_delays.rb10
3 files changed, 31 insertions, 0 deletions
diff --git a/db/migrate/20200731163700_create_destructing_statuses.rb b/db/migrate/20200731163700_create_destructing_statuses.rb
new file mode 100644
index 000000000..4923eb393
--- /dev/null
+++ b/db/migrate/20200731163700_create_destructing_statuses.rb
@@ -0,0 +1,11 @@
+class CreateDestructingStatuses < ActiveRecord::Migration[5.2]
+  disable_ddl_transaction!
+
+  def change
+    create_table :destructing_statuses do |t|
+      t.references :status, null: false, unique: true, foreign_key: { on_delete: :cascade }
+      t.datetime :after, null: false, index: { algorithm: :concurrently }
+      t.boolean :defederate_only, null: false, default: false
+    end
+  end
+end
diff --git a/db/migrate/20200731205913_create_queued_boosts.rb b/db/migrate/20200731205913_create_queued_boosts.rb
new file mode 100644
index 000000000..33ddbb966
--- /dev/null
+++ b/db/migrate/20200731205913_create_queued_boosts.rb
@@ -0,0 +1,10 @@
+class CreateQueuedBoosts < ActiveRecord::Migration[5.2]
+  def change
+    create_table :queued_boosts do |t|
+      t.references :account, null: false, foreign_key: { on_delete: :cascade }
+      t.references :status, null: false, foreign_key: { on_delete: :cascade }
+    end
+
+    add_index :queued_boosts, [:account_id, :status_id], unique: true
+  end
+end
diff --git a/db/migrate/20200731211100_create_publishing_delays.rb b/db/migrate/20200731211100_create_publishing_delays.rb
new file mode 100644
index 000000000..9561ca0b2
--- /dev/null
+++ b/db/migrate/20200731211100_create_publishing_delays.rb
@@ -0,0 +1,10 @@
+class CreatePublishingDelays < ActiveRecord::Migration[5.2]
+  disable_ddl_transaction!
+
+  def change
+    create_table :publishing_delays do |t|
+      t.references :status, null: false, unique: true, foreign_key: { on_delete: :cascade }
+      t.datetime :after, index: { algorithm: :concurrently }
+    end
+  end
+end