text: -- phpMyAdmin SQL Dump
  -- version 4.8.2
  -- https://www.phpmyadmin.net/
  --
  -- Host: 127.0.0.1
  -- Generation Time: Mar 09, 2019 at 07:51 PM
  -- Server version: 10.1.34-MariaDB
  -- PHP Version: 7.2.8
  
  SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
  SET AUTOCOMMIT = 0;
  START TRANSACTION;
  SET time_zone = "+00:00";
  
  
  /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
  /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
  /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
  /*!40101 SET NAMES utf8mb4 */;
  
  --
  -- Database: `sensus`
  --
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `customer`
  --
  
  CREATE TABLE `customer` (
    `id` int(11) NOT NULL,
    `username` varchar(30) DEFAULT NULL,
    `password` varchar(50) DEFAULT NULL,
    `authKey` varchar(50) DEFAULT NULL,
    `accessToken` varchar(50) DEFAULT NULL,
    `role` varchar(10) DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  --
  -- Dumping data for table `customer`
  --
  
  INSERT INTO `customer` (`id`, `username`, `password`, `authKey`, `accessToken`, `role`) VALUES
  (1, 'azmi', '123456', 'azmi-12345', 'adjafkjdsafjokaf', 'Admin');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `migration`
  --
  
  CREATE TABLE `migration` (
    `version` varchar(180) NOT NULL,
    `apply_time` int(11) DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  --
  -- Dumping data for table `migration`
  --
  
  INSERT INTO `migration` (`version`, `apply_time`) VALUES
  ('m000000_000000_base', 1552101433),
  ('m140209_132017_init', 1552124699),
  ('m140403_174025_create_account_table', 1552124699),
  ('m140504_113157_update_tables', 1552124699),
  ('m140504_130429_create_token_table', 1552124699),
  ('m140830_171933_fix_ip_field', 1552124699),
  ('m140830_172703_change_account_table_name', 1552124699),
  ('m141222_110026_update_ip_field', 1552124699),
  ('m141222_135246_alter_username_length', 1552124699),
  ('m150614_103145_update_social_account_table', 1552124699),
  ('m150623_212711_fix_username_notnull', 1552124699),
  ('m151218_234654_add_timezone_to_profile', 1552124700),
  ('m160929_103127_add_last_login_at_to_user_table', 1552124700),
  ('m190309_090114_create_users', 1552122261);
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `person`
  --
  
  CREATE TABLE `person` (
    `id` int(11) NOT NULL,
    `name` varchar(50) NOT NULL,
    `region_id` int(11) NOT NULL,
    `address` varchar(100) NOT NULL,
    `income` int(11) NOT NULL,
    `created_at` datetime NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  --
  -- Dumping data for table `person`
  --
  
  INSERT INTO `person` (`id`, `name`, `region_id`, `address`, `income`, `created_at`) VALUES
  (1, 'Lionel', 2, 'Batu', 20000, '2019-03-09 11:29:06'),
  (2, 'Ronaldo', 1, 'Kota', 30000, '2019-03-09 11:29:40'),
  (3, 'Ronaldinho', 1, 'Utara', 50000, '2019-03-09 12:55:28'),
  (4, 'Suarez', 2, 'Barat', 40000, '2019-03-09 15:20:54'),
  (5, 'Mbappe', 6, 'Selatan', 350000, '2019-03-09 15:28:46'),
  (6, 'Hazard', 7, 'Tengah', 2000000, '2019-03-09 15:30:12');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `profile`
  --
  
  CREATE TABLE `profile` (
    `user_id` int(11) NOT NULL,
    `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
    `public_email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
    `gravatar_email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
    `gravatar_id` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL,
    `location` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
    `website` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
    `bio` text COLLATE utf8_unicode_ci,
    `timezone` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
  
  --
  -- Dumping data for table `profile`
  --
  
  INSERT INTO `profile` (`user_id`, `name`, `public_email`, `gravatar_email`, `gravatar_id`, `location`, `website`, `bio`, `timezone`) VALUES
  (1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
  (2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `regions`
  --
  
  CREATE TABLE `regions` (
    `id` int(11) NOT NULL,
    `name` varchar(50) NOT NULL,
    `created_at` datetime NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  --
  -- Dumping data for table `regions`
  --
  
  INSERT INTO `regions` (`id`, `name`, `created_at`) VALUES
  (1, 'Malang', '2019-03-09 10:58:37'),
  (2, 'Surabaya', '2019-03-09 10:58:57'),
  (3, 'Yogyakarta', '2019-03-09 15:22:06'),
  (4, 'Bandung', '2019-03-09 15:22:45'),
  (5, 'Jakarta', '2019-03-09 15:22:59'),
  (6, 'Tangerang', '2019-03-09 15:23:13'),
  (7, 'Semarang', '2019-03-09 15:23:27'),
  (8, 'Medan', '2019-03-09 15:23:37'),
  (9, 'Balikpapan', '2019-03-09 15:23:49');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `social_account`
  --
  
  CREATE TABLE `social_account` (
    `id` int(11) NOT NULL,
    `user_id` int(11) DEFAULT NULL,
    `provider` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
    `client_id` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
    `data` text COLLATE utf8_unicode_ci,
    `code` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL,
    `created_at` int(11) DEFAULT NULL,
    `email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
    `username` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `token`
  --
  
  CREATE TABLE `token` (
    `user_id` int(11) NOT NULL,
    `code` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
    `created_at` int(11) NOT NULL,
    `type` smallint(6) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `user`
  --
  
  CREATE TABLE `user` (
    `id` int(11) NOT NULL,
    `username` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
    `email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
    `password_hash` varchar(60) COLLATE utf8_unicode_ci NOT NULL,
    `auth_key` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
    `confirmed_at` int(11) DEFAULT NULL,
    `unconfirmed_email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
    `blocked_at` int(11) DEFAULT NULL,
    `registration_ip` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
    `created_at` int(11) NOT NULL,
    `updated_at` int(11) NOT NULL,
    `flags` int(11) NOT NULL DEFAULT '0',
    `last_login_at` int(11) DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
  
  --
  -- Dumping data for table `user`
  --
  
  INSERT INTO `user` (`id`, `username`, `email`, `password_hash`, `auth_key`, `confirmed_at`, `unconfirmed_email`, `blocked_at`, `registration_ip`, `created_at`, `updated_at`, `flags`, `last_login_at`) VALUES
  (1, 'azmi', 'theazmi99ilyasa@gmail.com', '$2y$10$GG8gMr5pkRT0uIMzGoXnzO119m951dKlxQtoJ0o1NquUwNDoV9gsC', 'IXEND3s3Gz3yepMSYtiHBpsJP5bjsJzz', 1552125188, NULL, NULL, '::1', 1552124960, 1552124960, 0, 1552134918),
  (2, 'ilyasa', 'ilyasa@ok.com', '$2y$10$uYkLJit8MiDXVIbHf69y4OgBkqdERr1.IfHGR2C.MGoX0Q56aj7ja', 'CQ09DuomiHxgVWhyEKpbHmL2cq4OI1So', 1552126649, NULL, NULL, '::1', 1552126584, 1552126584, 0, 1552126748);
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `users`
  --
  
  CREATE TABLE `users` (
    `id` int(11) NOT NULL,
    `username` varchar(255) NOT NULL,
    `authKey` varchar(32) NOT NULL,
    `password` varchar(255) NOT NULL,
    `email` varchar(255) NOT NULL,
    `accessToken` varchar(32) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  --
  -- Dumping data for table `users`
  --
  
  INSERT INTO `users` (`id`, `username`, `authKey`, `password`, `email`, `accessToken`) VALUES
  (1, 'azmi', 'azmi-123456', '7c4a8d09ca3762af61e59520943dc26494f8941b', 'azmi@ok.com', 'kfsjfioagdga');
  
  --
  -- Indexes for dumped tables
  --
  
  --
  -- Indexes for table `customer`
  --
  ALTER TABLE `customer`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `migration`
  --
  ALTER TABLE `migration`
    ADD PRIMARY KEY (`version`);
  
  --
  -- Indexes for table `person`
  --
  ALTER TABLE `person`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `profile`
  --
  ALTER TABLE `profile`
    ADD PRIMARY KEY (`user_id`);
  
  --
  -- Indexes for table `regions`
  --
  ALTER TABLE `regions`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `social_account`
  --
  ALTER TABLE `social_account`
    ADD PRIMARY KEY (`id`),
    ADD UNIQUE KEY `account_unique` (`provider`,`client_id`),
    ADD UNIQUE KEY `account_unique_code` (`code`),
    ADD KEY `fk_user_account` (`user_id`);
  
  --
  -- Indexes for table `token`
  --
  ALTER TABLE `token`
    ADD UNIQUE KEY `token_unique` (`user_id`,`code`,`type`);
  
  --
  -- Indexes for table `user`
  --
  ALTER TABLE `user`
    ADD PRIMARY KEY (`id`),
    ADD UNIQUE KEY `user_unique_username` (`username`),
    ADD UNIQUE KEY `user_unique_email` (`email`);
  
  --
  -- Indexes for table `users`
  --
  ALTER TABLE `users`
    ADD PRIMARY KEY (`id`),
    ADD UNIQUE KEY `username` (`username`),
    ADD UNIQUE KEY `email` (`email`);
  
  --
  -- AUTO_INCREMENT for dumped tables
  --
  
  --
  -- AUTO_INCREMENT for table `customer`
  --
  ALTER TABLE `customer`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
  
  --
  -- AUTO_INCREMENT for table `person`
  --
  ALTER TABLE `person`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
  
  --
  -- AUTO_INCREMENT for table `regions`
  --
  ALTER TABLE `regions`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;
  
  --
  -- AUTO_INCREMENT for table `social_account`
  --
  ALTER TABLE `social_account`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
  
  --
  -- AUTO_INCREMENT for table `user`
  --
  ALTER TABLE `user`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
  
  --
  -- AUTO_INCREMENT for table `users`
  --
  ALTER TABLE `users`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
  
  --
  -- Constraints for dumped tables
  --
  
  --
  -- Constraints for table `profile`
  --
  ALTER TABLE `profile`
    ADD CONSTRAINT `fk_user_profile` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE;
  
  --
  -- Constraints for table `social_account`
  --
  ALTER TABLE `social_account`
    ADD CONSTRAINT `fk_user_account` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE;
  
  --
  -- Constraints for table `token`
  --
  ALTER TABLE `token`
    ADD CONSTRAINT `fk_user_token` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE;
  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 */;
  