diff options
author | Fire Demon <firedemon@creature.cafe> | 2020-07-19 18:50:24 -0500 |
---|---|---|
committer | Fire Demon <firedemon@creature.cafe> | 2020-08-30 05:43:59 -0500 |
commit | 21438b54bdaf3c557ec9ebbc482a2c418d8c64f8 (patch) | |
tree | e577d047af196823227e675dea52b2fc2fa842c6 /db/migrate | |
parent | 8c8ad0ac0ed0d3e67f3e521068b59edd4054f1e9 (diff) |
[Feature] Add manual publishing option
Diffstat (limited to 'db/migrate')
-rw-r--r-- | db/migrate/20200719181947_add_published_to_statuses.rb | 7 | ||||
-rw-r--r-- | db/migrate/20200719184152_add_unpublished_index_to_statuses.rb | 7 |
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 |