Skip to content

Commit

Permalink
changed server from branch to folder
Browse files Browse the repository at this point in the history
  • Loading branch information
skushagra committed Sep 27, 2024
1 parent 1c7c3af commit af27d26
Show file tree
Hide file tree
Showing 43 changed files with 193 additions and 5 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
-- CreateTable
CREATE TABLE `User` (
`UserId` INTEGER NOT NULL AUTO_INCREMENT,
`Name` VARCHAR(191) NOT NULL,
`Email` VARCHAR(255) NOT NULL,
`Password` VARCHAR(255) NOT NULL,
`PhoneNumber` VARCHAR(15) NOT NULL,
`LoginAllowed` BOOLEAN NOT NULL DEFAULT true,
`created_on` TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
`updated_on` TIMESTAMP(6) NOT NULL,
`last_login` TIMESTAMP(6) NULL,

UNIQUE INDEX `User_Email_key`(`Email`),
UNIQUE INDEX `User_PhoneNumber_key`(`PhoneNumber`),
PRIMARY KEY (`UserId`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `UserRoles` (
`user_id` INTEGER NOT NULL,
`Role` ENUM('ADMIN', 'TEACHER', 'STUDENT') NOT NULL,
`created_at` TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
`updated_at` TIMESTAMP(6) NOT NULL,

PRIMARY KEY (`user_id`, `Role`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `UserDevice` (
`UserDeviceId` INTEGER NOT NULL AUTO_INCREMENT,
`UserId` INTEGER NOT NULL,
`DeviceId` INTEGER NOT NULL,
`created_on` TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
`updated_on` TIMESTAMP(6) NOT NULL,

PRIMARY KEY (`UserDeviceId`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `SignInStates` (
`StateId` INTEGER NOT NULL AUTO_INCREMENT,
`user_id` INTEGER NOT NULL,
`device_id` INTEGER NOT NULL,
`login_state` ENUM('LOGGED_IN', 'LOGGED_OUT', 'LOCKED', 'DISABLED') NOT NULL DEFAULT 'LOGGED_OUT',
`created_at` TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
`updated_at` TIMESTAMP(6) NOT NULL,
`last_login` TIMESTAMP(6) NULL,

PRIMARY KEY (`StateId`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `Batch` (
`batch_id` INTEGER NOT NULL AUTO_INCREMENT,
`name` VARCHAR(191) NOT NULL,
`description` VARCHAR(191) NOT NULL,
`created_on` TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
`updated_on` TIMESTAMP(6) NOT NULL,

PRIMARY KEY (`batch_id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `BatchStudents` (
`batch_id` INTEGER NOT NULL,
`user_id` INTEGER NOT NULL,
`created_at` TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
`updated_at` TIMESTAMP(6) NOT NULL,

PRIMARY KEY (`batch_id`, `user_id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- AddForeignKey
ALTER TABLE `UserDevice` ADD CONSTRAINT `UserDevice_UserId_fkey` FOREIGN KEY (`UserId`) REFERENCES `User`(`UserId`) ON DELETE RESTRICT ON UPDATE CASCADE;
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
-- CreateTable
CREATE TABLE `Course` (
`course_id` INTEGER NOT NULL AUTO_INCREMENT,
`name` VARCHAR(191) NOT NULL,
`description` VARCHAR(191) NOT NULL,
`created_on` TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
`updated_on` TIMESTAMP(6) NOT NULL,

PRIMARY KEY (`course_id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
-- CreateTable
CREATE TABLE `CourseStudents` (
`course_id` INTEGER NOT NULL,
`user_id` INTEGER NOT NULL,
`created_at` TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
`updated_at` TIMESTAMP(6) NOT NULL,

PRIMARY KEY (`course_id`, `user_id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
Warnings:
- You are about to drop the `CourseStudents` table. If the table is not empty, all the data it contains will be lost.
*/
-- DropTable
DROP TABLE `CourseStudents`;

-- CreateTable
CREATE TABLE `CourseBatches` (
`course_id` INTEGER NOT NULL,
`batch_id` INTEGER NOT NULL,
`created_at` TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
`updated_at` TIMESTAMP(6) NOT NULL,

PRIMARY KEY (`course_id`, `batch_id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
-- CreateTable
CREATE TABLE `Lecture` (
`lecture_id` INTEGER NOT NULL AUTO_INCREMENT,
`name` VARCHAR(191) NOT NULL,
`description` VARCHAR(191) NOT NULL,
`created_on` TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
`updated_on` TIMESTAMP(6) NOT NULL,

PRIMARY KEY (`lecture_id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `LectureCourse` (
`lecture_id` INTEGER NOT NULL,
`course_id` INTEGER NOT NULL,
`created_at` TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
`updated_at` TIMESTAMP(6) NOT NULL,

PRIMARY KEY (`lecture_id`, `course_id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
Warnings:
- Added the required column `attendance_type` to the `Lecture` table without a default value. This is not possible if the table is not empty.
- Added the required column `end_time` to the `Lecture` table without a default value. This is not possible if the table is not empty.
- Added the required column `lecture_date` to the `Lecture` table without a default value. This is not possible if the table is not empty.
- Added the required column `start_time` to the `Lecture` table without a default value. This is not possible if the table is not empty.
*/
-- AlterTable
ALTER TABLE `Lecture` ADD COLUMN `attendance_type` VARCHAR(191) NOT NULL,
ADD COLUMN `end_time` TIMESTAMP(6) NOT NULL,
ADD COLUMN `lecture_date` DATE NOT NULL,
ADD COLUMN `mininum_attendance` INTEGER NOT NULL DEFAULT 75,
ADD COLUMN `start_time` TIMESTAMP(6) NOT NULL;
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
-- CreateTable
CREATE TABLE `FormsAndFeedback` (
`form_id` INTEGER NOT NULL AUTO_INCREMENT,
`name` VARCHAR(191) NOT NULL,
`description` VARCHAR(191) NOT NULL,
`created_on` TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
`updated_on` TIMESTAMP(6) NOT NULL,

PRIMARY KEY (`form_id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `Questions` (
`question_id` INTEGER NOT NULL AUTO_INCREMENT,
`question` VARCHAR(191) NOT NULL,
`form_id` INTEGER NOT NULL,
`created_on` TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
`updated_on` TIMESTAMP(6) NOT NULL,

PRIMARY KEY (`question_id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
-- CreateTable
CREATE TABLE `SSOProvider` (
`sso_provider_id` INTEGER NOT NULL AUTO_INCREMENT,
`name` VARCHAR(191) NOT NULL,
`description` VARCHAR(191) NOT NULL,
`home_url` VARCHAR(191) NOT NULL,
`privacy_policy` VARCHAR(191) NOT NULL,
`auth_redirect_url` VARCHAR(191) NOT NULL,
`created_on` TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
`updated_on` TIMESTAMP(6) NOT NULL,

PRIMARY KEY (`sso_provider_id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
Warnings:
- Added the required column `provider_key` to the `SSOProvider` table without a default value. This is not possible if the table is not empty.
*/
-- AlterTable
ALTER TABLE `SSOProvider` ADD COLUMN `provider_key` VARCHAR(191) NOT NULL;
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Application } from "express";
import UserRoute from "../routes/user.route";
import AuthRoute from "../routes/auth.route";
import BatchRoute from "../routes/batch.route";
import CourseRoute from "../routes/course.route";
import LecureRoute from "../routes/lecture.route";
import UserRoute from "./user.route";
import AuthRoute from "./auth.route";
import BatchRoute from "./batch.route";
import CourseRoute from "./course.route";
import LecureRoute from "./lecture.route";
import HelloRoute from "./hello.route";

class RoutesRegister {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit af27d26

Please sign in to comment.