-- https://www.phpmyadmin.net/
--

START TRANSACTION;



--
-- Database: `contact_manager`
--

-- --------------------------------------------------------

--
-- Table structure for table `contacts`
--

CREATE TABLE `contacts` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `group_id` int(10) UNSIGNED NOT NULL DEFAULT 0,
  `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `company` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `phone` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `address` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `photo` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `facebook` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `twitter` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `googleplus` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `notes` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `customfields` varchar(255) COLLATE utf8_unicode_ci DEFAULT '[]',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `contacts`
--

INSERT INTO `contacts` (`id`, `group_id`, `name`, `company`, `email`, `phone`, `address`, `photo`, `facebook`, `twitter`, `googleplus`, `notes`, `customfields`, `created_at`, `updated_at`) VALUES
(24, 1, 'Miguel Quigley', 'Keeling-Batz', 'senger.hermann@yahoo.com', '504.563.6737 x47414', 'Silas Junctions 77778 Minervashire', NULL, NULL, NULL, NULL, NULL, '[]', '2019-07-29 17:58:28', '2019-07-29 17:58:28'),
(25, 2, 'Sidney Wehner', 'DuBuque PLC', 'glover.zelma@yahoo.com', '(920) 482-7674 x734', 'Windler Cape 92619 West Winfieldfurt', NULL, NULL, NULL, NULL, NULL, '[]', '2019-07-29 17:58:28', '2019-07-29 17:58:28'),
(26, 2, 'Dr. Lela Treutel V', 'Beatty and Sons', 'coconnell@herman.com', '1-454-988-3970 x3279', 'Wiley Estates 55913-7525 New Alda', NULL, NULL, NULL, NULL, NULL, '[]', '2019-07-29 17:58:28', '2019-07-29 17:58:28'),
(27, 3, 'Savion Gulgowski', 'Ward Inc', 'qfeest@yahoo.com', '(284) 443-5816 x782', 'Foster Cove 96408-5697 Hellerview', NULL, NULL, NULL, NULL, NULL, '[]', '2019-07-29 17:58:28', '2019-07-29 17:58:28'),
(28, 1, 'Nigel Reichel', 'Lowe-Keeling', 'zfriesen@nolan.com', '1-678-607-1784 x390', 'Brekke Light 89274-7849 West Susie', NULL, NULL, NULL, NULL, NULL, '[]', '2019-07-29 17:58:28', '2019-07-29 17:58:28'),
(30, 2, 'Lacey Wintheiser PhD', 'Mertz-DuBuque', 'bmueller@jacobson.com', '842-432-0502', 'Lesch Summit 96797-2817 Zulaufburgh', NULL, NULL, NULL, NULL, NULL, '[]', '2019-07-29 17:58:28', '2019-07-29 17:58:28'),
(31, 1, 'Miguel Quigley', 'Keeling-Batz', 'senger.hermann@yahoo.com', '504.563.6737 x47414', 'Silas Junctions 77778 Minervashire', NULL, NULL, NULL, NULL, NULL, '[]', '2019-07-29 17:58:28', '2019-07-29 17:58:28'),
(32, 2, 'Sidney Wehner', 'DuBuque PLC', 'glover.zelma@yahoo.com', '(920) 482-7674 x734', 'Windler Cape 92619 West Winfieldfurt', NULL, NULL, NULL, NULL, NULL, '[]', '2019-07-29 17:58:28', '2019-07-29 17:58:28'),
(33, 2, 'Dr. Lela Treutel V', 'Beatty and Sons', 'coconnell@herman.com', '1-454-988-3970 x3279', 'Wiley Estates 55913-7525 New Alda', NULL, NULL, NULL, NULL, NULL, '[]', '2019-07-29 17:58:28', '2019-07-29 17:58:28');

-- --------------------------------------------------------

--
-- Table structure for table `contact_tag`
--

CREATE TABLE `contact_tag` (
  `contact_id` bigint(20) UNSIGNED NOT NULL,
  `tag_id` bigint(20) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `groups`
--

CREATE TABLE `groups` (
  `id` int(10) UNSIGNED NOT NULL,
  `groupename` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `groups`
--

INSERT INTO `groups` (`id`, `groupename`, `created_at`, `updated_at`) VALUES
(1, 'Family', '2019-07-29 17:58:28', '2019-07-29 17:58:28'),
(2, 'Friends', '2019-07-29 17:58:28', '2019-07-29 17:58:28'),
(3, 'Clients', '2019-07-29 17:58:28', '2019-07-29 17:58:28');

-- --------------------------------------------------------

--
-- Table structure for table `migrations`
--

CREATE TABLE `migrations` (
  `id` int(10) UNSIGNED NOT NULL,
  `migration` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `batch` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `migrations`
--

INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '2014_10_12_000000_create_users_table', 1),
(2, '2014_10_12_100000_create_password_resets_table', 1),
(3, '2017_01_24_064105_create_groups_and_contacts_table', 1),
(4, '2017_07_29_153429_create_tags_table', 1),
(5, '2019_07_29_125628_create_roles_table', 1),
(6, '2019_07_29_125904_create_role_user_table', 1),
(8, '2014_10_00_000000_create_settings_table', 2),
(9, '2014_10_00_000001_add_group_column_on_settings_table', 3);

-- --------------------------------------------------------

--
-- Table structure for table `roles`
--

CREATE TABLE `roles` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `description` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `roles`
--

INSERT INTO `roles` (`id`, `name`, `description`, `created_at`, `updated_at`) VALUES
(1, 'Clerk', 'Data Entry right for basic CRUD operations', '2019-07-29 17:58:27', '2019-07-29 17:58:27'),
(2, 'User', 'Read only access to the data', '2019-07-29 17:58:27', '2019-07-29 17:58:27'),
(3, 'Admin', 'Admin right with Full Access to the system', '2019-07-29 17:58:27', '2019-07-29 17:58:27');

-- --------------------------------------------------------

--
-- Table structure for table `role_user`
--

CREATE TABLE `role_user` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `role_id` int(10) UNSIGNED NOT NULL,
  `user_id` int(10) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `role_user`
--

INSERT INTO `role_user` (`id`, `role_id`, `user_id`, `created_at`, `updated_at`) VALUES
(1, 1, 1, NULL, NULL),
(3, 3, 3, NULL, NULL),
(4, 2, 4, NULL, NULL);

-- --------------------------------------------------------

--
-- Table structure for table `settings`
--

CREATE TABLE `settings` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `val` text COLLATE utf8_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `group` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'default'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `settings`
--

INSERT INTO `settings` (`id`, `name`, `val`, `created_at`, `updated_at`, `group`) VALUES
(1, 'app_name', 'MY CONTACTS APP', NULL, '2020-07-05 01:12:47', 'default'),
(2, 'app_lang', 'en', '2019-08-03 07:41:22', '2020-07-02 00:55:10', 'default'),
(3, 'app_description', 'LARAVEL ONLINE CONTACT MANAGER APP', '2019-08-03 07:41:22', '2019-08-03 09:45:45', 'default'),
(4, 'app_keywords', 'ONLINE CONTACT MANAGER APP', '2019-08-03 07:41:22', '2019-08-03 09:45:45', 'default'),
(5, 'from_email', 'admin@example.com', '2019-08-03 07:41:22', '2019-08-03 07:41:22', 'default'),
(6, 'from_name', 'Admin User', '2019-08-03 07:41:22', '2019-08-03 10:19:48', 'default'),
(7, 'app_layout', 'container', '2019-08-03 10:17:56', '2020-07-05 01:12:47', 'default'),
(8, 'logo', 'images/qn8pm8D9quswM3v03AKHJRo126rjNQuHp1xuLSpe.png', '2019-08-03 10:27:23', '2020-07-05 00:50:10', 'default'),
(9, 'user_register', '1', '2019-08-03 11:41:44', '2020-07-02 00:56:11', 'default'),
(10, 'social_media', '1', '2019-09-14 11:29:37', '2020-06-28 00:04:28', 'default');

-- --------------------------------------------------------

--
-- Table structure for table `tags`
--

CREATE TABLE `tags` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `slug` varchar(255) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `tags`
--

INSERT INTO `tags` (`id`, `name`, `slug`) VALUES
(1, 'client', 'client'),
(2, 'tag2', 'tag2');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `contacts`
--
ALTER TABLE `contacts`
  ADD PRIMARY KEY (`id`),
  ADD KEY `contacts_group_id_foreign` (`group_id`);

--
-- Indexes for table `contact_tag`
--
ALTER TABLE `contact_tag`
  ADD KEY `contact_tag_contact_id_foreign` (`contact_id`),
  ADD KEY `contact_tag_tag_id_foreign` (`tag_id`);

--
-- Indexes for table `groups`
--
ALTER TABLE `groups`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `migrations`
--
ALTER TABLE `migrations`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `roles`
--
ALTER TABLE `roles`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `role_user`
--
ALTER TABLE `role_user`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `settings`
--
ALTER TABLE `settings`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `tags`
--
ALTER TABLE `tags`
  ADD PRIMARY KEY (`id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `contacts`
--
ALTER TABLE `contacts`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=35;

--
-- AUTO_INCREMENT for table `groups`
--
ALTER TABLE `groups`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `migrations`
--
ALTER TABLE `migrations`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;

--
-- AUTO_INCREMENT for table `roles`
--
ALTER TABLE `roles`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `role_user`
--
ALTER TABLE `role_user`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `settings`
--
ALTER TABLE `settings`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;

--
-- AUTO_INCREMENT for table `tags`
--
ALTER TABLE `tags`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `contacts`
--
ALTER TABLE `contacts`
  ADD CONSTRAINT `contacts_group_id_foreign` FOREIGN KEY (`group_id`) REFERENCES `groups` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `contact_tag`
--
ALTER TABLE `contact_tag`
  ADD CONSTRAINT `contact_tag_contact_id_foreign` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `contact_tag_tag_id_foreign` FOREIGN KEY (`tag_id`) REFERENCES `tags` (`id`) ON DELETE CASCADE;
COMMIT;

