Table: roles
Role definitions used by RBAC.
Purpose
Describe why this table exists and what it stores.
Relationships
- List foreign keys and key joins (if any).
Columns
| Column | Definition |
|---|---|
id | int NOT NULL |
code | varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL |
name | varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL |
scope | enum('global','deanery','church') COLLATE utf8mb4_unicode_ci NOT NULL |
description | text COLLATE utf8mb4_unicode_ci |
created_at | timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP |
updated_at | timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP |
Indexes
List primary key and secondary indexes (if any).
Constraints
List foreign keys and other constraints (if any).
Operational notes / invariants
- Rules such as “no deletes”, “append-only”, “unique per church/FY”, etc.
DDL
CREATE TABLE `roles` (
`id` int NOT NULL,
`code` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
`scope` enum('global','deanery','church') COLLATE utf8mb4_unicode_ci NOT NULL,
`description` text COLLATE utf8mb4_unicode_ci,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;