diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2019-01-05 12:43:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-05 12:43:28 +0100 |
commit | a49d43d1121ac10f96d5a9cbf78112c707e7a59e (patch) | |
tree | ee311cf3d68d695f6cc6c69ce9e1b01c6ad4aeb4 /db/migrate | |
parent | b17b2f25acc4d0cd4284835f28364451cb2fcd88 (diff) |
Add scheduled statuses (#9706)
Fix #340
Diffstat (limited to 'db/migrate')
-rw-r--r-- | db/migrate/20190103124649_create_scheduled_statuses.rb | 9 | ||||
-rw-r--r-- | db/migrate/20190103124754_add_scheduled_status_id_to_media_attachments.rb | 8 |
2 files changed, 17 insertions, 0 deletions
diff --git a/db/migrate/20190103124649_create_scheduled_statuses.rb b/db/migrate/20190103124649_create_scheduled_statuses.rb new file mode 100644 index 000000000..2b78073b8 --- /dev/null +++ b/db/migrate/20190103124649_create_scheduled_statuses.rb @@ -0,0 +1,9 @@ +class CreateScheduledStatuses < ActiveRecord::Migration[5.2] + def change + create_table :scheduled_statuses do |t| + t.belongs_to :account, foreign_key: { on_delete: :cascade } + t.datetime :scheduled_at, index: true + t.jsonb :params + end + end +end diff --git a/db/migrate/20190103124754_add_scheduled_status_id_to_media_attachments.rb b/db/migrate/20190103124754_add_scheduled_status_id_to_media_attachments.rb new file mode 100644 index 000000000..6f6cf2351 --- /dev/null +++ b/db/migrate/20190103124754_add_scheduled_status_id_to_media_attachments.rb @@ -0,0 +1,8 @@ +class AddScheduledStatusIdToMediaAttachments < ActiveRecord::Migration[5.2] + disable_ddl_transaction! + + def change + add_reference :media_attachments, :scheduled_status, foreign_key: { on_delete: :nullify }, index: false + add_index :media_attachments, :scheduled_status_id, algorithm: :concurrently + end +end |