Church Cashbook
Data Schema Manual
Manual home Return to Church Cashbook

Table: roles

Role definitions used by RBAC.

Purpose

Describe why this table exists and what it stores.

Relationships

Columns

Column Definition
idint NOT NULL
codevarchar(50) COLLATE utf8mb4_unicode_ci NOT NULL
namevarchar(100) COLLATE utf8mb4_unicode_ci NOT NULL
scopeenum('global','deanery','church') COLLATE utf8mb4_unicode_ci NOT NULL
descriptiontext COLLATE utf8mb4_unicode_ci
created_attimestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
updated_attimestamp 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

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;