experimental form

This commit is contained in:
Om Lanke
2025-06-25 17:51:25 +05:30
parent 7645889297
commit e82685c7df
18 changed files with 2801 additions and 27 deletions

View File

@@ -8,6 +8,8 @@ import {
timestamp,
integer,
numeric,
primaryKey,
check
} from "drizzle-orm/pg-core";
export const students = pgTable("students", {
@@ -32,6 +34,7 @@ export const students = pgTable("students", {
github: text(),
ssc: numeric({ precision: 4, scale: 2 }),
hsc: numeric({ precision: 4, scale: 2 }),
isDiploma: boolean(),
createdAt: timestamp().notNull().defaultNow(),
updatedAt: timestamp()
.defaultNow()
@@ -106,7 +109,6 @@ export const resumes = pgTable("resumes", {
});
export const grades = pgTable("grades", {
id: serial().primaryKey(),
studentId: integer("student_id")
.notNull()
.references(() => students.id),
@@ -119,7 +121,7 @@ export const grades = pgTable("grades", {
.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),