feat(assign_tos): add manager column to assign_tos table. Same idea as administrateur_procedures.manager which flag a link between procedure/administrateur coming from a SuperAdmin [target: able to avoid SuperAdmin sec issues]
This commit is contained in:
parent
33000466a5
commit
f0a4cbb61e
4 changed files with 18 additions and 0 deletions
|
@ -6,6 +6,7 @@
|
|||
# daily_email_notifications_enabled :boolean default(FALSE), not null
|
||||
# instant_email_dossier_notifications_enabled :boolean default(FALSE), not null
|
||||
# instant_email_message_notifications_enabled :boolean default(FALSE), not null
|
||||
# manager :boolean default(TRUE)
|
||||
# weekly_email_notifications_enabled :boolean default(TRUE), not null
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
|
|
6
db/migrate/20220712141913_add_manager_to_assign_tos.rb
Normal file
6
db/migrate/20220712141913_add_manager_to_assign_tos.rb
Normal file
|
@ -0,0 +1,6 @@
|
|||
class AddManagerToAssignTos < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
add_column :assign_tos, :manager, :boolean
|
||||
change_column_default :assign_tos, :manager, default: false
|
||||
end
|
||||
end
|
10
db/migrate/20220712141945_backfill_assign_tos_manager.rb
Normal file
10
db/migrate/20220712141945_backfill_assign_tos_manager.rb
Normal file
|
@ -0,0 +1,10 @@
|
|||
class BackfillAssignTosManager < ActiveRecord::Migration[6.1]
|
||||
disable_ddl_transaction!
|
||||
|
||||
def change
|
||||
AssignTo.in_batches do |relation|
|
||||
relation.update_all manager: false
|
||||
sleep(0.01)
|
||||
end
|
||||
end
|
||||
end
|
|
@ -112,6 +112,7 @@ ActiveRecord::Schema.define(version: 2022_07_28_084804) do
|
|||
t.boolean "instant_email_dossier_notifications_enabled", default: false, null: false
|
||||
t.boolean "instant_email_message_notifications_enabled", default: false, null: false
|
||||
t.integer "instructeur_id"
|
||||
t.boolean "manager", default: true
|
||||
t.datetime "updated_at"
|
||||
t.boolean "weekly_email_notifications_enabled", default: true, null: false
|
||||
t.index ["groupe_instructeur_id", "instructeur_id"], name: "unique_couple_groupe_instructeur_instructeur", unique: true
|
||||
|
|
Loading…
Reference in a new issue