Skip to content

Instantly share code, notes, and snippets.

@viettranx
Last active July 13, 2023 13:49
Show Gist options
  • Save viettranx/b0a22a0a869309fc9c64fd820b1d0f29 to your computer and use it in GitHub Desktop.
Save viettranx/b0a22a0a869309fc9c64fd820b1d0f29 to your computer and use it in GitHub Desktop.
CREATE TABLE `restaurants` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`owner_id` int(11) NULL,
`name` varchar(50) NOT NULL,
`addr` varchar(255) NOT NULL,
`city_id` int(11) DEFAULT NULL,
`lat` double DEFAULT NULL,
`lng` double DEFAULT NULL,
`cover` json NULL,
`logo` json NULL,
`shipping_fee_per_km` double DEFAULT '0',
`status` int(11) NOT NULL DEFAULT '1',
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `owner_id` (`owner_id`) USING BTREE,
KEY `city_id` (`city_id`) USING BTREE,
KEY `status` (`status`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment