|
|
-
- -- use DeliveryTakingSystem;
-
- CREATE TABLE `user` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `username` varchar(20) DEFAULT NULL,
- `password` varchar(20) DEFAULT NULL,
- `phone` varchar(20) DEFAULT NULL,
- PRIMARY KEY (`id`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-
-
- CREATE TABLE `order` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `description` text,
- `when` datetime DEFAULT NULL,
- `location` text,
- `senderId` int(11) DEFAULT NULL,
- `receiverId` int(11) DEFAULT NULL,
- `price` int(11) DEFAULT NULL,
- `status` varchar(20) DEFAULT NULL,
- `comment` text,
- `timestamp` datetime DEFAULT NULL,
- PRIMARY KEY (`id`),
- KEY `fk_senderId` (`senderId`),
- CONSTRAINT `fk_senderId` FOREIGN KEY (`senderId`) REFERENCES `user` (`id`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|