From 3c4380251da19dff08047e76a3e6db091b5d71d3 Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Thu, 2 May 2019 16:18:10 +0200 Subject: [PATCH] Add digest and timestamps to operation_logs --- ...add_digest_and_timestamps_to_dossier_operation_logs.rb | 8 ++++++++ db/schema.rb | 6 +++++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20190327102360_add_digest_and_timestamps_to_dossier_operation_logs.rb diff --git a/db/migrate/20190327102360_add_digest_and_timestamps_to_dossier_operation_logs.rb b/db/migrate/20190327102360_add_digest_and_timestamps_to_dossier_operation_logs.rb new file mode 100644 index 000000000..235e78f78 --- /dev/null +++ b/db/migrate/20190327102360_add_digest_and_timestamps_to_dossier_operation_logs.rb @@ -0,0 +1,8 @@ +class AddDigestAndTimestampsToDossierOperationLogs < ActiveRecord::Migration[5.2] + def change + add_column :dossier_operation_logs, :keep_until, :datetime + add_column :dossier_operation_logs, :executed_at, :datetime + add_column :dossier_operation_logs, :digest, :text + add_index :dossier_operation_logs, :keep_until + end +end diff --git a/db/schema.rb b/db/schema.rb index aeceeaf2f..c0f9b1a41 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2019_03_27_102357) do +ActiveRecord::Schema.define(version: 2019_03_27_102360) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -221,9 +221,13 @@ ActiveRecord::Schema.define(version: 2019_03_27_102357) do t.datetime "updated_at", null: false t.boolean "automatic_operation", default: false, null: false t.bigint "administration_id" + t.datetime "keep_until" + t.datetime "executed_at" + t.text "digest" t.index ["administration_id"], name: "index_dossier_operation_logs_on_administration_id" t.index ["dossier_id"], name: "index_dossier_operation_logs_on_dossier_id" t.index ["gestionnaire_id"], name: "index_dossier_operation_logs_on_gestionnaire_id" + t.index ["keep_until"], name: "index_dossier_operation_logs_on_keep_until" end create_table "dossiers", id: :serial, force: :cascade do |t|