/
wax_boy
/
semaphore_custom
Обзор
Документация
Войти
/
wax_boy
/
semaphore_custom
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
develop
db/sql/migrations/v2.17.1.sql
23 строки
837 B
Denis Gukov
refactor(roles): make slug to primary key
08 окт 2025, 18:26
Не верифицирован
08 окт 2025, 18:26
544037a
Код
Авторство
О чём код?
create table role ( `slug` varchar(100) primary key not null, `name` varchar(100) not null, `permissions` bigint not null default 0, `project_id` int, foreign key (`project_id`) references project (`id`) on delete cascade ); create table project__template_role ( `id` integer primary key autoincrement, `template_id` int not null, `role_slug` varchar(100) not null, `project_id` int not null, `permissions` bigint not null default 0, foreign key (`template_id`) references project__template (`id`) on delete cascade, foreign key (`role_slug`) references role (`slug`) on delete cascade, foreign key (`project_id`) references project (`id`) on delete cascade, unique (`template_id`, `role_slug`) );