db: remove deprecated role columns on user

This commit is contained in:
Pierre de La Morinerie 2022-03-29 07:04:26 +00:00
parent 017625207e
commit 79ea80c199
2 changed files with 11 additions and 10 deletions

View file

@ -0,0 +1,10 @@
class RemoveRoleColumnsOnUser < ActiveRecord::Migration[6.1]
def change
# (The safety_assured block validates that the columns to remove are ignored in the model, which is the case.)
safety_assured do
remove_column :users, :administrateur_id
remove_column :users, :instructeur_id
remove_column :users, :expert_id
end
end
end

View file

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2022_03_23_113327) do
ActiveRecord::Schema.define(version: 2022_03_23_120846) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -791,7 +791,6 @@ ActiveRecord::Schema.define(version: 2022_03_23_113327) do
end
create_table "users", id: :serial, force: :cascade do |t|
t.bigint "administrateur_id"
t.datetime "confirmation_sent_at"
t.string "confirmation_token"
t.datetime "confirmed_at"
@ -800,9 +799,7 @@ ActiveRecord::Schema.define(version: 2022_03_23_113327) do
t.string "current_sign_in_ip"
t.string "email", default: "", null: false
t.string "encrypted_password", default: "", null: false
t.bigint "expert_id"
t.integer "failed_attempts", default: 0, null: false
t.bigint "instructeur_id"
t.datetime "last_sign_in_at"
t.string "last_sign_in_ip"
t.string "locale"
@ -817,11 +814,8 @@ ActiveRecord::Schema.define(version: 2022_03_23_113327) do
t.text "unconfirmed_email"
t.string "unlock_token"
t.datetime "updated_at"
t.index ["administrateur_id"], name: "index_users_on_administrateur_id"
t.index ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true
t.index ["email"], name: "index_users_on_email", unique: true
t.index ["expert_id"], name: "index_users_on_expert_id"
t.index ["instructeur_id"], name: "index_users_on_instructeur_id"
t.index ["requested_merge_into_id"], name: "index_users_on_requested_merge_into_id"
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
t.index ["unlock_token"], name: "index_users_on_unlock_token", unique: true
@ -907,9 +901,6 @@ ActiveRecord::Schema.define(version: 2022_03_23_113327) do
add_foreign_key "trusted_device_tokens", "instructeurs"
add_foreign_key "types_de_champ", "procedure_revisions", column: "revision_id"
add_foreign_key "types_de_champ", "types_de_champ", column: "parent_id"
add_foreign_key "users", "administrateurs"
add_foreign_key "users", "experts"
add_foreign_key "users", "instructeurs"
add_foreign_key "users", "users", column: "requested_merge_into_id"
add_foreign_key "without_continuation_mails", "procedures"
end