Oh hell. You’ll be disappointed to know that I’ve never done that and I’m not entirely sure this is what you mean, but here she is… note: this is all dummy data…
--
-- Table structure for table `contacts`
--
CREATE TABLE `contacts` (
`id` int(10) UNSIGNED NOT NULL,
`created_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`user_id` int(11) NOT NULL,
`email` varchar(60) DEFAULT NULL,
`first_name` varchar(60) NOT NULL,
`last_name` varchar(60) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `contacts`
--
INSERT INTO `contacts` (`id`, `created_on`, `user_id`, `email`, `first_name`, `last_name`) VALUES
(2712, '2019-08-05 17:40:39', 0, '[email protected]', 'Chris', ''),
(2713, '2019-08-05 17:57:12', 0, '[email protected]', 'Gary', ''),
(2714, '2019-08-05 19:09:59', 0, '[email protected]', 'Chris', 'Falk'),
(2715, '2019-08-05 20:09:50', 0, '[email protected]', 'tom', ''),
(2719, '2019-08-05 21:22:27', 0, '[email protected]', 'Tom', 'River'),
(2720, '2019-08-05 21:29:10', 0, '[email protected]', 'Zod', ''),
(2721, '2019-08-05 21:32:44', 0, '[email protected]', 'James', 'Butt'),
(2722, '2019-08-05 21:32:44', 0, '[email protected]', 'Josephine', 'Darakjy'),
(2723, '2019-08-05 21:32:44', 0, '[email protected]', 'Art', 'Venere'),
(2724, '2019-08-05 21:32:44', 0, '[email protected]', 'Lenna', 'Paprocki'),
(2725, '2019-08-05 21:32:44', 0, '[email protected]', 'Donette', 'Foller'),
(2726, '2019-08-05 21:32:44', 0, '[email protected]', 'Simona', 'Morasca'),
(2727, '2019-08-05 21:32:44', 0, '[email protected]', 'Mitsue', 'Tollner'),
(2741, '2019-08-05 21:32:44', 0, '[email protected]', 'Bette', 'Nicka'),
(2742, '2019-08-05 21:32:44', 0, '[email protected]', 'Veronika', 'Inouye'),
(2743, '2019-08-05 21:32:44', 0, '[email protected]', 'Willard', 'Kolmetz'),
(2744, '2019-08-05 21:32:44', 0, '[email protected]', 'Maryann', 'Royster'),
-- --------------------------------------------------------
--
-- Table structure for table `tags`
--
CREATE TABLE `tags` (
`id` int(10) UNSIGNED NOT NULL,
`user_id` int(11) NOT NULL,
`created_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`name` varchar(60) NOT NULL DEFAULT ''
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `tags`
--
INSERT INTO `tags` (`id`, `user_id`, `created_on`, `name`) VALUES
(17, 6, '2019-08-19 19:40:38', 'Democrats'),
(19, 6, '2019-08-19 19:41:43', 'Republicans'),
(27, 0, '2019-08-19 19:51:10', 'Wonderful People'),
(28, 0, '2019-08-19 20:24:43', 'Boiling Springs'),
(29, 0, '2019-08-19 20:24:53', 'Mechanicsburg');
-- --------------------------------------------------------
--
-- Table structure for table `tags_contacts`
--
CREATE TABLE `tags_contacts` (
`contact_id` int(11) NOT NULL,
`tag_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` int(11) NOT NULL,
`created_on` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`username` varchar(50) NOT NULL,
`password` varchar(60) NOT NULL,
`email` varchar(60) DEFAULT NULL,
`company_name` varchar(60) DEFAULT NULL,
`address` varchar(60) DEFAULT NULL,
`state` varchar(60) DEFAULT NULL,
`city` varchar(60) DEFAULT NULL,
`zip_code` varchar(20) DEFAULT NULL,
`time_zone` varchar(60) DEFAULT NULL,
`first_name` varchar(60) DEFAULT NULL,
`last_name` varchar(60) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `created_on`, `username`, `password`, `email`, `company_name`, `address`, `state`, `city`, `zip_code`, `time_zone`, `first_name`, `last_name`) VALUES
(0, '2019-06-05 16:40:43', 'thewebprojects', '$2y$10$fKe5GtZtjsfFnz5NSsD.iOaifme6BFSP2l8EZm6YpO8qHHNKYbjUK', '[email protected]', 'theWebProjects', '589 W 1st Street', 'PA', 'Boiling Springs', '17007', 'America/New_York', 'Christoper', 'Falkenstein'),
(6, '2019-08-14 17:14:24', 'sendsible', '$2y$10$2DcqgT16FiBkTJFNfqX9E.jUUlYzBQe3XYqGFUYUk.SoP6fJFSR86', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `contacts`
--
ALTER TABLE `contacts`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `idx` (`user_id`,`email`);
--
-- Indexes for table `tags`
--
ALTER TABLE `tags`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `user_id_2` (`user_id`,`name`),
ADD KEY `user_id` (`user_id`);
--
-- Indexes for table `tags_contacts`
--
ALTER TABLE `tags_contacts`
ADD UNIQUE KEY `u_idx` (`contact_id`,`tag_id`),
ADD UNIQUE KEY `contact_id` (`contact_id`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `username` (`username`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `contacts`
--
ALTER TABLE `contacts`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4239;
--
-- AUTO_INCREMENT for table `tags`
--
ALTER TABLE `tags`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=31;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `contacts`
--
ALTER TABLE `contacts`
ADD CONSTRAINT `contacts_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);
--
-- Constraints for table `tags`
--
ALTER TABLE `tags`
ADD CONSTRAINT `user_id_fk` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;