Church Cashbook
Data Schema Manual
Manual home Return to Church Cashbook

Table: gift_aid_church_settings

Per-church configuration used by Gift Aid reporting and HMRC claim outputs.

Purpose

Stores a single row of Gift Aid settings for each church. This includes charity identifiers and toggles used by the Gift Aid module (for example GASDS enablement).

Relationships

Columns

Indexes

Constraints

Operational notes / invariants

DDL

CREATE TABLE `gift_aid_church_settings` (
  `church_id` int UNSIGNED NOT NULL,
  `charity_name` varchar(255) DEFAULT NULL,
  `charity_number` varchar(80) DEFAULT NULL,
  `hmrc_ref` varchar(80) DEFAULT NULL,
  `gasds_enabled` tinyint(1) NOT NULL DEFAULT '1',
  `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

ALTER TABLE `gift_aid_church_settings`
  ADD PRIMARY KEY (`church_id`);

ALTER TABLE `gift_aid_church_settings`
  ADD CONSTRAINT `fk_ga_settings_church` FOREIGN KEY (`church_id`) REFERENCES `churches` (`id`) ON DELETE CASCADE;