-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRegularGivingMandate.sql
More file actions
39 lines (37 loc) · 1.65 KB
/
RegularGivingMandate.sql
File metadata and controls
39 lines (37 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
-- Auto generated file, do not edit.
-- run ./matchbot matchbot:write-schema-files to update
-- Note that CHARSET and COLLATE details have been removed to allow sucessful comparisons between schemas
-- on dev machines and CircleCI. Do not use these files to create a database. They are provided for
-- information only.
CREATE TABLE `RegularGivingMandate` (
`id` int unsigned NOT NULL AUTO_INCREMENT,
`uuid` char(36) NOT NULL,
`campaignId` varchar(255) NOT NULL,
`charityId` varchar(255) NOT NULL,
`giftAid` tinyint(1) NOT NULL,
`salesforceLastPush` datetime DEFAULT NULL,
`salesforcePushStatus` varchar(255) NOT NULL,
`salesforceId` varchar(18) DEFAULT NULL,
`createdAt` datetime NOT NULL,
`updatedAt` datetime NOT NULL,
`personid` char(36) NOT NULL,
`donationAmount_amountInPence` bigint NOT NULL,
`donationAmount_currency` varchar(3) NOT NULL,
`dayOfMonth` smallint NOT NULL,
`activeFrom` datetime DEFAULT NULL,
`status` varchar(255) NOT NULL,
`donationsCreatedUpTo` datetime DEFAULT NULL,
`tbgComms` tinyint(1) NOT NULL,
`charityComms` tinyint(1) NOT NULL,
`isMatched` tinyint(1) NOT NULL,
`cancellationType` varchar(50) DEFAULT NULL,
`cancellationReason` varchar(500) DEFAULT NULL,
`cancelledAt` datetime DEFAULT NULL,
`paymentDateOffsetMonths` int NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `UNIQ_F638CA2BD17F50A6` (`uuid`),
UNIQUE KEY `UNIQ_F638CA2BD8961D21` (`salesforceId`),
UNIQUE KEY `person_id_if_active` (((case when (`status` in (_utf8mb4'active',_utf8mb4'pending')) then concat(`personid`,_utf8mb4':',`campaignId`) end))),
KEY `uuid` (`uuid`),
KEY `donationsCreatedUpTo` (`donationsCreatedUpTo`)
)