-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDonation.sql
More file actions
81 lines (79 loc) · 3.67 KB
/
Donation.sql
File metadata and controls
81 lines (79 loc) · 3.67 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
-- 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 `Donation` (
`id` int unsigned NOT NULL AUTO_INCREMENT,
`campaign_id` int unsigned NOT NULL,
`uuid` char(36) NOT NULL,
`transactionId` varchar(255) DEFAULT NULL,
`amount` decimal(18,2) NOT NULL,
`donationStatus` varchar(255) NOT NULL,
`charityComms` tinyint(1) DEFAULT NULL,
`giftAid` tinyint(1) NOT NULL,
`tbgComms` tinyint(1) DEFAULT NULL,
`donorCountryCode` varchar(2) DEFAULT NULL,
`donorEmailAddress` varchar(255) DEFAULT NULL,
`donorFirstName` varchar(255) DEFAULT NULL,
`donorLastName` varchar(255) DEFAULT NULL,
`donorPostalAddress` varchar(255) DEFAULT NULL,
`salesforceLastPush` datetime DEFAULT NULL,
`salesforcePushStatus` varchar(255) NOT NULL,
`salesforceId` varchar(18) DEFAULT NULL,
`createdAt` datetime NOT NULL,
`updatedAt` datetime NOT NULL,
`tipAmount` decimal(18,2) NOT NULL,
`psp` varchar(20) NOT NULL,
`donorHomeAddressLine1` varchar(255) DEFAULT NULL,
`donorHomePostcode` varchar(255) DEFAULT NULL,
`tipGiftAid` tinyint(1) DEFAULT NULL,
`chargeId` varchar(255) DEFAULT NULL,
`championComms` tinyint(1) DEFAULT NULL,
`charityFee` decimal(18,2) NOT NULL,
`charityFeeVat` decimal(18,2) NOT NULL,
`originalPspFee` decimal(18,2) NOT NULL,
`currencyCode` varchar(3) NOT NULL,
`collectedAt` datetime DEFAULT NULL,
`refundedAt` datetime DEFAULT NULL,
`tbgShouldProcessGiftAid` tinyint(1) DEFAULT NULL,
`tbgGiftAidRequestQueuedAt` datetime DEFAULT NULL,
`tbgGiftAidRequestFailedAt` datetime DEFAULT NULL,
`transferId` varchar(255) DEFAULT NULL,
`tbgGiftAidRequestConfirmedCompleteAt` datetime DEFAULT NULL,
`tbgGiftAidRequestCorrelationId` varchar(255) DEFAULT NULL,
`tbgGiftAidResponseDetail` text,
`pspCustomerId` varchar(255) DEFAULT NULL,
`paymentMethodType` varchar(255) DEFAULT NULL,
`totalPaidByDonor` decimal(18,2) DEFAULT NULL,
`preAuthorizationDate` datetime DEFAULT NULL,
`mandate_id` int unsigned DEFAULT NULL,
`mandateSequenceNumber` int DEFAULT NULL,
`tipRefundAmount` decimal(18,2) DEFAULT NULL,
`giftAidRemovedAt` datetime DEFAULT NULL,
`donorUUID` char(36) DEFAULT NULL,
`stripePayoutId` varchar(255) DEFAULT NULL,
`paidOutAt` datetime DEFAULT NULL,
`payoutSuccessful` tinyint(1) DEFAULT NULL,
`paymentCard_brand` varchar(255) DEFAULT NULL,
`paymentCard_country` varchar(255) DEFAULT NULL,
`expectedMatchAmount_amountInPence` bigint NOT NULL,
`expectedMatchAmount_currency` varchar(3) NOT NULL,
`ryftPaymentSessionId` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `UNIQ_C893E3F6D17F50A6` (`uuid`),
UNIQUE KEY `UNIQ_C893E3F6C2F43114` (`transactionId`),
UNIQUE KEY `UNIQ_C893E3F6D8961D21` (`salesforceId`),
UNIQUE KEY `UNIQ_C893E3F6402C829F` (`chargeId`),
UNIQUE KEY `UNIQ_C893E3F6AE9826DA` (`transferId`),
UNIQUE KEY `UNIQ_C893E3F621F7BD156C1129CD` (`mandateSequenceNumber`,`mandate_id`),
KEY `IDX_C893E3F6F639F774` (`campaign_id`),
KEY `date_and_status` (`createdAt`,`donationStatus`),
KEY `salesforcePushStatus` (`salesforcePushStatus`),
KEY `campaign_and_status` (`campaign_id`,`donationStatus`),
KEY `updated_date_and_status` (`updatedAt`,`donationStatus`),
KEY `pspCustomerId` (`pspCustomerId`),
KEY `IDX_C893E3F66C1129CD` (`mandate_id`),
CONSTRAINT `FK_C893E3F66C1129CD` FOREIGN KEY (`mandate_id`) REFERENCES `RegularGivingMandate` (`id`),
CONSTRAINT `FK_C893E3F6F639F774` FOREIGN KEY (`campaign_id`) REFERENCES `Campaign` (`id`)
)