-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtransaction.sql
More file actions
26 lines (24 loc) · 982 Bytes
/
transaction.sql
File metadata and controls
26 lines (24 loc) · 982 Bytes
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
CREATE SCHEMA IF NOT EXISTS `code_sample`;
USE `code_sample`;
CREATE TABLE `transaction` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`invoice` VARCHAR(127) NULL DEFAULT NULL,
`custom` VARCHAR(255) NULL DEFAULT NULL,
`txn_type` VARCHAR(55) NOT NULL,
`txn_id` INT NOT NULL,
`payer_id` VARCHAR(13) NOT NULL,
`currency` CHAR(3) NOT NULL,
`gross` DECIMAL(10,2) NOT NULL,
`fee` DECIMAL(10,2) NOT NULL,
`handling` DECIMAL(10,2) NULL DEFAULT NULL,
`shipping` DECIMAL(10,2) NULL DEFAULT NULL,
`tax` DECIMAL(10,2) NULL DEFAULT NULL,
`payment_status` VARCHAR(17) NULL DEFAULT NULL,
`pending_reason` VARCHAR(17) NULL DEFAULT NULL,
`reason_code` VARCHAR(31) NULL DEFAULT NULL,
PRIMARY KEY (`id`),
INDEX `payer` (`payer_id` ASC, `payment_status` ASC),
INDEX `txn` (`txn_id` ASC, `payment_status` ASC),
INDEX `custom` (`custom` ASC, `payment_status` ASC),
INDEX `invoice` (`invoice` ASC, `payment_status` ASC)
);