secret
Last active

  • Download Gist
gistfile1.sql
SQL
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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
mysql> show create table tickets\G
*************************** 1. row ***************************
Table: tickets
Create Table: CREATE TABLE `tickets` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`shop_id` int(11) NOT NULL DEFAULT '0',
`created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`resolved` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`),
KEY `fk_tickets_shop_id` (`shop_id`,`ticket_status`),
KEY `idx_tickets_created` (`created`),
KEY `idx_tickets_resolved` (`resolved`),
) ENGINE=MyISAM AUTO_INCREMENT=210368 DEFAULT CHARSET=utf8
1 row in set (0.00 sec)
 
mysql> show create table shifts\G
*************************** 1. row ***************************
Table: shifts
Create Table: CREATE TABLE `shifts` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(64) NOT NULL,
`shop_id` int(11) NOT NULL,
`updated_by` int(11) DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `shop_id_fk_idx` (`shop_id`),
KEY `updated_by_fk_idx` (`updated_by`)
) ENGINE=MyISAM AUTO_INCREMENT=349 DEFAULT CHARSET=utf8
1 row in set (0.02 sec)
 
mysql> show create table shifts_users\G
*************************** 1. row ***************************
Table: shifts_users
Create Table: CREATE TABLE `shifts_users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`shift_id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`shift_position_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `shift_id_fk_idx` (`shift_id`),
KEY `user_id_fk_idx` (`user_id`),
KEY `shift_position_id_fk_idx` (`shift_position_id`)
) ENGINE=MyISAM AUTO_INCREMENT=1809 DEFAULT CHARSET=utf8
1 row in set (0.00 sec)
 
mysql> show create table shift_positions\G
*************************** 1. row ***************************
Table: shift_positions
Create Table: CREATE TABLE `shift_positions` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(20) NOT NULL,
`level` smallint(6) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=utf8
1 row in set (0.03 sec)
 
mysql> show create table shift_times\G
*************************** 1. row ***************************
Table: shift_times
Create Table: CREATE TABLE `shift_times` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`shift_id` int(11) NOT NULL,
`start` time NOT NULL,
`end` time NOT NULL,
`dow` enum('1','2','3','4','5','6','7') NOT NULL,
PRIMARY KEY (`id`),
KEY `shift_id_fk_idx` (`shift_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3415 DEFAULT CHARSET=utf8

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.