-- custom.app_roles definition CREATE TABLE `app_roles` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `app_id` bigint(20) unsigned NOT NULL COMMENT 'id приложения (связь с таблицей magic_apps)', `app_role` text COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Роль в приложении', `app_title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Название роли на русском', `role_priority` smallint(6) NOT NULL COMMENT 'Приоритет роли', `role_access` text COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Кому доступна роль (зависит от драйвера в magic_apps)', PRIMARY KEY (`id`), KEY `app_roles_app_id_foreign` (`app_id`), CONSTRAINT `app_roles_app_id_foreign` FOREIGN KEY (`app_id`) REFERENCES `magic_apps` (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Ролевая модель приложений';