text: -- phpMyAdmin SQL Dump
  -- version 4.7.9
  -- https://www.phpmyadmin.net/
  --
  -- Host: 127.0.0.1
  -- Generation Time: Sep 17, 2018 at 01:24 PM
  -- Server version: 10.1.31-MariaDB
  -- PHP Version: 7.2.3
  
  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: `zoryx`
  --
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `auth_assignment`
  --
  
  CREATE TABLE `auth_assignment` (
    `item_name` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
    `user_id` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
    `created_at` int(11) DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
  
  --
  -- Dumping data for table `auth_assignment`
  --
  
  INSERT INTO `auth_assignment` (`item_name`, `user_id`, `created_at`) VALUES
  ('admin', '1', 1504703574);
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `auth_item`
  --
  
  CREATE TABLE `auth_item` (
    `name` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
    `type` smallint(6) NOT NULL,
    `description` text COLLATE utf8_unicode_ci,
    `rule_name` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
    `data` blob,
    `created_at` int(11) DEFAULT NULL,
    `updated_at` int(11) DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
  
  --
  -- Dumping data for table `auth_item`
  --
  
  INSERT INTO `auth_item` (`name`, `type`, `description`, `rule_name`, `data`, `created_at`, `updated_at`) VALUES
  ('admin', 1, '', NULL, NULL, 1504703199, 1504703199);
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `auth_item_child`
  --
  
  CREATE TABLE `auth_item_child` (
    `parent` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
    `child` varchar(64) COLLATE utf8_unicode_ci NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `auth_rule`
  --
  
  CREATE TABLE `auth_rule` (
    `name` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
    `data` blob,
    `created_at` int(11) DEFAULT NULL,
    `updated_at` int(11) DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `language`
  --
  
  CREATE TABLE `language` (
    `id` int(11) NOT NULL,
    `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
    `code` varchar(5) COLLATE utf8_unicode_ci NOT NULL,
    `country` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
    `status` int(1) NOT NULL DEFAULT '1'
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
  
  --
  -- Dumping data for table `language`
  --
  
  INSERT INTO `language` (`id`, `name`, `code`, `country`, `status`) VALUES
  (1, 'Việt Nam', 'vi', 'vn', 1),
  (2, 'United States', 'en', 'us', 1);
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `migration`
  --
  
  CREATE TABLE `migration` (
    `version` varchar(180) NOT NULL,
    `apply_time` int(11) DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  --
  -- Dumping data for table `migration`
  --
  
  INSERT INTO `migration` (`version`, `apply_time`) VALUES
  ('m000000_000000_base', 1504696310),
  ('m140209_132017_init', 1504699715),
  ('m140403_174025_create_account_table', 1504699716),
  ('m140504_113157_update_tables', 1504699717),
  ('m140504_130429_create_token_table', 1504699717),
  ('m140506_102106_rbac_init', 1504700691),
  ('m140830_171933_fix_ip_field', 1504699717),
  ('m140830_172703_change_account_table_name', 1504699717),
  ('m141222_110026_update_ip_field', 1504699717),
  ('m141222_135246_alter_username_length', 1504699718),
  ('m150227_114524_init', 1504696313),
  ('m150614_103145_update_social_account_table', 1504699718),
  ('m150623_212711_fix_username_notnull', 1504699718),
  ('m151218_234654_add_timezone_to_profile', 1504699718),
  ('m160204_045439_navatech_multi_language_init', 1537183288),
  ('m160213_041916_navatech_multi_language_insert', 1537183288),
  ('m160507_171815_relations', 1537183289),
  ('m160929_103127_add_last_login_at_to_user_table', 1504699718),
  ('m161109_104201_rename_setting_table', 1504696313),
  ('m170323_102933_add_description_column_to_setting_table', 1504696313),
  ('m170413_125133_rename_date_columns', 1504696313);
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `phrase`
  --
  
  CREATE TABLE `phrase` (
    `id` int(11) NOT NULL,
    `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
  
  --
  -- Dumping data for table `phrase`
  --
  
  INSERT INTO `phrase` (`id`, `name`) VALUES
  (1, 'language'),
  (2, 'phrase'),
  (3, 'name'),
  (4, 'code'),
  (5, 'country'),
  (6, 'status'),
  (7, 'translate');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `phrase_translate`
  --
  
  CREATE TABLE `phrase_translate` (
    `id` int(11) NOT NULL,
    `phrase_id` int(11) NOT NULL,
    `language_id` int(11) NOT NULL,
    `value` text COLLATE utf8_unicode_ci NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
  
  --
  -- Dumping data for table `phrase_translate`
  --
  
  INSERT INTO `phrase_translate` (`id`, `phrase_id`, `language_id`, `value`) VALUES
  (1, 1, 1, 'Ngôn ngữ'),
  (2, 1, 2, 'Language'),
  (3, 2, 1, 'Từ ngữ'),
  (4, 2, 2, 'Phrase'),
  (5, 3, 1, 'Tên'),
  (6, 3, 2, 'Name'),
  (7, 4, 1, 'Mã'),
  (8, 4, 2, 'Code'),
  (9, 5, 1, 'Quốc gia'),
  (10, 5, 2, 'Country'),
  (11, 6, 1, 'Trạng thái'),
  (12, 6, 2, 'Status'),
  (13, 7, 1, 'Dịch'),
  (14, 7, 2, 'Translate');
  
  -- --------------------------------------------------------
  
  --
  -- 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 `setting`
  --
  
  CREATE TABLE `setting` (
    `id` int(11) NOT NULL,
    `type` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
    `section` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
    `key` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
    `value` text COLLATE utf8_unicode_ci NOT NULL,
    `status` smallint(6) NOT NULL DEFAULT '1',
    `description` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
    `created_at` int(11) NOT NULL,
    `updated_at` int(11) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
  
  --
  -- Dumping data for table `setting`
  --
  
  INSERT INTO `setting` (`id`, `type`, `section`, `key`, `value`, `status`, `description`, `created_at`, `updated_at`) VALUES
  (1, 'string', 'Setting', 'appName', 'Test', 1, NULL, 1504697421, 1504697421),
  (2, 'string', 'Setting', 'adminEmail', 'admin@gmail.com', 1, NULL, 1504697421, 1504697421);
  
  -- --------------------------------------------------------
  
  --
  -- 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;
  
  --
  -- Dumping data for table `token`
  --
  
  INSERT INTO `token` (`user_id`, `code`, `created_at`, `type`) VALUES
  (1, '_fhVqHXVQkfiM2Cfiqv_XprTwlc7GD7z', 1504701195, 0),
  (2, 'y-H5qWeLqCDRkndGhCLcHGc4vSHc4v8O', 1504704438, 0);
  
  -- --------------------------------------------------------
  
  --
  -- 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, 'admin', 'admin@gmail.com', '$2y$12$HkSHONEyDdnfAtqVb6jeK.2QgLhldmhtJDGRsmp0vJHRoob3N/tdK', 'EPJ14E927yIcUb5I4zy51LlAiPi7MpkB', 1504701195, NULL, NULL, '::1', 1504701195, 1504701195, 0, 1504705276),
  (2, 'user', 'user@gmail.com', '$2y$12$XIrIVmhgs6Vf5/MpTiJYv.ul5CLPypoNloDilNJu/4xWP6uKaINkW', '3r1Y2VsH8ryB2XC8qdRFcQfdaqoIDEhA', 1504701195, NULL, NULL, '::1', 1504704438, 1504704438, 0, 1504705259);
  
  --
  -- Indexes for dumped tables
  --
  
  --
  -- Indexes for table `auth_assignment`
  --
  ALTER TABLE `auth_assignment`
    ADD PRIMARY KEY (`item_name`,`user_id`);
  
  --
  -- Indexes for table `auth_item`
  --
  ALTER TABLE `auth_item`
    ADD PRIMARY KEY (`name`),
    ADD KEY `rule_name` (`rule_name`),
    ADD KEY `idx-auth_item-type` (`type`);
  
  --
  -- Indexes for table `auth_item_child`
  --
  ALTER TABLE `auth_item_child`
    ADD PRIMARY KEY (`parent`,`child`),
    ADD KEY `child` (`child`);
  
  --
  -- Indexes for table `auth_rule`
  --
  ALTER TABLE `auth_rule`
    ADD PRIMARY KEY (`name`);
  
  --
  -- Indexes for table `language`
  --
  ALTER TABLE `language`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `migration`
  --
  ALTER TABLE `migration`
    ADD PRIMARY KEY (`version`);
  
  --
  -- Indexes for table `phrase`
  --
  ALTER TABLE `phrase`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `phrase_translate`
  --
  ALTER TABLE `phrase_translate`
    ADD PRIMARY KEY (`id`),
    ADD KEY `phrase_translate_fk_phrase` (`phrase_id`),
    ADD KEY `phrase_translate_fk_language` (`language_id`);
  
  --
  -- Indexes for table `profile`
  --
  ALTER TABLE `profile`
    ADD PRIMARY KEY (`user_id`);
  
  --
  -- Indexes for table `setting`
  --
  ALTER TABLE `setting`
    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`);
  
  --
  -- AUTO_INCREMENT for dumped tables
  --
  
  --
  -- AUTO_INCREMENT for table `language`
  --
  ALTER TABLE `language`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
  
  --
  -- AUTO_INCREMENT for table `phrase`
  --
  ALTER TABLE `phrase`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
  
  --
  -- AUTO_INCREMENT for table `phrase_translate`
  --
  ALTER TABLE `phrase_translate`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
  
  --
  -- AUTO_INCREMENT for table `setting`
  --
  ALTER TABLE `setting`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
  
  --
  -- 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;
  
  --
  -- Constraints for dumped tables
  --
  
  --
  -- Constraints for table `auth_assignment`
  --
  ALTER TABLE `auth_assignment`
    ADD CONSTRAINT `auth_assignment_ibfk_1` FOREIGN KEY (`item_name`) REFERENCES `auth_item` (`name`) ON DELETE CASCADE ON UPDATE CASCADE;
  
  --
  -- Constraints for table `auth_item`
  --
  ALTER TABLE `auth_item`
    ADD CONSTRAINT `auth_item_ibfk_1` FOREIGN KEY (`rule_name`) REFERENCES `auth_rule` (`name`) ON DELETE SET NULL ON UPDATE CASCADE;
  
  --
  -- Constraints for table `auth_item_child`
  --
  ALTER TABLE `auth_item_child`
    ADD CONSTRAINT `auth_item_child_ibfk_1` FOREIGN KEY (`parent`) REFERENCES `auth_item` (`name`) ON DELETE CASCADE ON UPDATE CASCADE,
    ADD CONSTRAINT `auth_item_child_ibfk_2` FOREIGN KEY (`child`) REFERENCES `auth_item` (`name`) ON DELETE CASCADE ON UPDATE CASCADE;
  
  --
  -- Constraints for table `phrase_translate`
  --
  ALTER TABLE `phrase_translate`
    ADD CONSTRAINT `phrase_translate_fk_language` FOREIGN KEY (`language_id`) REFERENCES `language` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
    ADD CONSTRAINT `phrase_translate_fk_phrase` FOREIGN KEY (`phrase_id`) REFERENCES `phrase` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
  
  --
  -- 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 */;
  