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/20190103124649_create_scheduled_statuses.rb9
-rw-r--r--db/migrate/20190103124754_add_scheduled_status_id_to_media_attachments.rb8
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