From 03f028689fe256d13d1ab87f0492180b57a6a912 Mon Sep 17 00:00:00 2001 From: baarkerlounger Date: Wed, 25 May 2022 14:08:26 +0100 Subject: [PATCH] Remove routes and table --- config/routes.rb | 25 ------------- db/migrate/20220525130518_drop_admin_users.rb | 36 +++++++++++++++++++ db/schema.rb | 29 --------------- 3 files changed, 36 insertions(+), 54 deletions(-) create mode 100644 db/migrate/20220525130518_drop_admin_users.rb diff --git a/config/routes.rb b/config/routes.rb index 33c9f0a9a..c70cb2525 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,28 +1,5 @@ # For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html Rails.application.routes.draw do - devise_for :admin_users, { - path: :admin, - controllers: { - sessions: "auth/sessions", - passwords: "auth/passwords", - unlocks: "active_admin/devise/unlocks", - registrations: "active_admin/devise/registrations", - confirmations: "active_admin/devise/confirmations", - two_factor_authentication: "auth/two_factor_authentication", - }, - path_names: { - sign_in: "sign-in", - sign_out: "sign-out", - two_factor_authentication: "two-factor-authentication", - two_factor_authentication_resend_code: "resend-code", - }, - sign_out_via: %i[get], - } - - devise_scope :admin_user do - get "admin/two-factor-authentication/resend", to: "auth/two_factor_authentication#show_resend", as: "admin_user_two_factor_authentication_resend" - end - devise_for :users, { path: :account, controllers: { @@ -48,8 +25,6 @@ Rails.application.routes.draw do get "/health", to: ->(_) { [204, {}, [nil]] } - ActiveAdmin.routes(self) - root to: "start#index" get "/accessibility-statement", to: "content#accessibility_statement" diff --git a/db/migrate/20220525130518_drop_admin_users.rb b/db/migrate/20220525130518_drop_admin_users.rb new file mode 100644 index 000000000..fae8c3480 --- /dev/null +++ b/db/migrate/20220525130518_drop_admin_users.rb @@ -0,0 +1,36 @@ +class DropAdminUsers < ActiveRecord::Migration[7.0] + def up + drop_table :admin_users + end + + def down + create_table "admin_users", force: :cascade do |t| + t.string "email", default: "", null: false + t.string "encrypted_password", default: "", null: false + t.string "reset_password_token" + t.datetime "reset_password_sent_at", precision: nil + t.datetime "remember_created_at", precision: nil + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "second_factor_attempts_count", default: 0 + t.string "encrypted_otp_secret_key" + t.string "encrypted_otp_secret_key_iv" + t.string "encrypted_otp_secret_key_salt" + t.string "direct_otp" + t.datetime "direct_otp_sent_at", precision: nil + t.datetime "totp_timestamp", precision: nil + t.string "phone" + t.string "name" + t.integer "sign_in_count", default: 0, null: false + t.datetime "current_sign_in_at", precision: nil + t.datetime "last_sign_in_at", precision: nil + t.string "current_sign_in_ip" + t.string "last_sign_in_ip" + t.integer "failed_attempts", default: 0 + t.string "unlock_token" + t.datetime "locked_at", precision: nil + t.index ["encrypted_otp_secret_key"], name: "index_admin_users_on_encrypted_otp_secret_key", unique: true + t.index ["unlock_token"], name: "index_admin_users_on_unlock_token", unique: true + end + end +end diff --git a/db/schema.rb b/db/schema.rb index a2b94061b..e341b9157 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -14,35 +14,6 @@ ActiveRecord::Schema[7.0].define(version: 2022_05_23_150557) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" - create_table "admin_users", force: :cascade do |t| - t.string "email", default: "", null: false - t.string "encrypted_password", default: "", null: false - t.string "reset_password_token" - t.datetime "reset_password_sent_at", precision: nil - t.datetime "remember_created_at", precision: nil - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.integer "second_factor_attempts_count", default: 0 - t.string "encrypted_otp_secret_key" - t.string "encrypted_otp_secret_key_iv" - t.string "encrypted_otp_secret_key_salt" - t.string "direct_otp" - t.datetime "direct_otp_sent_at", precision: nil - t.datetime "totp_timestamp", precision: nil - t.string "phone" - t.string "name" - t.integer "sign_in_count", default: 0, null: false - t.datetime "current_sign_in_at", precision: nil - t.datetime "last_sign_in_at", precision: nil - t.string "current_sign_in_ip" - t.string "last_sign_in_ip" - t.integer "failed_attempts", default: 0 - t.string "unlock_token" - t.datetime "locked_at", precision: nil - t.index ["encrypted_otp_secret_key"], name: "index_admin_users_on_encrypted_otp_secret_key", unique: true - t.index ["unlock_token"], name: "index_admin_users_on_unlock_token", unique: true - end - create_table "case_logs", force: :cascade do |t| t.integer "status", default: 0 t.datetime "created_at", null: false