about summary refs log tree commit diff
path: root/db/migrate
diff options
context:
space:
mode:
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