text: -- phpMyAdmin SQL Dump
  -- version 4.6.5.2
  -- https://www.phpmyadmin.net/
  --
  -- Host: 127.0.0.1
  -- Czas generowania: 30 Mar 2017, 14:37
  -- Wersja serwera: 10.1.21-MariaDB
  -- Wersja PHP: 5.6.30
  
  SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
  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 */;
  
  --
  -- Baza danych: `yii2basic`
  --
  
  -- --------------------------------------------------------
  
  --
  -- Struktura tabeli dla tabeli `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;
  
  --
  -- Zrzut danych tabeli `auth_assignment`
  --
  
  INSERT INTO `auth_assignment` (`item_name`, `user_id`, `created_at`) VALUES
  ('admin', '8', NULL),
  ('admin', '9', NULL),
  ('create-task', '8', NULL),
  ('see-all', '8', NULL);
  
  -- --------------------------------------------------------
  
  --
  -- Struktura tabeli dla tabeli `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;
  
  --
  -- Zrzut danych tabeli `auth_item`
  --
  
  INSERT INTO `auth_item` (`name`, `type`, `description`, `rule_name`, `data`, `created_at`, `updated_at`) VALUES
  ('admin', 1, 'admin', NULL, NULL, NULL, NULL),
  ('create-task', 1, 'allo a user to add a task', NULL, NULL, NULL, NULL),
  ('see-all', 1, 'u can see all ', NULL, NULL, NULL, NULL);
  
  -- --------------------------------------------------------
  
  --
  -- Struktura tabeli dla tabeli `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;
  
  --
  -- Zrzut danych tabeli `auth_item_child`
  --
  
  INSERT INTO `auth_item_child` (`parent`, `child`) VALUES
  ('admin', 'create-task'),
  ('admin', 'see-all');
  
  -- --------------------------------------------------------
  
  --
  -- Struktura tabeli dla tabeli `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;
  
  -- --------------------------------------------------------
  
  --
  -- Struktura tabeli dla tabeli `migration`
  --
  
  CREATE TABLE `migration` (
    `version` varchar(180) NOT NULL,
    `apply_time` int(11) DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  --
  -- Zrzut danych tabeli `migration`
  --
  
  INSERT INTO `migration` (`version`, `apply_time`) VALUES
  ('m000000_000000_base', 1490776317),
  ('m140209_132017_init', 1490776321),
  ('m140403_174025_create_account_table', 1490776321),
  ('m140504_113157_update_tables', 1490776322),
  ('m140504_130429_create_token_table', 1490776322),
  ('m140506_102106_rbac_init', 1490787425),
  ('m140830_171933_fix_ip_field', 1490776322),
  ('m140830_172703_change_account_table_name', 1490776322),
  ('m141222_110026_update_ip_field', 1490776322),
  ('m141222_135246_alter_username_length', 1490776322),
  ('m150614_103145_update_social_account_table', 1490776323),
  ('m150623_212711_fix_username_notnull', 1490776323),
  ('m151218_234654_add_timezone_to_profile', 1490776323),
  ('m160929_103127_add_last_login_at_to_user_table', 1490776323);
  
  -- --------------------------------------------------------
  
  --
  -- Struktura tabeli dla tabeli `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;
  
  --
  -- Zrzut danych tabeli `profile`
  --
  
  INSERT INTO `profile` (`user_id`, `name`, `public_email`, `gravatar_email`, `gravatar_id`, `location`, `website`, `bio`, `timezone`) VALUES
  (8, 'edyta', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
  (9, 'bartek', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
  (10, 'michal', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
  (11, 'tomek', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
  (12, 'werwer', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
  
  -- --------------------------------------------------------
  
  --
  -- Struktura tabeli dla tabeli `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;
  
  -- --------------------------------------------------------
  
  --
  -- Struktura tabeli dla tabeli `task`
  --
  
  CREATE TABLE `task` (
    `id` int(11) NOT NULL,
    `username` varchar(255) CHARACTER SET utf8 NOT NULL,
    `task` varchar(100) CHARACTER SET utf8 NOT NULL,
    `description` varchar(100) CHARACTER SET utf8 NOT NULL,
    `date_b` date NOT NULL,
    `date_e` date NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  --
  -- Zrzut danych tabeli `task`
  --
  
  INSERT INTO `task` (`id`, `username`, `task`, `description`, `date_b`, `date_e`) VALUES
  (6, 'edyta', 'malowanie', 'farba lateksowa 2x', '2017-03-08', '2017-03-16'),
  (7, 'edyta', 'szpachlowanie', 'gladz szpachlowa', '2017-03-15', '2017-03-16'),
  (8, 'edyta', 'gruntowanie', '1x', '2017-03-23', '2017-03-31'),
  (9, 'bartek', 'gotowanie', 'mielone', '2017-03-01', '2017-03-03'),
  (10, 'bartek', 'betonowanie', 'b25', '2017-03-02', '2017-03-23'),
  (12, 'tomek', 'costam', 'ww', '2017-03-01', '2017-03-15');
  
  -- --------------------------------------------------------
  
  --
  -- Struktura tabeli dla tabeli `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;
  
  --
  -- Zrzut danych tabeli `token`
  --
  
  INSERT INTO `token` (`user_id`, `code`, `created_at`, `type`) VALUES
  (8, 'K41dW4qgba5zDnvMTDKwWa2X6PspxFAe', 1490790876, 0),
  (9, 'kvQ2IVdB-A6OrigIiY0AXvQPLAvWpLH7', 1490795681, 0),
  (10, 'S0e4sq6SnZz-6sfABK9np22oRYK6vqUL', 1490823579, 0),
  (11, 'BUXPQJjEunY0Z5_ANz5CkfrQIXZLCT32', 1490865973, 0),
  (12, 'YcrGX6Q-QR6dGLoG-DGKyHMwyoAfTk41', 1490875369, 0);
  
  -- --------------------------------------------------------
  
  --
  -- Struktura tabeli dla tabeli `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;
  
  --
  -- Zrzut danych tabeli `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
  (8, 'edyta', 'edyta@wp.pl', '$2y$10$8Fv.BbxzGATcyl641fgFyequSyGW2vKZJ7ZBHIFufYg4QILk5vAlK', 'Ozjupe0h6yJpiFtDTjpN2bRIxejvlBlJ', 1490791308, NULL, NULL, '::1', 1490790876, 1490790876, 0, 1490877214),
  (9, 'bartek', 'bartek@wp.pl', '$2y$10$2ZWhETHEiGNNh2D4N1ze3OWi5rCnG4ffsDYf9ucMh6kLgIY7VjBvO', 'v9IXg8ftl-tQd6sIBalpa3SpEDryqV7a', 1490799152, NULL, NULL, '::1', 1490795681, 1490795681, 0, 1490877227),
  (10, 'michal', 'michal@wp.pl', '$2y$10$AHhvVA5Ia9fA.tclB/dm8uHogepSNtkATa5zPW.QiwLc4li5EQoHK', 'c_JBQwk2evwzwk6A5Kb9hNB31zYokjy8', 1490823711, NULL, NULL, '::1', 1490823579, 1490823579, 0, 1490876836),
  (11, 'tomek', 'tomek@wp.pl', '$2y$10$rPbmRtG8dYsMyjAbum3s9OMgY41lZWiJs0nGaw61r7Bxzk.DCttHm', 't9pj7U113eMW2W4F9YyDQsDjyleQFbHa', NULL, NULL, NULL, '::1', 1490865973, 1490865973, 0, 1490873137),
  (12, 'bartekbartekbartek', 'bartek@o2.pl', '$2y$10$Y83ad9rry.99XOBGOsDZteZaNeJZ3CjZ0APPSEm5SUB5LBllLIVV.', 'wgs9H2kV2dTmu1dvQMeYLWqJUx3GIg3X', NULL, NULL, NULL, '::1', 1490875369, 1490875369, 0, 1490875381);
  
  --
  -- Indeksy dla zrzutów tabel
  --
  
  --
  -- 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 `migration`
  --
  ALTER TABLE `migration`
    ADD PRIMARY KEY (`version`);
  
  --
  -- Indexes for table `profile`
  --
  ALTER TABLE `profile`
    ADD PRIMARY KEY (`user_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 `task`
  --
  ALTER TABLE `task`
    ADD PRIMARY KEY (`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 dla tabeli `social_account`
  --
  ALTER TABLE `social_account`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
  --
  -- AUTO_INCREMENT dla tabeli `task`
  --
  ALTER TABLE `task`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
  --
  -- AUTO_INCREMENT dla tabeli `user`
  --
  ALTER TABLE `user`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
  --
  -- Ograniczenia dla zrzutów tabel
  --
  
  --
  -- Ograniczenia dla tabeli `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;
  
  --
  -- Ograniczenia dla tabeli `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;
  
  --
  -- Ograniczenia dla tabeli `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;
  
  --
  -- Ograniczenia dla tabeli `profile`
  --
  ALTER TABLE `profile`
    ADD CONSTRAINT `fk_user_profile` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE;
  
  --
  -- Ograniczenia dla tabeli `social_account`
  --
  ALTER TABLE `social_account`
    ADD CONSTRAINT `fk_user_account` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE;
  
  --
  -- Ograniczenia dla tabeli `token`
  --
  ALTER TABLE `token`
    ADD CONSTRAINT `fk_user_token` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE;
  
  /*!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 */;
  