-
Notifications
You must be signed in to change notification settings - Fork 0
/
db.sql
22 lines (19 loc) · 797 Bytes
/
db.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
-- `process-engine`.customer definition
CREATE TABLE `process-engine`.`customer` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`profile_name` varchar(100) DEFAULT NULL,
`phone_number` varchar(100) NOT NULL,
`gender_opt` char(1) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- `process-engine`.flow definition
CREATE TABLE `process-engine`.`flow` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`customer_id` int(11) NOT NULL,
`start_date` datetime DEFAULT CURRENT_TIMESTAMP,
`end_date` datetime DEFAULT NULL,
`instance_id` varchar(100) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `flow_FK` (`customer_id`),
CONSTRAINT `flow_FK` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;