about summary refs log tree commit diff
path: root/db/migrate
diff options
context:
space:
mode:
authorFire Demon <firedemon@creature.cafe>2020-07-19 18:50:24 -0500
committerFire Demon <firedemon@creature.cafe>2020-08-30 05:43:59 -0500
commit21438b54bdaf3c557ec9ebbc482a2c418d8c64f8 (patch)
treee577d047af196823227e675dea52b2fc2fa842c6 /db/migrate
parent8c8ad0ac0ed0d3e67f3e521068b59edd4054f1e9 (diff)
[Feature] Add manual publishing option
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20200719181947_add_published_to_statuses.rb7
-rw-r--r--db/migrate/20200719184152_add_unpublished_index_to_statuses.rb7
2 files changed, 14 insertions, 0 deletions
diff --git a/db/migrate/20200719181947_add_published_to_statuses.rb b/db/migrate/20200719181947_add_published_to_statuses.rb
new file mode 100644
index 000000000..129840a0c
--- /dev/null
+++ b/db/migrate/20200719181947_add_published_to_statuses.rb
@@ -0,0 +1,7 @@
+class AddPublishedToStatuses < ActiveRecord::Migration[5.2]
+  def change
+    safety_assured do
+      add_column :statuses, :published, :boolean, default: true, null: false
+    end
+  end
+end
diff --git a/db/migrate/20200719184152_add_unpublished_index_to_statuses.rb b/db/migrate/20200719184152_add_unpublished_index_to_statuses.rb
new file mode 100644
index 000000000..ee6d3e942
--- /dev/null
+++ b/db/migrate/20200719184152_add_unpublished_index_to_statuses.rb
@@ -0,0 +1,7 @@
+class AddUnpublishedIndexToStatuses < ActiveRecord::Migration[5.2]
+  disable_ddl_transaction!
+
+  def change
+    add_index :statuses, [:account_id, :id], where: '(deleted_at IS NULL) AND (published = FALSE)', order: { id: :desc }, algorithm: :concurrently, name: :index_unpublished_statuses
+  end
+end