33 lines
884 B
TypeScript
33 lines
884 B
TypeScript
import {
|
|
date,
|
|
integer,
|
|
pgTable,
|
|
serial,
|
|
text,
|
|
} from "npm:drizzle-orm/pg-core";
|
|
|
|
export const promotions = pgTable("promotions", {
|
|
id: serial("id").primaryKey(),
|
|
endyear: integer("endyear"),
|
|
current: integer("current"),
|
|
});
|
|
|
|
export const students = pgTable("students", {
|
|
userId: text("userId").primaryKey(),
|
|
firstName: text("firstName"),
|
|
lastName: text("lastName"),
|
|
mail: text("mail"),
|
|
promotionId: integer("promotionId").references(() => promotions.id),
|
|
});
|
|
|
|
export const mobility = pgTable("mobility", {
|
|
id: serial("id").primaryKey(),
|
|
studentId: text("studentId").references(() => students.userId),
|
|
startDate: date("startDate"),
|
|
endDate: date("endDate"),
|
|
weeksCount: integer("weeksCount"),
|
|
destinationCountry: text("destinationCountry"),
|
|
destinationName: text("destinationName"),
|
|
mobilityStatus: text("mobilityStatus").default("N/A"),
|
|
});
|