|
| 1 | +SET NAMES utf8mb4; |
| 2 | +SET FOREIGN_KEY_CHECKS = 0; |
| 3 | + |
| 4 | +-- ---------------------------- |
| 5 | +-- Table structure for backup-codes |
| 6 | +-- ---------------------------- |
| 7 | +DROP TABLE IF EXISTS `backup-codes`; |
| 8 | +CREATE TABLE `backup-codes` ( |
| 9 | + `code` int(6) NOT NULL, |
| 10 | + `userId` int(11) NOT NULL, |
| 11 | + `used` int(1) NOT NULL DEFAULT '0', |
| 12 | + `createdAt` datetime NOT NULL, |
| 13 | + `updatedAt` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP, |
| 14 | + PRIMARY KEY (`code`) |
| 15 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; |
| 16 | + |
| 17 | +-- ---------------------------- |
| 18 | +-- Table structure for emails |
| 19 | +-- ---------------------------- |
| 20 | +DROP TABLE IF EXISTS `emails`; |
| 21 | +CREATE TABLE `emails` ( |
| 22 | + `id` int(11) NOT NULL AUTO_INCREMENT, |
| 23 | + `email` varchar(255) NOT NULL, |
| 24 | + `userId` int(11) NOT NULL, |
| 25 | + `isVerified` int(1) NOT NULL DEFAULT '0', |
| 26 | + `isPrimary` int(1) NOT NULL DEFAULT '0', |
| 27 | + `createdAt` datetime NOT NULL, |
| 28 | + `updatedAt` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP, |
| 29 | + PRIMARY KEY (`id`) |
| 30 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; |
| 31 | + |
| 32 | +-- ---------------------------- |
| 33 | +-- Table structure for memberships |
| 34 | +-- ---------------------------- |
| 35 | +DROP TABLE IF EXISTS `memberships`; |
| 36 | +CREATE TABLE `memberships` ( |
| 37 | + `id` int(11) NOT NULL AUTO_INCREMENT, |
| 38 | + `organizationId` int(11) NOT NULL, |
| 39 | + `userId` int(11) NOT NULL, |
| 40 | + `role` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT 'member', |
| 41 | + `createdAt` datetime NOT NULL, |
| 42 | + `updatedAt` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP, |
| 43 | + PRIMARY KEY (`id`) |
| 44 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; |
| 45 | + |
| 46 | +-- ---------------------------- |
| 47 | +-- Table structure for organizations |
| 48 | +-- ---------------------------- |
| 49 | +DROP TABLE IF EXISTS `organizations`; |
| 50 | +CREATE TABLE `organizations` ( |
| 51 | + `id` int(11) NOT NULL AUTO_INCREMENT, |
| 52 | + `name` varchar(255) DEFAULT NULL, |
| 53 | + `invitationDomain` varchar(255) DEFAULT NULL, |
| 54 | + `createdAt` datetime NOT NULL, |
| 55 | + `updatedAt` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP, |
| 56 | + PRIMARY KEY (`id`) |
| 57 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; |
| 58 | + |
| 59 | +-- ---------------------------- |
| 60 | +-- Table structure for users |
| 61 | +-- ---------------------------- |
| 62 | +DROP TABLE IF EXISTS `users`; |
| 63 | +CREATE TABLE `users` ( |
| 64 | + `id` int(12) NOT NULL AUTO_INCREMENT, |
| 65 | + `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL, |
| 66 | + `nickname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL, |
| 67 | + `primaryEmail` int(12) DEFAULT NULL, |
| 68 | + `password` varchar(255) DEFAULT NULL, |
| 69 | + `twoFactorEnabled` int(1) NOT NULL DEFAULT '0', |
| 70 | + `twoFactorSecret` varchar(255) DEFAULT NULL, |
| 71 | + `countryCode` varchar(2) DEFAULT NULL, |
| 72 | + `timezone` varchar(255) NOT NULL DEFAULT 'Europe/Amsterdam', |
| 73 | + `notificationEmails` int(1) NOT NULL DEFAULT '1', |
| 74 | + `preferredLanguage` varchar(5) NOT NULL DEFAULT 'en-us', |
| 75 | + `prefersReducedMotion` int(1) NOT NULL DEFAULT '0', |
| 76 | + `createdAt` datetime(6) NOT NULL, |
| 77 | + `updatedAt` datetime(6) NOT NULL ON UPDATE CURRENT_TIMESTAMP(6), |
| 78 | + PRIMARY KEY (`id`) |
| 79 | +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; |
| 80 | + |
| 81 | +SET FOREIGN_KEY_CHECKS = 1; |
0 commit comments