Skip to content

Commit 7a4a29c

Browse files
authored
Merge pull request #11761 from demarches-simplifiees/delete-instructeur-from-proconnect
Supprime la relation Instructeur <> ProConnectInformation
2 parents 8df2745 + bbd581e commit 7a4a29c

2 files changed

Lines changed: 18 additions & 4 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# frozen_string_literal: true
2+
3+
class RemoveInstructeurReferencesFromProConnectInformation < ActiveRecord::Migration[7.0]
4+
def up
5+
remove_index :agent_connect_informations, :instructeur_id if index_exists?(:agent_connect_informations, :instructeur_id)
6+
7+
remove_foreign_key :agent_connect_informations, :instructeurs if foreign_key_exists?(:agent_connect_informations, :instructeurs)
8+
9+
safety_assured { remove_column :agent_connect_informations, :instructeur_id }
10+
end
11+
12+
def down
13+
add_column :agent_connect_informations, :instructeur_id, :bigint
14+
add_index :agent_connect_informations, :instructeur_id
15+
add_foreign_key :agent_connect_informations, :instructeurs
16+
end
17+
end

db/schema.rb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#
1111
# It's strongly recommended that you check this file into your version control system.
1212

13-
ActiveRecord::Schema[7.1].define(version: 2025_06_04_104959) do
13+
ActiveRecord::Schema[7.1].define(version: 2025_06_12_115833) do
1414
# These are extensions that must be enabled in order to support this database
1515
enable_extension "pg_buffercache"
1616
enable_extension "pg_stat_statements"
@@ -100,15 +100,13 @@
100100
t.datetime "created_at", null: false
101101
t.string "email", null: false
102102
t.string "given_name"
103-
t.bigint "instructeur_id"
104103
t.string "organizational_unit"
105104
t.string "phone"
106105
t.string "siret"
107106
t.string "sub", null: false
108107
t.datetime "updated_at", null: false
109108
t.bigint "user_id"
110109
t.string "usual_name"
111-
t.index ["instructeur_id"], name: "index_agent_connect_informations_on_instructeur_id"
112110
t.index ["user_id", "sub"], name: "index_agent_connect_informations_on_user_id_and_sub", unique: true
113111
t.index ["user_id"], name: "index_agent_connect_informations_on_user_id"
114112
end
@@ -1381,7 +1379,6 @@
13811379
add_foreign_key "administrateurs_instructeurs", "instructeurs"
13821380
add_foreign_key "administrateurs_procedures", "administrateurs"
13831381
add_foreign_key "administrateurs_procedures", "procedures"
1384-
add_foreign_key "agent_connect_informations", "instructeurs"
13851382
add_foreign_key "agent_connect_informations", "users"
13861383
add_foreign_key "api_tokens", "administrateurs"
13871384
add_foreign_key "archives_groupe_instructeurs", "archives"

0 commit comments

Comments
 (0)