-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8cad7f3
commit df29cab
Showing
1 changed file
with
106 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
-- CreateTable | ||
CREATE TABLE `Users` ( | ||
`id` INTEGER NOT NULL AUTO_INCREMENT, | ||
`email` VARCHAR(191) NOT NULL, | ||
`password` VARCHAR(191) NULL, | ||
`username` VARCHAR(191) NULL, | ||
`firstname` VARCHAR(191) NULL, | ||
`lastname` VARCHAR(191) NULL, | ||
`bio` VARCHAR(191) NULL, | ||
`timezone` VARCHAR(191) NULL, | ||
`googleProfileId` VARCHAR(191) NULL, | ||
`microsoftProfileId` VARCHAR(191) NULL, | ||
`emailVerified` BOOLEAN NOT NULL DEFAULT false, | ||
`isDeleted` BOOLEAN NOT NULL DEFAULT false, | ||
`onboarding` JSON NOT NULL, | ||
`createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), | ||
`updatedAt` DATETIME(3) NOT NULL, | ||
|
||
UNIQUE INDEX `Users_email_key`(`email`), | ||
UNIQUE INDEX `Users_username_key`(`username`), | ||
PRIMARY KEY (`id`) | ||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | ||
|
||
-- CreateTable | ||
CREATE TABLE `Calendar` ( | ||
`id` INTEGER NOT NULL AUTO_INCREMENT, | ||
`name` VARCHAR(191) NOT NULL, | ||
`ownerId` INTEGER NOT NULL, | ||
`isPrimary` BOOLEAN NOT NULL DEFAULT false, | ||
`isDeleted` BOOLEAN NOT NULL DEFAULT false, | ||
|
||
PRIMARY KEY (`id`) | ||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | ||
|
||
-- CreateTable | ||
CREATE TABLE `EventType` ( | ||
`id` INTEGER NOT NULL AUTO_INCREMENT, | ||
`name` VARCHAR(191) NOT NULL, | ||
`appGenerated` BOOLEAN NOT NULL, | ||
`ownerId` INTEGER NOT NULL, | ||
`isDeleted` BOOLEAN NOT NULL DEFAULT false, | ||
|
||
PRIMARY KEY (`id`) | ||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | ||
|
||
-- CreateTable | ||
CREATE TABLE `Event` ( | ||
`id` INTEGER NOT NULL AUTO_INCREMENT, | ||
`name` VARCHAR(191) NOT NULL, | ||
`description` VARCHAR(191) NULL, | ||
`location` VARCHAR(191) NULL, | ||
`startTime` DATETIME(3) NOT NULL, | ||
`endTime` DATETIME(3) NOT NULL, | ||
`ownerId` INTEGER NOT NULL, | ||
`eventTypeId` INTEGER NOT NULL, | ||
`calendarId` INTEGER NOT NULL, | ||
`isPrivate` BOOLEAN NOT NULL DEFAULT true, | ||
`isDeleted` BOOLEAN NOT NULL DEFAULT false, | ||
|
||
PRIMARY KEY (`id`) | ||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | ||
|
||
-- CreateTable | ||
CREATE TABLE `RecurringEvent` ( | ||
`id` INTEGER NOT NULL AUTO_INCREMENT, | ||
`eventId` INTEGER NOT NULL, | ||
`recurringFrequency` ENUM('YEARLY', 'MONTHLY', 'WEEKLY', 'DAILY', 'HOURLY') NULL, | ||
`interval` INTEGER NULL, | ||
`count` INTEGER NULL, | ||
`daysOfWeek` VARCHAR(191) NULL, | ||
`weeksOfMonth` VARCHAR(191) NULL, | ||
`daysOfMonth` VARCHAR(191) NULL, | ||
`monthsOfYear` VARCHAR(191) NULL, | ||
|
||
PRIMARY KEY (`id`) | ||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | ||
|
||
-- CreateTable | ||
CREATE TABLE `Attendees` ( | ||
`id` INTEGER NOT NULL AUTO_INCREMENT, | ||
`eventId` INTEGER NOT NULL, | ||
`attendeeId` INTEGER NOT NULL, | ||
|
||
PRIMARY KEY (`id`) | ||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | ||
|
||
-- CreateTable | ||
CREATE TABLE `AccessToken` ( | ||
`id` INTEGER NOT NULL AUTO_INCREMENT, | ||
`userId` INTEGER NOT NULL, | ||
`associatedEmail` VARCHAR(191) NOT NULL, | ||
`tokenType` ENUM('BEARER') NOT NULL, | ||
`calendarId` VARCHAR(191) NOT NULL, | ||
`calendarType` ENUM('GOOGLECAL', 'OUTLOOKCAL') NOT NULL, | ||
`scope` VARCHAR(191) NOT NULL, | ||
`expiry` DATETIME(3) NOT NULL, | ||
`accessToken` VARCHAR(191) NOT NULL, | ||
`refreshToken` VARCHAR(191) NOT NULL, | ||
`isDeleted` BOOLEAN NOT NULL DEFAULT false, | ||
`createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), | ||
`updatedAt` DATETIME(3) NOT NULL, | ||
|
||
UNIQUE INDEX `AccessToken_userId_calendarId_key`(`userId`, `calendarId`), | ||
PRIMARY KEY (`id`) | ||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | ||
|