-- https://www.phpmyadmin.net/
--

START TRANSACTION;



--
-- Database: `statsmain_main`
--

-- --------------------------------------------------------

--
-- Table structure for table `auth_group`
--

CREATE TABLE `auth_group` (
  `id` int(11) NOT NULL,
  `name` varchar(150) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `auth_group_permissions`
--

CREATE TABLE `auth_group_permissions` (
  `id` bigint(20) NOT NULL,
  `group_id` int(11) NOT NULL,
  `permission_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `auth_permission`
--

CREATE TABLE `auth_permission` (
  `id` int(11) NOT NULL,
  `name` varchar(255) NOT NULL,
  `content_type_id` int(11) NOT NULL,
  `codename` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `auth_permission`
--

INSERT INTO `auth_permission` (`id`, `name`, `content_type_id`, `codename`) VALUES
(1, 'Can add log entry', 1, 'add_logentry'),
(2, 'Can change log entry', 1, 'change_logentry'),
(3, 'Can delete log entry', 1, 'delete_logentry'),
(4, 'Can view log entry', 1, 'view_logentry'),
(5, 'Can add permission', 2, 'add_permission'),
(6, 'Can change permission', 2, 'change_permission'),
(7, 'Can delete permission', 2, 'delete_permission'),
(8, 'Can view permission', 2, 'view_permission'),
(9, 'Can add group', 3, 'add_group'),
(10, 'Can change group', 3, 'change_group'),
(11, 'Can delete group', 3, 'delete_group'),
(12, 'Can view group', 3, 'view_group'),
(13, 'Can add content type', 4, 'add_contenttype'),
(14, 'Can change content type', 4, 'change_contenttype'),
(15, 'Can delete content type', 4, 'delete_contenttype'),
(16, 'Can view content type', 4, 'view_contenttype'),
(17, 'Can add session', 5, 'add_session'),
(18, 'Can change session', 5, 'change_session'),
(19, 'Can delete session', 5, 'delete_session'),
(20, 'Can view session', 5, 'view_session'),
(21, 'Can add user', 6, 'add_user'),
(22, 'Can change user', 6, 'change_user'),
(23, 'Can delete user', 6, 'delete_user'),
(24, 'Can view user', 6, 'view_user'),
(25, 'Can add permission', 7, 'add_permission'),
(26, 'Can change permission', 7, 'change_permission'),
(27, 'Can delete permission', 7, 'delete_permission'),
(28, 'Can view permission', 7, 'view_permission'),
(29, 'Can add role', 8, 'add_role'),
(30, 'Can change role', 8, 'change_role'),
(31, 'Can delete role', 8, 'delete_role'),
(32, 'Can view role', 8, 'view_role'),
(33, 'Can add user permission', 9, 'add_userpermission'),
(34, 'Can change user permission', 9, 'change_userpermission'),
(35, 'Can delete user permission', 9, 'delete_userpermission'),
(36, 'Can view user permission', 9, 'view_userpermission'),
(37, 'Can add role permission', 10, 'add_rolepermission'),
(38, 'Can change role permission', 10, 'change_rolepermission'),
(39, 'Can delete role permission', 10, 'delete_rolepermission'),
(40, 'Can view role permission', 10, 'view_rolepermission'),
(41, 'Can add dashboard session', 11, 'add_dashboardsession'),
(42, 'Can change dashboard session', 11, 'change_dashboardsession'),
(43, 'Can delete dashboard session', 11, 'delete_dashboardsession'),
(44, 'Can view dashboard session', 11, 'view_dashboardsession'),
(45, 'Can add client revenue target', 12, 'add_clientrevenuetarget'),
(46, 'Can change client revenue target', 12, 'change_clientrevenuetarget'),
(47, 'Can delete client revenue target', 12, 'delete_clientrevenuetarget'),
(48, 'Can view client revenue target', 12, 'view_clientrevenuetarget'),
(49, 'Can add client kpi target override', 13, 'add_clientkpitargetoverride'),
(50, 'Can change client kpi target override', 13, 'change_clientkpitargetoverride'),
(51, 'Can delete client kpi target override', 13, 'delete_clientkpitargetoverride'),
(52, 'Can view client kpi target override', 13, 'view_clientkpitargetoverride'),
(53, 'Can add client gp threshold', 14, 'add_clientgpthreshold'),
(54, 'Can change client gp threshold', 14, 'change_clientgpthreshold'),
(55, 'Can delete client gp threshold', 14, 'delete_clientgpthreshold'),
(56, 'Can view client gp threshold', 14, 'view_clientgpthreshold'),
(57, 'Can add client', 15, 'add_client'),
(58, 'Can change client', 15, 'change_client'),
(59, 'Can delete client', 15, 'delete_client'),
(60, 'Can view client', 15, 'view_client'),
(61, 'Can add client user membership', 16, 'add_clientusermembership'),
(62, 'Can change client user membership', 16, 'change_clientusermembership'),
(63, 'Can delete client user membership', 16, 'delete_clientusermembership'),
(64, 'Can view client user membership', 16, 'view_clientusermembership'),
(65, 'Can add client branch', 17, 'add_clientbranch'),
(66, 'Can change client branch', 17, 'change_clientbranch'),
(67, 'Can delete client branch', 17, 'delete_clientbranch'),
(68, 'Can view client branch', 17, 'view_clientbranch');

-- --------------------------------------------------------

--
-- Table structure for table `client_gp_thresholds`
--

CREATE TABLE `client_gp_thresholds` (
  `id` bigint(20) NOT NULL,
  `department_type` varchar(50) NOT NULL,
  `green_min` double NOT NULL,
  `yellow_min` double NOT NULL,
  `yellow_max` double NOT NULL,
  `red_max` double NOT NULL,
  `updated_at` datetime(6) NOT NULL,
  `client_id` bigint(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `client_kpi_target_overrides`
--

CREATE TABLE `client_kpi_target_overrides` (
  `id` bigint(20) NOT NULL,
  `branch` varchar(80) NOT NULL,
  `department` varchar(80) NOT NULL,
  `metric_key` varchar(80) NOT NULL,
  `target` double DEFAULT NULL,
  `weight` double DEFAULT NULL,
  `updated_at` datetime(6) NOT NULL,
  `client_id` bigint(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `client_revenue_targets`
--

CREATE TABLE `client_revenue_targets` (
  `id` bigint(20) NOT NULL,
  `branch_id` varchar(50) NOT NULL,
  `company_id` int(11) NOT NULL,
  `target` int(11) DEFAULT NULL,
  `breakeven` int(11) DEFAULT NULL,
  `updated_at` datetime(6) NOT NULL,
  `client_id` bigint(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `client_user_memberships`
--

CREATE TABLE `client_user_memberships` (
  `id` bigint(20) NOT NULL,
  `is_active` tinyint(1) NOT NULL,
  `created_at` datetime(6) NOT NULL,
  `client_id` bigint(20) NOT NULL,
  `user_id` bigint(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `client_user_memberships`
--

INSERT INTO `client_user_memberships` (`id`, `is_active`, `created_at`, `client_id`, `user_id`) VALUES
(1, 1, '2026-04-28 16:39:49.240658', 1, 2),
(2, 1, '2026-04-28 16:39:49.242314', 1, 12),
(3, 1, '2026-04-28 16:39:49.243992', 1, 17),
(4, 1, '2026-04-28 16:39:49.245628', 1, 18),
(5, 1, '2026-04-28 16:39:49.247242', 1, 20),
(6, 1, '2026-04-28 16:39:49.248854', 1, 21),
(7, 1, '2026-04-28 16:39:49.250427', 1, 22),
(8, 1, '2026-04-28 16:39:49.252067', 1, 23),
(9, 1, '2026-04-28 16:39:49.253654', 1, 24),
(10, 1, '2026-04-28 16:39:49.255225', 1, 25),
(11, 1, '2026-04-28 16:39:49.256767', 1, 27),
(12, 1, '2026-04-28 16:39:49.258286', 1, 28),
(13, 1, '2026-04-28 16:39:49.259933', 1, 29),
(14, 1, '2026-04-28 16:39:49.261570', 1, 30),
(15, 1, '2026-04-28 16:39:49.262973', 1, 31),
(16, 1, '2026-04-28 16:39:49.264588', 1, 32),
(17, 1, '2026-04-28 16:39:49.266271', 1, 33),
(18, 1, '2026-04-28 16:39:49.267880', 1, 34),
(19, 1, '2026-04-28 16:39:49.269476', 1, 35),
(20, 1, '2026-04-28 16:39:49.271082', 1, 36),
(21, 1, '2026-04-28 16:39:49.272660', 1, 37),
(22, 1, '2026-04-28 16:39:49.274145', 1, 39);

-- --------------------------------------------------------

--
-- Table structure for table `django_admin_log`
--

CREATE TABLE `django_admin_log` (
  `id` int(11) NOT NULL,
  `action_time` datetime(6) NOT NULL,
  `object_id` longtext DEFAULT NULL,
  `object_repr` varchar(200) NOT NULL,
  `action_flag` smallint(5) UNSIGNED NOT NULL CHECK (`action_flag` >= 0),
  `change_message` longtext NOT NULL,
  `content_type_id` int(11) DEFAULT NULL,
  `user_id` bigint(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `django_content_type`
--

CREATE TABLE `django_content_type` (
  `id` int(11) NOT NULL,
  `app_label` varchar(100) NOT NULL,
  `model` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `django_content_type`
--

INSERT INTO `django_content_type` (`id`, `app_label`, `model`) VALUES
(11, 'accounts', 'dashboardsession'),
(7, 'accounts', 'permission'),
(8, 'accounts', 'role'),
(10, 'accounts', 'rolepermission'),
(6, 'accounts', 'user'),
(9, 'accounts', 'userpermission'),
(1, 'admin', 'logentry'),
(3, 'auth', 'group'),
(2, 'auth', 'permission'),
(4, 'contenttypes', 'contenttype'),
(14, 'dashboard_api', 'clientgpthreshold'),
(13, 'dashboard_api', 'clientkpitargetoverride'),
(12, 'dashboard_api', 'clientrevenuetarget'),
(15, 'integrations', 'client'),
(17, 'integrations', 'clientbranch'),
(16, 'integrations', 'clientusermembership'),
(5, 'sessions', 'session');

-- --------------------------------------------------------

--
-- Table structure for table `django_migrations`
--

CREATE TABLE `django_migrations` (
  `id` bigint(20) NOT NULL,
  `app` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `applied` datetime(6) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `django_migrations`
--

INSERT INTO `django_migrations` (`id`, `app`, `name`, `applied`) VALUES
(1, 'contenttypes', '0001_initial', '2026-04-28 16:33:59.864531'),
(2, 'contenttypes', '0002_remove_content_type_name', '2026-04-28 16:33:59.884335'),
(3, 'auth', '0001_initial', '2026-04-28 16:33:59.927726'),
(4, 'auth', '0002_alter_permission_name_max_length', '2026-04-28 16:33:59.936348'),
(5, 'auth', '0003_alter_user_email_max_length', '2026-04-28 16:33:59.939474'),
(6, 'auth', '0004_alter_user_username_opts', '2026-04-28 16:33:59.943443'),
(7, 'auth', '0005_alter_user_last_login_null', '2026-04-28 16:33:59.946206'),
(8, 'auth', '0006_require_contenttypes_0002', '2026-04-28 16:33:59.947173'),
(9, 'auth', '0007_alter_validators_add_error_messages', '2026-04-28 16:33:59.949873'),
(10, 'auth', '0008_alter_user_username_max_length', '2026-04-28 16:33:59.952707'),
(11, 'auth', '0009_alter_user_last_name_max_length', '2026-04-28 16:33:59.955679'),
(12, 'auth', '0010_alter_group_name_max_length', '2026-04-28 16:33:59.961547'),
(13, 'auth', '0011_update_proxy_permissions', '2026-04-28 16:33:59.964786'),
(14, 'auth', '0012_alter_user_first_name_max_length', '2026-04-28 16:33:59.967796'),
(15, 'accounts', '0001_initial', '2026-04-28 16:34:00.178485'),
(17, 'admin', '0001_initial', '2026-04-28 16:34:00.208319'),
(18, 'admin', '0002_logentry_remove_auto_add', '2026-04-28 16:34:00.215178'),
(19, 'admin', '0003_logentry_add_action_flag_choices', '2026-04-28 16:34:00.220719'),
(20, 'integrations', '0001_initial', '2026-04-28 16:34:00.269347'),
(21, 'dashboard_api', '0001_initial', '2026-04-28 16:34:00.327291'),
(22, 'integrations', '0002_client_subdomain', '2026-04-28 16:34:00.338475'),
(23, 'integrations', '0003_client_use_demo_data', '2026-04-28 16:34:00.348540'),
(24, 'integrations', '0004_client_xero_oauth_and_features', '2026-04-28 16:34:00.395392'),
(25, 'integrations', '0005_client_branding', '2026-04-28 16:34:00.412009'),
(26, 'sessions', '0001_initial', '2026-04-28 16:34:00.422437'),
(27, 'accounts', '0002_legacy_mysql_user_extras', '2026-04-28 16:34:31.800402');

-- --------------------------------------------------------

--
-- Table structure for table `roles`
--

CREATE TABLE `roles` (
  `id` bigint(20) NOT NULL,
  `name` varchar(60) NOT NULL,
  `slug` varchar(20) DEFAULT NULL,
  `is_system` tinyint(1) NOT NULL,
  `created_at` datetime(6) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `roles`
--

INSERT INTO `roles` (`id`, `name`, `slug`, `is_system`, `created_at`) VALUES
(1, 'User', 'user', 1, '2026-04-28 16:34:01.038865'),
(2, 'Admin', 'admin', 1, '2026-04-28 16:34:01.040375'),
(3, 'Director', 'director', 1, '2026-04-28 16:34:01.041485');

-- --------------------------------------------------------

--
-- Table structure for table `role_permissions`
--

CREATE TABLE `role_permissions` (
  `id` bigint(20) NOT NULL,
  `permission_id` bigint(20) NOT NULL,
  `role_id` bigint(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `users_groups`
--

CREATE TABLE `users_groups` (
  `id` bigint(20) NOT NULL,
  `user_id` bigint(20) NOT NULL,
  `group_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `users_user_permissions`
--

CREATE TABLE `users_user_permissions` (
  `id` bigint(20) NOT NULL,
  `user_id` bigint(20) NOT NULL,
  `permission_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `user_permissions`
--

CREATE TABLE `user_permissions` (
  `id` bigint(20) NOT NULL,
  `permission_id` bigint(20) NOT NULL,
  `user_id` bigint(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `user_permissions`
--

INSERT INTO `user_permissions` (`id`, `permission_id`, `user_id`) VALUES
(1, 1, 2),
(2, 2, 2),
(3, 3, 2),
(4, 4, 2),
(5, 5, 2),
(6, 6, 2),
(7, 7, 2),
(8, 8, 2),
(9, 9, 2),
(10, 10, 2),
(11, 11, 2),
(12, 12, 2),
(13, 13, 2),
(14, 14, 2),
(15, 15, 2),
(16, 16, 2),
(17, 17, 2),
(18, 18, 2),
(19, 19, 2),
(20, 20, 2),
(21, 1, 12),
(22, 2, 12),
(23, 3, 12),
(24, 4, 12),
(25, 5, 12),
(26, 6, 12),
(27, 7, 12),
(28, 8, 12),
(29, 9, 12),
(30, 10, 12),
(31, 11, 12),
(32, 12, 12),
(33, 13, 12),
(34, 14, 12),
(35, 15, 12),
(36, 16, 12),
(37, 17, 12),
(38, 18, 12),
(39, 19, 12),
(40, 20, 12),
(41, 10, 17),
(42, 14, 17),
(43, 10, 18),
(44, 21, 18),
(45, 10, 20),
(46, 13, 20),
(47, 14, 20),
(48, 11, 21),
(49, 15, 21),
(50, 11, 22),
(51, 16, 22),
(52, 11, 23),
(53, 18, 23),
(54, 12, 24),
(55, 19, 24),
(56, 12, 25),
(57, 20, 25),
(58, 11, 27),
(59, 18, 27),
(60, 8, 28),
(61, 9, 28),
(62, 10, 28),
(63, 11, 28),
(64, 12, 28),
(65, 13, 28),
(66, 14, 28),
(67, 15, 28),
(68, 16, 28),
(69, 17, 28),
(70, 18, 28),
(71, 19, 28),
(72, 20, 28),
(73, 8, 29),
(74, 9, 29),
(75, 10, 29),
(76, 11, 29),
(77, 12, 29),
(78, 13, 29),
(79, 14, 29),
(80, 15, 29),
(81, 16, 29),
(82, 17, 29),
(83, 18, 29),
(84, 19, 29),
(85, 20, 29),
(86, 8, 30),
(87, 9, 30),
(88, 10, 30),
(89, 11, 30),
(90, 12, 30),
(91, 13, 30),
(92, 14, 30),
(93, 15, 30),
(94, 16, 30),
(95, 17, 30),
(96, 18, 30),
(97, 19, 30),
(98, 20, 30),
(99, 12, 31),
(100, 19, 31),
(101, 20, 31),
(102, 11, 32),
(103, 15, 32),
(104, 16, 32),
(105, 17, 32),
(106, 18, 32),
(107, 8, 33),
(108, 9, 33),
(109, 10, 33),
(110, 11, 33),
(111, 12, 33),
(112, 13, 33),
(113, 14, 33),
(114, 15, 33),
(115, 16, 33),
(116, 17, 33),
(117, 18, 33),
(118, 19, 33),
(119, 20, 33),
(120, 11, 34),
(121, 17, 34),
(122, 10, 35),
(123, 21, 35),
(124, 11, 36),
(125, 22, 36),
(126, 12, 37),
(127, 23, 37),
(128, 11, 39),
(129, 17, 39);

--
-- Indexes for dumped tables
--

--
-- Indexes for table `auth_group`
--
ALTER TABLE `auth_group`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `name` (`name`);

--
-- Indexes for table `auth_group_permissions`
--
ALTER TABLE `auth_group_permissions`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `auth_group_permissions_group_id_permission_id_0cd325b0_uniq` (`group_id`,`permission_id`),
  ADD KEY `auth_group_permissio_permission_id_84c5c92e_fk_auth_perm` (`permission_id`);

--
-- Indexes for table `auth_permission`
--
ALTER TABLE `auth_permission`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `auth_permission_content_type_id_codename_01ab375a_uniq` (`content_type_id`,`codename`);

--
-- Indexes for table `client_gp_thresholds`
--
ALTER TABLE `client_gp_thresholds`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `client_gp_thresholds_client_id_department_type_a594316f_uniq` (`client_id`,`department_type`);

--
-- Indexes for table `client_kpi_target_overrides`
--
ALTER TABLE `client_kpi_target_overrides`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `client_kpi_target_overri_client_id_branch_departm_9def5971_uniq` (`client_id`,`branch`,`department`,`metric_key`);

--
-- Indexes for table `client_revenue_targets`
--
ALTER TABLE `client_revenue_targets`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `client_revenue_targets_client_id_branch_id_comp_07d98757_uniq` (`client_id`,`branch_id`,`company_id`);

--
-- Indexes for table `client_user_memberships`
--
ALTER TABLE `client_user_memberships`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `client_user_memberships_client_id_user_id_0bbb23c1_uniq` (`client_id`,`user_id`),
  ADD KEY `client_user_memberships_user_id_be0102d4_fk_users_id` (`user_id`);

--
-- Indexes for table `django_admin_log`
--
ALTER TABLE `django_admin_log`
  ADD PRIMARY KEY (`id`),
  ADD KEY `django_admin_log_content_type_id_c4bce8eb_fk_django_co` (`content_type_id`),
  ADD KEY `django_admin_log_user_id_c564eba6_fk_users_id` (`user_id`);

--
-- Indexes for table `django_content_type`
--
ALTER TABLE `django_content_type`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `django_content_type_app_label_model_76bd3d3b_uniq` (`app_label`,`model`);

--
-- Indexes for table `django_migrations`
--
ALTER TABLE `django_migrations`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `roles`
--
ALTER TABLE `roles`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `slug` (`slug`);

--
-- Indexes for table `role_permissions`
--
ALTER TABLE `role_permissions`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `role_permissions_role_id_permission_id_04f77df0_uniq` (`role_id`,`permission_id`),
  ADD KEY `role_permissions_permission_id_ad343843_fk_permissions_id` (`permission_id`);

--
-- Indexes for table `users_groups`
--
ALTER TABLE `users_groups`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `users_groups_user_id_group_id_fc7788e8_uniq` (`user_id`,`group_id`),
  ADD KEY `users_groups_group_id_2f3517aa_fk_auth_group_id` (`group_id`);

--
-- Indexes for table `users_user_permissions`
--
ALTER TABLE `users_user_permissions`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `users_user_permissions_user_id_permission_id_3b86cbdf_uniq` (`user_id`,`permission_id`),
  ADD KEY `users_user_permissio_permission_id_6d08dcd2_fk_auth_perm` (`permission_id`);

--
-- Indexes for table `user_permissions`
--
ALTER TABLE `user_permissions`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `user_permissions_user_id_permission_id_11a83645_uniq` (`user_id`,`permission_id`),
  ADD KEY `user_permissions_permission_id_c566ae5c_fk_permissions_id` (`permission_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `auth_group`
--
ALTER TABLE `auth_group`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `auth_group_permissions`
--
ALTER TABLE `auth_group_permissions`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `auth_permission`
--
ALTER TABLE `auth_permission`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=69;

--
-- AUTO_INCREMENT for table `client_gp_thresholds`
--
ALTER TABLE `client_gp_thresholds`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `client_kpi_target_overrides`
--
ALTER TABLE `client_kpi_target_overrides`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `client_revenue_targets`
--
ALTER TABLE `client_revenue_targets`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `client_user_memberships`
--
ALTER TABLE `client_user_memberships`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=23;

--
-- AUTO_INCREMENT for table `django_admin_log`
--
ALTER TABLE `django_admin_log`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `django_content_type`
--
ALTER TABLE `django_content_type`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18;

--
-- AUTO_INCREMENT for table `django_migrations`
--
ALTER TABLE `django_migrations`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=28;

--
-- AUTO_INCREMENT for table `roles`
--
ALTER TABLE `roles`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `role_permissions`
--
ALTER TABLE `role_permissions`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `users_groups`
--
ALTER TABLE `users_groups`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `users_user_permissions`
--
ALTER TABLE `users_user_permissions`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `user_permissions`
--
ALTER TABLE `user_permissions`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=130;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `auth_group_permissions`
--
ALTER TABLE `auth_group_permissions`
  ADD CONSTRAINT `auth_group_permissio_permission_id_84c5c92e_fk_auth_perm` FOREIGN KEY (`permission_id`) REFERENCES `auth_permission` (`id`),
  ADD CONSTRAINT `auth_group_permissions_group_id_b120cbf9_fk_auth_group_id` FOREIGN KEY (`group_id`) REFERENCES `auth_group` (`id`);

--
-- Constraints for table `auth_permission`
--
ALTER TABLE `auth_permission`
  ADD CONSTRAINT `auth_permission_content_type_id_2f476e4b_fk_django_co` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`);

--
-- Constraints for table `client_gp_thresholds`
--
ALTER TABLE `client_gp_thresholds`
  ADD CONSTRAINT `client_gp_thresholds_client_id_96b75e4b_fk_clients_id` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`);

--
-- Constraints for table `client_kpi_target_overrides`
--
ALTER TABLE `client_kpi_target_overrides`
  ADD CONSTRAINT `client_kpi_target_overrides_client_id_5e853716_fk_clients_id` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`);

--
-- Constraints for table `client_revenue_targets`
--
ALTER TABLE `client_revenue_targets`
  ADD CONSTRAINT `client_revenue_targets_client_id_19ceb6a5_fk_clients_id` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`);

--
-- Constraints for table `client_user_memberships`
--
ALTER TABLE `client_user_memberships`
  ADD CONSTRAINT `client_user_memberships_client_id_8196b433_fk_clients_id` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`),
  ADD CONSTRAINT `client_user_memberships_user_id_be0102d4_fk_users_id` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);

--
-- Constraints for table `django_admin_log`
--
ALTER TABLE `django_admin_log`
  ADD CONSTRAINT `django_admin_log_content_type_id_c4bce8eb_fk_django_co` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`),
  ADD CONSTRAINT `django_admin_log_user_id_c564eba6_fk_users_id` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);

--
-- Constraints for table `role_permissions`
--
ALTER TABLE `role_permissions`
  ADD CONSTRAINT `role_permissions_permission_id_ad343843_fk_permissions_id` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`),
  ADD CONSTRAINT `role_permissions_role_id_216516f2_fk_roles_id` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`);

--
-- Constraints for table `users_groups`
--
ALTER TABLE `users_groups`
  ADD CONSTRAINT `users_groups_group_id_2f3517aa_fk_auth_group_id` FOREIGN KEY (`group_id`) REFERENCES `auth_group` (`id`),
  ADD CONSTRAINT `users_groups_user_id_f500bee5_fk_users_id` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);

--
-- Constraints for table `users_user_permissions`
--
ALTER TABLE `users_user_permissions`
  ADD CONSTRAINT `users_user_permissio_permission_id_6d08dcd2_fk_auth_perm` FOREIGN KEY (`permission_id`) REFERENCES `auth_permission` (`id`),
  ADD CONSTRAINT `users_user_permissions_user_id_92473840_fk_users_id` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);

--
-- Constraints for table `user_permissions`
--
ALTER TABLE `user_permissions`
  ADD CONSTRAINT `user_permissions_permission_id_c566ae5c_fk_permissions_id` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`),
  ADD CONSTRAINT `user_permissions_user_id_b176ff97_fk_users_id` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);
COMMIT;

