few changes

This commit is contained in:
Om Lanke
2025-06-29 13:05:12 +05:30
parent e82685c7df
commit 99220fb9a9
20 changed files with 1743 additions and 197 deletions

View File

@@ -2,4 +2,4 @@ import { drizzle } from "drizzle-orm/neon-http";
export const db = drizzle(process.env.DATABASE_URL!);
export * from "./schema.ts";
export * from "./schema";

View File

@@ -0,0 +1,5 @@
DROP TABLE "certificates" CASCADE;--> statement-breakpoint
DROP TABLE "projects" CASCADE;--> statement-breakpoint
ALTER TABLE "students" ADD COLUMN "isDiploma" boolean;--> statement-breakpoint
ALTER TABLE "companies" DROP COLUMN "passwordHash";--> statement-breakpoint
ALTER TABLE "internships" DROP COLUMN "status";

View File

@@ -0,0 +1,3 @@
ALTER TABLE "students" ADD COLUMN "gender" varchar(10);--> statement-breakpoint
ALTER TABLE "students" ADD COLUMN "dob" timestamp;--> statement-breakpoint
ALTER TABLE "students" ADD COLUMN "personalGmail" text;

View File

@@ -0,0 +1,751 @@
{
"id": "5bcc500e-17e0-411d-8b8c-597d5b6de14d",
"prevId": "a00a32a1-83c4-49c8-b7b5-ff990facf461",
"version": "7",
"dialect": "postgresql",
"tables": {
"public.admins": {
"name": "admins",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"email": {
"name": "email",
"type": "text",
"primaryKey": false,
"notNull": true
},
"createdAt": {
"name": "createdAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updatedAt": {
"name": "updatedAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"admins_email_unique": {
"name": "admins_email_unique",
"nullsNotDistinct": false,
"columns": [
"email"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.applications": {
"name": "applications",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"job_id": {
"name": "job_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"student_id": {
"name": "student_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"resume_id": {
"name": "resume_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'pending'"
},
"createdAt": {
"name": "createdAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updatedAt": {
"name": "updatedAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"applications_job_id_jobs_id_fk": {
"name": "applications_job_id_jobs_id_fk",
"tableFrom": "applications",
"tableTo": "jobs",
"columnsFrom": [
"job_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"applications_student_id_students_id_fk": {
"name": "applications_student_id_students_id_fk",
"tableFrom": "applications",
"tableTo": "students",
"columnsFrom": [
"student_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"applications_resume_id_resumes_id_fk": {
"name": "applications_resume_id_resumes_id_fk",
"tableFrom": "applications",
"tableTo": "resumes",
"columnsFrom": [
"resume_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.companies": {
"name": "companies",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"email": {
"name": "email",
"type": "text",
"primaryKey": false,
"notNull": true
},
"link": {
"name": "link",
"type": "text",
"primaryKey": false,
"notNull": true
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": true
},
"imageURL": {
"name": "imageURL",
"type": "text",
"primaryKey": false,
"notNull": true
},
"createdAt": {
"name": "createdAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updatedAt": {
"name": "updatedAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.grades": {
"name": "grades",
"schema": "",
"columns": {
"student_id": {
"name": "student_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"sem": {
"name": "sem",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"sgpi": {
"name": "sgpi",
"type": "numeric(4, 2)",
"primaryKey": false,
"notNull": true
},
"isKT": {
"name": "isKT",
"type": "boolean",
"primaryKey": false,
"notNull": true
},
"deadKT": {
"name": "deadKT",
"type": "boolean",
"primaryKey": false,
"notNull": false
},
"createdAt": {
"name": "createdAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updatedAt": {
"name": "updatedAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"grades_student_id_students_id_fk": {
"name": "grades_student_id_students_id_fk",
"tableFrom": "grades",
"tableTo": "students",
"columnsFrom": [
"student_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {
"grades_student_id_sem_pk": {
"name": "grades_student_id_sem_pk",
"columns": [
"student_id",
"sem"
]
}
},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {
"sem_check1": {
"name": "sem_check1",
"value": "\"grades\".\"sem\" < 9"
}
},
"isRLSEnabled": false
},
"public.internships": {
"name": "internships",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"student_id": {
"name": "student_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"title": {
"name": "title",
"type": "text",
"primaryKey": false,
"notNull": true
},
"company": {
"name": "company",
"type": "text",
"primaryKey": false,
"notNull": true
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": true
},
"location": {
"name": "location",
"type": "text",
"primaryKey": false,
"notNull": true
},
"startDate": {
"name": "startDate",
"type": "timestamp",
"primaryKey": false,
"notNull": true
},
"endDate": {
"name": "endDate",
"type": "timestamp",
"primaryKey": false,
"notNull": true
},
"createdAt": {
"name": "createdAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updatedAt": {
"name": "updatedAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"internships_student_id_students_id_fk": {
"name": "internships_student_id_students_id_fk",
"tableFrom": "internships",
"tableTo": "students",
"columnsFrom": [
"student_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.jobs": {
"name": "jobs",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"company_id": {
"name": "company_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"title": {
"name": "title",
"type": "text",
"primaryKey": false,
"notNull": true
},
"link": {
"name": "link",
"type": "text",
"primaryKey": false,
"notNull": true
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": true
},
"location": {
"name": "location",
"type": "text",
"primaryKey": false,
"notNull": true
},
"imageURL": {
"name": "imageURL",
"type": "text",
"primaryKey": false,
"notNull": true
},
"salary": {
"name": "salary",
"type": "text",
"primaryKey": false,
"notNull": true
},
"applicationDeadline": {
"name": "applicationDeadline",
"type": "timestamp",
"primaryKey": false,
"notNull": true
},
"active": {
"name": "active",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"minCGPA": {
"name": "minCGPA",
"type": "numeric(4, 2)",
"primaryKey": false,
"notNull": true,
"default": "'0'"
},
"minSSC": {
"name": "minSSC",
"type": "numeric(4, 2)",
"primaryKey": false,
"notNull": true,
"default": "'0'"
},
"minHSC": {
"name": "minHSC",
"type": "numeric(4, 2)",
"primaryKey": false,
"notNull": true,
"default": "'0'"
},
"allowDeadKT": {
"name": "allowDeadKT",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
},
"allowLiveKT": {
"name": "allowLiveKT",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
},
"createdAt": {
"name": "createdAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updatedAt": {
"name": "updatedAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"jobs_company_id_companies_id_fk": {
"name": "jobs_company_id_companies_id_fk",
"tableFrom": "jobs",
"tableTo": "companies",
"columnsFrom": [
"company_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.resumes": {
"name": "resumes",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"student_id": {
"name": "student_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"title": {
"name": "title",
"type": "text",
"primaryKey": false,
"notNull": true
},
"link": {
"name": "link",
"type": "text",
"primaryKey": false,
"notNull": true
},
"createdAt": {
"name": "createdAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updatedAt": {
"name": "updatedAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"resumes_student_id_students_id_fk": {
"name": "resumes_student_id_students_id_fk",
"tableFrom": "resumes",
"tableTo": "students",
"columnsFrom": [
"student_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.students": {
"name": "students",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"email": {
"name": "email",
"type": "text",
"primaryKey": false,
"notNull": true
},
"rollNumber": {
"name": "rollNumber",
"type": "varchar(12)",
"primaryKey": false,
"notNull": false
},
"verified": {
"name": "verified",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"firstName": {
"name": "firstName",
"type": "varchar(255)",
"primaryKey": false,
"notNull": false
},
"middleName": {
"name": "middleName",
"type": "varchar(255)",
"primaryKey": false,
"notNull": false
},
"lastName": {
"name": "lastName",
"type": "varchar(255)",
"primaryKey": false,
"notNull": false
},
"mothersName": {
"name": "mothersName",
"type": "varchar(255)",
"primaryKey": false,
"notNull": false
},
"phoneNumber": {
"name": "phoneNumber",
"type": "varchar(10)",
"primaryKey": false,
"notNull": false
},
"address": {
"name": "address",
"type": "text",
"primaryKey": false,
"notNull": false
},
"profilePicture": {
"name": "profilePicture",
"type": "text",
"primaryKey": false,
"notNull": false
},
"degree": {
"name": "degree",
"type": "text",
"primaryKey": false,
"notNull": false
},
"branch": {
"name": "branch",
"type": "text",
"primaryKey": false,
"notNull": false
},
"year": {
"name": "year",
"type": "text",
"primaryKey": false,
"notNull": false
},
"skills": {
"name": "skills",
"type": "text[]",
"primaryKey": false,
"notNull": false,
"default": "ARRAY[]::text[]"
},
"linkedin": {
"name": "linkedin",
"type": "text",
"primaryKey": false,
"notNull": false
},
"github": {
"name": "github",
"type": "text",
"primaryKey": false,
"notNull": false
},
"ssc": {
"name": "ssc",
"type": "numeric(4, 2)",
"primaryKey": false,
"notNull": false
},
"hsc": {
"name": "hsc",
"type": "numeric(4, 2)",
"primaryKey": false,
"notNull": false
},
"isDiploma": {
"name": "isDiploma",
"type": "boolean",
"primaryKey": false,
"notNull": false
},
"createdAt": {
"name": "createdAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updatedAt": {
"name": "updatedAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
}
},
"enums": {},
"schemas": {},
"sequences": {},
"roles": {},
"policies": {},
"views": {},
"_meta": {
"columns": {},
"schemas": {},
"tables": {}
}
}

View File

@@ -0,0 +1,769 @@
{
"id": "1506d00a-2620-44ac-af01-19e04c21f679",
"prevId": "5bcc500e-17e0-411d-8b8c-597d5b6de14d",
"version": "7",
"dialect": "postgresql",
"tables": {
"public.admins": {
"name": "admins",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"email": {
"name": "email",
"type": "text",
"primaryKey": false,
"notNull": true
},
"createdAt": {
"name": "createdAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updatedAt": {
"name": "updatedAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"admins_email_unique": {
"name": "admins_email_unique",
"nullsNotDistinct": false,
"columns": [
"email"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.applications": {
"name": "applications",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"job_id": {
"name": "job_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"student_id": {
"name": "student_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"resume_id": {
"name": "resume_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'pending'"
},
"createdAt": {
"name": "createdAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updatedAt": {
"name": "updatedAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"applications_job_id_jobs_id_fk": {
"name": "applications_job_id_jobs_id_fk",
"tableFrom": "applications",
"tableTo": "jobs",
"columnsFrom": [
"job_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"applications_student_id_students_id_fk": {
"name": "applications_student_id_students_id_fk",
"tableFrom": "applications",
"tableTo": "students",
"columnsFrom": [
"student_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"applications_resume_id_resumes_id_fk": {
"name": "applications_resume_id_resumes_id_fk",
"tableFrom": "applications",
"tableTo": "resumes",
"columnsFrom": [
"resume_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.companies": {
"name": "companies",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"email": {
"name": "email",
"type": "text",
"primaryKey": false,
"notNull": true
},
"link": {
"name": "link",
"type": "text",
"primaryKey": false,
"notNull": true
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": true
},
"imageURL": {
"name": "imageURL",
"type": "text",
"primaryKey": false,
"notNull": true
},
"createdAt": {
"name": "createdAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updatedAt": {
"name": "updatedAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.grades": {
"name": "grades",
"schema": "",
"columns": {
"student_id": {
"name": "student_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"sem": {
"name": "sem",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"sgpi": {
"name": "sgpi",
"type": "numeric(4, 2)",
"primaryKey": false,
"notNull": true
},
"isKT": {
"name": "isKT",
"type": "boolean",
"primaryKey": false,
"notNull": true
},
"deadKT": {
"name": "deadKT",
"type": "boolean",
"primaryKey": false,
"notNull": false
},
"createdAt": {
"name": "createdAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updatedAt": {
"name": "updatedAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"grades_student_id_students_id_fk": {
"name": "grades_student_id_students_id_fk",
"tableFrom": "grades",
"tableTo": "students",
"columnsFrom": [
"student_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {
"grades_student_id_sem_pk": {
"name": "grades_student_id_sem_pk",
"columns": [
"student_id",
"sem"
]
}
},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {
"sem_check1": {
"name": "sem_check1",
"value": "\"grades\".\"sem\" < 9"
}
},
"isRLSEnabled": false
},
"public.internships": {
"name": "internships",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"student_id": {
"name": "student_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"title": {
"name": "title",
"type": "text",
"primaryKey": false,
"notNull": true
},
"company": {
"name": "company",
"type": "text",
"primaryKey": false,
"notNull": true
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": true
},
"location": {
"name": "location",
"type": "text",
"primaryKey": false,
"notNull": true
},
"startDate": {
"name": "startDate",
"type": "timestamp",
"primaryKey": false,
"notNull": true
},
"endDate": {
"name": "endDate",
"type": "timestamp",
"primaryKey": false,
"notNull": true
},
"createdAt": {
"name": "createdAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updatedAt": {
"name": "updatedAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"internships_student_id_students_id_fk": {
"name": "internships_student_id_students_id_fk",
"tableFrom": "internships",
"tableTo": "students",
"columnsFrom": [
"student_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.jobs": {
"name": "jobs",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"company_id": {
"name": "company_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"title": {
"name": "title",
"type": "text",
"primaryKey": false,
"notNull": true
},
"link": {
"name": "link",
"type": "text",
"primaryKey": false,
"notNull": true
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": true
},
"location": {
"name": "location",
"type": "text",
"primaryKey": false,
"notNull": true
},
"imageURL": {
"name": "imageURL",
"type": "text",
"primaryKey": false,
"notNull": true
},
"salary": {
"name": "salary",
"type": "text",
"primaryKey": false,
"notNull": true
},
"applicationDeadline": {
"name": "applicationDeadline",
"type": "timestamp",
"primaryKey": false,
"notNull": true
},
"active": {
"name": "active",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"minCGPA": {
"name": "minCGPA",
"type": "numeric(4, 2)",
"primaryKey": false,
"notNull": true,
"default": "'0'"
},
"minSSC": {
"name": "minSSC",
"type": "numeric(4, 2)",
"primaryKey": false,
"notNull": true,
"default": "'0'"
},
"minHSC": {
"name": "minHSC",
"type": "numeric(4, 2)",
"primaryKey": false,
"notNull": true,
"default": "'0'"
},
"allowDeadKT": {
"name": "allowDeadKT",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
},
"allowLiveKT": {
"name": "allowLiveKT",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
},
"createdAt": {
"name": "createdAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updatedAt": {
"name": "updatedAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"jobs_company_id_companies_id_fk": {
"name": "jobs_company_id_companies_id_fk",
"tableFrom": "jobs",
"tableTo": "companies",
"columnsFrom": [
"company_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.resumes": {
"name": "resumes",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"student_id": {
"name": "student_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"title": {
"name": "title",
"type": "text",
"primaryKey": false,
"notNull": true
},
"link": {
"name": "link",
"type": "text",
"primaryKey": false,
"notNull": true
},
"createdAt": {
"name": "createdAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updatedAt": {
"name": "updatedAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"resumes_student_id_students_id_fk": {
"name": "resumes_student_id_students_id_fk",
"tableFrom": "resumes",
"tableTo": "students",
"columnsFrom": [
"student_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.students": {
"name": "students",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"email": {
"name": "email",
"type": "text",
"primaryKey": false,
"notNull": true
},
"rollNumber": {
"name": "rollNumber",
"type": "varchar(12)",
"primaryKey": false,
"notNull": false
},
"verified": {
"name": "verified",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"firstName": {
"name": "firstName",
"type": "varchar(255)",
"primaryKey": false,
"notNull": false
},
"middleName": {
"name": "middleName",
"type": "varchar(255)",
"primaryKey": false,
"notNull": false
},
"lastName": {
"name": "lastName",
"type": "varchar(255)",
"primaryKey": false,
"notNull": false
},
"mothersName": {
"name": "mothersName",
"type": "varchar(255)",
"primaryKey": false,
"notNull": false
},
"gender": {
"name": "gender",
"type": "varchar(10)",
"primaryKey": false,
"notNull": false
},
"dob": {
"name": "dob",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"personalGmail": {
"name": "personalGmail",
"type": "text",
"primaryKey": false,
"notNull": false
},
"phoneNumber": {
"name": "phoneNumber",
"type": "varchar(10)",
"primaryKey": false,
"notNull": false
},
"address": {
"name": "address",
"type": "text",
"primaryKey": false,
"notNull": false
},
"profilePicture": {
"name": "profilePicture",
"type": "text",
"primaryKey": false,
"notNull": false
},
"degree": {
"name": "degree",
"type": "text",
"primaryKey": false,
"notNull": false
},
"branch": {
"name": "branch",
"type": "text",
"primaryKey": false,
"notNull": false
},
"year": {
"name": "year",
"type": "text",
"primaryKey": false,
"notNull": false
},
"skills": {
"name": "skills",
"type": "text[]",
"primaryKey": false,
"notNull": false,
"default": "ARRAY[]::text[]"
},
"linkedin": {
"name": "linkedin",
"type": "text",
"primaryKey": false,
"notNull": false
},
"github": {
"name": "github",
"type": "text",
"primaryKey": false,
"notNull": false
},
"ssc": {
"name": "ssc",
"type": "numeric(4, 2)",
"primaryKey": false,
"notNull": false
},
"hsc": {
"name": "hsc",
"type": "numeric(4, 2)",
"primaryKey": false,
"notNull": false
},
"isDiploma": {
"name": "isDiploma",
"type": "boolean",
"primaryKey": false,
"notNull": false
},
"createdAt": {
"name": "createdAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updatedAt": {
"name": "updatedAt",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
}
},
"enums": {},
"schemas": {},
"sequences": {},
"roles": {},
"policies": {},
"views": {},
"_meta": {
"columns": {},
"schemas": {},
"tables": {}
}
}

View File

@@ -29,6 +29,20 @@
"when": 1750849519081,
"tag": "0003_clammy_shadowcat",
"breakpoints": true
},
{
"idx": 4,
"version": "7",
"when": 1751094285471,
"tag": "0004_blushing_captain_flint",
"breakpoints": true
},
{
"idx": 5,
"version": "7",
"when": 1751182452704,
"tag": "0005_solid_photon",
"breakpoints": true
}
]
}

View File

@@ -9,7 +9,7 @@ import {
integer,
numeric,
primaryKey,
check
check,
} from "drizzle-orm/pg-core";
export const students = pgTable("students", {
@@ -21,6 +21,9 @@ export const students = pgTable("students", {
middleName: varchar({ length: 255 }),
lastName: varchar({ length: 255 }),
mothersName: varchar({ length: 255 }),
gender: varchar({ length: 10 }),
dob: timestamp(),
personalGmail: text(),
phoneNumber: varchar({ length: 10 }),
address: text(),
profilePicture: text(),
@@ -32,9 +35,9 @@ export const students = pgTable("students", {
.default(sql`ARRAY[]::text[]`),
linkedin: text(),
github: text(),
ssc: numeric({ precision: 4, scale: 2 }),
hsc: numeric({ precision: 4, scale: 2 }),
isDiploma: boolean(),
ssc: numeric({ precision: 4, scale: 2 }), // TODO: year, board
hsc: numeric({ precision: 4, scale: 2 }), // TODO: year, board
isDiploma: boolean(), // TODO: diploma branch
createdAt: timestamp().notNull().defaultNow(),
updatedAt: timestamp()
.defaultNow()
@@ -53,7 +56,7 @@ export const internships = pgTable("internships", {
location: text().notNull(),
startDate: timestamp().notNull(),
endDate: timestamp().notNull(),
status: text().notNull(),
// status: text().notNull(),
createdAt: timestamp().notNull().defaultNow(),
updatedAt: timestamp()
.defaultNow()
@@ -61,38 +64,38 @@ export const internships = pgTable("internships", {
.notNull(),
});
export const projects = pgTable("projects", {
id: serial().primaryKey(),
studentId: integer("student_id")
.notNull()
.references(() => students.id),
title: text().notNull(),
description: text().notNull(),
links: text()
.array()
.notNull()
.default(sql`ARRAY[]::text[]`),
createdAt: timestamp().notNull().defaultNow(),
updatedAt: timestamp()
.defaultNow()
.$onUpdate(() => new Date())
.notNull(),
});
// export const projects = pgTable("projects", {
// id: serial().primaryKey(),
// studentId: integer("student_id")
// .notNull()
// .references(() => students.id),
// title: text().notNull(),
// description: text().notNull(),
// links: text()
// .array()
// .notNull()
// .default(sql`ARRAY[]::text[]`),
// createdAt: timestamp().notNull().defaultNow(),
// updatedAt: timestamp()
// .defaultNow()
// .$onUpdate(() => new Date())
// .notNull(),
// });
export const certificates = pgTable("certificates", {
id: serial().primaryKey(),
studentId: integer("student_id")
.notNull()
.references(() => students.id),
title: text().notNull(),
description: text().notNull(),
link: text().notNull(),
createdAt: timestamp().notNull().defaultNow(),
updatedAt: timestamp()
.defaultNow()
.$onUpdate(() => new Date())
.notNull(),
});
// export const certificates = pgTable("certificates", {
// id: serial().primaryKey(),
// studentId: integer("student_id")
// .notNull()
// .references(() => students.id),
// title: text().notNull(),
// description: text().notNull(),
// link: text().notNull(),
// createdAt: timestamp().notNull().defaultNow(),
// updatedAt: timestamp()
// .defaultNow()
// .$onUpdate(() => new Date())
// .notNull(),
// });
export const resumes = pgTable("resumes", {
id: serial().primaryKey(),
@@ -108,25 +111,32 @@ export const resumes = pgTable("resumes", {
.notNull(),
});
export const grades = pgTable("grades", {
studentId: integer("student_id")
.notNull()
.references(() => students.id),
sem: integer().notNull(),
sgpi: numeric({ precision: 4, scale: 2 }).notNull(),
isKT: boolean().notNull(),
deadKT: boolean(),
createdAt: timestamp().notNull().defaultNow(),
updatedAt: timestamp()
.defaultNow()
.$onUpdate(() => new Date())
.notNull(),
}, (table) => [primaryKey({ columns: [table.studentId, table.sem] }), check("sem_check1", sql`${table.sem} < 9`)]);
export const grades = pgTable(
"grades",
{
studentId: integer("student_id")
.notNull()
.references(() => students.id),
sem: integer().notNull(),
sgpi: numeric({ precision: 4, scale: 2 }).notNull(),
isKT: boolean().notNull(),
deadKT: boolean(),
createdAt: timestamp().notNull().defaultNow(),
updatedAt: timestamp()
.defaultNow()
.$onUpdate(() => new Date())
.notNull(),
},
(table) => [
primaryKey({ columns: [table.studentId, table.sem] }),
check("sem_check1", sql`${table.sem} < 9`),
],
);
export const studentRelations = relations(students, ({ many }) => ({
internships: many(internships),
projects: many(projects),
certificates: many(certificates),
// projects: many(projects),
// certificates: many(certificates),
resumes: many(resumes),
grades: many(grades),
}));
@@ -138,19 +148,19 @@ export const internshipRelations = relations(internships, ({ one }) => ({
}),
}));
export const projectRelations = relations(projects, ({ one }) => ({
student: one(students, {
fields: [projects.studentId],
references: [students.id],
}),
}));
// export const projectRelations = relations(projects, ({ one }) => ({
// student: one(students, {
// fields: [projects.studentId],
// references: [students.id],
// }),
// }));
export const certificateRelations = relations(certificates, ({ one }) => ({
student: one(students, {
fields: [certificates.studentId],
references: [students.id],
}),
}));
// export const certificateRelations = relations(certificates, ({ one }) => ({
// student: one(students, {
// fields: [certificates.studentId],
// references: [students.id],
// }),
// }));
export const resumeRelations = relations(resumes, ({ one, many }) => ({
student: one(students, {
@@ -173,7 +183,7 @@ export const companies = pgTable("companies", {
email: text().notNull(),
link: text().notNull(),
description: text().notNull(),
passwordHash: text(),
// passwordHash: text(),
imageURL: text().notNull(),
createdAt: timestamp().notNull().defaultNow(),
updatedAt: timestamp()

View File

@@ -1,12 +0,0 @@
{
"extends": "@workspace/typescript-config/nextjs.json",
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./*"],
},
"allowImportingTsExtensions": true,
},
"include": ["**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
}