Remove unused columns
This commit is contained in:
parent
3ac4a1b339
commit
371d612fdb
5 changed files with 16 additions and 16 deletions
|
@ -14,6 +14,8 @@
|
||||||
# procedure_id :integer
|
# procedure_id :integer
|
||||||
#
|
#
|
||||||
class AssignTo < ApplicationRecord
|
class AssignTo < ApplicationRecord
|
||||||
|
self.ignored_columns = [:procedure_id]
|
||||||
|
|
||||||
belongs_to :instructeur, optional: false
|
belongs_to :instructeur, optional: false
|
||||||
belongs_to :groupe_instructeur, optional: false
|
belongs_to :groupe_instructeur, optional: false
|
||||||
has_one :procedure_presentation, dependent: :destroy
|
has_one :procedure_presentation, dependent: :destroy
|
||||||
|
|
|
@ -9,13 +9,11 @@
|
||||||
# email :string
|
# email :string
|
||||||
# introduction :text
|
# introduction :text
|
||||||
# revoked_at :datetime
|
# revoked_at :datetime
|
||||||
# tmp_expert_migrated :boolean default(FALSE)
|
|
||||||
# created_at :datetime not null
|
# created_at :datetime not null
|
||||||
# updated_at :datetime not null
|
# updated_at :datetime not null
|
||||||
# claimant_id :integer not null
|
# claimant_id :integer not null
|
||||||
# dossier_id :integer
|
# dossier_id :integer
|
||||||
# experts_procedure_id :bigint
|
# experts_procedure_id :bigint
|
||||||
# instructeur_id :integer
|
|
||||||
#
|
#
|
||||||
class Avis < ApplicationRecord
|
class Avis < ApplicationRecord
|
||||||
include EmailSanitizableConcern
|
include EmailSanitizableConcern
|
||||||
|
|
|
@ -489,8 +489,7 @@ class Dossier < ApplicationRecord
|
||||||
else
|
else
|
||||||
avis
|
avis
|
||||||
.where(confidentiel: false)
|
.where(confidentiel: false)
|
||||||
.or(avis.where(claimant_id: instructeur.id, claimant_type: 'Instructeur'))
|
.or(avis.where(claimant: instructeur))
|
||||||
.or(avis.where(instructeur: instructeur))
|
|
||||||
.order(created_at: :asc)
|
.order(created_at: :asc)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -499,11 +498,9 @@ class Dossier < ApplicationRecord
|
||||||
if expert.dossiers.include?(self)
|
if expert.dossiers.include?(self)
|
||||||
avis.order(created_at: :asc)
|
avis.order(created_at: :asc)
|
||||||
else
|
else
|
||||||
instructeur = expert.user.instructeur.id if expert.user.instructeur
|
|
||||||
avis
|
avis
|
||||||
.where(confidentiel: false)
|
.where(confidentiel: false)
|
||||||
.or(avis.where(claimant_id: expert.id, claimant_type: 'Expert', tmp_expert_migrated: true))
|
.or(avis.where(claimant: expert))
|
||||||
.or(avis.where(claimant_id: instructeur, claimant_type: 'Instructeur', tmp_expert_migrated: false))
|
|
||||||
.order(created_at: :asc)
|
.order(created_at: :asc)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
11
db/migrate/20210407174523_drop_unused_columns.rb
Normal file
11
db/migrate/20210407174523_drop_unused_columns.rb
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
class DropUnusedColumns < ActiveRecord::Migration[6.1]
|
||||||
|
def change
|
||||||
|
remove_column :avis, :instructeur_id
|
||||||
|
remove_column :avis, :tmp_expert_migrated
|
||||||
|
remove_column :etablissements, :entreprise_id
|
||||||
|
remove_column :procedures, :archived_at
|
||||||
|
remove_column :procedures, :csv_export_queued
|
||||||
|
remove_column :procedures, :xlsx_export_queued
|
||||||
|
remove_column :procedures, :ods_export_queued
|
||||||
|
end
|
||||||
|
end
|
10
db/schema.rb
10
db/schema.rb
|
@ -10,7 +10,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(version: 2021_04_02_163003) do
|
ActiveRecord::Schema.define(version: 2021_04_07_174523) do
|
||||||
|
|
||||||
# These are extensions that must be enabled in order to support this database
|
# These are extensions that must be enabled in order to support this database
|
||||||
enable_extension "plpgsql"
|
enable_extension "plpgsql"
|
||||||
|
@ -121,7 +121,6 @@ ActiveRecord::Schema.define(version: 2021_04_02_163003) do
|
||||||
t.string "email"
|
t.string "email"
|
||||||
t.text "introduction"
|
t.text "introduction"
|
||||||
t.text "answer"
|
t.text "answer"
|
||||||
t.integer "instructeur_id"
|
|
||||||
t.integer "dossier_id"
|
t.integer "dossier_id"
|
||||||
t.datetime "created_at", null: false
|
t.datetime "created_at", null: false
|
||||||
t.datetime "updated_at", null: false
|
t.datetime "updated_at", null: false
|
||||||
|
@ -130,11 +129,9 @@ ActiveRecord::Schema.define(version: 2021_04_02_163003) do
|
||||||
t.datetime "revoked_at"
|
t.datetime "revoked_at"
|
||||||
t.bigint "experts_procedure_id"
|
t.bigint "experts_procedure_id"
|
||||||
t.string "claimant_type"
|
t.string "claimant_type"
|
||||||
t.boolean "tmp_expert_migrated", default: false
|
|
||||||
t.index ["claimant_id"], name: "index_avis_on_claimant_id"
|
t.index ["claimant_id"], name: "index_avis_on_claimant_id"
|
||||||
t.index ["dossier_id"], name: "index_avis_on_dossier_id"
|
t.index ["dossier_id"], name: "index_avis_on_dossier_id"
|
||||||
t.index ["experts_procedure_id"], name: "index_avis_on_experts_procedure_id"
|
t.index ["experts_procedure_id"], name: "index_avis_on_experts_procedure_id"
|
||||||
t.index ["instructeur_id"], name: "index_avis_on_instructeur_id"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "bill_signatures", force: :cascade do |t|
|
create_table "bill_signatures", force: :cascade do |t|
|
||||||
|
@ -291,7 +288,6 @@ ActiveRecord::Schema.define(version: 2021_04_02_163003) do
|
||||||
t.string "localite"
|
t.string "localite"
|
||||||
t.string "code_insee_localite"
|
t.string "code_insee_localite"
|
||||||
t.integer "dossier_id"
|
t.integer "dossier_id"
|
||||||
t.integer "entreprise_id"
|
|
||||||
t.string "entreprise_siren"
|
t.string "entreprise_siren"
|
||||||
t.bigint "entreprise_capital_social"
|
t.bigint "entreprise_capital_social"
|
||||||
t.string "entreprise_numero_tva_intracommunautaire"
|
t.string "entreprise_numero_tva_intracommunautaire"
|
||||||
|
@ -532,7 +528,6 @@ ActiveRecord::Schema.define(version: 2021_04_02_163003) do
|
||||||
t.date "auto_archive_on"
|
t.date "auto_archive_on"
|
||||||
t.datetime "published_at"
|
t.datetime "published_at"
|
||||||
t.datetime "hidden_at"
|
t.datetime "hidden_at"
|
||||||
t.datetime "archived_at"
|
|
||||||
t.datetime "whitelisted_at"
|
t.datetime "whitelisted_at"
|
||||||
t.boolean "ask_birthday", default: false, null: false
|
t.boolean "ask_birthday", default: false, null: false
|
||||||
t.string "web_hook_url"
|
t.string "web_hook_url"
|
||||||
|
@ -550,9 +545,6 @@ ActiveRecord::Schema.define(version: 2021_04_02_163003) do
|
||||||
t.string "declarative_with_state"
|
t.string "declarative_with_state"
|
||||||
t.text "monavis_embed"
|
t.text "monavis_embed"
|
||||||
t.text "routing_criteria_name", default: "Votre ville"
|
t.text "routing_criteria_name", default: "Votre ville"
|
||||||
t.boolean "csv_export_queued"
|
|
||||||
t.boolean "xlsx_export_queued"
|
|
||||||
t.boolean "ods_export_queued"
|
|
||||||
t.datetime "closed_at"
|
t.datetime "closed_at"
|
||||||
t.datetime "unpublished_at"
|
t.datetime "unpublished_at"
|
||||||
t.bigint "canonical_procedure_id"
|
t.bigint "canonical_procedure_id"
|
||||||
|
|
Loading…
Reference in a new issue