2019-05-02 17:17:27 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-08-30 23:06:56 -05:00
|
|
|
class CreateQueuedPosts < ActiveRecord::Migration[4.2]
|
2015-03-25 13:24:34 -05:00
|
|
|
def change
|
2015-03-26 15:57:50 -05:00
|
|
|
create_table :queued_posts, force: true do |t|
|
2023-01-09 05:59:41 -06:00
|
|
|
t.string :queue, null: false
|
|
|
|
t.integer :state, null: false
|
|
|
|
t.integer :user_id, null: false
|
|
|
|
t.text :raw, null: false
|
|
|
|
t.json :post_options, null: false
|
|
|
|
t.integer :topic_id
|
|
|
|
t.integer :approved_by_id
|
|
|
|
t.timestamp :approved_at
|
|
|
|
t.integer :rejected_by_id
|
|
|
|
t.timestamp :rejected_at
|
2017-08-07 10:48:36 -05:00
|
|
|
t.timestamps null: false
|
2015-03-25 13:24:34 -05:00
|
|
|
end
|
|
|
|
|
2023-01-09 05:59:41 -06:00
|
|
|
add_index :queued_posts, %i[queue state created_at], name: "by_queue_status"
|
|
|
|
add_index :queued_posts, %i[topic_id queue state created_at], name: "by_queue_status_topic"
|
2015-03-25 13:24:34 -05:00
|
|
|
end
|
|
|
|
end
|