text: -- phpMyAdmin SQL Dump
  -- version 4.9.2
  -- https://www.phpmyadmin.net/
  --
  -- Počítač: 127.0.0.1
  -- Vytvořeno: Pon 11. říj 2021, 22:44
  -- Verze serveru: 10.4.10-MariaDB
  -- Verze PHP: 7.3.12
  
  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 */;
  
  --
  -- Databáze: `kino`
  --
  
  -- --------------------------------------------------------
  
  --
  -- Struktura tabulky `users_groups`
  --
  
  CREATE TABLE `users_groups` (
    `id` int(11) UNSIGNED NOT NULL,
    `user_id` int(11) UNSIGNED NOT NULL,
    `group_id` mediumint(8) UNSIGNED NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  --
  -- Vypisuji data pro tabulku `users_groups`
  --
  
  INSERT INTO `users_groups` (`id`, `user_id`, `group_id`) VALUES
  (1, 1, 1),
  (2, 1, 2);
  
  --
  -- Klíče pro exportované tabulky
  --
  
  --
  -- Klíče pro tabulku `users_groups`
  --
  ALTER TABLE `users_groups`
    ADD PRIMARY KEY (`id`),
    ADD UNIQUE KEY `uc_users_groups` (`user_id`,`group_id`),
    ADD KEY `fk_users_groups_users1_idx` (`user_id`),
    ADD KEY `fk_users_groups_groups1_idx` (`group_id`);
  
  --
  -- AUTO_INCREMENT pro tabulky
  --
  
  --
  -- AUTO_INCREMENT pro tabulku `users_groups`
  --
  ALTER TABLE `users_groups`
    MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
  
  --
  -- Omezení pro exportované tabulky
  --
  
  --
  -- Omezení pro tabulku `users_groups`
  --
  ALTER TABLE `users_groups`
    ADD CONSTRAINT `fk_users_groups_groups1` FOREIGN KEY (`group_id`) REFERENCES `groups` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION,
    ADD CONSTRAINT `fk_users_groups_users1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;
  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 */;
  