From b927ab4568b2fc62646214853c1ec75869a4f290 Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Tue, 4 Dec 2018 13:53:18 +0100 Subject: [PATCH] Add user_id and gestionnaire_id to commentaires --- db/migrate/20181204125101_add_user_id_to_commentaires.rb | 9 +++++++++ db/schema.rb | 6 +++++- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20181204125101_add_user_id_to_commentaires.rb diff --git a/db/migrate/20181204125101_add_user_id_to_commentaires.rb b/db/migrate/20181204125101_add_user_id_to_commentaires.rb new file mode 100644 index 000000000..0ba86c3a0 --- /dev/null +++ b/db/migrate/20181204125101_add_user_id_to_commentaires.rb @@ -0,0 +1,9 @@ +class AddUserIdToCommentaires < ActiveRecord::Migration[5.2] + def change + add_column :commentaires, :user_id, :bigint + add_column :commentaires, :gestionnaire_id, :bigint + + add_index :commentaires, :user_id + add_index :commentaires, :gestionnaire_id + end +end diff --git a/db/schema.rb b/db/schema.rb index 1d8759dfa..2d0cf5c2e 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: 2018_11_23_195208) do +ActiveRecord::Schema.define(version: 2018_12_04_125101) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -189,7 +189,11 @@ ActiveRecord::Schema.define(version: 2018_11_23_195208) do t.datetime "updated_at", null: false t.integer "piece_justificative_id" t.string "file" + t.bigint "user_id" + t.bigint "gestionnaire_id" t.index ["dossier_id"], name: "index_commentaires_on_dossier_id" + t.index ["gestionnaire_id"], name: "index_commentaires_on_gestionnaire_id" + t.index ["user_id"], name: "index_commentaires_on_user_id" end create_table "delayed_jobs", id: :serial, force: :cascade do |t|