chore(db): remove unused columns

This commit is contained in:
Paul Chavard 2023-01-17 10:46:05 +01:00
parent 30899803ae
commit dad393355b
41 changed files with 15 additions and 50 deletions

View file

@ -3,14 +3,11 @@
# Table name: administrateurs
#
# id :integer not null, primary key
# encrypted_token :string
# created_at :datetime
# updated_at :datetime
# user_id :bigint not null
#
class Administrateur < ApplicationRecord
self.ignored_columns = [:active, :encrypted_token]
UNUSED_ADMIN_THRESHOLD = 6.months
has_and_belongs_to_many :instructeurs

View file

@ -8,7 +8,6 @@
# prefilled :boolean default(FALSE)
# private :boolean default(FALSE), not null
# rebased_at :datetime
# row :integer
# type :string
# value :string
# value_json :jsonb
@ -22,7 +21,6 @@
# type_de_champ_id :integer
#
class Champ < ApplicationRecord
self.ignored_columns = [:row]
belongs_to :dossier, inverse_of: false, touch: true, optional: false
belongs_to :type_de_champ, inverse_of: :champ, optional: false
belongs_to :parent, class_name: 'Champ', optional: true

View file

@ -8,7 +8,6 @@
# prefilled :boolean default(FALSE)
# private :boolean default(FALSE), not null
# rebased_at :datetime
# row :integer
# type :string
# value :string
# value_json :jsonb

View file

@ -8,7 +8,6 @@
# prefilled :boolean default(FALSE)
# private :boolean default(FALSE), not null
# rebased_at :datetime
# row :integer
# type :string
# value :string
# value_json :jsonb

View file

@ -8,7 +8,6 @@
# prefilled :boolean default(FALSE)
# private :boolean default(FALSE), not null
# rebased_at :datetime
# row :integer
# type :string
# value :string
# value_json :jsonb

View file

@ -8,7 +8,6 @@
# prefilled :boolean default(FALSE)
# private :boolean default(FALSE), not null
# rebased_at :datetime
# row :integer
# type :string
# value :string
# value_json :jsonb

View file

@ -8,7 +8,6 @@
# prefilled :boolean default(FALSE)
# private :boolean default(FALSE), not null
# rebased_at :datetime
# row :integer
# type :string
# value :string
# value_json :jsonb

View file

@ -8,7 +8,6 @@
# prefilled :boolean default(FALSE)
# private :boolean default(FALSE), not null
# rebased_at :datetime
# row :integer
# type :string
# value :string
# value_json :jsonb

View file

@ -8,7 +8,6 @@
# prefilled :boolean default(FALSE)
# private :boolean default(FALSE), not null
# rebased_at :datetime
# row :integer
# type :string
# value :string
# value_json :jsonb

View file

@ -8,7 +8,6 @@
# prefilled :boolean default(FALSE)
# private :boolean default(FALSE), not null
# rebased_at :datetime
# row :integer
# type :string
# value :string
# value_json :jsonb

View file

@ -8,7 +8,6 @@
# prefilled :boolean default(FALSE)
# private :boolean default(FALSE), not null
# rebased_at :datetime
# row :integer
# type :string
# value :string
# value_json :jsonb

View file

@ -8,7 +8,6 @@
# prefilled :boolean default(FALSE)
# private :boolean default(FALSE), not null
# rebased_at :datetime
# row :integer
# type :string
# value :string
# value_json :jsonb

View file

@ -8,7 +8,6 @@
# prefilled :boolean default(FALSE)
# private :boolean default(FALSE), not null
# rebased_at :datetime
# row :integer
# type :string
# value :string
# value_json :jsonb

View file

@ -8,7 +8,6 @@
# prefilled :boolean default(FALSE)
# private :boolean default(FALSE), not null
# rebased_at :datetime
# row :integer
# type :string
# value :string
# value_json :jsonb

View file

@ -8,7 +8,6 @@
# prefilled :boolean default(FALSE)
# private :boolean default(FALSE), not null
# rebased_at :datetime
# row :integer
# type :string
# value :string
# value_json :jsonb

View file

@ -8,7 +8,6 @@
# prefilled :boolean default(FALSE)
# private :boolean default(FALSE), not null
# rebased_at :datetime
# row :integer
# type :string
# value :string
# value_json :jsonb

View file

@ -8,7 +8,6 @@
# prefilled :boolean default(FALSE)
# private :boolean default(FALSE), not null
# rebased_at :datetime
# row :integer
# type :string
# value :string
# value_json :jsonb

View file

@ -8,7 +8,6 @@
# prefilled :boolean default(FALSE)
# private :boolean default(FALSE), not null
# rebased_at :datetime
# row :integer
# type :string
# value :string
# value_json :jsonb

View file

@ -8,7 +8,6 @@
# prefilled :boolean default(FALSE)
# private :boolean default(FALSE), not null
# rebased_at :datetime
# row :integer
# type :string
# value :string
# value_json :jsonb

View file

@ -8,7 +8,6 @@
# prefilled :boolean default(FALSE)
# private :boolean default(FALSE), not null
# rebased_at :datetime
# row :integer
# type :string
# value :string
# value_json :jsonb

View file

@ -8,7 +8,6 @@
# prefilled :boolean default(FALSE)
# private :boolean default(FALSE), not null
# rebased_at :datetime
# row :integer
# type :string
# value :string
# value_json :jsonb

View file

@ -8,7 +8,6 @@
# prefilled :boolean default(FALSE)
# private :boolean default(FALSE), not null
# rebased_at :datetime
# row :integer
# type :string
# value :string
# value_json :jsonb

View file

@ -8,7 +8,6 @@
# prefilled :boolean default(FALSE)
# private :boolean default(FALSE), not null
# rebased_at :datetime
# row :integer
# type :string
# value :string
# value_json :jsonb

View file

@ -8,7 +8,6 @@
# prefilled :boolean default(FALSE)
# private :boolean default(FALSE), not null
# rebased_at :datetime
# row :integer
# type :string
# value :string
# value_json :jsonb

View file

@ -8,7 +8,6 @@
# prefilled :boolean default(FALSE)
# private :boolean default(FALSE), not null
# rebased_at :datetime
# row :integer
# type :string
# value :string
# value_json :jsonb

View file

@ -8,7 +8,6 @@
# prefilled :boolean default(FALSE)
# private :boolean default(FALSE), not null
# rebased_at :datetime
# row :integer
# type :string
# value :string
# value_json :jsonb

View file

@ -8,7 +8,6 @@
# prefilled :boolean default(FALSE)
# private :boolean default(FALSE), not null
# rebased_at :datetime
# row :integer
# type :string
# value :string
# value_json :jsonb

View file

@ -8,7 +8,6 @@
# prefilled :boolean default(FALSE)
# private :boolean default(FALSE), not null
# rebased_at :datetime
# row :integer
# type :string
# value :string
# value_json :jsonb

View file

@ -8,7 +8,6 @@
# prefilled :boolean default(FALSE)
# private :boolean default(FALSE), not null
# rebased_at :datetime
# row :integer
# type :string
# value :string
# value_json :jsonb

View file

@ -8,7 +8,6 @@
# prefilled :boolean default(FALSE)
# private :boolean default(FALSE), not null
# rebased_at :datetime
# row :integer
# type :string
# value :string
# value_json :jsonb

View file

@ -8,7 +8,6 @@
# prefilled :boolean default(FALSE)
# private :boolean default(FALSE), not null
# rebased_at :datetime
# row :integer
# type :string
# value :string
# value_json :jsonb

View file

@ -8,7 +8,6 @@
# prefilled :boolean default(FALSE)
# private :boolean default(FALSE), not null
# rebased_at :datetime
# row :integer
# type :string
# value :string
# value_json :jsonb

View file

@ -8,7 +8,6 @@
# prefilled :boolean default(FALSE)
# private :boolean default(FALSE), not null
# rebased_at :datetime
# row :integer
# type :string
# value :string
# value_json :jsonb

View file

@ -8,7 +8,6 @@
# prefilled :boolean default(FALSE)
# private :boolean default(FALSE), not null
# rebased_at :datetime
# row :integer
# type :string
# value :string
# value_json :jsonb

View file

@ -8,7 +8,6 @@
# prefilled :boolean default(FALSE)
# private :boolean default(FALSE), not null
# rebased_at :datetime
# row :integer
# type :string
# value :string
# value_json :jsonb

View file

@ -8,7 +8,6 @@
# prefilled :boolean default(FALSE)
# private :boolean default(FALSE), not null
# rebased_at :datetime
# row :integer
# type :string
# value :string
# value_json :jsonb

View file

@ -8,7 +8,6 @@
# prefilled :boolean default(FALSE)
# private :boolean default(FALSE), not null
# rebased_at :datetime
# row :integer
# type :string
# value :string
# value_json :jsonb

View file

@ -8,7 +8,6 @@
# prefilled :boolean default(FALSE)
# private :boolean default(FALSE), not null
# rebased_at :datetime
# row :integer
# type :string
# value :string
# value_json :jsonb

View file

@ -0,0 +1,5 @@
class RemoveRowFromChamps < ActiveRecord::Migration[6.1]
def change
safety_assured { remove_columns :champs, :row }
end
end

View file

@ -0,0 +1,5 @@
class RemoveEncryptedTokenAndActiveFromAdministrateurs < ActiveRecord::Migration[6.1]
def change
safety_assured { remove_columns :administrateurs, :encrypted_token, :active }
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: 2023_01_11_094621) do
ActiveRecord::Schema.define(version: 2023_01_17_094317) do
# These are extensions that must be enabled in order to support this database
enable_extension "pgcrypto"
@ -60,9 +60,7 @@ ActiveRecord::Schema.define(version: 2023_01_11_094621) do
end
create_table "administrateurs", id: :serial, force: :cascade do |t|
t.boolean "active", default: false
t.datetime "created_at"
t.string "encrypted_token"
t.datetime "updated_at"
t.bigint "user_id", null: false
t.index ["user_id"], name: "index_administrateurs_on_user_id"
@ -226,7 +224,6 @@ ActiveRecord::Schema.define(version: 2023_01_11_094621) do
t.boolean "prefilled"
t.boolean "private", default: false, null: false
t.datetime "rebased_at"
t.integer "row"
t.string "row_id"
t.string "type"
t.integer "type_de_champ_id", null: false
@ -237,7 +234,6 @@ ActiveRecord::Schema.define(version: 2023_01_11_094621) do
t.index ["etablissement_id"], name: "index_champs_on_etablissement_id"
t.index ["parent_id"], name: "index_champs_on_parent_id"
t.index ["private"], name: "index_champs_on_private"
t.index ["row"], name: "index_champs_on_row"
t.index ["row_id"], name: "index_champs_on_row_id"
t.index ["type"], name: "index_champs_on_type"
t.index ["type_de_champ_id", "dossier_id", "row_id"], name: "index_champs_on_type_de_champ_id_and_dossier_id_and_row_id", unique: true