Files
khb_microservices/packages/khb_common/migrations/083_acc_invoices_admin.sql
Yuri Yaryshev b878aa72bb
All checks were successful
ci / test (push) Successful in 55s
ci / deploy (push) Successful in 3m13s
acc_invoices: роль admin и переключатель роли CFO/accountant/employee; Keycloak: фирменный стиль KH Build
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-12-04 14:36:45 +03:00

7 lines
496 B
SQL

-- acc_invoices: роль admin (отладка и тестирование: может переключаться между CFO, accountant и employee)
alter table user_roles drop constraint if exists user_roles_role_check;
alter table user_roles add constraint user_roles_role_check check (role in ('accountant', 'cfo', 'admin'));
insert into user_roles (person_id, role)
select id, 'admin' from person where lower(email) in ('yuri@khbuild.pro', 'dmitry@khbuild.pro')
on conflict do nothing;