Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Onboarding for HR and roles #545

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions prisma/migrations/20241023172043_fix/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
Warnings:

- A unique constraint covering the columns `[companyId]` on the table `User` will be added. If there are existing duplicate values, this will fail.
- Added the required column `companyId` to the `Job` table without a default value. This is not possible if the table is not empty.

*/
-- AlterTable
ALTER TABLE "Job" ADD COLUMN "companyId" TEXT NOT NULL;

-- AlterTable
ALTER TABLE "User" ADD COLUMN "companyId" TEXT;

-- CreateTable
CREATE TABLE "Company" (
"id" TEXT NOT NULL,
"name" TEXT NOT NULL,
"website" TEXT,
"description" TEXT,
"userId" TEXT,

CONSTRAINT "Company_pkey" PRIMARY KEY ("id")
);

-- CreateIndex
CREATE UNIQUE INDEX "Company_userId_key" ON "Company"("userId");

-- CreateIndex
CREATE UNIQUE INDEX "User_companyId_key" ON "User"("companyId");

-- AddForeignKey
ALTER TABLE "Company" ADD CONSTRAINT "Company_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "Job" ADD CONSTRAINT "Job_companyId_fkey" FOREIGN KEY ("companyId") REFERENCES "Company"("id") ON DELETE CASCADE ON UPDATE CASCADE;
12 changes: 12 additions & 0 deletions prisma/migrations/20241023180340_fix_project_mode/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-- CreateEnum
CREATE TYPE "ProjectStack" AS ENUM ('GO', 'PYTHON', 'MERN', 'NEXTJS', 'AI_GPT_APIS', 'SPRINGBOOT', 'OTHERS');

-- DropForeignKey
ALTER TABLE "Project" DROP CONSTRAINT "Project_userId_fkey";

-- AlterTable
ALTER TABLE "Project" ADD COLUMN "projectThumbnail" TEXT,
ADD COLUMN "stack" "ProjectStack" NOT NULL DEFAULT 'OTHERS';

-- AddForeignKey
ALTER TABLE "Project" ADD CONSTRAINT "Project_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "Company" ADD COLUMN "logo" TEXT;
66 changes: 0 additions & 66 deletions prisma/migrations/20241024174828_profileupdate/migration.sql

This file was deleted.

3 changes: 0 additions & 3 deletions prisma/migrations/20241025095014_user_updated/migration.sql

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "Job" ADD COLUMN "deletedAt" TIMESTAMP(3);
11 changes: 0 additions & 11 deletions prisma/migrations/20241031043344_username_remove/migration.sql

This file was deleted.

26 changes: 0 additions & 26 deletions prisma/migrations/20241031064849_company/migration.sql

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
-- CreateEnum
CREATE TYPE "DegreeType" AS ENUM ('BTech', 'MTech', 'BCA', 'MCA');

-- CreateEnum
CREATE TYPE "FieldOfStudyType" AS ENUM ('AI', 'Machine_Learning', 'CS', 'Mechanical');

-- AlterTable
ALTER TABLE "Project" ADD COLUMN "isFeature" BOOLEAN NOT NULL DEFAULT false;

-- AlterTable
ALTER TABLE "User" ADD COLUMN "about" TEXT,
ADD COLUMN "contactEmail" TEXT,
ADD COLUMN "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
ADD COLUMN "discordLink" TEXT,
ADD COLUMN "githubLink" TEXT,
ADD COLUMN "linkedinLink" TEXT,
ADD COLUMN "portfolioLink" TEXT,
ADD COLUMN "twitterLink" TEXT;

-- CreateTable
CREATE TABLE "Education" (
"id" SERIAL NOT NULL,
"instituteName" TEXT NOT NULL,
"degree" "DegreeType" NOT NULL,
"fieldOfStudy" "FieldOfStudyType" NOT NULL,
"startDate" TIMESTAMP(3) NOT NULL,
"endDate" TIMESTAMP(3),
"userId" TEXT NOT NULL,

CONSTRAINT "Education_pkey" PRIMARY KEY ("id")
);

-- AddForeignKey
ALTER TABLE "Education" ADD CONSTRAINT "Education_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
81 changes: 40 additions & 41 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,16 @@ datasource db {
}

model User {
id String @id @default(cuid())
name String

password String?
avatar String?
isVerified Boolean @default(false)
role Role @default(USER)
jobs Job[]

id String @id @default(cuid())
name String
email String @unique
password String?
avatar String?
isVerified Boolean @default(false)
role Role @default(USER)
emailVerified DateTime?

jobs Job[]
skills String[]
experience Experience[]
project Project[]
Expand All @@ -31,31 +29,29 @@ model User {
blockedByAdmin DateTime?
onBoard Boolean @default(false)
bookmark Bookmark[]

githubLink String?
portfolioLink String?
linkedinLink String?
twitterLink String?
discordLink String?

contactEmail String?

aboutMe String?

company Company? @relation("UserCompany")
companyId String? @unique
education Education[]
resumeUpdateDate DateTime?
contactEmail String?
about String?
discordLink String?
linkedinLink String?
twitterLink String?
githubLink String?
portfolioLink String?

resumeUpdateDate DateTime?
companyId String? @unique
company Company? @relation(fields: [companyId], references: [id])
}

model Company {
id String @id @default(cuid())
companyName String
companyLogo String?
companyEmail String
companyBio String
user User?
id String @id @default(cuid())
name String
logo String?
website String?
description String?
jobs Job[]
user User? @relation("UserCompany", fields: [userId], references: [id])
userId String? @unique
}

enum OauthProvider {
Expand All @@ -80,6 +76,7 @@ enum TokenType {
model Job {
id String @id @default(cuid())
userId String
companyId String
title String
description String?
companyName String @map("company_name")
Expand Down Expand Up @@ -108,8 +105,10 @@ model Job {
deletedAt DateTime?
postedAt DateTime @default(now())
updatedAt DateTime @updatedAt
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
bookmark Bookmark[]

user User @relation(fields: [userId], references: [id], onDelete: Cascade)
company Company @relation(fields: [companyId], references: [id], onDelete: Cascade)
bookmark Bookmark[]
}

model Bookmark {
Expand All @@ -132,18 +131,18 @@ model Experience {
endDate DateTime?
description String
userId String
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
user User @relation(fields: [userId], references: [id])
}

model Education {
id Int @id @default(autoincrement())
instituteName String
degree DegreeType
fieldOfStudy FieldOfStudyType
startDate DateTime
endDate DateTime?
userId String
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
id Int @id @default(autoincrement())
instituteName String
degree DegreeType
fieldOfStudy FieldOfStudyType
startDate DateTime
endDate DateTime?
userId String
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
}

model Project {
Expand All @@ -156,7 +155,7 @@ model Project {
stack ProjectStack @default(OTHERS)
userId String
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
isFeature Boolean @default(false)
isFeature Boolean @default(false)
}

enum ProjectStack {
Expand Down
Loading
Loading