-
Notifications
You must be signed in to change notification settings - Fork 195
/
banking.sql
22 lines (21 loc) · 1012 Bytes
/
banking.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
CREATE TABLE IF NOT EXISTS `bank_accounts` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`citizenid` varchar(11) DEFAULT NULL,
`account_name` varchar(50) DEFAULT NULL,
`account_balance` int(11) NOT NULL DEFAULT 0,
`account_type` enum('shared','job','gang') NOT NULL,
`users` longtext DEFAULT '[]',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `account_name` (`account_name`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `bank_statements` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`citizenid` varchar(11) DEFAULT NULL,
`account_name` varchar(50) DEFAULT 'checking',
`amount` int(11) DEFAULT NULL,
`reason` varchar(50) DEFAULT NULL,
`statement_type` enum('deposit','withdraw') DEFAULT NULL,
`date` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`id`) USING BTREE,
KEY `citizenid` (`citizenid`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;