Skip to content

Instantly share code, notes, and snippets.

@rruhlen
Created February 21, 2013 22:29
Show Gist options
  • Save rruhlen/5008964 to your computer and use it in GitHub Desktop.
Save rruhlen/5008964 to your computer and use it in GitHub Desktop.
SQL commands to Create Temporary MySQL tables.
1. Create Table to Import Users
CREATE TABLE `zd_users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`zd_id` int(11) DEFAULT NULL,
`desk_id` int(11) DEFAULT NULL,
`name` varchar(255) DEFAULT NULL,
`email` varchar(255) DEFAULT NULL,
`role` varchar(255) DEFAULT NULL,
`phone` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `unique_email_index` (`email`),
UNIQUE KEY `unique_zd_id_index` (`zd_id`)
) ENGINE=InnoDB AUTO_INCREMENT=816 DEFAULT CHARSET=utf8;
2. Create Table to Import Tickets
CREATE TABLE `zd_tickets` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`zd_id` int(11) DEFAULT NULL,
`desk_id` int(11) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`tags` varchar(255) DEFAULT NULL,
`subject` varchar(255) DEFAULT NULL,
`group_id` int(8) DEFAULT NULL,
`status_id` int(4) DEFAULT NULL,
`listing_status` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `unique_zd_id_index` (`zd_id`)
) ENGINE=InnoDB AUTO_INCREMENT=813 DEFAULT CHARSET=utf8;
3. Create Table to Import Comments
CREATE TABLE `zd_comments` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`zd_ticket_id` int(11),
`zd_user_id` int(11),
`desk_id` int(11),
`created_at` datetime DEFAULT NULL,
`body` mediumblob,
`public` tinyint(1) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=813 DEFAULT CHARSET=utf8;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment