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

START TRANSACTION;



--
-- Database: `nbrp_aegis`
--

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

--
-- Table structure for table `discordapplication`
--

CREATE TABLE `discordapplication` (
  `id` int(11) NOT NULL,
  `typeId` int(11) NOT NULL,
  `applicantId` varchar(100) NOT NULL,
  `applicantName` varchar(100) NOT NULL,
  `data` longtext NOT NULL,
  `status` enum('PENDING','APPROVED','REJECTED') NOT NULL DEFAULT 'PENDING',
  `submittedAt` datetime(3) NOT NULL DEFAULT current_timestamp(3),
  `reviewedAt` datetime(3) DEFAULT NULL,
  `reviewedBy` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `discordapplicationtype`
--

CREATE TABLE `discordapplicationtype` (
  `id` int(11) NOT NULL,
  `name` varchar(100) NOT NULL,
  `discordBotId` int(11) NOT NULL,
  `createdBy` int(11) NOT NULL,
  `createdAt` datetime(3) NOT NULL DEFAULT current_timestamp(3),
  `visibleToRoles` text NOT NULL DEFAULT 'VERIAGENT,MODERATOR,DEVELOPERS,ADMIN,SUPER_ADMIN'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `discordapplicationtype`
--

INSERT INTO `discordapplicationtype` (`id`, `name`, `discordBotId`, `createdBy`, `createdAt`, `visibleToRoles`) VALUES
(1, 'test', 3, 2, '2025-07-30 12:56:11.857', 'VERIAGENT,MODERATOR,DEVELOPERS,ADMIN,SUPER_ADMIN');

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

--
-- Table structure for table `discordbot`
--

CREATE TABLE `discordbot` (
  `id` int(11) NOT NULL,
  `name` varchar(191) NOT NULL,
  `token` text NOT NULL,
  `clientId` varchar(191) NOT NULL,
  `guildId` varchar(191) DEFAULT NULL,
  `isActive` tinyint(1) NOT NULL DEFAULT 1,
  `createdAt` datetime(3) NOT NULL DEFAULT current_timestamp(3),
  `updatedAt` datetime(3) NOT NULL DEFAULT current_timestamp(3),
  `botType` varchar(191) NOT NULL DEFAULT 'general',
  `clientSecret` text DEFAULT NULL,
  `status` varchar(191) NOT NULL DEFAULT 'offline',
  `whitelistChannelId` varchar(191) DEFAULT NULL,
  `announcementChannelId` varchar(191) DEFAULT NULL,
  `announcementColor` varchar(191) DEFAULT '#f97316',
  `changelogChannelId` varchar(191) DEFAULT NULL,
  `changelogColor` varchar(191) DEFAULT '#22c55e',
  `changelogRoleId` varchar(191) DEFAULT NULL,
  `teamName` varchar(191) DEFAULT 'Team Nightbox'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `discordbot`
--

INSERT INTO `discordbot` (`id`, `name`, `token`, `clientId`, `guildId`, `isActive`, `createdAt`, `updatedAt`, `botType`, `clientSecret`, `status`, `whitelistChannelId`, `announcementChannelId`, `announcementColor`, `changelogChannelId`, `changelogColor`, `changelogRoleId`, `teamName`) VALUES
(1, 'AEGISStreamWatchBot', 'MTM5OTQ0NzIzMjc5MjQ5NDIxMg.GyA797.FXboqW8nVCXqf6ckNFGTysJbQqc93h-82i1hKs', '1399447232792494212', '936710630424076289', 1, '2025-07-30 11:38:04.089', '2025-07-30 11:38:04.089', 'streaming', 'q0uB4V8TY22_gRNgXXcXYr2eKOEsiXPP', 'offline', '1307754262922526762', NULL, '#f97316', NULL, '', NULL, ''),
(3, 'test-forms', 'MTQwMDA0OTM0MzIwOTI3NTUyMg.G_UoU7.I2TTx6xUu1UabJ43cMPDPC1bgOpK9d9lNG9Rb8', '1400049343209275522', '936710630424076289', 1, '2025-07-30 12:13:02.280', '2025-07-30 12:13:02.280', 'whitelist', '-UVpNFn1Xd6-e7h7n3Uh9TA4Dsj8qJOO', 'offline', '1307754262922526762', NULL, '#f97316', NULL, '', NULL, ''),
(6, 'Announcement', 'MTQwMDA0OTM0MzIwOTI3NTUyMg.G_UoU7.I2TTx6xUu1UabJ43cMPDPC1bgOpK9d9lNG9Rb8', '1400049343209275522', '936710630424076289', 1, '2025-07-31 07:32:05.226', '2025-08-01 08:12:10.393', 'announcements', '-UVpNFn1Xd6-e7h7n3Uh9TA4Dsj8qJOO', 'offline', '', '1400375323308327003', '#b91c1c', '1400375174443827332', '#22c55e', NULL, 'Team Nightbox');

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

--
-- Table structure for table `discordbotform`
--

CREATE TABLE `discordbotform` (
  `id` int(11) NOT NULL,
  `botId` int(11) NOT NULL,
  `formId` int(11) NOT NULL,
  `channelId` varchar(191) DEFAULT NULL,
  `isActive` tinyint(1) NOT NULL DEFAULT 1,
  `sortOrder` int(11) NOT NULL DEFAULT 0,
  `createdAt` datetime(3) NOT NULL DEFAULT current_timestamp(3)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `discordbotform`
--

INSERT INTO `discordbotform` (`id`, `botId`, `formId`, `channelId`, `isActive`, `sortOrder`, `createdAt`) VALUES
(1, 3, 5, '', 1, 0, '2025-07-30 13:18:43.592');

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

--
-- Table structure for table `discordnotificationconfig`
--

CREATE TABLE `discordnotificationconfig` (
  `id` int(11) NOT NULL,
  `serverId` varchar(191) NOT NULL,
  `serverName` varchar(191) NOT NULL,
  `channelId` varchar(191) NOT NULL,
  `channelName` varchar(191) NOT NULL,
  `notificationType` varchar(191) NOT NULL,
  `isActive` tinyint(1) NOT NULL DEFAULT 1,
  `customMessage` text DEFAULT NULL,
  `createdAt` datetime(3) NOT NULL DEFAULT current_timestamp(3),
  `updatedAt` datetime(3) NOT NULL DEFAULT current_timestamp(3)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `document`
--

CREATE TABLE `document` (
  `id` int(11) NOT NULL,
  `title` varchar(191) NOT NULL,
  `content` longtext DEFAULT NULL,
  `excerpt` text DEFAULT NULL,
  `category` varchar(191) DEFAULT NULL,
  `tags` text DEFAULT NULL,
  `fileUrl` varchar(191) DEFAULT NULL,
  `fileName` varchar(191) DEFAULT NULL,
  `fileType` varchar(191) DEFAULT NULL,
  `fileSize` int(11) DEFAULT NULL,
  `status` enum('DRAFT','PUBLISHED','ARCHIVED') NOT NULL DEFAULT 'DRAFT',
  `visibility` enum('PUBLIC','INTERNAL','RESTRICTED') NOT NULL DEFAULT 'INTERNAL',
  `version` int(11) NOT NULL DEFAULT 1,
  `createdAt` datetime(3) NOT NULL DEFAULT current_timestamp(3),
  `updatedAt` datetime(3) NOT NULL,
  `publishedAt` datetime(3) DEFAULT NULL,
  `authorId` int(11) NOT NULL,
  `visibleToRoles` text NOT NULL DEFAULT 'VERIAGENT,MODERATOR,DEVELOPERS,ADMIN,SUPER_ADMIN'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `document_version`
--

CREATE TABLE `document_version` (
  `id` int(11) NOT NULL,
  `documentId` int(11) NOT NULL,
  `version` int(11) NOT NULL,
  `title` varchar(191) NOT NULL,
  `content` longtext DEFAULT NULL,
  `changes` text DEFAULT NULL,
  `createdAt` datetime(3) NOT NULL DEFAULT current_timestamp(3),
  `createdBy` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `formsubmission`
--

CREATE TABLE `formsubmission` (
  `id` int(11) NOT NULL,
  `formId` int(11) NOT NULL,
  `submittedBy` varchar(191) NOT NULL,
  `formData` longtext NOT NULL,
  `status` varchar(191) NOT NULL DEFAULT 'Pending',
  `reviewedBy` int(11) DEFAULT NULL,
  `reviewedAt` datetime(3) DEFAULT NULL,
  `createdAt` datetime(3) NOT NULL DEFAULT current_timestamp(3)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `ftp_server`
--

CREATE TABLE `ftp_server` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `name` varchar(255) NOT NULL,
  `host` varchar(255) NOT NULL,
  `port` int(11) NOT NULL DEFAULT 21,
  `username` varchar(255) NOT NULL,
  `password` text DEFAULT NULL,
  `protocol` enum('FTP','FTPS','SFTP') NOT NULL DEFAULT 'FTP',
  `encryption` enum('None','SSL','TLS') NOT NULL DEFAULT 'None',
  `passive_mode` tinyint(1) NOT NULL DEFAULT 1,
  `ssl` tinyint(1) NOT NULL DEFAULT 0,
  `remote_path` varchar(500) NOT NULL DEFAULT '/',
  `remember_password` tinyint(1) NOT NULL DEFAULT 1,
  `server_type` enum('development','production') NOT NULL DEFAULT 'development',
  `last_connected` datetime(3) DEFAULT NULL,
  `created_at` datetime(3) NOT NULL DEFAULT current_timestamp(3),
  `updated_at` datetime(3) NOT NULL DEFAULT current_timestamp(3) ON UPDATE current_timestamp(3)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `push_2fa_challenge`
--

CREATE TABLE `push_2fa_challenge` (
  `id` int(11) NOT NULL,
  `userId` int(11) NOT NULL,
  `challengeCode` varchar(6) NOT NULL,
  `sessionToken` varchar(100) NOT NULL,
  `deviceId` int(11) NOT NULL,
  `status` enum('PENDING','APPROVED','DENIED','EXPIRED') NOT NULL DEFAULT 'PENDING',
  `createdAt` datetime(3) NOT NULL DEFAULT current_timestamp(3),
  `expiresAt` datetime(3) NOT NULL,
  `respondedAt` datetime(3) DEFAULT NULL,
  `ipAddress` varchar(45) DEFAULT NULL,
  `userAgent` text DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `push_2fa_device`
--

CREATE TABLE `push_2fa_device` (
  `id` int(11) NOT NULL,
  `userId` int(11) NOT NULL,
  `deviceToken` varchar(500) NOT NULL,
  `deviceName` varchar(100) DEFAULT NULL,
  `deviceType` enum('IOS','ANDROID','WEB') NOT NULL,
  `isActive` tinyint(1) NOT NULL DEFAULT 1,
  `createdAt` datetime(3) NOT NULL DEFAULT current_timestamp(3),
  `lastUsed` datetime(3) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `report`
--

CREATE TABLE `report` (
  `id` int(11) NOT NULL,
  `reporterName` varchar(191) NOT NULL,
  `playerName` varchar(191) NOT NULL,
  `discordUserId` varchar(191) NOT NULL,
  `subject` varchar(191) NOT NULL,
  `description` text NOT NULL,
  `priority` varchar(191) NOT NULL DEFAULT 'Medium',
  `status` varchar(191) NOT NULL DEFAULT 'Open',
  `attachments` longtext DEFAULT NULL,
  `linkedReports` text DEFAULT NULL,
  `violations` text DEFAULT NULL,
  `createdBy` int(11) DEFAULT NULL,
  `createdAt` datetime(3) NOT NULL DEFAULT current_timestamp(3),
  `updatedAt` datetime(3) NOT NULL DEFAULT current_timestamp(3)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `report`
--

INSERT INTO `report` (`id`, `reporterName`, `playerName`, `discordUserId`, `subject`, `description`, `priority`, `status`, `attachments`, `linkedReports`, `violations`, `createdBy`, `createdAt`, `updatedAt`) VALUES
(8, 'Melissa Helena Tambs', 'Zyncronix', '45323266', 'test 2', 'test', 'Medium', 'Open', '[]', '[]', '[\"valueOfLife\",\"powergaming\",\"metagaming\",\"combatlogging\",\"copbait\",\"vdm\",\"rdm\",\"forceperm\",\"newLifeRule\",\"greenzone\"]', 2, '2025-07-31 16:38:42.588', '2025-07-31 16:38:42.588'),
(9, 'Melissa Helena Tambs', 'ZeGal', '465218139714748426', 'tst3', 'Spiller snakker er toxic i support, hører ikke', 'Medium', 'Open', '[]', '[]', '[\"powergaming\",\"metagaming\",\"combatlogging\",\"copbait\",\"vdm\",\"rdm\",\"forceperm\",\"newLifeRule\",\"greenzone\",\"valueOfLife\"]', 2, '2025-08-01 08:00:32.732', '2025-08-01 08:00:32.732');

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

--
-- Table structure for table `setting`
--

CREATE TABLE `setting` (
  `id` int(11) NOT NULL,
  `key` varchar(191) NOT NULL,
  `value` longtext DEFAULT NULL,
  `encrypted` tinyint(1) NOT NULL DEFAULT 0,
  `createdAt` datetime(3) NOT NULL DEFAULT current_timestamp(3),
  `updatedAt` datetime(3) NOT NULL DEFAULT current_timestamp(3)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `setting`
--

INSERT INTO `setting` (`id`, `key`, `value`, `encrypted`, `createdAt`, `updatedAt`) VALUES
(1, 'webhook_language', 'no', 0, '2025-07-31 08:26:13.200', '2025-07-31 08:26:13.200'),
(2, 'webhook_enabled', 'true', 0, '2025-07-31 08:26:13.221', '2025-07-31 08:26:13.221');

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

--
-- Table structure for table `streamer`
--

CREATE TABLE `streamer` (
  `id` int(11) NOT NULL,
  `username` varchar(191) NOT NULL,
  `platform` enum('TWITCH','YOUTUBE','TIKTOK','KICK') NOT NULL,
  `platformUserId` varchar(191) DEFAULT NULL,
  `displayName` varchar(191) DEFAULT NULL,
  `profileImageUrl` varchar(191) DEFAULT NULL,
  `isActive` tinyint(1) NOT NULL DEFAULT 1,
  `lastChecked` datetime(3) DEFAULT NULL,
  `lastLiveAt` datetime(3) DEFAULT NULL,
  `isCurrentlyLive` tinyint(1) NOT NULL DEFAULT 0,
  `currentTitle` varchar(191) DEFAULT NULL,
  `currentGame` varchar(191) DEFAULT NULL,
  `currentViewers` int(11) DEFAULT NULL,
  `discordBotId` int(11) DEFAULT NULL,
  `discordChannelId` varchar(191) DEFAULT NULL,
  `customMessage` varchar(191) DEFAULT NULL,
  `createdAt` datetime(3) NOT NULL DEFAULT current_timestamp(3),
  `updatedAt` datetime(3) NOT NULL DEFAULT current_timestamp(3),
  `createdBy` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `streamer`
--

INSERT INTO `streamer` (`id`, `username`, `platform`, `platformUserId`, `displayName`, `profileImageUrl`, `isActive`, `lastChecked`, `lastLiveAt`, `isCurrentlyLive`, `currentTitle`, `currentGame`, `currentViewers`, `discordBotId`, `discordChannelId`, `customMessage`, `createdAt`, `updatedAt`, `createdBy`) VALUES
(3, 'sunni', 'TWITCH', NULL, NULL, NULL, 1, '2025-08-04 07:58:45.392', '2025-08-03 12:27:09.290', 0, NULL, NULL, NULL, 1, '1307754262922526762', NULL, '2025-07-30 11:56:06.365', '2025-07-30 11:56:06.365', 2),
(4, 'lejo98', 'TWITCH', NULL, NULL, NULL, 1, '2025-08-04 07:58:46.466', '2025-08-02 18:59:55.992', 0, NULL, NULL, NULL, 1, '1307754262922526762', NULL, '2025-07-30 13:22:45.228', '2025-07-30 13:22:45.228', 2),
(5, 'yuuukiii__', 'TWITCH', NULL, NULL, NULL, 1, '2025-08-04 07:58:44.308', '2025-08-01 19:43:18.383', 0, NULL, NULL, NULL, 1, '1307754262922526762', NULL, '2025-08-01 06:22:17.593', '2025-08-01 06:22:17.593', 2);

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

--
-- Table structure for table `streamnotification`
--

CREATE TABLE `streamnotification` (
  `id` int(11) NOT NULL,
  `streamerId` int(11) NOT NULL,
  `platform` enum('TWITCH','YOUTUBE','TIKTOK','KICK') NOT NULL,
  `title` varchar(191) DEFAULT NULL,
  `game` varchar(191) DEFAULT NULL,
  `viewers` int(11) DEFAULT NULL,
  `startedAt` datetime(3) NOT NULL,
  `endedAt` datetime(3) DEFAULT NULL,
  `notificationSent` tinyint(1) NOT NULL DEFAULT 0,
  `discordMessageId` varchar(191) DEFAULT NULL,
  `createdAt` datetime(3) NOT NULL DEFAULT current_timestamp(3)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `streamnotification`
--

INSERT INTO `streamnotification` (`id`, `streamerId`, `platform`, `title`, `game`, `viewers`, `startedAt`, `endedAt`, `notificationSent`, `discordMessageId`, `createdAt`) VALUES
(1, 3, 'TWITCH', 'sunni is live on Twitch!', NULL, NULL, '2025-07-30 11:56:07.017', NULL, 1, '1400084540302557255', '2025-07-30 11:56:07.018'),
(2, 3, 'TWITCH', 'sunni is live on Twitch!', NULL, NULL, '2025-07-31 12:05:22.545', NULL, 1, '1400449260490588170', '2025-07-31 12:05:22.546'),
(3, 5, 'TWITCH', 'yuuukiii__ is live on Twitch!', NULL, NULL, '2025-08-01 06:22:29.724', NULL, 1, '1400725353625817180', '2025-08-01 06:22:29.726'),
(4, 3, 'TWITCH', 'sunni is live on Twitch!', NULL, NULL, '2025-08-01 14:38:18.812', NULL, 1, '1400850128499380229', '2025-08-01 14:38:18.813'),
(5, 4, 'TWITCH', 'lejo98 is live on Twitch!', NULL, NULL, '2025-08-01 19:43:17.252', NULL, 1, '1400926883172057108', '2025-08-01 19:43:17.253'),
(6, 5, 'TWITCH', 'yuuukiii__ is live on Twitch!', NULL, NULL, '2025-08-01 19:43:18.839', NULL, 1, '1400926889664843837', '2025-08-01 19:43:18.840'),
(7, 3, 'TWITCH', 'sunni is live on Twitch!', NULL, NULL, '2025-08-02 09:08:54.617', NULL, 1, '1401129621080117320', '2025-08-02 09:08:54.619'),
(8, 4, 'TWITCH', 'lejo98 is live on Twitch!', NULL, NULL, '2025-08-02 14:47:18.708', NULL, 1, '1401214781364375622', '2025-08-02 14:47:18.710'),
(9, 4, 'TWITCH', 'lejo98 is live on Twitch!', NULL, NULL, '2025-08-02 18:07:05.834', NULL, 1, '1401265064522154074', '2025-08-02 18:07:05.837'),
(10, 4, 'TWITCH', 'lejo98 is live on Twitch!', NULL, NULL, '2025-08-02 18:23:05.381', NULL, 1, '1401269088826691628', '2025-08-02 18:23:05.382'),
(11, 4, 'TWITCH', 'lejo98 is live on Twitch!', NULL, NULL, '2025-08-02 18:38:23.942', NULL, 1, '1401272941668339722', '2025-08-02 18:38:23.943'),
(12, 4, 'TWITCH', 'lejo98 is live on Twitch!', NULL, NULL, '2025-08-02 18:59:56.406', NULL, 1, '1401278362357600286', '2025-08-02 18:59:56.407'),
(13, 3, 'TWITCH', 'sunni is live on Twitch!', NULL, NULL, '2025-08-03 12:27:09.759', NULL, 1, '1401541900212768838', '2025-08-03 12:27:09.760');

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

--
-- Table structure for table `txadmin_server_config`
--

CREATE TABLE `txadmin_server_config` (
  `id` int(11) NOT NULL,
  `serverUrl` varchar(191) NOT NULL,
  `isActive` tinyint(1) NOT NULL DEFAULT 1,
  `createdAt` datetime(3) NOT NULL DEFAULT current_timestamp(3),
  `updatedAt` datetime(3) NOT NULL DEFAULT current_timestamp(3) ON UPDATE current_timestamp(3)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `txadmin_server_config`
--

INSERT INTO `txadmin_server_config` (`id`, `serverUrl`, `isActive`, `createdAt`, `updatedAt`) VALUES
(3, 'http://localhost:40120/', 1, '2025-08-02 15:42:46.671', '2025-08-02 17:45:57.015');

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

--
-- Table structure for table `txadmin_user_config`
--

CREATE TABLE `txadmin_user_config` (
  `id` int(11) NOT NULL,
  `userId` int(11) NOT NULL,
  `username` varchar(191) NOT NULL,
  `password` text NOT NULL,
  `createdAt` datetime(3) NOT NULL DEFAULT current_timestamp(3),
  `updatedAt` datetime(3) NOT NULL DEFAULT current_timestamp(3) ON UPDATE current_timestamp(3)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `txadmin_user_config`
--

INSERT INTO `txadmin_user_config` (`id`, `userId`, `username`, `password`, `createdAt`, `updatedAt`) VALUES
(6, 2, 'txAdmin', '5ee904c7f1a513d89b00a5e45625a842:eed066d0990c42eae9de5bcce3fcda1e', '2025-08-04 10:57:10.346', '2025-08-04 10:57:10.346');

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

--
-- Table structure for table `user`
--

CREATE TABLE `user` (
  `id` int(11) NOT NULL,
  `username` varchar(191) NOT NULL,
  `email` varchar(191) NOT NULL,
  `password` varchar(191) NOT NULL,
  `firstName` varchar(191) DEFAULT NULL,
  `lastName` varchar(191) DEFAULT NULL,
  `role` enum('VERIAGENT','MODERATOR','DEVELOPERS','ADMIN','SUPER_ADMIN') NOT NULL DEFAULT 'VERIAGENT',
  `twoFactorEnabled` tinyint(1) NOT NULL DEFAULT 0,
  `twoFactorSecret` varchar(191) DEFAULT NULL,
  `twoFactorBackupCodes` varchar(191) DEFAULT NULL,
  `lastLogin` datetime(3) DEFAULT NULL,
  `loginAttempts` int(11) NOT NULL DEFAULT 0,
  `lockedUntil` datetime(3) DEFAULT NULL,
  `createdAt` datetime(3) NOT NULL DEFAULT current_timestamp(3),
  `updatedAt` datetime(3) NOT NULL DEFAULT current_timestamp(3),
  `isVerified` tinyint(1) NOT NULL DEFAULT 0,
  `isTemporaryPassword` tinyint(1) NOT NULL DEFAULT 0,
  `passwordChangeRequired` tinyint(1) NOT NULL DEFAULT 0,
  `preferredTwoFactorMethod` enum('TOTP','PUSH','BOTH') NOT NULL DEFAULT 'TOTP',
  `pushTwoFactorEnabled` tinyint(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `user`
--

INSERT INTO `user` (`id`, `username`, `email`, `password`, `firstName`, `lastName`, `role`, `twoFactorEnabled`, `twoFactorSecret`, `twoFactorBackupCodes`, `lastLogin`, `loginAttempts`, `lockedUntil`, `createdAt`, `updatedAt`, `isVerified`, `isTemporaryPassword`, `passwordChangeRequired`, `preferredTwoFactorMethod`, `pushTwoFactorEnabled`) VALUES
(2, 'melissa.tambs@gmail.com', 'melissa.tambs@gmail.com', '$2b$12$6NtS0TJ.1jXpzRhw6.88SOtq/fZ/9yxtoy/./3OrGEjEzjCxT54Mm', 'Melissa Helena', 'Tambs', 'SUPER_ADMIN', 1, 'MVBVQWCOORTUGWTTLNIW47KOKJDXKUTWFZASGWB2F5FCY5RZERUA', '[\"$2b$12$hzNTEUSA0zefTy8klqe8WOCV74sf/tpYW.HwI6qPhuq6Z4z44Nq8m\",\"$2b$12$6yuLTjCVic5nWK8s9SoCBuM5Zy9Ty3sxFKs4MS65vYz7rUC9Jky..\",\"$2b$12$j.dQzwGm0ObkYW5KvAH6wOeOHy9FdMpr36EhYeUDkmbBJ7S0/gWjy\",\"', '2025-08-04 05:58:26.922', 0, NULL, '2025-07-30 11:12:04.791', '2025-08-02 15:53:36.115', 1, 0, 0, 'BOTH', 0);

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

--
-- Table structure for table `usersession`
--

CREATE TABLE `usersession` (
  `id` varchar(191) NOT NULL,
  `userId` int(11) NOT NULL,
  `token` varchar(191) NOT NULL,
  `expiresAt` datetime(3) NOT NULL,
  `createdAt` datetime(3) NOT NULL DEFAULT current_timestamp(3)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `usersession`
--

INSERT INTO `usersession` (`id`, `userId`, `token`, `expiresAt`, `createdAt`) VALUES
('cmdpvaw4m0003wtgwm7xquw6s', 2, 'g2e94x2g3opmdpvaw4l', '2025-07-31 11:13:31.173', '2025-07-30 11:13:31.175'),
('cmdpvif6k0007wtgwxxygqpak', 2, 'bsyn3tknjkmdpvif6j', '2025-07-31 11:19:22.459', '2025-07-30 11:19:22.461'),
('cmdpvlu4x0009wtgw8r7daku4', 2, '6xn6kzhactmdpvlu4w', '2025-07-30 11:32:01.808', '2025-07-30 11:22:01.809'),
('cmdpvr21z000dwtgw86g6r0n4', 2, 'wbgjnqw2b0nmdpvr21y', '2025-07-31 11:26:05.350', '2025-07-30 11:26:05.351'),
('cmdpvsfmd000hwtgwffuaj4ow', 2, 'zrshiy0o9qmdpvsfmc', '2025-07-31 11:27:09.588', '2025-07-30 11:27:09.590'),
('cmdpw3pof0003wtbof2h9duut', 2, 'a7lr5uvb5nkmdpw3poe', '2025-07-31 11:35:55.839', '2025-07-30 11:35:55.840'),
('cmdr0qh3l0003wtx0uy964r2m', 2, 'cglhz4bfbcwmdr0qh3i', '2025-08-01 06:33:22.447', '2025-07-31 06:33:22.449'),
('cmdrd50ij0003wtu0k04x7cgp', 2, '2xo2u28uw5cmdrd50ig', '2025-08-01 12:20:36.184', '2025-07-31 12:20:36.187'),
('cmdrefgfv0003wt84but7yfg4', 2, '9fx1h7n7dtcmdrefgfs', '2025-08-01 12:56:43.000', '2025-07-31 12:56:43.003'),
('cmdrhgzkz0003ug5kd5jzhrbi', 2, '4jqhez8rtylmdrhgzky', '2025-08-01 14:21:53.314', '2025-07-31 14:21:53.316'),
('cmdrvheyt0003ugbs8nu0p2ei', 2, '6wl4mley1x7mdrvheys', '2025-08-01 20:54:07.876', '2025-07-31 20:54:07.878'),
('cmdsol4dd0003wts0pyclug84', 2, 'gt25m5eaemdsol4db', '2025-08-02 10:28:49.631', '2025-08-01 10:28:49.634'),
('cmduf1fmj0003ugesxubx74ye', 2, 'co0j7ow0vemduf1fmi', '2025-08-03 15:37:06.906', '2025-08-02 15:37:06.908'),
('cmdufprh50007ugesex08b4vo', 2, '1qkqbdrd2rfmdufprh4', '2025-08-03 15:56:02.008', '2025-08-02 15:56:02.009'),
('cmduupmzs0003ug5kzjfkzu6m', 2, 'ypx258c69k8mduupmzr', '2025-08-03 22:55:50.439', '2025-08-02 22:55:50.441'),
('cmdvk9hrt0003ugn8lucgqo7j', 2, 'xqha96ubc7imdvk9hrs', '2025-08-04 10:51:07.192', '2025-08-03 10:51:07.193'),
('cmdwp8yub0003wtowmp1v7ra9', 2, '3l7brq3fg1jmdwp8yu9', '2025-08-05 05:58:26.913', '2025-08-04 05:58:26.915');

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

--
-- Table structure for table `whitelistform`
--

CREATE TABLE `whitelistform` (
  `id` int(11) NOT NULL,
  `name` varchar(191) NOT NULL,
  `description` text DEFAULT NULL,
  `welcomeMessage` text DEFAULT NULL,
  `submitButtonText` varchar(191) NOT NULL DEFAULT 'Submit Application',
  `successMessage` text DEFAULT NULL,
  `fields` longtext NOT NULL,
  `status` varchar(191) NOT NULL DEFAULT 'Active',
  `submissions` int(11) NOT NULL DEFAULT 0,
  `createdBy` int(11) DEFAULT NULL,
  `createdAt` datetime(3) NOT NULL DEFAULT current_timestamp(3),
  `updatedAt` datetime(3) NOT NULL DEFAULT current_timestamp(3)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `whitelistform`
--

INSERT INTO `whitelistform` (`id`, `name`, `description`, `welcomeMessage`, `submitButtonText`, `successMessage`, `fields`, `status`, `submissions`, `createdBy`, `createdAt`, `updatedAt`) VALUES
(5, 'test-forms', NULL, NULL, '{\"en\":\"Submit Application\",\"no\":\"Send inn søknad\"}', '{\"en\":\"Thank you for your application! We will review it and get back to you soon.\",\"no\":\"Takk for søknaden din! Vi vil gjennomgå den og komme tilbake til deg snart.\"}', '[{\"id\":1,\"label\":\"Discord Username\",\"type\":\"text\",\"required\":true,\"placeholder\":\"YourDiscordName#1234\",\"options\":[]},{\"id\":2,\"label\":\"Character Name\",\"type\":\"text\",\"required\":true,\"placeholder\":\"Enter your character name...\",\"options\":[]}]', 'Active', 0, 2, '2025-07-30 13:18:43.578', '2025-07-30 13:18:43.578');

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

--
-- Table structure for table `_prisma_migrations`
--

CREATE TABLE `_prisma_migrations` (
  `id` varchar(36) NOT NULL,
  `checksum` varchar(64) NOT NULL,
  `finished_at` datetime(3) DEFAULT NULL,
  `migration_name` varchar(255) NOT NULL,
  `logs` text DEFAULT NULL,
  `rolled_back_at` datetime(3) DEFAULT NULL,
  `started_at` datetime(3) NOT NULL DEFAULT current_timestamp(3),
  `applied_steps_count` int(10) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `_prisma_migrations`
--

INSERT INTO `_prisma_migrations` (`id`, `checksum`, `finished_at`, `migration_name`, `logs`, `rolled_back_at`, `started_at`, `applied_steps_count`) VALUES
('11486d3a-9db5-4a45-ad29-f857a3ae41c5', 'f92472a2f95927b852fa3f67a8d4cf69d71cd225bf54c3f318e9582d8bc76383', '2025-07-30 10:56:57.649', '20250728080512_remove_ecommerce_tables', NULL, NULL, '2025-07-30 10:56:57.588', 1),
('148a490f-9111-4fb4-9a95-1dc4218276c0', '3367fd9fd811fa3e1044ea4b0cf1d50392a7c371d89c48547022a465a613603b', '2025-07-30 10:56:58.042', '20250728085501_discord_bot_forms_many_to_many', NULL, NULL, '2025-07-30 10:56:57.924', 1),
('1b0147b2-ab23-4677-ae98-2d2d5684ee5d', 'cd838a300349902305c2506f3596ba3d737a2e5bfecd21dfd68dcb7da298d826', '2025-07-30 10:56:57.922', '20250728084600_add_bot_type_field', NULL, NULL, '2025-07-30 10:56:57.909', 1),
('22fe213c-328e-4ade-b7cd-6dcf75e514ae', '341ddff9a277059c881cb96b29a7193bff48596be805c492b4f68cced4c14f89', '2025-07-30 10:56:58.061', '20250728093650_add_settings_table', NULL, NULL, '2025-07-30 10:56:58.044', 1),
('4717dabd-ae03-49bc-83ca-38677dba6b95', '4fed65500bbee5dac3cd2b80077d395cf8a44753b60c81483ca6b34077dbe613', '2025-07-30 10:56:57.161', '20250723091736_add_password_management_fields', NULL, NULL, '2025-07-30 10:56:56.655', 1),
('55269177-c85a-478c-a925-1b1ac4a9de7f', 'b4d3dacf5160736d1abc480942233edde4555edb61cd60d394275afbdce1b75a', '2025-07-30 10:56:57.908', '20250728083915_add_discord_bots_table', NULL, NULL, '2025-07-30 10:56:57.793', 1),
('56428138-aedb-4b5b-85b9-821be05987e4', '27e98865649a494749e7007e206b4dc4df08bf9e2d48ecd1ee836181ba216c00', '2025-07-30 10:57:02.539', '20250730105701_remove_cfxid_add_missing_fields', NULL, NULL, '2025-07-30 10:57:01.639', 1),
('7b622ef6-900d-403a-8316-9650446333d4', '3c37da2c6cc973d8e3bdc28d06ea3045d9ad12de95de2646de802f63363e855c', '2025-07-30 10:56:57.216', '20250723142746_set_default_permissions', NULL, NULL, '2025-07-30 10:56:57.206', 1),
('a3c40652-7c44-4bab-8c52-af123fcfde37', '0d72359a4a43d031fa66d064a46c2c1f60c816be4ac50dd9d55a1989979db84f', '2025-07-30 10:56:58.287', '20250728115617_add_streamwatch_tables', NULL, NULL, '2025-07-30 10:56:58.062', 1),
('b252ed9c-05a7-46cd-a7bf-385d06452536', '4329b3d64d4f8a6fe7bf65a64a075b21ccb52827efe880420f81383ec778ca06', '2025-07-30 10:56:57.204', '20250723142453_add_user_permissions', NULL, NULL, '2025-07-30 10:56:57.164', 1),
('b8ed6ea0-8562-4a50-b75c-0f22bb7829e8', 'c2b4d53e08a9526ee383d4a0adb10d27b9c147fbb94b3e3c97ea74a35abf2ac5', '2025-07-30 10:56:57.587', '20250728075701_add_reports_table', NULL, NULL, '2025-07-30 10:56:57.218', 1),
('c1467057-9385-447e-8283-289520cfbe29', '76eb11242bfe1faf18c219f53b5e7ca2fade06c1d040ef57da076b0340fb1cbf', '2025-07-30 10:56:57.792', '20250728082408_add_forms_tables', NULL, NULL, '2025-07-30 10:56:57.650', 1);

--
-- Indexes for dumped tables
--

--
-- Indexes for table `discordapplication`
--
ALTER TABLE `discordapplication`
  ADD PRIMARY KEY (`id`),
  ADD KEY `discordapplication_typeId_idx` (`typeId`),
  ADD KEY `discordapplication_status_idx` (`status`),
  ADD KEY `discordapplication_applicantId_idx` (`applicantId`),
  ADD KEY `discordapplication_submittedAt_idx` (`submittedAt`),
  ADD KEY `discordapplication_reviewedBy_idx` (`reviewedBy`);

--
-- Indexes for table `discordapplicationtype`
--
ALTER TABLE `discordapplicationtype`
  ADD PRIMARY KEY (`id`),
  ADD KEY `discordapplicationtype_discordBotId_idx` (`discordBotId`),
  ADD KEY `discordapplicationtype_createdBy_idx` (`createdBy`);

--
-- Indexes for table `discordbot`
--
ALTER TABLE `discordbot`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_bot_active` (`isActive`),
  ADD KEY `idx_bot_type` (`botType`);

--
-- Indexes for table `discordbotform`
--
ALTER TABLE `discordbotform`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_bot_form` (`botId`,`formId`),
  ADD KEY `idx_bot_form_bot` (`botId`),
  ADD KEY `idx_bot_form_form` (`formId`);

--
-- Indexes for table `discordnotificationconfig`
--
ALTER TABLE `discordnotificationconfig`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_server_channel_type` (`serverId`,`channelId`,`notificationType`),
  ADD KEY `idx_discord_config_server` (`serverId`),
  ADD KEY `idx_discord_config_type` (`notificationType`),
  ADD KEY `idx_discord_config_active` (`isActive`);

--
-- Indexes for table `document`
--
ALTER TABLE `document`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_document_author` (`authorId`),
  ADD KEY `idx_document_category` (`category`),
  ADD KEY `idx_document_status` (`status`),
  ADD KEY `idx_document_visibility` (`visibility`),
  ADD KEY `idx_document_created` (`createdAt`);

--
-- Indexes for table `document_version`
--
ALTER TABLE `document_version`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `document_version_documentId_version_key` (`documentId`,`version`),
  ADD KEY `idx_document_version_doc` (`documentId`),
  ADD KEY `idx_document_version_user` (`createdBy`);

--
-- Indexes for table `formsubmission`
--
ALTER TABLE `formsubmission`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_submission_form` (`formId`),
  ADD KEY `idx_submission_created` (`createdAt`),
  ADD KEY `idx_submission_status` (`status`),
  ADD KEY `formSubmission_reviewedBy_fkey` (`reviewedBy`);

--
-- Indexes for table `ftp_server`
--
ALTER TABLE `ftp_server`
  ADD PRIMARY KEY (`id`),
  ADD KEY `ftp_server_user_id_fkey` (`user_id`),
  ADD KEY `idx_ftp_server_user_type` (`user_id`,`server_type`);

--
-- Indexes for table `push_2fa_challenge`
--
ALTER TABLE `push_2fa_challenge`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_challenge_code` (`challengeCode`),
  ADD KEY `idx_session_token` (`sessionToken`),
  ADD KEY `idx_user_challenges` (`userId`),
  ADD KEY `idx_status_expires` (`status`,`expiresAt`),
  ADD KEY `push_2fa_challenge_deviceId_fkey` (`deviceId`);

--
-- Indexes for table `push_2fa_device`
--
ALTER TABLE `push_2fa_device`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_user_devices` (`userId`),
  ADD KEY `idx_device_token` (`deviceToken`);

--
-- Indexes for table `report`
--
ALTER TABLE `report`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_report_created` (`createdAt`),
  ADD KEY `idx_report_status` (`status`),
  ADD KEY `idx_report_priority` (`priority`),
  ADD KEY `idx_report_player` (`playerName`),
  ADD KEY `report_createdBy_fkey` (`createdBy`);

--
-- Indexes for table `setting`
--
ALTER TABLE `setting`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `setting_key_key` (`key`),
  ADD KEY `idx_setting_key` (`key`);

--
-- Indexes for table `streamer`
--
ALTER TABLE `streamer`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_streamer_platform` (`username`,`platform`),
  ADD KEY `idx_streamer_platform` (`platform`),
  ADD KEY `idx_streamer_active` (`isActive`),
  ADD KEY `idx_streamer_live` (`isCurrentlyLive`),
  ADD KEY `idx_streamer_creator` (`createdBy`),
  ADD KEY `streamer_discordBotId_fkey` (`discordBotId`);

--
-- Indexes for table `streamnotification`
--
ALTER TABLE `streamnotification`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_notification_streamer` (`streamerId`),
  ADD KEY `idx_notification_started` (`startedAt`),
  ADD KEY `idx_notification_sent` (`notificationSent`);

--
-- Indexes for table `txadmin_server_config`
--
ALTER TABLE `txadmin_server_config`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_txadmin_server_config_active` (`isActive`);

--
-- Indexes for table `txadmin_user_config`
--
ALTER TABLE `txadmin_user_config`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `txadmin_user_config_userId_key` (`userId`),
  ADD KEY `idx_txadmin_user_config_user` (`userId`);

--
-- Indexes for table `user`
--
ALTER TABLE `user`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `User_username_key` (`username`),
  ADD UNIQUE KEY `User_email_key` (`email`),
  ADD KEY `idx_user_email` (`email`),
  ADD KEY `idx_user_role` (`role`),
  ADD KEY `idx_user_username` (`username`);

--
-- Indexes for table `usersession`
--
ALTER TABLE `usersession`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `UserSession_token_key` (`token`),
  ADD KEY `UserSession_userId_fkey` (`userId`);

--
-- Indexes for table `whitelistform`
--
ALTER TABLE `whitelistform`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_form_created` (`createdAt`),
  ADD KEY `idx_form_status` (`status`),
  ADD KEY `whitelistForm_createdBy_fkey` (`createdBy`);

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

--
-- AUTO_INCREMENT for dumped tables
--

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

--
-- Constraints for dumped tables
--

--
-- Constraints for table `discordapplication`
--
ALTER TABLE `discordapplication`
  ADD CONSTRAINT `discordapplication_reviewedBy_fkey` FOREIGN KEY (`reviewedBy`) REFERENCES `user` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `discordapplication_typeId_fkey` FOREIGN KEY (`typeId`) REFERENCES `discordapplicationtype` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `discordapplicationtype`
--
ALTER TABLE `discordapplicationtype`
  ADD CONSTRAINT `discordapplicationtype_createdBy_fkey` FOREIGN KEY (`createdBy`) REFERENCES `user` (`id`) ON UPDATE CASCADE,
  ADD CONSTRAINT `discordapplicationtype_discordBotId_fkey` FOREIGN KEY (`discordBotId`) REFERENCES `discordbot` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `discordbotform`
--
ALTER TABLE `discordbotform`
  ADD CONSTRAINT `discordBotForm_botId_fkey` FOREIGN KEY (`botId`) REFERENCES `discordbot` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `discordBotForm_formId_fkey` FOREIGN KEY (`formId`) REFERENCES `whitelistform` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `document`
--
ALTER TABLE `document`
  ADD CONSTRAINT `document_authorId_fkey` FOREIGN KEY (`authorId`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `document_version`
--
ALTER TABLE `document_version`
  ADD CONSTRAINT `document_version_createdBy_fkey` FOREIGN KEY (`createdBy`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `document_version_documentId_fkey` FOREIGN KEY (`documentId`) REFERENCES `document` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `formsubmission`
--
ALTER TABLE `formsubmission`
  ADD CONSTRAINT `formSubmission_formId_fkey` FOREIGN KEY (`formId`) REFERENCES `whitelistform` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `formSubmission_reviewedBy_fkey` FOREIGN KEY (`reviewedBy`) REFERENCES `user` (`id`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `ftp_server`
--
ALTER TABLE `ftp_server`
  ADD CONSTRAINT `ftp_server_user_id_fkey` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `push_2fa_challenge`
--
ALTER TABLE `push_2fa_challenge`
  ADD CONSTRAINT `push_2fa_challenge_deviceId_fkey` FOREIGN KEY (`deviceId`) REFERENCES `push_2fa_device` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `push_2fa_challenge_userId_fkey` FOREIGN KEY (`userId`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `push_2fa_device`
--
ALTER TABLE `push_2fa_device`
  ADD CONSTRAINT `push_2fa_device_userId_fkey` FOREIGN KEY (`userId`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `report`
--
ALTER TABLE `report`
  ADD CONSTRAINT `report_createdBy_fkey` FOREIGN KEY (`createdBy`) REFERENCES `user` (`id`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `streamer`
--
ALTER TABLE `streamer`
  ADD CONSTRAINT `streamer_createdBy_fkey` FOREIGN KEY (`createdBy`) REFERENCES `user` (`id`) ON UPDATE CASCADE,
  ADD CONSTRAINT `streamer_discordBotId_fkey` FOREIGN KEY (`discordBotId`) REFERENCES `discordbot` (`id`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `streamnotification`
--
ALTER TABLE `streamnotification`
  ADD CONSTRAINT `streamNotification_streamerId_fkey` FOREIGN KEY (`streamerId`) REFERENCES `streamer` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `txadmin_user_config`
--
ALTER TABLE `txadmin_user_config`
  ADD CONSTRAINT `txadmin_user_config_userId_fkey` FOREIGN KEY (`userId`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `usersession`
--
ALTER TABLE `usersession`
  ADD CONSTRAINT `UserSession_userId_fkey` FOREIGN KEY (`userId`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `whitelistform`
--
ALTER TABLE `whitelistform`
  ADD CONSTRAINT `whitelistForm_createdBy_fkey` FOREIGN KEY (`createdBy`) REFERENCES `user` (`id`) ON DELETE SET NULL ON UPDATE CASCADE;
COMMIT;

