﻿CREATE TABLE `auth_user_user_permissions` (
  `id` BIGINT(20) NOT NULL AUTO_INCREMENT,
  `user_id` INT(11) NOT NULL,
  `permission_id` INT(11) NOT NULL,
  PRIMARY KEY (id)
)
ENGINE = INNODB,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
ROW_FORMAT = DYNAMIC;

ALTER TABLE `auth_user_user_permissions` 
  ADD UNIQUE INDEX auth_user_user_permissions_user_id_permission_id_14a6b632_uniq(user_id, permission_id);

ALTER TABLE `auth_user_user_permissions` 
  ADD CONSTRAINT `auth_user_user_permi_permission_id_1fbb5f2c_fk_auth_perm` FOREIGN KEY (permission_id)
    REFERENCES auth_permission(id);

ALTER TABLE `auth_user_user_permissions` 
  ADD CONSTRAINT `auth_user_user_permissions_user_id_a95ead1b_fk_auth_user_id` FOREIGN KEY (user_id)
    REFERENCES auth_user(id);