2020-08-07 01:14:14 +02:00
|
|
|
class CreatePrinterJobs < ActiveRecord::Migration[4.2]
|
2019-02-02 12:40:57 +01:00
|
|
|
def change
|
|
|
|
create_table :printer_jobs do |t|
|
|
|
|
t.references :order
|
|
|
|
t.string :document, null: false
|
|
|
|
t.integer :created_by_user_id, null: false
|
|
|
|
t.integer :finished_by_user_id
|
|
|
|
t.datetime :finished_at, index: true
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table :printer_job_updates do |t|
|
|
|
|
t.references :printer_job, null: false
|
|
|
|
t.datetime :created_at, null: false
|
|
|
|
t.string :state, null: false
|
|
|
|
t.text :message
|
|
|
|
end
|
|
|
|
|
2023-05-12 13:01:12 +02:00
|
|
|
add_index :printer_job_updates, %i[printer_job_id created_at]
|
2019-02-02 12:40:57 +01:00
|
|
|
end
|
|
|
|
end
|