From 5336574a84c23e27e0acbbc1b9565c7b5d2c9c31 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Wed, 28 Jan 2026 11:11:00 -0800 Subject: [PATCH 01/91] refactored RuleBase type to have a nullable proxyAdvice --- apps/data-pipeline/degreeworks-scraper/src/types.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/data-pipeline/degreeworks-scraper/src/types.ts b/apps/data-pipeline/degreeworks-scraper/src/types.ts index be925258..a73e7bc1 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/types.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/types.ts @@ -3,7 +3,12 @@ import type { DegreeWorksProgramId } from "@packages/db/schema"; /** * The base type for all `Rule` objects. */ -export type RuleBase = { label: string }; +export type RuleBase = { + label: string; + proxyAdvice?: { + textList: string[]; + }; +}; /** * A group of `numberOfRules` rules, * of which `numberOfGroups` must be satisfied From 70da258180ee290fb20ba3c916f1abaf96d51f91 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Wed, 28 Jan 2026 11:15:06 -0800 Subject: [PATCH 02/91] added degreeworksSpecRequirment to schema --- packages/db/src/schema.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/db/src/schema.ts b/packages/db/src/schema.ts index 054f1e2d..956443e1 100644 --- a/packages/db/src/schema.ts +++ b/packages/db/src/schema.ts @@ -128,6 +128,10 @@ export type DegreeWorksMarkerRequirement = { requirementType: "Marker"; }; +export type DegreeWorksSpecRequirement = { + requirementType: "Spec"; +}; + export type DegreeWorksRequirementBase = { label: string }; export type DegreeWorksRequirement = DegreeWorksRequirementBase & @@ -136,6 +140,7 @@ export type DegreeWorksRequirement = DegreeWorksRequirementBase & | DegreeWorksUnitRequirement | DegreeWorksGroupRequirement | DegreeWorksMarkerRequirement + | DegreeWorksSpecRequirement ); export type APCoursesGrantedTree = From 1a05141e5b69ef4356753e644399888f7b6c5f1b Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Wed, 28 Jan 2026 11:33:23 -0800 Subject: [PATCH 03/91] added ifElsePart property to RuleBase --- apps/data-pipeline/degreeworks-scraper/src/types.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/data-pipeline/degreeworks-scraper/src/types.ts b/apps/data-pipeline/degreeworks-scraper/src/types.ts index a73e7bc1..c2352660 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/types.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/types.ts @@ -5,6 +5,7 @@ import type { DegreeWorksProgramId } from "@packages/db/schema"; */ export type RuleBase = { label: string; + ifElsePart?: "IfPart" | "ElsePart"; proxyAdvice?: { textList: string[]; }; From bddc87a6bfa7bd3f19b394657412fd400be89b2d Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Wed, 28 Jan 2026 12:08:12 -0800 Subject: [PATCH 04/91] push DWSpecRequirement when encountering match in ruleArrayToReq --- .../src/components/AuditParser.ts | 170 ++++++++++-------- 1 file changed, 91 insertions(+), 79 deletions(-) diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts b/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts index 46918d95..06ba72af 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts @@ -112,93 +112,105 @@ export class AuditParser { async ruleArrayToRequirements(ruleArray: Rule[]) { const ret: DegreeWorksRequirement[] = []; for (const rule of ruleArray) { - switch (rule.ruleType) { - case "Block": - case "Noncourse": - break; - case "Course": { - const includedCourses = rule.requirement.courseArray.map( - (x) => `${x.discipline} ${x.number}${x.numberEnd ? `-${x.numberEnd}` : ""}`, - ); - const toInclude = new Map( - await Promise.all(includedCourses.map(this.normalizeCourseId.bind(this))).then((x) => - x.flat().map((y) => [y.id, y]), - ), - ); - const excludedCourses = - rule.requirement.except?.courseArray.map( + if ( + rule.ifElsePart === "ElsePart" && + rule.proxyAdvice?.textList.some((x) => + /specialization|concentration|emphasis|area|track|major/i.test(x), + ) + ) { + ret.push({ + label: AuditParser.suppressLabelPolymorphism(rule.label), + requirementType: "Spec", + }); + } else { + switch (rule.ruleType) { + case "Block": + case "Noncourse": + break; + case "Course": { + const includedCourses = rule.requirement.courseArray.map( (x) => `${x.discipline} ${x.number}${x.numberEnd ? `-${x.numberEnd}` : ""}`, - ) ?? []; - const toExclude = new Set( - await Promise.all(excludedCourses.map(this.normalizeCourseId.bind(this))).then((x) => - x.flat().map((y) => y.id), - ), - ); - const courses = Array.from(toInclude) - .filter(([x]) => !toExclude.has(x)) - .sort(([, a], [, b]) => - a.department === b.department - ? a.courseNumeric - b.courseNumeric || this.lexOrd(a.courseNumber, b.courseNumber) - : this.lexOrd(a.department, b.department), - ) - .map(([x]) => x); - if (rule.requirement.classesBegin) { + ); + const toInclude = new Map( + await Promise.all(includedCourses.map(this.normalizeCourseId.bind(this))).then((x) => + x.flat().map((y) => [y.id, y]), + ), + ); + const excludedCourses = + rule.requirement.except?.courseArray.map( + (x) => `${x.discipline} ${x.number}${x.numberEnd ? `-${x.numberEnd}` : ""}`, + ) ?? []; + const toExclude = new Set( + await Promise.all(excludedCourses.map(this.normalizeCourseId.bind(this))).then((x) => + x.flat().map((y) => y.id), + ), + ); + const courses = Array.from(toInclude) + .filter(([x]) => !toExclude.has(x)) + .sort(([, a], [, b]) => + a.department === b.department + ? a.courseNumeric - b.courseNumeric || this.lexOrd(a.courseNumber, b.courseNumber) + : this.lexOrd(a.department, b.department), + ) + .map(([x]) => x); + if (rule.requirement.classesBegin) { + ret.push({ + label: AuditParser.suppressLabelPolymorphism(rule.label), + requirementType: "Course", + courseCount: Number.parseInt(rule.requirement.classesBegin, 10), + courses, + }); + } else if (rule.requirement.creditsBegin) { + ret.push({ + label: AuditParser.suppressLabelPolymorphism(rule.label), + requirementType: "Unit", + unitCount: Number.parseInt(rule.requirement.creditsBegin, 10), + courses, + }); + } + break; + } + case "Group": { + ret.push({ + label: AuditParser.suppressLabelPolymorphism(rule.label), + requirementType: "Group", + requirementCount: Number.parseInt(rule.requirement.numberOfGroups), + requirements: await this.ruleArrayToRequirements(rule.ruleArray), + }); + break; + } + case "IfStmt": { + const rules = this.flattenIfStmt([rule]); + if (!rules.some((x) => x.ruleType === "Block")) { + if (rules.length > 1) { + ret.push({ + label: "Select 1 of the following", + requirementType: "Group", + requirementCount: 1, + requirements: await this.ruleArrayToRequirements(rules), + }); + } else if (rules.length === 1) { + ret.push(...(await this.ruleArrayToRequirements(rules))); + } + } + break; + } + case "Complete": + case "Incomplete": ret.push({ label: AuditParser.suppressLabelPolymorphism(rule.label), - requirementType: "Course", - courseCount: Number.parseInt(rule.requirement.classesBegin, 10), - courses, + requirementType: "Marker", }); - } else if (rule.requirement.creditsBegin) { + break; + case "Subset": { + const requirements = await this.ruleArrayToRequirements(rule.ruleArray); ret.push({ label: AuditParser.suppressLabelPolymorphism(rule.label), - requirementType: "Unit", - unitCount: Number.parseInt(rule.requirement.creditsBegin, 10), - courses, + requirementType: "Group", + requirementCount: Object.keys(requirements).length, + requirements, }); } - break; - } - case "Group": { - ret.push({ - label: AuditParser.suppressLabelPolymorphism(rule.label), - requirementType: "Group", - requirementCount: Number.parseInt(rule.requirement.numberOfGroups), - requirements: await this.ruleArrayToRequirements(rule.ruleArray), - }); - break; - } - case "IfStmt": { - const rules = this.flattenIfStmt([rule]); - if (!rules.some((x) => x.ruleType === "Block")) { - if (rules.length > 1) { - ret.push({ - label: "Select 1 of the following", - requirementType: "Group", - requirementCount: 1, - requirements: await this.ruleArrayToRequirements(rules), - }); - } else if (rules.length === 1) { - ret.push(...(await this.ruleArrayToRequirements(rules))); - } - } - break; - } - case "Complete": - case "Incomplete": - ret.push({ - label: AuditParser.suppressLabelPolymorphism(rule.label), - requirementType: "Marker", - }); - break; - case "Subset": { - const requirements = await this.ruleArrayToRequirements(rule.ruleArray); - ret.push({ - label: AuditParser.suppressLabelPolymorphism(rule.label), - requirementType: "Group", - requirementCount: Object.keys(requirements).length, - requirements, - }); } } } From a761de22ef84e49e48c59ca87d50a390ef3e02e5 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Wed, 28 Jan 2026 12:15:44 -0800 Subject: [PATCH 05/91] added requireSpec to schema --- apps/data-pipeline/degreeworks-scraper/src/index.ts | 1 + packages/db/src/schema.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/apps/data-pipeline/degreeworks-scraper/src/index.ts b/apps/data-pipeline/degreeworks-scraper/src/index.ts index 7aff6de0..3edca563 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/index.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/index.ts @@ -71,6 +71,7 @@ async function main() { degreeId: degreeType ?? "", code, name, + requireSpec: requirements.some((x) => x.requirementType === "Spec"), requirements, ...(collegeBlockIndex !== undefined ? { collegeBlockIndex } : {}), }; diff --git a/packages/db/src/schema.ts b/packages/db/src/schema.ts index 956443e1..332b0c46 100644 --- a/packages/db/src/schema.ts +++ b/packages/db/src/schema.ts @@ -676,6 +676,7 @@ export const major = pgTable( .notNull(), code: varchar("code").notNull(), name: varchar("name").notNull(), + requireSpec: boolean("require_spec"), collegeRequirement: uuid("college_requirement").references(() => collegeRequirement.id), requirements: json("requirements").$type().notNull(), }, From 480abb67aa34bb034f6db40693457de8e91218b2 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Wed, 28 Jan 2026 20:13:27 -0800 Subject: [PATCH 06/91] migrated db and did some pg testing --- apps/api/src/schema/programs.ts | 3 + apps/api/src/services/programs.ts | 2 + packages/db/migrations/0023_fresh_chimera.sql | 1 + .../db/migrations/meta/0023_snapshot.json | 3852 +++++++++++++++++ packages/db/migrations/meta/_journal.json | 7 + 5 files changed, 3865 insertions(+) create mode 100644 packages/db/migrations/0023_fresh_chimera.sql create mode 100644 packages/db/migrations/meta/0023_snapshot.json diff --git a/apps/api/src/schema/programs.ts b/apps/api/src/schema/programs.ts index 76b7845c..60508edd 100644 --- a/apps/api/src/schema/programs.ts +++ b/apps/api/src/schema/programs.ts @@ -187,6 +187,9 @@ export const majorsResponseSchema = z.array( division: z.literal("Undergraduate").or(z.literal("Graduate")).openapi({ description: "The division in which this major is offered", }), + requireSpecialization: z.boolean().openapi({ + description: "Whether a specialization must be completed to complete this degree", + }), specializations: z.array(z.string()).openapi({ description: "The ID(s) of specialization(s) associated with this major; if any are present, one is mandatory for this major.", diff --git a/apps/api/src/services/programs.ts b/apps/api/src/services/programs.ts index c7400000..ba3040e6 100644 --- a/apps/api/src/services/programs.ts +++ b/apps/api/src/services/programs.ts @@ -32,6 +32,7 @@ export class ProgramsService { .select({ id: major.id, name: major.name, + requireSpec: major.requireSpec, specializations: sql`ARRAY_REMOVE(ARRAY_AGG(${specialization.id}), NULL)`.as( "specializations", ), @@ -46,6 +47,7 @@ export class ProgramsService { .select({ id: majorSpecialization.id, name: majorSpecialization.name, + requireSpec: majorSpecialization.requireSpec, specializations: majorSpecialization.specializations, type: degree.name, division: degree.division, diff --git a/packages/db/migrations/0023_fresh_chimera.sql b/packages/db/migrations/0023_fresh_chimera.sql new file mode 100644 index 00000000..6f37517d --- /dev/null +++ b/packages/db/migrations/0023_fresh_chimera.sql @@ -0,0 +1 @@ +ALTER TABLE "major" ADD COLUMN "require_spec" boolean; \ No newline at end of file diff --git a/packages/db/migrations/meta/0023_snapshot.json b/packages/db/migrations/meta/0023_snapshot.json new file mode 100644 index 00000000..8d1c5442 --- /dev/null +++ b/packages/db/migrations/meta/0023_snapshot.json @@ -0,0 +1,3852 @@ +{ + "id": "02076c7e-4d5b-47e4-9722-3a6ee9849b3f", + "prevId": "169622b6-bb25-46af-9384-cb3825533964", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.ap_exam": { + "name": "ap_exam", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "catalogue_name": { + "name": "catalogue_name", + "type": "varchar", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.ap_exam_reward": { + "name": "ap_exam_reward", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "units_granted": { + "name": "units_granted", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "elective_units_granted": { + "name": "elective_units_granted", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "ge_1a_courses_granted": { + "name": "ge_1a_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_1b_courses_granted": { + "name": "ge_1b_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_2_courses_granted": { + "name": "ge_2_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_3_courses_granted": { + "name": "ge_3_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_4_courses_granted": { + "name": "ge_4_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_5a_courses_granted": { + "name": "ge_5a_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_5b_courses_granted": { + "name": "ge_5b_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_6_courses_granted": { + "name": "ge_6_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_7_courses_granted": { + "name": "ge_7_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_8_courses_granted": { + "name": "ge_8_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "courses_granted": { + "name": "courses_granted", + "type": "json", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.ap_exam_to_reward": { + "name": "ap_exam_to_reward", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "exam_id": { + "name": "exam_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "score": { + "name": "score", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "reward": { + "name": "reward", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "ap_exam_to_reward_exam_id_score_index": { + "name": "ap_exam_to_reward_exam_id_score_index", + "columns": [ + { + "expression": "exam_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "score", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "ap_exam_to_reward_exam_id_ap_exam_id_fk": { + "name": "ap_exam_to_reward_exam_id_ap_exam_id_fk", + "tableFrom": "ap_exam_to_reward", + "tableTo": "ap_exam", + "columnsFrom": ["exam_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "ap_exam_to_reward_reward_ap_exam_reward_id_fk": { + "name": "ap_exam_to_reward_reward_ap_exam_reward_id_fk", + "tableFrom": "ap_exam_to_reward", + "tableTo": "ap_exam_reward", + "columnsFrom": ["reward"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.calendar_term": { + "name": "calendar_term", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true, + "generated": { + "as": "\"calendar_term\".\"year\" || ' ' || CASE WHEN \"calendar_term\".\"quarter\" = 'Fall' THEN 'Fall' WHEN \"calendar_term\".\"quarter\" = 'Winter' THEN 'Winter' WHEN \"calendar_term\".\"quarter\" = 'Spring' THEN 'Spring' WHEN \"calendar_term\".\"quarter\" = 'Summer1' THEN 'Summer1' WHEN \"calendar_term\".\"quarter\" = 'Summer10wk' THEN 'Summer10wk' WHEN \"calendar_term\".\"quarter\" = 'Summer2' THEN 'Summer2' ELSE '' END", + "type": "stored" + } + }, + "year": { + "name": "year", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "quarter": { + "name": "quarter", + "type": "term", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "instruction_start": { + "name": "instruction_start", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "instruction_end": { + "name": "instruction_end", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "finals_start": { + "name": "finals_start", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "finals_end": { + "name": "finals_end", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "soc_available": { + "name": "soc_available", + "type": "date", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.catalogue_program": { + "name": "catalogue_program", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "program_name": { + "name": "program_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.college_requirement": { + "name": "college_requirement", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "requirements": { + "name": "requirements", + "type": "jsonb", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "college_requirement_requirements_unique": { + "name": "college_requirement_requirements_unique", + "nullsNotDistinct": false, + "columns": ["requirements"] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.course": { + "name": "course", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "department": { + "name": "department", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "shortened_dept": { + "name": "shortened_dept", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "REPLACE(\"course\".\"department\", ' ', '')", + "type": "stored" + } + }, + "department_alias": { + "name": "department_alias", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "course_number": { + "name": "course_number", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_numeric": { + "name": "course_numeric", + "type": "integer", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "CASE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g') WHEN '' THEN 0 ELSE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g')::INTEGER END", + "type": "stored" + } + }, + "school": { + "name": "school", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_level": { + "name": "course_level", + "type": "course_level", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "min_units": { + "name": "min_units", + "type": "numeric(4, 2)", + "primaryKey": false, + "notNull": true + }, + "max_units": { + "name": "max_units", + "type": "numeric(4, 2)", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "department_name": { + "name": "department_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "prerequisite_tree": { + "name": "prerequisite_tree", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "prerequisite_text": { + "name": "prerequisite_text", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "repeatability": { + "name": "repeatability", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "grading_option": { + "name": "grading_option", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "concurrent": { + "name": "concurrent", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "same_as": { + "name": "same_as", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "restriction": { + "name": "restriction", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "overlap": { + "name": "overlap", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "corequisites": { + "name": "corequisites", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "is_ge_1a": { + "name": "is_ge_1a", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_1b": { + "name": "is_ge_1b", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_2": { + "name": "is_ge_2", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_3": { + "name": "is_ge_3", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_4": { + "name": "is_ge_4", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_5a": { + "name": "is_ge_5a", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_5b": { + "name": "is_ge_5b", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_6": { + "name": "is_ge_6", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_7": { + "name": "is_ge_7", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_8": { + "name": "is_ge_8", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "ge_text": { + "name": "ge_text", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "course_search_index": { + "name": "course_search_index", + "columns": [ + { + "expression": "(\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"id\", '')), 'A') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"department\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"department_alias\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"shortened_dept\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"course_number\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"course_numeric\"::TEXT, '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"title\", '')), 'C') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"description\", '')), 'D')\n)", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "gin", + "with": {} + }, + "shortened_dept": { + "name": "shortened_dept", + "columns": [ + { + "expression": "shortened_dept", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.degree": { + "name": "degree", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "division": { + "name": "division", + "type": "division", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.instructor": { + "name": "instructor", + "schema": "", + "columns": { + "ucinetid": { + "name": "ucinetid", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "email": { + "name": "email", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "department": { + "name": "department", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "instructor_search_index": { + "name": "instructor_search_index", + "columns": [ + { + "expression": "(\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"ucinetid\", '')), 'A') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"name\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"title\", '')), 'B')\n)", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "gin", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.instructor_to_websoc_instructor": { + "name": "instructor_to_websoc_instructor", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "instructor_ucinetid": { + "name": "instructor_ucinetid", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "websoc_instructor_name": { + "name": "websoc_instructor_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "instructor_to_websoc_instructor_instructor_ucinetid_index": { + "name": "instructor_to_websoc_instructor_instructor_ucinetid_index", + "columns": [ + { + "expression": "instructor_ucinetid", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "instructor_to_websoc_instructor_websoc_instructor_name_index": { + "name": "instructor_to_websoc_instructor_websoc_instructor_name_index", + "columns": [ + { + "expression": "websoc_instructor_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "instructor_to_websoc_instructor_instructor_ucinetid_websoc_instructor_name_index": { + "name": "instructor_to_websoc_instructor_instructor_ucinetid_websoc_instructor_name_index", + "columns": [ + { + "expression": "instructor_ucinetid", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "websoc_instructor_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "instructor_to_websoc_instructor_instructor_ucinetid_instructor_ucinetid_fk": { + "name": "instructor_to_websoc_instructor_instructor_ucinetid_instructor_ucinetid_fk", + "tableFrom": "instructor_to_websoc_instructor", + "tableTo": "instructor", + "columnsFrom": ["instructor_ucinetid"], + "columnsTo": ["ucinetid"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "instructor_to_websoc_instructor_websoc_instructor_name_websoc_instructor_name_fk": { + "name": "instructor_to_websoc_instructor_websoc_instructor_name_websoc_instructor_name_fk", + "tableFrom": "instructor_to_websoc_instructor", + "tableTo": "websoc_instructor", + "columnsFrom": ["websoc_instructor_name"], + "columnsTo": ["name"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.larc_section": { + "name": "larc_section", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "course_id": { + "name": "course_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "days_string": { + "name": "days_string", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "time_string": { + "name": "time_string", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "start_time": { + "name": "start_time", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "end_time": { + "name": "end_time", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "instructor": { + "name": "instructor", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "building": { + "name": "building", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "meets_monday": { + "name": "meets_monday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_tuesday": { + "name": "meets_tuesday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_wednesday": { + "name": "meets_wednesday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_thursday": { + "name": "meets_thursday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_friday": { + "name": "meets_friday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_saturday": { + "name": "meets_saturday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_sunday": { + "name": "meets_sunday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": { + "larc_section_course_id_index": { + "name": "larc_section_course_id_index", + "columns": [ + { + "expression": "course_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "larc_section_course_id_websoc_course_id_fk": { + "name": "larc_section_course_id_websoc_course_id_fk", + "tableFrom": "larc_section", + "tableTo": "websoc_course", + "columnsFrom": ["course_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.library_traffic": { + "name": "library_traffic", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true + }, + "library_name": { + "name": "library_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "location_name": { + "name": "location_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "traffic_count": { + "name": "traffic_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "traffic_percentage": { + "name": "traffic_percentage", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "timestamp": { + "name": "timestamp", + "type": "timestamp", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "library_traffic_library_name_index": { + "name": "library_traffic_library_name_index", + "columns": [ + { + "expression": "library_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "library_traffic_location_name_index": { + "name": "library_traffic_location_name_index", + "columns": [ + { + "expression": "location_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.library_traffic_history": { + "name": "library_traffic_history", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "location_id": { + "name": "location_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "traffic_count": { + "name": "traffic_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "traffic_percentage": { + "name": "traffic_percentage", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "timestamp": { + "name": "timestamp", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "library_traffic_history_location_id_timestamp_index": { + "name": "library_traffic_history_location_id_timestamp_index", + "columns": [ + { + "expression": "location_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "timestamp", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "library_traffic_history_location_id_library_traffic_id_fk": { + "name": "library_traffic_history_location_id_library_traffic_id_fk", + "tableFrom": "library_traffic_history", + "tableTo": "library_traffic", + "columnsFrom": ["location_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.major": { + "name": "major", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "degree_id": { + "name": "degree_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "code": { + "name": "code", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "require_spec": { + "name": "require_spec", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "college_requirement": { + "name": "college_requirement", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "requirements": { + "name": "requirements", + "type": "json", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "major_degree_id_index": { + "name": "major_degree_id_index", + "columns": [ + { + "expression": "degree_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "major_college_requirement_index": { + "name": "major_college_requirement_index", + "columns": [ + { + "expression": "college_requirement", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "major_degree_id_degree_id_fk": { + "name": "major_degree_id_degree_id_fk", + "tableFrom": "major", + "tableTo": "degree", + "columnsFrom": ["degree_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "major_college_requirement_college_requirement_id_fk": { + "name": "major_college_requirement_college_requirement_id_fk", + "tableFrom": "major", + "tableTo": "college_requirement", + "columnsFrom": ["college_requirement"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.minor": { + "name": "minor", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "requirements": { + "name": "requirements", + "type": "json", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.prerequisite": { + "name": "prerequisite", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "dep_dept": { + "name": "dep_dept", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "prerequisite_id": { + "name": "prerequisite_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "dependency_id": { + "name": "dependency_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "prerequisite_dep_dept_index": { + "name": "prerequisite_dep_dept_index", + "columns": [ + { + "expression": "dep_dept", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "prerequisite_prerequisite_id_index": { + "name": "prerequisite_prerequisite_id_index", + "columns": [ + { + "expression": "prerequisite_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "prerequisite_dependency_id_index": { + "name": "prerequisite_dependency_id_index", + "columns": [ + { + "expression": "dependency_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "prerequisite_prerequisite_id_dependency_id_index": { + "name": "prerequisite_prerequisite_id_dependency_id_index", + "columns": [ + { + "expression": "prerequisite_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "dependency_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.sample_program_variation": { + "name": "sample_program_variation", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "program_id": { + "name": "program_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "label": { + "name": "label", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "sample_program": { + "name": "sample_program", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "variation_notes": { + "name": "variation_notes", + "type": "varchar[]", + "primaryKey": false, + "notNull": true, + "default": "ARRAY[]::VARCHAR[]" + } + }, + "indexes": {}, + "foreignKeys": { + "sample_program_variation_program_id_catalogue_program_id_fk": { + "name": "sample_program_variation_program_id_catalogue_program_id_fk", + "tableFrom": "sample_program_variation", + "tableTo": "catalogue_program", + "columnsFrom": ["program_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.school_requirement": { + "name": "school_requirement", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "requirements": { + "name": "requirements", + "type": "json", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.specialization": { + "name": "specialization", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "major_id": { + "name": "major_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "requirements": { + "name": "requirements", + "type": "json", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "specialization_major_id_index": { + "name": "specialization_major_id_index", + "columns": [ + { + "expression": "major_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "specialization_major_id_major_id_fk": { + "name": "specialization_major_id_major_id_fk", + "tableFrom": "specialization", + "tableTo": "major", + "columnsFrom": ["major_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.study_location": { + "name": "study_location", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.study_room": { + "name": "study_room", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "capacity": { + "name": "capacity", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "location": { + "name": "location", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "directions": { + "name": "directions", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "tech_enhanced": { + "name": "tech_enhanced", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "study_location_id": { + "name": "study_location_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "study_room_study_location_id_index": { + "name": "study_room_study_location_id_index", + "columns": [ + { + "expression": "study_location_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "study_room_study_location_id_study_location_id_fk": { + "name": "study_room_study_location_id_study_location_id_fk", + "tableFrom": "study_room", + "tableTo": "study_location", + "columnsFrom": ["study_location_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.study_room_slot": { + "name": "study_room_slot", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "study_room_id": { + "name": "study_room_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "start": { + "name": "start", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "end": { + "name": "end", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "is_available": { + "name": "is_available", + "type": "boolean", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "study_room_slot_study_room_id_index": { + "name": "study_room_slot_study_room_id_index", + "columns": [ + { + "expression": "study_room_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "study_room_slot_study_room_id_start_end_index": { + "name": "study_room_slot_study_room_id_start_end_index", + "columns": [ + { + "expression": "study_room_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "start", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "end", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "study_room_slot_study_room_id_study_room_id_fk": { + "name": "study_room_slot_study_room_id_study_room_id_fk", + "tableFrom": "study_room_slot", + "tableTo": "study_room", + "columnsFrom": ["study_room_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_course": { + "name": "websoc_course", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "department_id": { + "name": "department_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "course_id": { + "name": "course_id", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "REPLACE(\"websoc_course\".\"dept_code\", ' ', '') || \"websoc_course\".\"course_number\"", + "type": "stored" + } + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "year": { + "name": "year", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "quarter": { + "name": "quarter", + "type": "term", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "school_name": { + "name": "school_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "dept_code": { + "name": "dept_code", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_title": { + "name": "course_title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_number": { + "name": "course_number", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_numeric": { + "name": "course_numeric", + "type": "integer", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "CASE REGEXP_REPLACE(\"websoc_course\".\"course_number\", '\\D', '', 'g') WHEN '' THEN 0 ELSE REGEXP_REPLACE(\"websoc_course\".\"course_number\", '\\D', '', 'g')::INTEGER END", + "type": "stored" + } + }, + "course_comment": { + "name": "course_comment", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "prerequisite_link": { + "name": "prerequisite_link", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "is_ge_1a": { + "name": "is_ge_1a", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_1b": { + "name": "is_ge_1b", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_2": { + "name": "is_ge_2", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_3": { + "name": "is_ge_3", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_4": { + "name": "is_ge_4", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_5a": { + "name": "is_ge_5a", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_5b": { + "name": "is_ge_5b", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_6": { + "name": "is_ge_6", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_7": { + "name": "is_ge_7", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_8": { + "name": "is_ge_8", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": { + "websoc_course_department_id_index": { + "name": "websoc_course_department_id_index", + "columns": [ + { + "expression": "department_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_course_id_index": { + "name": "websoc_course_course_id_index", + "columns": [ + { + "expression": "course_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_school_name_dept_code_course_number_course_title_index": { + "name": "websoc_course_year_quarter_school_name_dept_code_course_number_course_title_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "school_name", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "dept_code", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "course_number", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "course_title", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_1a_index": { + "name": "websoc_course_year_quarter_is_ge_1a_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_1a", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_1b_index": { + "name": "websoc_course_year_quarter_is_ge_1b_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_1b", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_2_index": { + "name": "websoc_course_year_quarter_is_ge_2_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_2", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_3_index": { + "name": "websoc_course_year_quarter_is_ge_3_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_3", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_4_index": { + "name": "websoc_course_year_quarter_is_ge_4_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_4", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_5a_index": { + "name": "websoc_course_year_quarter_is_ge_5a_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_5a", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_5b_index": { + "name": "websoc_course_year_quarter_is_ge_5b_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_5b", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_6_index": { + "name": "websoc_course_year_quarter_is_ge_6_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_6", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_7_index": { + "name": "websoc_course_year_quarter_is_ge_7_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_7", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_8_index": { + "name": "websoc_course_year_quarter_is_ge_8_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_8", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_dept_code_index": { + "name": "websoc_course_year_quarter_dept_code_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "dept_code", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_dept_code_course_number_index": { + "name": "websoc_course_year_quarter_dept_code_course_number_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "dept_code", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "course_number", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_course_department_id_websoc_department_id_fk": { + "name": "websoc_course_department_id_websoc_department_id_fk", + "tableFrom": "websoc_course", + "tableTo": "websoc_department", + "columnsFrom": ["department_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_department": { + "name": "websoc_department", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "school_id": { + "name": "school_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "year": { + "name": "year", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "quarter": { + "name": "quarter", + "type": "term", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "dept_code": { + "name": "dept_code", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "dept_name": { + "name": "dept_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "dept_comment": { + "name": "dept_comment", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "section_code_range_comments": { + "name": "section_code_range_comments", + "type": "text[]", + "primaryKey": false, + "notNull": true + }, + "course_number_range_comments": { + "name": "course_number_range_comments", + "type": "text[]", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "websoc_department_school_id_index": { + "name": "websoc_department_school_id_index", + "columns": [ + { + "expression": "school_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_department_year_quarter_school_id_dept_code_index": { + "name": "websoc_department_year_quarter_school_id_dept_code_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "school_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "dept_code", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_department_school_id_websoc_school_id_fk": { + "name": "websoc_department_school_id_websoc_school_id_fk", + "tableFrom": "websoc_department", + "tableTo": "websoc_school", + "columnsFrom": ["school_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_instructor": { + "name": "websoc_instructor", + "schema": "", + "columns": { + "name": { + "name": "name", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_location": { + "name": "websoc_location", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "building": { + "name": "building", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "room": { + "name": "room", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "websoc_location_building_room_index": { + "name": "websoc_location_building_room_index", + "columns": [ + { + "expression": "building", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "room", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_meta": { + "name": "websoc_meta", + "schema": "", + "columns": { + "name": { + "name": "name", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "last_scraped": { + "name": "last_scraped", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "last_dept_scraped": { + "name": "last_dept_scraped", + "type": "varchar", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_school": { + "name": "websoc_school", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "year": { + "name": "year", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "quarter": { + "name": "quarter", + "type": "term", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "school_name": { + "name": "school_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "school_comment": { + "name": "school_comment", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "websoc_school_year_quarter_school_name_index": { + "name": "websoc_school_year_quarter_school_name_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "school_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_section": { + "name": "websoc_section", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "course_id": { + "name": "course_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "year": { + "name": "year", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "quarter": { + "name": "quarter", + "type": "term", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "units": { + "name": "units", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "websoc_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "instructors": { + "name": "instructors", + "type": "text[]", + "primaryKey": false, + "notNull": true + }, + "meetings": { + "name": "meetings", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "final_exam_string": { + "name": "final_exam_string", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "final_exam": { + "name": "final_exam", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "section_num": { + "name": "section_num", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "max_capacity": { + "name": "max_capacity", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "section_code": { + "name": "section_code", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "section_type": { + "name": "section_type", + "type": "websoc_section_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "num_requested": { + "name": "num_requested", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "restriction_string": { + "name": "restriction_string", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "restriction_a": { + "name": "restriction_a", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_b": { + "name": "restriction_b", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_c": { + "name": "restriction_c", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_d": { + "name": "restriction_d", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_e": { + "name": "restriction_e", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_f": { + "name": "restriction_f", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_g": { + "name": "restriction_g", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_h": { + "name": "restriction_h", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_i": { + "name": "restriction_i", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_j": { + "name": "restriction_j", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_k": { + "name": "restriction_k", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_l": { + "name": "restriction_l", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_m": { + "name": "restriction_m", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_n": { + "name": "restriction_n", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_o": { + "name": "restriction_o", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_r": { + "name": "restriction_r", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_s": { + "name": "restriction_s", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_x": { + "name": "restriction_x", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "num_on_waitlist": { + "name": "num_on_waitlist", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_waitlist_cap": { + "name": "num_waitlist_cap", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "section_comment": { + "name": "section_comment", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "num_new_only_reserved": { + "name": "num_new_only_reserved", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_currently_total_enrolled": { + "name": "num_currently_total_enrolled", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_currently_section_enrolled": { + "name": "num_currently_section_enrolled", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "is_cancelled": { + "name": "is_cancelled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "\"websoc_section\".\"section_comment\" LIKE '%*** CANCELLED ***%' OR \"websoc_section\".\"section_comment\" LIKE '%*** CANCELED ***%'", + "type": "stored" + } + }, + "web_url": { + "name": "web_url", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "''" + } + }, + "indexes": { + "websoc_section_course_id_index": { + "name": "websoc_section_course_id_index", + "columns": [ + { + "expression": "course_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_section_year_quarter_section_code_index": { + "name": "websoc_section_year_quarter_section_code_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "section_code", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_section_course_id_websoc_course_id_fk": { + "name": "websoc_section_course_id_websoc_course_id_fk", + "tableFrom": "websoc_section", + "tableTo": "websoc_course", + "columnsFrom": ["course_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_section_enrollment": { + "name": "websoc_section_enrollment", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "section_id": { + "name": "section_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "date", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "year": { + "name": "year", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "quarter": { + "name": "quarter", + "type": "term", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "max_capacity": { + "name": "max_capacity", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "num_currently_total_enrolled": { + "name": "num_currently_total_enrolled", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_on_waitlist": { + "name": "num_on_waitlist", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_waitlist_cap": { + "name": "num_waitlist_cap", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_requested": { + "name": "num_requested", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_new_only_reserved": { + "name": "num_new_only_reserved", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "websoc_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "websoc_section_enrollment_section_id_index": { + "name": "websoc_section_enrollment_section_id_index", + "columns": [ + { + "expression": "section_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_section_enrollment_section_id_created_at_index": { + "name": "websoc_section_enrollment_section_id_created_at_index", + "columns": [ + { + "expression": "section_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_section_enrollment_section_id_websoc_section_id_fk": { + "name": "websoc_section_enrollment_section_id_websoc_section_id_fk", + "tableFrom": "websoc_section_enrollment", + "tableTo": "websoc_section", + "columnsFrom": ["section_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_section_grade": { + "name": "websoc_section_grade", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "section_id": { + "name": "section_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "grade_a_count": { + "name": "grade_a_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_b_count": { + "name": "grade_b_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_c_count": { + "name": "grade_c_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_d_count": { + "name": "grade_d_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_f_count": { + "name": "grade_f_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_p_count": { + "name": "grade_p_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_np_count": { + "name": "grade_np_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_w_count": { + "name": "grade_w_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "average_gpa": { + "name": "average_gpa", + "type": "numeric(3, 2)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "websoc_section_grade_section_id_index": { + "name": "websoc_section_grade_section_id_index", + "columns": [ + { + "expression": "section_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_section_grade_section_id_websoc_section_id_fk": { + "name": "websoc_section_grade_section_id_websoc_section_id_fk", + "tableFrom": "websoc_section_grade", + "tableTo": "websoc_section", + "columnsFrom": ["section_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "websoc_section_grade_section_id_unique": { + "name": "websoc_section_grade_section_id_unique", + "nullsNotDistinct": false, + "columns": ["section_id"] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_section_meeting": { + "name": "websoc_section_meeting", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "section_id": { + "name": "section_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "section_code": { + "name": "section_code", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "meeting_index": { + "name": "meeting_index", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "time_string": { + "name": "time_string", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "time_is_tba": { + "name": "time_is_tba", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "\"websoc_section_meeting\".\"time_string\" LIKE '%TBA%'", + "type": "stored" + } + }, + "start_time": { + "name": "start_time", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "end_time": { + "name": "end_time", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "days_string": { + "name": "days_string", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "meets_monday": { + "name": "meets_monday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_tuesday": { + "name": "meets_tuesday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_wednesday": { + "name": "meets_wednesday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_thursday": { + "name": "meets_thursday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_friday": { + "name": "meets_friday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_saturday": { + "name": "meets_saturday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_sunday": { + "name": "meets_sunday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": { + "websoc_section_meeting_section_id_index": { + "name": "websoc_section_meeting_section_id_index", + "columns": [ + { + "expression": "section_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_section_meeting_section_id_websoc_section_id_fk": { + "name": "websoc_section_meeting_section_id_websoc_section_id_fk", + "tableFrom": "websoc_section_meeting", + "tableTo": "websoc_section", + "columnsFrom": ["section_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_section_meeting_to_location": { + "name": "websoc_section_meeting_to_location", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "meeting_id": { + "name": "meeting_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "location_id": { + "name": "location_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "websoc_section_meeting_to_location_meeting_id_index": { + "name": "websoc_section_meeting_to_location_meeting_id_index", + "columns": [ + { + "expression": "meeting_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_section_meeting_to_location_location_id_index": { + "name": "websoc_section_meeting_to_location_location_id_index", + "columns": [ + { + "expression": "location_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_section_meeting_to_location_meeting_id_location_id_index": { + "name": "websoc_section_meeting_to_location_meeting_id_location_id_index", + "columns": [ + { + "expression": "meeting_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "location_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_section_meeting_to_location_meeting_id_websoc_section_meeting_id_fk": { + "name": "websoc_section_meeting_to_location_meeting_id_websoc_section_meeting_id_fk", + "tableFrom": "websoc_section_meeting_to_location", + "tableTo": "websoc_section_meeting", + "columnsFrom": ["meeting_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "websoc_section_meeting_to_location_location_id_websoc_location_id_fk": { + "name": "websoc_section_meeting_to_location_location_id_websoc_location_id_fk", + "tableFrom": "websoc_section_meeting_to_location", + "tableTo": "websoc_location", + "columnsFrom": ["location_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_section_to_instructor": { + "name": "websoc_section_to_instructor", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "section_id": { + "name": "section_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "instructor_name": { + "name": "instructor_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "websoc_section_to_instructor_section_id_index": { + "name": "websoc_section_to_instructor_section_id_index", + "columns": [ + { + "expression": "section_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_section_to_instructor_instructor_name_index": { + "name": "websoc_section_to_instructor_instructor_name_index", + "columns": [ + { + "expression": "instructor_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_section_to_instructor_section_id_websoc_section_id_fk": { + "name": "websoc_section_to_instructor_section_id_websoc_section_id_fk", + "tableFrom": "websoc_section_to_instructor", + "tableTo": "websoc_section", + "columnsFrom": ["section_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "websoc_section_to_instructor_instructor_name_websoc_instructor_name_fk": { + "name": "websoc_section_to_instructor_instructor_name_websoc_instructor_name_fk", + "tableFrom": "websoc_section_to_instructor", + "tableTo": "websoc_instructor", + "columnsFrom": ["instructor_name"], + "columnsTo": ["name"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": { + "public.course_level": { + "name": "course_level", + "schema": "public", + "values": ["LowerDiv", "UpperDiv", "Graduate"] + }, + "public.division": { + "name": "division", + "schema": "public", + "values": ["Undergraduate", "Graduate"] + }, + "public.term": { + "name": "term", + "schema": "public", + "values": ["Fall", "Winter", "Spring", "Summer1", "Summer10wk", "Summer2"] + }, + "public.websoc_section_type": { + "name": "websoc_section_type", + "schema": "public", + "values": [ + "Act", + "Col", + "Dis", + "Fld", + "Lab", + "Lec", + "Qiz", + "Res", + "Sem", + "Stu", + "Tap", + "Tut" + ] + }, + "public.websoc_status": { + "name": "websoc_status", + "schema": "public", + "values": ["OPEN", "Waitl", "FULL", "NewOnly"] + } + }, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": { + "public.course_view": { + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "department": { + "name": "department", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "shortened_dept": { + "name": "shortened_dept", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "REPLACE(\"course\".\"department\", ' ', '')", + "type": "stored" + } + }, + "department_alias": { + "name": "department_alias", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "course_number": { + "name": "course_number", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_numeric": { + "name": "course_numeric", + "type": "integer", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "CASE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g') WHEN '' THEN 0 ELSE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g')::INTEGER END", + "type": "stored" + } + }, + "school": { + "name": "school", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_level": { + "name": "course_level", + "type": "course_level", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "min_units": { + "name": "min_units", + "type": "numeric(4, 2)", + "primaryKey": false, + "notNull": true + }, + "max_units": { + "name": "max_units", + "type": "numeric(4, 2)", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "department_name": { + "name": "department_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "prerequisite_tree": { + "name": "prerequisite_tree", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "prerequisite_text": { + "name": "prerequisite_text", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "repeatability": { + "name": "repeatability", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "grading_option": { + "name": "grading_option", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "concurrent": { + "name": "concurrent", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "same_as": { + "name": "same_as", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "restriction": { + "name": "restriction", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "overlap": { + "name": "overlap", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "corequisites": { + "name": "corequisites", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "is_ge_1a": { + "name": "is_ge_1a", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_1b": { + "name": "is_ge_1b", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_2": { + "name": "is_ge_2", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_3": { + "name": "is_ge_3", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_4": { + "name": "is_ge_4", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_5a": { + "name": "is_ge_5a", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_5b": { + "name": "is_ge_5b", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_6": { + "name": "is_ge_6", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_7": { + "name": "is_ge_7", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_8": { + "name": "is_ge_8", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "ge_text": { + "name": "ge_text", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "definition": "select \"course\".\"id\", \"course\".\"updated_at\", \"course\".\"department\", \"course\".\"shortened_dept\", \"course\".\"department_alias\", \"course\".\"course_number\", \"course\".\"course_numeric\", \"course\".\"school\", \"course\".\"title\", \"course\".\"course_level\", \"course\".\"min_units\", \"course\".\"max_units\", \"course\".\"description\", \"course\".\"department_name\", \"course\".\"prerequisite_tree\", \"course\".\"prerequisite_text\", \"course\".\"repeatability\", \"course\".\"grading_option\", \"course\".\"concurrent\", \"course\".\"same_as\", \"course\".\"restriction\", \"course\".\"overlap\", \"course\".\"corequisites\", \"course\".\"is_ge_1a\", \"course\".\"is_ge_1b\", \"course\".\"is_ge_2\", \"course\".\"is_ge_3\", \"course\".\"is_ge_4\", \"course\".\"is_ge_5a\", \"course\".\"is_ge_5b\", \"course\".\"is_ge_6\", \"course\".\"is_ge_7\", \"course\".\"is_ge_8\", \"course\".\"ge_text\", \n ARRAY_REMOVE(COALESCE(\n (\n SELECT ARRAY_AGG(\n CASE WHEN \"prerequisite_course\".\"id\" IS NULL THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'id', \"prerequisite_course\".\"id\",\n 'title', \"prerequisite_course\".\"title\",\n 'department', \"prerequisite_course\".\"department\",\n 'courseNumber', \"prerequisite_course\".\"course_number\"\n )\n END\n )\n FROM \"prerequisite\"\n LEFT JOIN \"course\" \"prerequisite_course\" ON \"prerequisite_course\".\"id\" = \"prerequisite\".\"prerequisite_id\"\n WHERE \"prerequisite\".\"dependency_id\" = \"course\".\"id\"\n ),\n ARRAY[]::JSONB[]), NULL)\n as \"prerequisites\", \n ARRAY_REMOVE(COALESCE(\n (\n SELECT ARRAY_AGG(\n CASE WHEN \"dependency_course\".\"id\" IS NULL THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'id', \"dependency_course\".\"id\",\n 'title', \"dependency_course\".\"title\",\n 'department', \"dependency_course\".\"department\",\n 'courseNumber', \"dependency_course\".\"course_number\"\n )\n END\n )\n FROM \"prerequisite\" \"dependency\"\n LEFT JOIN \"course\" \"dependency_course\" ON \"dependency_course\".\"id\" = \"dependency\".\"dependency_id\"\n WHERE \"dependency\".\"prerequisite_id\" = \"course\".\"id\"\n ),\n ARRAY[]::JSONB[]), NULL)\n as \"dependencies\", \n ARRAY_REMOVE(ARRAY_AGG(DISTINCT\n CASE WHEN \"websoc_course\".\"year\" IS NULL THEN NULL\n ELSE CONCAT(\"websoc_course\".\"year\", ' ', \"websoc_course\".\"quarter\")\n END\n ), NULL)\n as \"terms\", \n ARRAY_REMOVE(COALESCE(ARRAY_AGG(DISTINCT\n CASE WHEN \"instructor\".\"ucinetid\" IS NULL THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'ucinetid', \"instructor\".\"ucinetid\",\n 'name', \"instructor\".\"name\",\n 'title', \"instructor\".\"title\",\n 'email', \"instructor\".\"email\",\n 'department', \"instructor\".\"department\",\n 'shortenedNames', ARRAY(\n SELECT \"instructor_to_websoc_instructor\".\"websoc_instructor_name\"\n FROM \"instructor_to_websoc_instructor\"\n WHERE \"instructor_to_websoc_instructor\".\"instructor_ucinetid\" = \"instructor\".\"ucinetid\"\n )\n )\n END\n ), ARRAY[]::JSONB[]), NULL)\n as \"instructors\" from \"course\" left join \"websoc_course\" on \"websoc_course\".\"course_id\" = \"course\".\"id\" left join \"websoc_section\" on \"websoc_section\".\"course_id\" = \"websoc_course\".\"id\" left join \"websoc_section_to_instructor\" on \"websoc_section_to_instructor\".\"section_id\" = \"websoc_section\".\"id\" left join \"websoc_instructor\" on \"websoc_instructor\".\"name\" = \"websoc_section_to_instructor\".\"instructor_name\" left join \"instructor_to_websoc_instructor\" on \"instructor_to_websoc_instructor\".\"websoc_instructor_name\" = \"websoc_instructor\".\"name\" left join \"instructor\" on (\"instructor\".\"ucinetid\" = \"instructor_to_websoc_instructor\".\"instructor_ucinetid\" and \"instructor\".\"ucinetid\" is not null and \"instructor\".\"ucinetid\" <> 'student') group by \"course\".\"id\"", + "name": "course_view", + "schema": "public", + "isExisting": false, + "materialized": true + }, + "public.instructor_view": { + "columns": { + "ucinetid": { + "name": "ucinetid", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "email": { + "name": "email", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "department": { + "name": "department", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "definition": "with \"shortened_names_cte\" as (select \"instructor_ucinetid\", ARRAY_AGG(\"websoc_instructor_name\") as \"shortened_names\" from \"instructor_to_websoc_instructor\" group by \"instructor_to_websoc_instructor\".\"instructor_ucinetid\"), \"courses_cte\" as (with \"terms_cte\" as (select \"course\".\"id\", \"instructor_to_websoc_instructor\".\"instructor_ucinetid\", \n ARRAY_REMOVE(ARRAY_AGG(DISTINCT\n CASE WHEN \"websoc_course\".\"year\" IS NULL THEN NULL\n ELSE CONCAT(\"websoc_course\".\"year\", ' ', \"websoc_course\".\"quarter\")\n END\n ), NULL) as \"terms\" from \"course\" left join \"websoc_course\" on \"websoc_course\".\"course_id\" = \"course\".\"id\" left join \"websoc_section\" on \"websoc_section\".\"course_id\" = \"websoc_course\".\"id\" left join \"websoc_section_to_instructor\" on \"websoc_section_to_instructor\".\"section_id\" = \"websoc_section\".\"id\" left join \"websoc_instructor\" on \"websoc_instructor\".\"name\" = \"websoc_section_to_instructor\".\"instructor_name\" left join \"instructor_to_websoc_instructor\" on \"instructor_to_websoc_instructor\".\"websoc_instructor_name\" = \"websoc_instructor\".\"name\" group by \"course\".\"id\", \"instructor_to_websoc_instructor\".\"instructor_ucinetid\") select \"terms_cte\".\"instructor_ucinetid\", \"course\".\"id\", \n CASE WHEN \"course\".\"id\" IS NULL\n THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'id', \"course\".\"id\",\n 'title', \"course\".\"title\",\n 'department', \"course\".\"department\",\n 'courseNumber', \"course\".\"course_number\",\n 'terms', COALESCE(\"terms\", ARRAY[]::TEXT[])\n )\n END\n as \"course_info\" from \"course\" left join \"terms_cte\" on \"terms_cte\".\"id\" = \"course\".\"id\" group by \"course\".\"id\", \"terms_cte\".\"instructor_ucinetid\", \"terms\") select \"instructor\".\"ucinetid\", \"instructor\".\"name\", \"instructor\".\"title\", \"instructor\".\"email\", \"instructor\".\"department\", COALESCE(\"shortened_names\", ARRAY[]::TEXT[]) as \"shortened_names\", \n ARRAY_REMOVE(ARRAY_AGG(DISTINCT \"course_info\"), NULL)\n as \"courses\" from \"instructor\" left join \"shortened_names_cte\" on \"shortened_names_cte\".\"instructor_ucinetid\" = \"instructor\".\"ucinetid\" left join \"courses_cte\" on \"courses_cte\".\"instructor_ucinetid\" = \"instructor\".\"ucinetid\" where \"instructor\".\"ucinetid\" <> 'student' group by \"instructor\".\"ucinetid\", \"shortened_names\"", + "name": "instructor_view", + "schema": "public", + "isExisting": false, + "materialized": true + } + }, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} diff --git a/packages/db/migrations/meta/_journal.json b/packages/db/migrations/meta/_journal.json index 9a7f9aea..11dc6739 100644 --- a/packages/db/migrations/meta/_journal.json +++ b/packages/db/migrations/meta/_journal.json @@ -162,6 +162,13 @@ "when": 1766088418349, "tag": "0022_fix_websoc_is_cancelled", "breakpoints": true + }, + { + "idx": 23, + "version": "7", + "when": 1769640710103, + "tag": "0023_fresh_chimera", + "breakpoints": true } ] } From 6359bdb2504afd9eaa9fa821b00299ce5e1defda Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Thu, 29 Jan 2026 10:09:43 -0800 Subject: [PATCH 07/91] updated pnpm --- apps/api/src/schema/programs.ts | 2 +- apps/api/src/services/programs.ts | 3 +-- package.json | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/api/src/schema/programs.ts b/apps/api/src/schema/programs.ts index 60508edd..9747a884 100644 --- a/apps/api/src/schema/programs.ts +++ b/apps/api/src/schema/programs.ts @@ -187,7 +187,7 @@ export const majorsResponseSchema = z.array( division: z.literal("Undergraduate").or(z.literal("Graduate")).openapi({ description: "The division in which this major is offered", }), - requireSpecialization: z.boolean().openapi({ + requireSpec: z.boolean().openapi({ description: "Whether a specialization must be completed to complete this degree", }), specializations: z.array(z.string()).openapi({ diff --git a/apps/api/src/services/programs.ts b/apps/api/src/services/programs.ts index ba3040e6..6de8c8e4 100644 --- a/apps/api/src/services/programs.ts +++ b/apps/api/src/services/programs.ts @@ -32,7 +32,6 @@ export class ProgramsService { .select({ id: major.id, name: major.name, - requireSpec: major.requireSpec, specializations: sql`ARRAY_REMOVE(ARRAY_AGG(${specialization.id}), NULL)`.as( "specializations", ), @@ -47,7 +46,7 @@ export class ProgramsService { .select({ id: majorSpecialization.id, name: majorSpecialization.name, - requireSpec: majorSpecialization.requireSpec, + requireSpec: major.requireSpec, specializations: majorSpecialization.specializations, type: degree.name, division: degree.division, diff --git a/package.json b/package.json index c6d7d943..e769033b 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "tsx": "4.19.2", "typescript": "5.6.3" }, - "packageManager": "pnpm@10.17.0", + "packageManager": "pnpm@10.28.2", "engines": { "pnpm": "^10.17.0" } From cf4e1a0fc2420a4f43f116b3859483e553817f87 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Thu, 29 Jan 2026 11:20:06 -0800 Subject: [PATCH 08/91] added requireSpec field to graphql schema --- apps/api/src/graphql/schema/programs.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/api/src/graphql/schema/programs.ts b/apps/api/src/graphql/schema/programs.ts index 04cd4c6f..48ac42ba 100644 --- a/apps/api/src/graphql/schema/programs.ts +++ b/apps/api/src/graphql/schema/programs.ts @@ -14,6 +14,7 @@ type MajorPreview implements ProgramPreview @cacheControl(maxAge: 86400) { name: String! type: String! division: ProgramDivision! + requireSpec: Boolean! specializations: [String!]! } From 9b396a71ba2152293dab6d45f1e010191ca94f30 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Thu, 29 Jan 2026 11:20:26 -0800 Subject: [PATCH 09/91] made requireSpec a nonnullable type --- packages/db/src/schema.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/db/src/schema.ts b/packages/db/src/schema.ts index 332b0c46..c28c70df 100644 --- a/packages/db/src/schema.ts +++ b/packages/db/src/schema.ts @@ -676,7 +676,7 @@ export const major = pgTable( .notNull(), code: varchar("code").notNull(), name: varchar("name").notNull(), - requireSpec: boolean("require_spec"), + requireSpec: boolean("require_spec").notNull(), collegeRequirement: uuid("college_requirement").references(() => collegeRequirement.id), requirements: json("requirements").$type().notNull(), }, From 5bcd14ea789e081730348e849fac176a2f7677f6 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Thu, 29 Jan 2026 11:52:46 -0800 Subject: [PATCH 10/91] remigrated db after making requireSpec nonNullable --- .../migrations/0024_nebulous_chronomancer.sql | 1 + .../db/migrations/meta/0024_snapshot.json | 3852 +++++++++++++++++ packages/db/migrations/meta/_journal.json | 7 + 3 files changed, 3860 insertions(+) create mode 100644 packages/db/migrations/0024_nebulous_chronomancer.sql create mode 100644 packages/db/migrations/meta/0024_snapshot.json diff --git a/packages/db/migrations/0024_nebulous_chronomancer.sql b/packages/db/migrations/0024_nebulous_chronomancer.sql new file mode 100644 index 00000000..03912a7b --- /dev/null +++ b/packages/db/migrations/0024_nebulous_chronomancer.sql @@ -0,0 +1 @@ +ALTER TABLE "major" ALTER COLUMN "require_spec" SET NOT NULL; \ No newline at end of file diff --git a/packages/db/migrations/meta/0024_snapshot.json b/packages/db/migrations/meta/0024_snapshot.json new file mode 100644 index 00000000..494947b7 --- /dev/null +++ b/packages/db/migrations/meta/0024_snapshot.json @@ -0,0 +1,3852 @@ +{ + "id": "f26b0ba2-71c0-4bec-a749-dd90bfe40b40", + "prevId": "02076c7e-4d5b-47e4-9722-3a6ee9849b3f", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.ap_exam": { + "name": "ap_exam", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "catalogue_name": { + "name": "catalogue_name", + "type": "varchar", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.ap_exam_reward": { + "name": "ap_exam_reward", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "units_granted": { + "name": "units_granted", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "elective_units_granted": { + "name": "elective_units_granted", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "ge_1a_courses_granted": { + "name": "ge_1a_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_1b_courses_granted": { + "name": "ge_1b_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_2_courses_granted": { + "name": "ge_2_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_3_courses_granted": { + "name": "ge_3_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_4_courses_granted": { + "name": "ge_4_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_5a_courses_granted": { + "name": "ge_5a_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_5b_courses_granted": { + "name": "ge_5b_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_6_courses_granted": { + "name": "ge_6_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_7_courses_granted": { + "name": "ge_7_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_8_courses_granted": { + "name": "ge_8_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "courses_granted": { + "name": "courses_granted", + "type": "json", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.ap_exam_to_reward": { + "name": "ap_exam_to_reward", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "exam_id": { + "name": "exam_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "score": { + "name": "score", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "reward": { + "name": "reward", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "ap_exam_to_reward_exam_id_score_index": { + "name": "ap_exam_to_reward_exam_id_score_index", + "columns": [ + { + "expression": "exam_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "score", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "ap_exam_to_reward_exam_id_ap_exam_id_fk": { + "name": "ap_exam_to_reward_exam_id_ap_exam_id_fk", + "tableFrom": "ap_exam_to_reward", + "tableTo": "ap_exam", + "columnsFrom": ["exam_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "ap_exam_to_reward_reward_ap_exam_reward_id_fk": { + "name": "ap_exam_to_reward_reward_ap_exam_reward_id_fk", + "tableFrom": "ap_exam_to_reward", + "tableTo": "ap_exam_reward", + "columnsFrom": ["reward"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.calendar_term": { + "name": "calendar_term", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true, + "generated": { + "as": "\"calendar_term\".\"year\" || ' ' || CASE WHEN \"calendar_term\".\"quarter\" = 'Fall' THEN 'Fall' WHEN \"calendar_term\".\"quarter\" = 'Winter' THEN 'Winter' WHEN \"calendar_term\".\"quarter\" = 'Spring' THEN 'Spring' WHEN \"calendar_term\".\"quarter\" = 'Summer1' THEN 'Summer1' WHEN \"calendar_term\".\"quarter\" = 'Summer10wk' THEN 'Summer10wk' WHEN \"calendar_term\".\"quarter\" = 'Summer2' THEN 'Summer2' ELSE '' END", + "type": "stored" + } + }, + "year": { + "name": "year", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "quarter": { + "name": "quarter", + "type": "term", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "instruction_start": { + "name": "instruction_start", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "instruction_end": { + "name": "instruction_end", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "finals_start": { + "name": "finals_start", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "finals_end": { + "name": "finals_end", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "soc_available": { + "name": "soc_available", + "type": "date", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.catalogue_program": { + "name": "catalogue_program", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "program_name": { + "name": "program_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.college_requirement": { + "name": "college_requirement", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "requirements": { + "name": "requirements", + "type": "jsonb", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "college_requirement_requirements_unique": { + "name": "college_requirement_requirements_unique", + "nullsNotDistinct": false, + "columns": ["requirements"] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.course": { + "name": "course", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "department": { + "name": "department", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "shortened_dept": { + "name": "shortened_dept", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "REPLACE(\"course\".\"department\", ' ', '')", + "type": "stored" + } + }, + "department_alias": { + "name": "department_alias", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "course_number": { + "name": "course_number", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_numeric": { + "name": "course_numeric", + "type": "integer", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "CASE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g') WHEN '' THEN 0 ELSE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g')::INTEGER END", + "type": "stored" + } + }, + "school": { + "name": "school", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_level": { + "name": "course_level", + "type": "course_level", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "min_units": { + "name": "min_units", + "type": "numeric(4, 2)", + "primaryKey": false, + "notNull": true + }, + "max_units": { + "name": "max_units", + "type": "numeric(4, 2)", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "department_name": { + "name": "department_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "prerequisite_tree": { + "name": "prerequisite_tree", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "prerequisite_text": { + "name": "prerequisite_text", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "repeatability": { + "name": "repeatability", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "grading_option": { + "name": "grading_option", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "concurrent": { + "name": "concurrent", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "same_as": { + "name": "same_as", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "restriction": { + "name": "restriction", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "overlap": { + "name": "overlap", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "corequisites": { + "name": "corequisites", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "is_ge_1a": { + "name": "is_ge_1a", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_1b": { + "name": "is_ge_1b", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_2": { + "name": "is_ge_2", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_3": { + "name": "is_ge_3", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_4": { + "name": "is_ge_4", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_5a": { + "name": "is_ge_5a", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_5b": { + "name": "is_ge_5b", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_6": { + "name": "is_ge_6", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_7": { + "name": "is_ge_7", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_8": { + "name": "is_ge_8", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "ge_text": { + "name": "ge_text", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "course_search_index": { + "name": "course_search_index", + "columns": [ + { + "expression": "(\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"id\", '')), 'A') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"department\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"department_alias\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"shortened_dept\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"course_number\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"course_numeric\"::TEXT, '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"title\", '')), 'C') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"description\", '')), 'D')\n)", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "gin", + "with": {} + }, + "shortened_dept": { + "name": "shortened_dept", + "columns": [ + { + "expression": "shortened_dept", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.degree": { + "name": "degree", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "division": { + "name": "division", + "type": "division", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.instructor": { + "name": "instructor", + "schema": "", + "columns": { + "ucinetid": { + "name": "ucinetid", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "email": { + "name": "email", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "department": { + "name": "department", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "instructor_search_index": { + "name": "instructor_search_index", + "columns": [ + { + "expression": "(\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"ucinetid\", '')), 'A') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"name\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"title\", '')), 'B')\n)", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "gin", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.instructor_to_websoc_instructor": { + "name": "instructor_to_websoc_instructor", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "instructor_ucinetid": { + "name": "instructor_ucinetid", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "websoc_instructor_name": { + "name": "websoc_instructor_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "instructor_to_websoc_instructor_instructor_ucinetid_index": { + "name": "instructor_to_websoc_instructor_instructor_ucinetid_index", + "columns": [ + { + "expression": "instructor_ucinetid", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "instructor_to_websoc_instructor_websoc_instructor_name_index": { + "name": "instructor_to_websoc_instructor_websoc_instructor_name_index", + "columns": [ + { + "expression": "websoc_instructor_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "instructor_to_websoc_instructor_instructor_ucinetid_websoc_instructor_name_index": { + "name": "instructor_to_websoc_instructor_instructor_ucinetid_websoc_instructor_name_index", + "columns": [ + { + "expression": "instructor_ucinetid", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "websoc_instructor_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "instructor_to_websoc_instructor_instructor_ucinetid_instructor_ucinetid_fk": { + "name": "instructor_to_websoc_instructor_instructor_ucinetid_instructor_ucinetid_fk", + "tableFrom": "instructor_to_websoc_instructor", + "tableTo": "instructor", + "columnsFrom": ["instructor_ucinetid"], + "columnsTo": ["ucinetid"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "instructor_to_websoc_instructor_websoc_instructor_name_websoc_instructor_name_fk": { + "name": "instructor_to_websoc_instructor_websoc_instructor_name_websoc_instructor_name_fk", + "tableFrom": "instructor_to_websoc_instructor", + "tableTo": "websoc_instructor", + "columnsFrom": ["websoc_instructor_name"], + "columnsTo": ["name"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.larc_section": { + "name": "larc_section", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "course_id": { + "name": "course_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "days_string": { + "name": "days_string", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "time_string": { + "name": "time_string", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "start_time": { + "name": "start_time", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "end_time": { + "name": "end_time", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "instructor": { + "name": "instructor", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "building": { + "name": "building", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "meets_monday": { + "name": "meets_monday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_tuesday": { + "name": "meets_tuesday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_wednesday": { + "name": "meets_wednesday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_thursday": { + "name": "meets_thursday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_friday": { + "name": "meets_friday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_saturday": { + "name": "meets_saturday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_sunday": { + "name": "meets_sunday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": { + "larc_section_course_id_index": { + "name": "larc_section_course_id_index", + "columns": [ + { + "expression": "course_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "larc_section_course_id_websoc_course_id_fk": { + "name": "larc_section_course_id_websoc_course_id_fk", + "tableFrom": "larc_section", + "tableTo": "websoc_course", + "columnsFrom": ["course_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.library_traffic": { + "name": "library_traffic", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true + }, + "library_name": { + "name": "library_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "location_name": { + "name": "location_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "traffic_count": { + "name": "traffic_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "traffic_percentage": { + "name": "traffic_percentage", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "timestamp": { + "name": "timestamp", + "type": "timestamp", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "library_traffic_library_name_index": { + "name": "library_traffic_library_name_index", + "columns": [ + { + "expression": "library_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "library_traffic_location_name_index": { + "name": "library_traffic_location_name_index", + "columns": [ + { + "expression": "location_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.library_traffic_history": { + "name": "library_traffic_history", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "location_id": { + "name": "location_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "traffic_count": { + "name": "traffic_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "traffic_percentage": { + "name": "traffic_percentage", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "timestamp": { + "name": "timestamp", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "library_traffic_history_location_id_timestamp_index": { + "name": "library_traffic_history_location_id_timestamp_index", + "columns": [ + { + "expression": "location_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "timestamp", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "library_traffic_history_location_id_library_traffic_id_fk": { + "name": "library_traffic_history_location_id_library_traffic_id_fk", + "tableFrom": "library_traffic_history", + "tableTo": "library_traffic", + "columnsFrom": ["location_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.major": { + "name": "major", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "degree_id": { + "name": "degree_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "code": { + "name": "code", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "require_spec": { + "name": "require_spec", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "college_requirement": { + "name": "college_requirement", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "requirements": { + "name": "requirements", + "type": "json", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "major_degree_id_index": { + "name": "major_degree_id_index", + "columns": [ + { + "expression": "degree_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "major_college_requirement_index": { + "name": "major_college_requirement_index", + "columns": [ + { + "expression": "college_requirement", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "major_degree_id_degree_id_fk": { + "name": "major_degree_id_degree_id_fk", + "tableFrom": "major", + "tableTo": "degree", + "columnsFrom": ["degree_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "major_college_requirement_college_requirement_id_fk": { + "name": "major_college_requirement_college_requirement_id_fk", + "tableFrom": "major", + "tableTo": "college_requirement", + "columnsFrom": ["college_requirement"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.minor": { + "name": "minor", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "requirements": { + "name": "requirements", + "type": "json", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.prerequisite": { + "name": "prerequisite", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "dep_dept": { + "name": "dep_dept", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "prerequisite_id": { + "name": "prerequisite_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "dependency_id": { + "name": "dependency_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "prerequisite_dep_dept_index": { + "name": "prerequisite_dep_dept_index", + "columns": [ + { + "expression": "dep_dept", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "prerequisite_prerequisite_id_index": { + "name": "prerequisite_prerequisite_id_index", + "columns": [ + { + "expression": "prerequisite_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "prerequisite_dependency_id_index": { + "name": "prerequisite_dependency_id_index", + "columns": [ + { + "expression": "dependency_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "prerequisite_prerequisite_id_dependency_id_index": { + "name": "prerequisite_prerequisite_id_dependency_id_index", + "columns": [ + { + "expression": "prerequisite_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "dependency_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.sample_program_variation": { + "name": "sample_program_variation", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "program_id": { + "name": "program_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "label": { + "name": "label", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "sample_program": { + "name": "sample_program", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "variation_notes": { + "name": "variation_notes", + "type": "varchar[]", + "primaryKey": false, + "notNull": true, + "default": "ARRAY[]::VARCHAR[]" + } + }, + "indexes": {}, + "foreignKeys": { + "sample_program_variation_program_id_catalogue_program_id_fk": { + "name": "sample_program_variation_program_id_catalogue_program_id_fk", + "tableFrom": "sample_program_variation", + "tableTo": "catalogue_program", + "columnsFrom": ["program_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.school_requirement": { + "name": "school_requirement", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "requirements": { + "name": "requirements", + "type": "json", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.specialization": { + "name": "specialization", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "major_id": { + "name": "major_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "requirements": { + "name": "requirements", + "type": "json", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "specialization_major_id_index": { + "name": "specialization_major_id_index", + "columns": [ + { + "expression": "major_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "specialization_major_id_major_id_fk": { + "name": "specialization_major_id_major_id_fk", + "tableFrom": "specialization", + "tableTo": "major", + "columnsFrom": ["major_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.study_location": { + "name": "study_location", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.study_room": { + "name": "study_room", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "capacity": { + "name": "capacity", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "location": { + "name": "location", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "directions": { + "name": "directions", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "tech_enhanced": { + "name": "tech_enhanced", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "study_location_id": { + "name": "study_location_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "study_room_study_location_id_index": { + "name": "study_room_study_location_id_index", + "columns": [ + { + "expression": "study_location_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "study_room_study_location_id_study_location_id_fk": { + "name": "study_room_study_location_id_study_location_id_fk", + "tableFrom": "study_room", + "tableTo": "study_location", + "columnsFrom": ["study_location_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.study_room_slot": { + "name": "study_room_slot", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "study_room_id": { + "name": "study_room_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "start": { + "name": "start", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "end": { + "name": "end", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "is_available": { + "name": "is_available", + "type": "boolean", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "study_room_slot_study_room_id_index": { + "name": "study_room_slot_study_room_id_index", + "columns": [ + { + "expression": "study_room_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "study_room_slot_study_room_id_start_end_index": { + "name": "study_room_slot_study_room_id_start_end_index", + "columns": [ + { + "expression": "study_room_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "start", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "end", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "study_room_slot_study_room_id_study_room_id_fk": { + "name": "study_room_slot_study_room_id_study_room_id_fk", + "tableFrom": "study_room_slot", + "tableTo": "study_room", + "columnsFrom": ["study_room_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_course": { + "name": "websoc_course", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "department_id": { + "name": "department_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "course_id": { + "name": "course_id", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "REPLACE(\"websoc_course\".\"dept_code\", ' ', '') || \"websoc_course\".\"course_number\"", + "type": "stored" + } + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "year": { + "name": "year", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "quarter": { + "name": "quarter", + "type": "term", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "school_name": { + "name": "school_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "dept_code": { + "name": "dept_code", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_title": { + "name": "course_title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_number": { + "name": "course_number", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_numeric": { + "name": "course_numeric", + "type": "integer", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "CASE REGEXP_REPLACE(\"websoc_course\".\"course_number\", '\\D', '', 'g') WHEN '' THEN 0 ELSE REGEXP_REPLACE(\"websoc_course\".\"course_number\", '\\D', '', 'g')::INTEGER END", + "type": "stored" + } + }, + "course_comment": { + "name": "course_comment", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "prerequisite_link": { + "name": "prerequisite_link", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "is_ge_1a": { + "name": "is_ge_1a", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_1b": { + "name": "is_ge_1b", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_2": { + "name": "is_ge_2", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_3": { + "name": "is_ge_3", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_4": { + "name": "is_ge_4", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_5a": { + "name": "is_ge_5a", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_5b": { + "name": "is_ge_5b", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_6": { + "name": "is_ge_6", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_7": { + "name": "is_ge_7", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_8": { + "name": "is_ge_8", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": { + "websoc_course_department_id_index": { + "name": "websoc_course_department_id_index", + "columns": [ + { + "expression": "department_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_course_id_index": { + "name": "websoc_course_course_id_index", + "columns": [ + { + "expression": "course_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_school_name_dept_code_course_number_course_title_index": { + "name": "websoc_course_year_quarter_school_name_dept_code_course_number_course_title_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "school_name", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "dept_code", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "course_number", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "course_title", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_1a_index": { + "name": "websoc_course_year_quarter_is_ge_1a_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_1a", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_1b_index": { + "name": "websoc_course_year_quarter_is_ge_1b_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_1b", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_2_index": { + "name": "websoc_course_year_quarter_is_ge_2_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_2", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_3_index": { + "name": "websoc_course_year_quarter_is_ge_3_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_3", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_4_index": { + "name": "websoc_course_year_quarter_is_ge_4_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_4", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_5a_index": { + "name": "websoc_course_year_quarter_is_ge_5a_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_5a", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_5b_index": { + "name": "websoc_course_year_quarter_is_ge_5b_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_5b", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_6_index": { + "name": "websoc_course_year_quarter_is_ge_6_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_6", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_7_index": { + "name": "websoc_course_year_quarter_is_ge_7_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_7", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_8_index": { + "name": "websoc_course_year_quarter_is_ge_8_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_8", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_dept_code_index": { + "name": "websoc_course_year_quarter_dept_code_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "dept_code", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_dept_code_course_number_index": { + "name": "websoc_course_year_quarter_dept_code_course_number_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "dept_code", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "course_number", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_course_department_id_websoc_department_id_fk": { + "name": "websoc_course_department_id_websoc_department_id_fk", + "tableFrom": "websoc_course", + "tableTo": "websoc_department", + "columnsFrom": ["department_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_department": { + "name": "websoc_department", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "school_id": { + "name": "school_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "year": { + "name": "year", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "quarter": { + "name": "quarter", + "type": "term", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "dept_code": { + "name": "dept_code", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "dept_name": { + "name": "dept_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "dept_comment": { + "name": "dept_comment", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "section_code_range_comments": { + "name": "section_code_range_comments", + "type": "text[]", + "primaryKey": false, + "notNull": true + }, + "course_number_range_comments": { + "name": "course_number_range_comments", + "type": "text[]", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "websoc_department_school_id_index": { + "name": "websoc_department_school_id_index", + "columns": [ + { + "expression": "school_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_department_year_quarter_school_id_dept_code_index": { + "name": "websoc_department_year_quarter_school_id_dept_code_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "school_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "dept_code", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_department_school_id_websoc_school_id_fk": { + "name": "websoc_department_school_id_websoc_school_id_fk", + "tableFrom": "websoc_department", + "tableTo": "websoc_school", + "columnsFrom": ["school_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_instructor": { + "name": "websoc_instructor", + "schema": "", + "columns": { + "name": { + "name": "name", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_location": { + "name": "websoc_location", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "building": { + "name": "building", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "room": { + "name": "room", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "websoc_location_building_room_index": { + "name": "websoc_location_building_room_index", + "columns": [ + { + "expression": "building", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "room", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_meta": { + "name": "websoc_meta", + "schema": "", + "columns": { + "name": { + "name": "name", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "last_scraped": { + "name": "last_scraped", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "last_dept_scraped": { + "name": "last_dept_scraped", + "type": "varchar", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_school": { + "name": "websoc_school", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "year": { + "name": "year", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "quarter": { + "name": "quarter", + "type": "term", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "school_name": { + "name": "school_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "school_comment": { + "name": "school_comment", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "websoc_school_year_quarter_school_name_index": { + "name": "websoc_school_year_quarter_school_name_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "school_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_section": { + "name": "websoc_section", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "course_id": { + "name": "course_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "year": { + "name": "year", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "quarter": { + "name": "quarter", + "type": "term", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "units": { + "name": "units", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "websoc_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "instructors": { + "name": "instructors", + "type": "text[]", + "primaryKey": false, + "notNull": true + }, + "meetings": { + "name": "meetings", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "final_exam_string": { + "name": "final_exam_string", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "final_exam": { + "name": "final_exam", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "section_num": { + "name": "section_num", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "max_capacity": { + "name": "max_capacity", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "section_code": { + "name": "section_code", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "section_type": { + "name": "section_type", + "type": "websoc_section_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "num_requested": { + "name": "num_requested", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "restriction_string": { + "name": "restriction_string", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "restriction_a": { + "name": "restriction_a", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_b": { + "name": "restriction_b", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_c": { + "name": "restriction_c", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_d": { + "name": "restriction_d", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_e": { + "name": "restriction_e", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_f": { + "name": "restriction_f", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_g": { + "name": "restriction_g", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_h": { + "name": "restriction_h", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_i": { + "name": "restriction_i", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_j": { + "name": "restriction_j", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_k": { + "name": "restriction_k", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_l": { + "name": "restriction_l", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_m": { + "name": "restriction_m", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_n": { + "name": "restriction_n", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_o": { + "name": "restriction_o", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_r": { + "name": "restriction_r", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_s": { + "name": "restriction_s", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_x": { + "name": "restriction_x", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "num_on_waitlist": { + "name": "num_on_waitlist", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_waitlist_cap": { + "name": "num_waitlist_cap", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "section_comment": { + "name": "section_comment", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "num_new_only_reserved": { + "name": "num_new_only_reserved", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_currently_total_enrolled": { + "name": "num_currently_total_enrolled", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_currently_section_enrolled": { + "name": "num_currently_section_enrolled", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "is_cancelled": { + "name": "is_cancelled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "\"websoc_section\".\"section_comment\" LIKE '%*** CANCELLED ***%' OR \"websoc_section\".\"section_comment\" LIKE '%*** CANCELED ***%'", + "type": "stored" + } + }, + "web_url": { + "name": "web_url", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "''" + } + }, + "indexes": { + "websoc_section_course_id_index": { + "name": "websoc_section_course_id_index", + "columns": [ + { + "expression": "course_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_section_year_quarter_section_code_index": { + "name": "websoc_section_year_quarter_section_code_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "section_code", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_section_course_id_websoc_course_id_fk": { + "name": "websoc_section_course_id_websoc_course_id_fk", + "tableFrom": "websoc_section", + "tableTo": "websoc_course", + "columnsFrom": ["course_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_section_enrollment": { + "name": "websoc_section_enrollment", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "section_id": { + "name": "section_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "date", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "year": { + "name": "year", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "quarter": { + "name": "quarter", + "type": "term", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "max_capacity": { + "name": "max_capacity", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "num_currently_total_enrolled": { + "name": "num_currently_total_enrolled", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_on_waitlist": { + "name": "num_on_waitlist", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_waitlist_cap": { + "name": "num_waitlist_cap", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_requested": { + "name": "num_requested", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_new_only_reserved": { + "name": "num_new_only_reserved", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "websoc_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "websoc_section_enrollment_section_id_index": { + "name": "websoc_section_enrollment_section_id_index", + "columns": [ + { + "expression": "section_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_section_enrollment_section_id_created_at_index": { + "name": "websoc_section_enrollment_section_id_created_at_index", + "columns": [ + { + "expression": "section_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_section_enrollment_section_id_websoc_section_id_fk": { + "name": "websoc_section_enrollment_section_id_websoc_section_id_fk", + "tableFrom": "websoc_section_enrollment", + "tableTo": "websoc_section", + "columnsFrom": ["section_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_section_grade": { + "name": "websoc_section_grade", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "section_id": { + "name": "section_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "grade_a_count": { + "name": "grade_a_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_b_count": { + "name": "grade_b_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_c_count": { + "name": "grade_c_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_d_count": { + "name": "grade_d_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_f_count": { + "name": "grade_f_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_p_count": { + "name": "grade_p_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_np_count": { + "name": "grade_np_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_w_count": { + "name": "grade_w_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "average_gpa": { + "name": "average_gpa", + "type": "numeric(3, 2)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "websoc_section_grade_section_id_index": { + "name": "websoc_section_grade_section_id_index", + "columns": [ + { + "expression": "section_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_section_grade_section_id_websoc_section_id_fk": { + "name": "websoc_section_grade_section_id_websoc_section_id_fk", + "tableFrom": "websoc_section_grade", + "tableTo": "websoc_section", + "columnsFrom": ["section_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "websoc_section_grade_section_id_unique": { + "name": "websoc_section_grade_section_id_unique", + "nullsNotDistinct": false, + "columns": ["section_id"] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_section_meeting": { + "name": "websoc_section_meeting", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "section_id": { + "name": "section_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "section_code": { + "name": "section_code", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "meeting_index": { + "name": "meeting_index", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "time_string": { + "name": "time_string", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "time_is_tba": { + "name": "time_is_tba", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "\"websoc_section_meeting\".\"time_string\" LIKE '%TBA%'", + "type": "stored" + } + }, + "start_time": { + "name": "start_time", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "end_time": { + "name": "end_time", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "days_string": { + "name": "days_string", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "meets_monday": { + "name": "meets_monday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_tuesday": { + "name": "meets_tuesday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_wednesday": { + "name": "meets_wednesday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_thursday": { + "name": "meets_thursday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_friday": { + "name": "meets_friday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_saturday": { + "name": "meets_saturday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_sunday": { + "name": "meets_sunday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": { + "websoc_section_meeting_section_id_index": { + "name": "websoc_section_meeting_section_id_index", + "columns": [ + { + "expression": "section_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_section_meeting_section_id_websoc_section_id_fk": { + "name": "websoc_section_meeting_section_id_websoc_section_id_fk", + "tableFrom": "websoc_section_meeting", + "tableTo": "websoc_section", + "columnsFrom": ["section_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_section_meeting_to_location": { + "name": "websoc_section_meeting_to_location", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "meeting_id": { + "name": "meeting_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "location_id": { + "name": "location_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "websoc_section_meeting_to_location_meeting_id_index": { + "name": "websoc_section_meeting_to_location_meeting_id_index", + "columns": [ + { + "expression": "meeting_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_section_meeting_to_location_location_id_index": { + "name": "websoc_section_meeting_to_location_location_id_index", + "columns": [ + { + "expression": "location_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_section_meeting_to_location_meeting_id_location_id_index": { + "name": "websoc_section_meeting_to_location_meeting_id_location_id_index", + "columns": [ + { + "expression": "meeting_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "location_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_section_meeting_to_location_meeting_id_websoc_section_meeting_id_fk": { + "name": "websoc_section_meeting_to_location_meeting_id_websoc_section_meeting_id_fk", + "tableFrom": "websoc_section_meeting_to_location", + "tableTo": "websoc_section_meeting", + "columnsFrom": ["meeting_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "websoc_section_meeting_to_location_location_id_websoc_location_id_fk": { + "name": "websoc_section_meeting_to_location_location_id_websoc_location_id_fk", + "tableFrom": "websoc_section_meeting_to_location", + "tableTo": "websoc_location", + "columnsFrom": ["location_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_section_to_instructor": { + "name": "websoc_section_to_instructor", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "section_id": { + "name": "section_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "instructor_name": { + "name": "instructor_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "websoc_section_to_instructor_section_id_index": { + "name": "websoc_section_to_instructor_section_id_index", + "columns": [ + { + "expression": "section_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_section_to_instructor_instructor_name_index": { + "name": "websoc_section_to_instructor_instructor_name_index", + "columns": [ + { + "expression": "instructor_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_section_to_instructor_section_id_websoc_section_id_fk": { + "name": "websoc_section_to_instructor_section_id_websoc_section_id_fk", + "tableFrom": "websoc_section_to_instructor", + "tableTo": "websoc_section", + "columnsFrom": ["section_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "websoc_section_to_instructor_instructor_name_websoc_instructor_name_fk": { + "name": "websoc_section_to_instructor_instructor_name_websoc_instructor_name_fk", + "tableFrom": "websoc_section_to_instructor", + "tableTo": "websoc_instructor", + "columnsFrom": ["instructor_name"], + "columnsTo": ["name"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": { + "public.course_level": { + "name": "course_level", + "schema": "public", + "values": ["LowerDiv", "UpperDiv", "Graduate"] + }, + "public.division": { + "name": "division", + "schema": "public", + "values": ["Undergraduate", "Graduate"] + }, + "public.term": { + "name": "term", + "schema": "public", + "values": ["Fall", "Winter", "Spring", "Summer1", "Summer10wk", "Summer2"] + }, + "public.websoc_section_type": { + "name": "websoc_section_type", + "schema": "public", + "values": [ + "Act", + "Col", + "Dis", + "Fld", + "Lab", + "Lec", + "Qiz", + "Res", + "Sem", + "Stu", + "Tap", + "Tut" + ] + }, + "public.websoc_status": { + "name": "websoc_status", + "schema": "public", + "values": ["OPEN", "Waitl", "FULL", "NewOnly"] + } + }, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": { + "public.course_view": { + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "department": { + "name": "department", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "shortened_dept": { + "name": "shortened_dept", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "REPLACE(\"course\".\"department\", ' ', '')", + "type": "stored" + } + }, + "department_alias": { + "name": "department_alias", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "course_number": { + "name": "course_number", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_numeric": { + "name": "course_numeric", + "type": "integer", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "CASE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g') WHEN '' THEN 0 ELSE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g')::INTEGER END", + "type": "stored" + } + }, + "school": { + "name": "school", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_level": { + "name": "course_level", + "type": "course_level", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "min_units": { + "name": "min_units", + "type": "numeric(4, 2)", + "primaryKey": false, + "notNull": true + }, + "max_units": { + "name": "max_units", + "type": "numeric(4, 2)", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "department_name": { + "name": "department_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "prerequisite_tree": { + "name": "prerequisite_tree", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "prerequisite_text": { + "name": "prerequisite_text", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "repeatability": { + "name": "repeatability", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "grading_option": { + "name": "grading_option", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "concurrent": { + "name": "concurrent", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "same_as": { + "name": "same_as", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "restriction": { + "name": "restriction", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "overlap": { + "name": "overlap", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "corequisites": { + "name": "corequisites", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "is_ge_1a": { + "name": "is_ge_1a", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_1b": { + "name": "is_ge_1b", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_2": { + "name": "is_ge_2", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_3": { + "name": "is_ge_3", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_4": { + "name": "is_ge_4", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_5a": { + "name": "is_ge_5a", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_5b": { + "name": "is_ge_5b", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_6": { + "name": "is_ge_6", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_7": { + "name": "is_ge_7", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_8": { + "name": "is_ge_8", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "ge_text": { + "name": "ge_text", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "definition": "select \"course\".\"id\", \"course\".\"updated_at\", \"course\".\"department\", \"course\".\"shortened_dept\", \"course\".\"department_alias\", \"course\".\"course_number\", \"course\".\"course_numeric\", \"course\".\"school\", \"course\".\"title\", \"course\".\"course_level\", \"course\".\"min_units\", \"course\".\"max_units\", \"course\".\"description\", \"course\".\"department_name\", \"course\".\"prerequisite_tree\", \"course\".\"prerequisite_text\", \"course\".\"repeatability\", \"course\".\"grading_option\", \"course\".\"concurrent\", \"course\".\"same_as\", \"course\".\"restriction\", \"course\".\"overlap\", \"course\".\"corequisites\", \"course\".\"is_ge_1a\", \"course\".\"is_ge_1b\", \"course\".\"is_ge_2\", \"course\".\"is_ge_3\", \"course\".\"is_ge_4\", \"course\".\"is_ge_5a\", \"course\".\"is_ge_5b\", \"course\".\"is_ge_6\", \"course\".\"is_ge_7\", \"course\".\"is_ge_8\", \"course\".\"ge_text\", \n ARRAY_REMOVE(COALESCE(\n (\n SELECT ARRAY_AGG(\n CASE WHEN \"prerequisite_course\".\"id\" IS NULL THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'id', \"prerequisite_course\".\"id\",\n 'title', \"prerequisite_course\".\"title\",\n 'department', \"prerequisite_course\".\"department\",\n 'courseNumber', \"prerequisite_course\".\"course_number\"\n )\n END\n )\n FROM \"prerequisite\"\n LEFT JOIN \"course\" \"prerequisite_course\" ON \"prerequisite_course\".\"id\" = \"prerequisite\".\"prerequisite_id\"\n WHERE \"prerequisite\".\"dependency_id\" = \"course\".\"id\"\n ),\n ARRAY[]::JSONB[]), NULL)\n as \"prerequisites\", \n ARRAY_REMOVE(COALESCE(\n (\n SELECT ARRAY_AGG(\n CASE WHEN \"dependency_course\".\"id\" IS NULL THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'id', \"dependency_course\".\"id\",\n 'title', \"dependency_course\".\"title\",\n 'department', \"dependency_course\".\"department\",\n 'courseNumber', \"dependency_course\".\"course_number\"\n )\n END\n )\n FROM \"prerequisite\" \"dependency\"\n LEFT JOIN \"course\" \"dependency_course\" ON \"dependency_course\".\"id\" = \"dependency\".\"dependency_id\"\n WHERE \"dependency\".\"prerequisite_id\" = \"course\".\"id\"\n ),\n ARRAY[]::JSONB[]), NULL)\n as \"dependencies\", \n ARRAY_REMOVE(ARRAY_AGG(DISTINCT\n CASE WHEN \"websoc_course\".\"year\" IS NULL THEN NULL\n ELSE CONCAT(\"websoc_course\".\"year\", ' ', \"websoc_course\".\"quarter\")\n END\n ), NULL)\n as \"terms\", \n ARRAY_REMOVE(COALESCE(ARRAY_AGG(DISTINCT\n CASE WHEN \"instructor\".\"ucinetid\" IS NULL THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'ucinetid', \"instructor\".\"ucinetid\",\n 'name', \"instructor\".\"name\",\n 'title', \"instructor\".\"title\",\n 'email', \"instructor\".\"email\",\n 'department', \"instructor\".\"department\",\n 'shortenedNames', ARRAY(\n SELECT \"instructor_to_websoc_instructor\".\"websoc_instructor_name\"\n FROM \"instructor_to_websoc_instructor\"\n WHERE \"instructor_to_websoc_instructor\".\"instructor_ucinetid\" = \"instructor\".\"ucinetid\"\n )\n )\n END\n ), ARRAY[]::JSONB[]), NULL)\n as \"instructors\" from \"course\" left join \"websoc_course\" on \"websoc_course\".\"course_id\" = \"course\".\"id\" left join \"websoc_section\" on \"websoc_section\".\"course_id\" = \"websoc_course\".\"id\" left join \"websoc_section_to_instructor\" on \"websoc_section_to_instructor\".\"section_id\" = \"websoc_section\".\"id\" left join \"websoc_instructor\" on \"websoc_instructor\".\"name\" = \"websoc_section_to_instructor\".\"instructor_name\" left join \"instructor_to_websoc_instructor\" on \"instructor_to_websoc_instructor\".\"websoc_instructor_name\" = \"websoc_instructor\".\"name\" left join \"instructor\" on (\"instructor\".\"ucinetid\" = \"instructor_to_websoc_instructor\".\"instructor_ucinetid\" and \"instructor\".\"ucinetid\" is not null and \"instructor\".\"ucinetid\" <> 'student') group by \"course\".\"id\"", + "name": "course_view", + "schema": "public", + "isExisting": false, + "materialized": true + }, + "public.instructor_view": { + "columns": { + "ucinetid": { + "name": "ucinetid", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "email": { + "name": "email", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "department": { + "name": "department", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "definition": "with \"shortened_names_cte\" as (select \"instructor_ucinetid\", ARRAY_AGG(\"websoc_instructor_name\") as \"shortened_names\" from \"instructor_to_websoc_instructor\" group by \"instructor_to_websoc_instructor\".\"instructor_ucinetid\"), \"courses_cte\" as (with \"terms_cte\" as (select \"course\".\"id\", \"instructor_to_websoc_instructor\".\"instructor_ucinetid\", \n ARRAY_REMOVE(ARRAY_AGG(DISTINCT\n CASE WHEN \"websoc_course\".\"year\" IS NULL THEN NULL\n ELSE CONCAT(\"websoc_course\".\"year\", ' ', \"websoc_course\".\"quarter\")\n END\n ), NULL) as \"terms\" from \"course\" left join \"websoc_course\" on \"websoc_course\".\"course_id\" = \"course\".\"id\" left join \"websoc_section\" on \"websoc_section\".\"course_id\" = \"websoc_course\".\"id\" left join \"websoc_section_to_instructor\" on \"websoc_section_to_instructor\".\"section_id\" = \"websoc_section\".\"id\" left join \"websoc_instructor\" on \"websoc_instructor\".\"name\" = \"websoc_section_to_instructor\".\"instructor_name\" left join \"instructor_to_websoc_instructor\" on \"instructor_to_websoc_instructor\".\"websoc_instructor_name\" = \"websoc_instructor\".\"name\" group by \"course\".\"id\", \"instructor_to_websoc_instructor\".\"instructor_ucinetid\") select \"terms_cte\".\"instructor_ucinetid\", \"course\".\"id\", \n CASE WHEN \"course\".\"id\" IS NULL\n THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'id', \"course\".\"id\",\n 'title', \"course\".\"title\",\n 'department', \"course\".\"department\",\n 'courseNumber', \"course\".\"course_number\",\n 'terms', COALESCE(\"terms\", ARRAY[]::TEXT[])\n )\n END\n as \"course_info\" from \"course\" left join \"terms_cte\" on \"terms_cte\".\"id\" = \"course\".\"id\" group by \"course\".\"id\", \"terms_cte\".\"instructor_ucinetid\", \"terms\") select \"instructor\".\"ucinetid\", \"instructor\".\"name\", \"instructor\".\"title\", \"instructor\".\"email\", \"instructor\".\"department\", COALESCE(\"shortened_names\", ARRAY[]::TEXT[]) as \"shortened_names\", \n ARRAY_REMOVE(ARRAY_AGG(DISTINCT \"course_info\"), NULL)\n as \"courses\" from \"instructor\" left join \"shortened_names_cte\" on \"shortened_names_cte\".\"instructor_ucinetid\" = \"instructor\".\"ucinetid\" left join \"courses_cte\" on \"courses_cte\".\"instructor_ucinetid\" = \"instructor\".\"ucinetid\" where \"instructor\".\"ucinetid\" <> 'student' group by \"instructor\".\"ucinetid\", \"shortened_names\"", + "name": "instructor_view", + "schema": "public", + "isExisting": false, + "materialized": true + } + }, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} diff --git a/packages/db/migrations/meta/_journal.json b/packages/db/migrations/meta/_journal.json index 11dc6739..4ad64e3a 100644 --- a/packages/db/migrations/meta/_journal.json +++ b/packages/db/migrations/meta/_journal.json @@ -169,6 +169,13 @@ "when": 1769640710103, "tag": "0023_fresh_chimera", "breakpoints": true + }, + { + "idx": 24, + "version": "7", + "when": 1769714498160, + "tag": "0024_nebulous_chronomancer", + "breakpoints": true } ] } From e8f271c04c57c0e01114eced87c9ad78e5b37260 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Sun, 1 Feb 2026 10:28:28 -0800 Subject: [PATCH 11/91] added comments for evaluating spec req --- .../degreeworks-scraper/src/components/AuditParser.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts b/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts index 06ba72af..fa98e38f 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts @@ -112,6 +112,8 @@ export class AuditParser { async ruleArrayToRequirements(ruleArray: Rule[]) { const ret: DegreeWorksRequirement[] = []; for (const rule of ruleArray) { + // heuristic for matching a specialization requirement + // false positive on B.S. ChemE (pr#295) if ( rule.ifElsePart === "ElsePart" && rule.proxyAdvice?.textList.some((x) => From 02106bb086fc76240672bcd568b8f9156e89d43b Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Sat, 7 Feb 2026 15:03:22 -0800 Subject: [PATCH 12/91] filtered out DegreeworksSpecRequirement when adding to db to reduce redundancy --- apps/data-pipeline/degreeworks-scraper/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/data-pipeline/degreeworks-scraper/src/index.ts b/apps/data-pipeline/degreeworks-scraper/src/index.ts index 3edca563..266cc8c1 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/index.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/index.ts @@ -72,7 +72,7 @@ async function main() { code, name, requireSpec: requirements.some((x) => x.requirementType === "Spec"), - requirements, + requirements: requirements.filter((x) => x.requirementType !== "Spec"), ...(collegeBlockIndex !== undefined ? { collegeBlockIndex } : {}), }; }) From b1744ffd0916e6772925220888e30086a5c2bb71 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Sat, 7 Feb 2026 15:10:34 -0800 Subject: [PATCH 13/91] removed 2 migrations so that we could redo --- packages/db/migrations/0023_fresh_chimera.sql | 1 - .../migrations/0024_nebulous_chronomancer.sql | 1 - .../db/migrations/meta/0023_snapshot.json | 3852 ----------------- .../db/migrations/meta/0024_snapshot.json | 3852 ----------------- packages/db/migrations/meta/_journal.json | 14 - 5 files changed, 7720 deletions(-) delete mode 100644 packages/db/migrations/0023_fresh_chimera.sql delete mode 100644 packages/db/migrations/0024_nebulous_chronomancer.sql delete mode 100644 packages/db/migrations/meta/0023_snapshot.json delete mode 100644 packages/db/migrations/meta/0024_snapshot.json diff --git a/packages/db/migrations/0023_fresh_chimera.sql b/packages/db/migrations/0023_fresh_chimera.sql deleted file mode 100644 index 6f37517d..00000000 --- a/packages/db/migrations/0023_fresh_chimera.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "major" ADD COLUMN "require_spec" boolean; \ No newline at end of file diff --git a/packages/db/migrations/0024_nebulous_chronomancer.sql b/packages/db/migrations/0024_nebulous_chronomancer.sql deleted file mode 100644 index 03912a7b..00000000 --- a/packages/db/migrations/0024_nebulous_chronomancer.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "major" ALTER COLUMN "require_spec" SET NOT NULL; \ No newline at end of file diff --git a/packages/db/migrations/meta/0023_snapshot.json b/packages/db/migrations/meta/0023_snapshot.json deleted file mode 100644 index 8d1c5442..00000000 --- a/packages/db/migrations/meta/0023_snapshot.json +++ /dev/null @@ -1,3852 +0,0 @@ -{ - "id": "02076c7e-4d5b-47e4-9722-3a6ee9849b3f", - "prevId": "169622b6-bb25-46af-9384-cb3825533964", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.ap_exam": { - "name": "ap_exam", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "catalogue_name": { - "name": "catalogue_name", - "type": "varchar", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.ap_exam_reward": { - "name": "ap_exam_reward", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "units_granted": { - "name": "units_granted", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "elective_units_granted": { - "name": "elective_units_granted", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "ge_1a_courses_granted": { - "name": "ge_1a_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_1b_courses_granted": { - "name": "ge_1b_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_2_courses_granted": { - "name": "ge_2_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_3_courses_granted": { - "name": "ge_3_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_4_courses_granted": { - "name": "ge_4_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_5a_courses_granted": { - "name": "ge_5a_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_5b_courses_granted": { - "name": "ge_5b_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_6_courses_granted": { - "name": "ge_6_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_7_courses_granted": { - "name": "ge_7_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_8_courses_granted": { - "name": "ge_8_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "courses_granted": { - "name": "courses_granted", - "type": "json", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.ap_exam_to_reward": { - "name": "ap_exam_to_reward", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "exam_id": { - "name": "exam_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "score": { - "name": "score", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "reward": { - "name": "reward", - "type": "uuid", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "ap_exam_to_reward_exam_id_score_index": { - "name": "ap_exam_to_reward_exam_id_score_index", - "columns": [ - { - "expression": "exam_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "score", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "ap_exam_to_reward_exam_id_ap_exam_id_fk": { - "name": "ap_exam_to_reward_exam_id_ap_exam_id_fk", - "tableFrom": "ap_exam_to_reward", - "tableTo": "ap_exam", - "columnsFrom": ["exam_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "ap_exam_to_reward_reward_ap_exam_reward_id_fk": { - "name": "ap_exam_to_reward_reward_ap_exam_reward_id_fk", - "tableFrom": "ap_exam_to_reward", - "tableTo": "ap_exam_reward", - "columnsFrom": ["reward"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.calendar_term": { - "name": "calendar_term", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true, - "generated": { - "as": "\"calendar_term\".\"year\" || ' ' || CASE WHEN \"calendar_term\".\"quarter\" = 'Fall' THEN 'Fall' WHEN \"calendar_term\".\"quarter\" = 'Winter' THEN 'Winter' WHEN \"calendar_term\".\"quarter\" = 'Spring' THEN 'Spring' WHEN \"calendar_term\".\"quarter\" = 'Summer1' THEN 'Summer1' WHEN \"calendar_term\".\"quarter\" = 'Summer10wk' THEN 'Summer10wk' WHEN \"calendar_term\".\"quarter\" = 'Summer2' THEN 'Summer2' ELSE '' END", - "type": "stored" - } - }, - "year": { - "name": "year", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "quarter": { - "name": "quarter", - "type": "term", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "instruction_start": { - "name": "instruction_start", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "instruction_end": { - "name": "instruction_end", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "finals_start": { - "name": "finals_start", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "finals_end": { - "name": "finals_end", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "soc_available": { - "name": "soc_available", - "type": "date", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.catalogue_program": { - "name": "catalogue_program", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "program_name": { - "name": "program_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.college_requirement": { - "name": "college_requirement", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "requirements": { - "name": "requirements", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "college_requirement_requirements_unique": { - "name": "college_requirement_requirements_unique", - "nullsNotDistinct": false, - "columns": ["requirements"] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.course": { - "name": "course", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "department": { - "name": "department", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "shortened_dept": { - "name": "shortened_dept", - "type": "varchar", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "REPLACE(\"course\".\"department\", ' ', '')", - "type": "stored" - } - }, - "department_alias": { - "name": "department_alias", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "course_number": { - "name": "course_number", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "course_numeric": { - "name": "course_numeric", - "type": "integer", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "CASE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g') WHEN '' THEN 0 ELSE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g')::INTEGER END", - "type": "stored" - } - }, - "school": { - "name": "school", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "course_level": { - "name": "course_level", - "type": "course_level", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "min_units": { - "name": "min_units", - "type": "numeric(4, 2)", - "primaryKey": false, - "notNull": true - }, - "max_units": { - "name": "max_units", - "type": "numeric(4, 2)", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "department_name": { - "name": "department_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "prerequisite_tree": { - "name": "prerequisite_tree", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "prerequisite_text": { - "name": "prerequisite_text", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "repeatability": { - "name": "repeatability", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "grading_option": { - "name": "grading_option", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "concurrent": { - "name": "concurrent", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "same_as": { - "name": "same_as", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "restriction": { - "name": "restriction", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "overlap": { - "name": "overlap", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "corequisites": { - "name": "corequisites", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "is_ge_1a": { - "name": "is_ge_1a", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_1b": { - "name": "is_ge_1b", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_2": { - "name": "is_ge_2", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_3": { - "name": "is_ge_3", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_4": { - "name": "is_ge_4", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_5a": { - "name": "is_ge_5a", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_5b": { - "name": "is_ge_5b", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_6": { - "name": "is_ge_6", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_7": { - "name": "is_ge_7", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_8": { - "name": "is_ge_8", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "ge_text": { - "name": "ge_text", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "course_search_index": { - "name": "course_search_index", - "columns": [ - { - "expression": "(\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"id\", '')), 'A') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"department\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"department_alias\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"shortened_dept\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"course_number\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"course_numeric\"::TEXT, '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"title\", '')), 'C') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"description\", '')), 'D')\n)", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "shortened_dept": { - "name": "shortened_dept", - "columns": [ - { - "expression": "shortened_dept", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.degree": { - "name": "degree", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "division": { - "name": "division", - "type": "division", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.instructor": { - "name": "instructor", - "schema": "", - "columns": { - "ucinetid": { - "name": "ucinetid", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "department": { - "name": "department", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "instructor_search_index": { - "name": "instructor_search_index", - "columns": [ - { - "expression": "(\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"ucinetid\", '')), 'A') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"name\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"title\", '')), 'B')\n)", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.instructor_to_websoc_instructor": { - "name": "instructor_to_websoc_instructor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "instructor_ucinetid": { - "name": "instructor_ucinetid", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "websoc_instructor_name": { - "name": "websoc_instructor_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "instructor_to_websoc_instructor_instructor_ucinetid_index": { - "name": "instructor_to_websoc_instructor_instructor_ucinetid_index", - "columns": [ - { - "expression": "instructor_ucinetid", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "instructor_to_websoc_instructor_websoc_instructor_name_index": { - "name": "instructor_to_websoc_instructor_websoc_instructor_name_index", - "columns": [ - { - "expression": "websoc_instructor_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "instructor_to_websoc_instructor_instructor_ucinetid_websoc_instructor_name_index": { - "name": "instructor_to_websoc_instructor_instructor_ucinetid_websoc_instructor_name_index", - "columns": [ - { - "expression": "instructor_ucinetid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "websoc_instructor_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "instructor_to_websoc_instructor_instructor_ucinetid_instructor_ucinetid_fk": { - "name": "instructor_to_websoc_instructor_instructor_ucinetid_instructor_ucinetid_fk", - "tableFrom": "instructor_to_websoc_instructor", - "tableTo": "instructor", - "columnsFrom": ["instructor_ucinetid"], - "columnsTo": ["ucinetid"], - "onDelete": "no action", - "onUpdate": "no action" - }, - "instructor_to_websoc_instructor_websoc_instructor_name_websoc_instructor_name_fk": { - "name": "instructor_to_websoc_instructor_websoc_instructor_name_websoc_instructor_name_fk", - "tableFrom": "instructor_to_websoc_instructor", - "tableTo": "websoc_instructor", - "columnsFrom": ["websoc_instructor_name"], - "columnsTo": ["name"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.larc_section": { - "name": "larc_section", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "course_id": { - "name": "course_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "days_string": { - "name": "days_string", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "time_string": { - "name": "time_string", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "start_time": { - "name": "start_time", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "end_time": { - "name": "end_time", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "instructor": { - "name": "instructor", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "building": { - "name": "building", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "meets_monday": { - "name": "meets_monday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_tuesday": { - "name": "meets_tuesday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_wednesday": { - "name": "meets_wednesday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_thursday": { - "name": "meets_thursday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_friday": { - "name": "meets_friday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_saturday": { - "name": "meets_saturday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_sunday": { - "name": "meets_sunday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "larc_section_course_id_index": { - "name": "larc_section_course_id_index", - "columns": [ - { - "expression": "course_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "larc_section_course_id_websoc_course_id_fk": { - "name": "larc_section_course_id_websoc_course_id_fk", - "tableFrom": "larc_section", - "tableTo": "websoc_course", - "columnsFrom": ["course_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.library_traffic": { - "name": "library_traffic", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "library_name": { - "name": "library_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "location_name": { - "name": "location_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "traffic_count": { - "name": "traffic_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "traffic_percentage": { - "name": "traffic_percentage", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "timestamp": { - "name": "timestamp", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "library_traffic_library_name_index": { - "name": "library_traffic_library_name_index", - "columns": [ - { - "expression": "library_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "library_traffic_location_name_index": { - "name": "library_traffic_location_name_index", - "columns": [ - { - "expression": "location_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.library_traffic_history": { - "name": "library_traffic_history", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "location_id": { - "name": "location_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "traffic_count": { - "name": "traffic_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "traffic_percentage": { - "name": "traffic_percentage", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "timestamp": { - "name": "timestamp", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "library_traffic_history_location_id_timestamp_index": { - "name": "library_traffic_history_location_id_timestamp_index", - "columns": [ - { - "expression": "location_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "timestamp", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "library_traffic_history_location_id_library_traffic_id_fk": { - "name": "library_traffic_history_location_id_library_traffic_id_fk", - "tableFrom": "library_traffic_history", - "tableTo": "library_traffic", - "columnsFrom": ["location_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.major": { - "name": "major", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "degree_id": { - "name": "degree_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "code": { - "name": "code", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "require_spec": { - "name": "require_spec", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "college_requirement": { - "name": "college_requirement", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "requirements": { - "name": "requirements", - "type": "json", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "major_degree_id_index": { - "name": "major_degree_id_index", - "columns": [ - { - "expression": "degree_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "major_college_requirement_index": { - "name": "major_college_requirement_index", - "columns": [ - { - "expression": "college_requirement", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "major_degree_id_degree_id_fk": { - "name": "major_degree_id_degree_id_fk", - "tableFrom": "major", - "tableTo": "degree", - "columnsFrom": ["degree_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - }, - "major_college_requirement_college_requirement_id_fk": { - "name": "major_college_requirement_college_requirement_id_fk", - "tableFrom": "major", - "tableTo": "college_requirement", - "columnsFrom": ["college_requirement"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.minor": { - "name": "minor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "requirements": { - "name": "requirements", - "type": "json", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.prerequisite": { - "name": "prerequisite", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "dep_dept": { - "name": "dep_dept", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "prerequisite_id": { - "name": "prerequisite_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "dependency_id": { - "name": "dependency_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "prerequisite_dep_dept_index": { - "name": "prerequisite_dep_dept_index", - "columns": [ - { - "expression": "dep_dept", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "prerequisite_prerequisite_id_index": { - "name": "prerequisite_prerequisite_id_index", - "columns": [ - { - "expression": "prerequisite_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "prerequisite_dependency_id_index": { - "name": "prerequisite_dependency_id_index", - "columns": [ - { - "expression": "dependency_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "prerequisite_prerequisite_id_dependency_id_index": { - "name": "prerequisite_prerequisite_id_dependency_id_index", - "columns": [ - { - "expression": "prerequisite_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dependency_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.sample_program_variation": { - "name": "sample_program_variation", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "program_id": { - "name": "program_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "label": { - "name": "label", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "sample_program": { - "name": "sample_program", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "variation_notes": { - "name": "variation_notes", - "type": "varchar[]", - "primaryKey": false, - "notNull": true, - "default": "ARRAY[]::VARCHAR[]" - } - }, - "indexes": {}, - "foreignKeys": { - "sample_program_variation_program_id_catalogue_program_id_fk": { - "name": "sample_program_variation_program_id_catalogue_program_id_fk", - "tableFrom": "sample_program_variation", - "tableTo": "catalogue_program", - "columnsFrom": ["program_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.school_requirement": { - "name": "school_requirement", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "requirements": { - "name": "requirements", - "type": "json", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.specialization": { - "name": "specialization", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "major_id": { - "name": "major_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "requirements": { - "name": "requirements", - "type": "json", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "specialization_major_id_index": { - "name": "specialization_major_id_index", - "columns": [ - { - "expression": "major_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "specialization_major_id_major_id_fk": { - "name": "specialization_major_id_major_id_fk", - "tableFrom": "specialization", - "tableTo": "major", - "columnsFrom": ["major_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.study_location": { - "name": "study_location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.study_room": { - "name": "study_room", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "capacity": { - "name": "capacity", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "location": { - "name": "location", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "directions": { - "name": "directions", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "tech_enhanced": { - "name": "tech_enhanced", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "study_location_id": { - "name": "study_location_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "study_room_study_location_id_index": { - "name": "study_room_study_location_id_index", - "columns": [ - { - "expression": "study_location_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "study_room_study_location_id_study_location_id_fk": { - "name": "study_room_study_location_id_study_location_id_fk", - "tableFrom": "study_room", - "tableTo": "study_location", - "columnsFrom": ["study_location_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.study_room_slot": { - "name": "study_room_slot", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "study_room_id": { - "name": "study_room_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "start": { - "name": "start", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "end": { - "name": "end", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "is_available": { - "name": "is_available", - "type": "boolean", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "study_room_slot_study_room_id_index": { - "name": "study_room_slot_study_room_id_index", - "columns": [ - { - "expression": "study_room_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "study_room_slot_study_room_id_start_end_index": { - "name": "study_room_slot_study_room_id_start_end_index", - "columns": [ - { - "expression": "study_room_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "start", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "end", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "study_room_slot_study_room_id_study_room_id_fk": { - "name": "study_room_slot_study_room_id_study_room_id_fk", - "tableFrom": "study_room_slot", - "tableTo": "study_room", - "columnsFrom": ["study_room_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_course": { - "name": "websoc_course", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "department_id": { - "name": "department_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "course_id": { - "name": "course_id", - "type": "varchar", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "REPLACE(\"websoc_course\".\"dept_code\", ' ', '') || \"websoc_course\".\"course_number\"", - "type": "stored" - } - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "year": { - "name": "year", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "quarter": { - "name": "quarter", - "type": "term", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "school_name": { - "name": "school_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "dept_code": { - "name": "dept_code", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "course_title": { - "name": "course_title", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "course_number": { - "name": "course_number", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "course_numeric": { - "name": "course_numeric", - "type": "integer", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "CASE REGEXP_REPLACE(\"websoc_course\".\"course_number\", '\\D', '', 'g') WHEN '' THEN 0 ELSE REGEXP_REPLACE(\"websoc_course\".\"course_number\", '\\D', '', 'g')::INTEGER END", - "type": "stored" - } - }, - "course_comment": { - "name": "course_comment", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "prerequisite_link": { - "name": "prerequisite_link", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "is_ge_1a": { - "name": "is_ge_1a", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_1b": { - "name": "is_ge_1b", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_2": { - "name": "is_ge_2", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_3": { - "name": "is_ge_3", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_4": { - "name": "is_ge_4", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_5a": { - "name": "is_ge_5a", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_5b": { - "name": "is_ge_5b", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_6": { - "name": "is_ge_6", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_7": { - "name": "is_ge_7", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_8": { - "name": "is_ge_8", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "websoc_course_department_id_index": { - "name": "websoc_course_department_id_index", - "columns": [ - { - "expression": "department_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_course_id_index": { - "name": "websoc_course_course_id_index", - "columns": [ - { - "expression": "course_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_school_name_dept_code_course_number_course_title_index": { - "name": "websoc_course_year_quarter_school_name_dept_code_course_number_course_title_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "school_name", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dept_code", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "course_number", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "course_title", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_1a_index": { - "name": "websoc_course_year_quarter_is_ge_1a_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_1a", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_1b_index": { - "name": "websoc_course_year_quarter_is_ge_1b_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_1b", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_2_index": { - "name": "websoc_course_year_quarter_is_ge_2_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_2", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_3_index": { - "name": "websoc_course_year_quarter_is_ge_3_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_3", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_4_index": { - "name": "websoc_course_year_quarter_is_ge_4_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_4", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_5a_index": { - "name": "websoc_course_year_quarter_is_ge_5a_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_5a", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_5b_index": { - "name": "websoc_course_year_quarter_is_ge_5b_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_5b", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_6_index": { - "name": "websoc_course_year_quarter_is_ge_6_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_6", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_7_index": { - "name": "websoc_course_year_quarter_is_ge_7_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_7", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_8_index": { - "name": "websoc_course_year_quarter_is_ge_8_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_8", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_dept_code_index": { - "name": "websoc_course_year_quarter_dept_code_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dept_code", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_dept_code_course_number_index": { - "name": "websoc_course_year_quarter_dept_code_course_number_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dept_code", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "course_number", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_course_department_id_websoc_department_id_fk": { - "name": "websoc_course_department_id_websoc_department_id_fk", - "tableFrom": "websoc_course", - "tableTo": "websoc_department", - "columnsFrom": ["department_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_department": { - "name": "websoc_department", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "school_id": { - "name": "school_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "year": { - "name": "year", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "quarter": { - "name": "quarter", - "type": "term", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "dept_code": { - "name": "dept_code", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "dept_name": { - "name": "dept_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "dept_comment": { - "name": "dept_comment", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "section_code_range_comments": { - "name": "section_code_range_comments", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "course_number_range_comments": { - "name": "course_number_range_comments", - "type": "text[]", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "websoc_department_school_id_index": { - "name": "websoc_department_school_id_index", - "columns": [ - { - "expression": "school_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_department_year_quarter_school_id_dept_code_index": { - "name": "websoc_department_year_quarter_school_id_dept_code_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "school_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dept_code", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_department_school_id_websoc_school_id_fk": { - "name": "websoc_department_school_id_websoc_school_id_fk", - "tableFrom": "websoc_department", - "tableTo": "websoc_school", - "columnsFrom": ["school_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_instructor": { - "name": "websoc_instructor", - "schema": "", - "columns": { - "name": { - "name": "name", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_location": { - "name": "websoc_location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "building": { - "name": "building", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "room": { - "name": "room", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "websoc_location_building_room_index": { - "name": "websoc_location_building_room_index", - "columns": [ - { - "expression": "building", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "room", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_meta": { - "name": "websoc_meta", - "schema": "", - "columns": { - "name": { - "name": "name", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "last_scraped": { - "name": "last_scraped", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_dept_scraped": { - "name": "last_dept_scraped", - "type": "varchar", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_school": { - "name": "websoc_school", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "year": { - "name": "year", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "quarter": { - "name": "quarter", - "type": "term", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "school_name": { - "name": "school_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "school_comment": { - "name": "school_comment", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "websoc_school_year_quarter_school_name_index": { - "name": "websoc_school_year_quarter_school_name_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "school_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_section": { - "name": "websoc_section", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "course_id": { - "name": "course_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "year": { - "name": "year", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "quarter": { - "name": "quarter", - "type": "term", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "units": { - "name": "units", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "websoc_status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "instructors": { - "name": "instructors", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "meetings": { - "name": "meetings", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "final_exam_string": { - "name": "final_exam_string", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "final_exam": { - "name": "final_exam", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "section_num": { - "name": "section_num", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "max_capacity": { - "name": "max_capacity", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "section_code": { - "name": "section_code", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "section_type": { - "name": "section_type", - "type": "websoc_section_type", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "num_requested": { - "name": "num_requested", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "restriction_string": { - "name": "restriction_string", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "restriction_a": { - "name": "restriction_a", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_b": { - "name": "restriction_b", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_c": { - "name": "restriction_c", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_d": { - "name": "restriction_d", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_e": { - "name": "restriction_e", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_f": { - "name": "restriction_f", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_g": { - "name": "restriction_g", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_h": { - "name": "restriction_h", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_i": { - "name": "restriction_i", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_j": { - "name": "restriction_j", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_k": { - "name": "restriction_k", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_l": { - "name": "restriction_l", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_m": { - "name": "restriction_m", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_n": { - "name": "restriction_n", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_o": { - "name": "restriction_o", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_r": { - "name": "restriction_r", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_s": { - "name": "restriction_s", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_x": { - "name": "restriction_x", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "num_on_waitlist": { - "name": "num_on_waitlist", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "num_waitlist_cap": { - "name": "num_waitlist_cap", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "section_comment": { - "name": "section_comment", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "num_new_only_reserved": { - "name": "num_new_only_reserved", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "num_currently_total_enrolled": { - "name": "num_currently_total_enrolled", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "num_currently_section_enrolled": { - "name": "num_currently_section_enrolled", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "is_cancelled": { - "name": "is_cancelled", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "\"websoc_section\".\"section_comment\" LIKE '%*** CANCELLED ***%' OR \"websoc_section\".\"section_comment\" LIKE '%*** CANCELED ***%'", - "type": "stored" - } - }, - "web_url": { - "name": "web_url", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "websoc_section_course_id_index": { - "name": "websoc_section_course_id_index", - "columns": [ - { - "expression": "course_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_section_year_quarter_section_code_index": { - "name": "websoc_section_year_quarter_section_code_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "section_code", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_section_course_id_websoc_course_id_fk": { - "name": "websoc_section_course_id_websoc_course_id_fk", - "tableFrom": "websoc_section", - "tableTo": "websoc_course", - "columnsFrom": ["course_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_section_enrollment": { - "name": "websoc_section_enrollment", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "section_id": { - "name": "section_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "date", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "year": { - "name": "year", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "quarter": { - "name": "quarter", - "type": "term", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "max_capacity": { - "name": "max_capacity", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "num_currently_total_enrolled": { - "name": "num_currently_total_enrolled", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "num_on_waitlist": { - "name": "num_on_waitlist", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "num_waitlist_cap": { - "name": "num_waitlist_cap", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "num_requested": { - "name": "num_requested", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "num_new_only_reserved": { - "name": "num_new_only_reserved", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "websoc_status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "websoc_section_enrollment_section_id_index": { - "name": "websoc_section_enrollment_section_id_index", - "columns": [ - { - "expression": "section_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_section_enrollment_section_id_created_at_index": { - "name": "websoc_section_enrollment_section_id_created_at_index", - "columns": [ - { - "expression": "section_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_section_enrollment_section_id_websoc_section_id_fk": { - "name": "websoc_section_enrollment_section_id_websoc_section_id_fk", - "tableFrom": "websoc_section_enrollment", - "tableTo": "websoc_section", - "columnsFrom": ["section_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_section_grade": { - "name": "websoc_section_grade", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "section_id": { - "name": "section_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "grade_a_count": { - "name": "grade_a_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "grade_b_count": { - "name": "grade_b_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "grade_c_count": { - "name": "grade_c_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "grade_d_count": { - "name": "grade_d_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "grade_f_count": { - "name": "grade_f_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "grade_p_count": { - "name": "grade_p_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "grade_np_count": { - "name": "grade_np_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "grade_w_count": { - "name": "grade_w_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "average_gpa": { - "name": "average_gpa", - "type": "numeric(3, 2)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "websoc_section_grade_section_id_index": { - "name": "websoc_section_grade_section_id_index", - "columns": [ - { - "expression": "section_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_section_grade_section_id_websoc_section_id_fk": { - "name": "websoc_section_grade_section_id_websoc_section_id_fk", - "tableFrom": "websoc_section_grade", - "tableTo": "websoc_section", - "columnsFrom": ["section_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "websoc_section_grade_section_id_unique": { - "name": "websoc_section_grade_section_id_unique", - "nullsNotDistinct": false, - "columns": ["section_id"] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_section_meeting": { - "name": "websoc_section_meeting", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "section_id": { - "name": "section_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "section_code": { - "name": "section_code", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "meeting_index": { - "name": "meeting_index", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "time_string": { - "name": "time_string", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "time_is_tba": { - "name": "time_is_tba", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "\"websoc_section_meeting\".\"time_string\" LIKE '%TBA%'", - "type": "stored" - } - }, - "start_time": { - "name": "start_time", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "end_time": { - "name": "end_time", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "days_string": { - "name": "days_string", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "meets_monday": { - "name": "meets_monday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_tuesday": { - "name": "meets_tuesday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_wednesday": { - "name": "meets_wednesday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_thursday": { - "name": "meets_thursday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_friday": { - "name": "meets_friday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_saturday": { - "name": "meets_saturday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_sunday": { - "name": "meets_sunday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "websoc_section_meeting_section_id_index": { - "name": "websoc_section_meeting_section_id_index", - "columns": [ - { - "expression": "section_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_section_meeting_section_id_websoc_section_id_fk": { - "name": "websoc_section_meeting_section_id_websoc_section_id_fk", - "tableFrom": "websoc_section_meeting", - "tableTo": "websoc_section", - "columnsFrom": ["section_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_section_meeting_to_location": { - "name": "websoc_section_meeting_to_location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "meeting_id": { - "name": "meeting_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "location_id": { - "name": "location_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "websoc_section_meeting_to_location_meeting_id_index": { - "name": "websoc_section_meeting_to_location_meeting_id_index", - "columns": [ - { - "expression": "meeting_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_section_meeting_to_location_location_id_index": { - "name": "websoc_section_meeting_to_location_location_id_index", - "columns": [ - { - "expression": "location_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_section_meeting_to_location_meeting_id_location_id_index": { - "name": "websoc_section_meeting_to_location_meeting_id_location_id_index", - "columns": [ - { - "expression": "meeting_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "location_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_section_meeting_to_location_meeting_id_websoc_section_meeting_id_fk": { - "name": "websoc_section_meeting_to_location_meeting_id_websoc_section_meeting_id_fk", - "tableFrom": "websoc_section_meeting_to_location", - "tableTo": "websoc_section_meeting", - "columnsFrom": ["meeting_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "websoc_section_meeting_to_location_location_id_websoc_location_id_fk": { - "name": "websoc_section_meeting_to_location_location_id_websoc_location_id_fk", - "tableFrom": "websoc_section_meeting_to_location", - "tableTo": "websoc_location", - "columnsFrom": ["location_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_section_to_instructor": { - "name": "websoc_section_to_instructor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "section_id": { - "name": "section_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "instructor_name": { - "name": "instructor_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "websoc_section_to_instructor_section_id_index": { - "name": "websoc_section_to_instructor_section_id_index", - "columns": [ - { - "expression": "section_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_section_to_instructor_instructor_name_index": { - "name": "websoc_section_to_instructor_instructor_name_index", - "columns": [ - { - "expression": "instructor_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_section_to_instructor_section_id_websoc_section_id_fk": { - "name": "websoc_section_to_instructor_section_id_websoc_section_id_fk", - "tableFrom": "websoc_section_to_instructor", - "tableTo": "websoc_section", - "columnsFrom": ["section_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - }, - "websoc_section_to_instructor_instructor_name_websoc_instructor_name_fk": { - "name": "websoc_section_to_instructor_instructor_name_websoc_instructor_name_fk", - "tableFrom": "websoc_section_to_instructor", - "tableTo": "websoc_instructor", - "columnsFrom": ["instructor_name"], - "columnsTo": ["name"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.course_level": { - "name": "course_level", - "schema": "public", - "values": ["LowerDiv", "UpperDiv", "Graduate"] - }, - "public.division": { - "name": "division", - "schema": "public", - "values": ["Undergraduate", "Graduate"] - }, - "public.term": { - "name": "term", - "schema": "public", - "values": ["Fall", "Winter", "Spring", "Summer1", "Summer10wk", "Summer2"] - }, - "public.websoc_section_type": { - "name": "websoc_section_type", - "schema": "public", - "values": [ - "Act", - "Col", - "Dis", - "Fld", - "Lab", - "Lec", - "Qiz", - "Res", - "Sem", - "Stu", - "Tap", - "Tut" - ] - }, - "public.websoc_status": { - "name": "websoc_status", - "schema": "public", - "values": ["OPEN", "Waitl", "FULL", "NewOnly"] - } - }, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": { - "public.course_view": { - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "department": { - "name": "department", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "shortened_dept": { - "name": "shortened_dept", - "type": "varchar", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "REPLACE(\"course\".\"department\", ' ', '')", - "type": "stored" - } - }, - "department_alias": { - "name": "department_alias", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "course_number": { - "name": "course_number", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "course_numeric": { - "name": "course_numeric", - "type": "integer", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "CASE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g') WHEN '' THEN 0 ELSE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g')::INTEGER END", - "type": "stored" - } - }, - "school": { - "name": "school", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "course_level": { - "name": "course_level", - "type": "course_level", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "min_units": { - "name": "min_units", - "type": "numeric(4, 2)", - "primaryKey": false, - "notNull": true - }, - "max_units": { - "name": "max_units", - "type": "numeric(4, 2)", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "department_name": { - "name": "department_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "prerequisite_tree": { - "name": "prerequisite_tree", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "prerequisite_text": { - "name": "prerequisite_text", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "repeatability": { - "name": "repeatability", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "grading_option": { - "name": "grading_option", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "concurrent": { - "name": "concurrent", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "same_as": { - "name": "same_as", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "restriction": { - "name": "restriction", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "overlap": { - "name": "overlap", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "corequisites": { - "name": "corequisites", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "is_ge_1a": { - "name": "is_ge_1a", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_1b": { - "name": "is_ge_1b", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_2": { - "name": "is_ge_2", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_3": { - "name": "is_ge_3", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_4": { - "name": "is_ge_4", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_5a": { - "name": "is_ge_5a", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_5b": { - "name": "is_ge_5b", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_6": { - "name": "is_ge_6", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_7": { - "name": "is_ge_7", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_8": { - "name": "is_ge_8", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "ge_text": { - "name": "ge_text", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "definition": "select \"course\".\"id\", \"course\".\"updated_at\", \"course\".\"department\", \"course\".\"shortened_dept\", \"course\".\"department_alias\", \"course\".\"course_number\", \"course\".\"course_numeric\", \"course\".\"school\", \"course\".\"title\", \"course\".\"course_level\", \"course\".\"min_units\", \"course\".\"max_units\", \"course\".\"description\", \"course\".\"department_name\", \"course\".\"prerequisite_tree\", \"course\".\"prerequisite_text\", \"course\".\"repeatability\", \"course\".\"grading_option\", \"course\".\"concurrent\", \"course\".\"same_as\", \"course\".\"restriction\", \"course\".\"overlap\", \"course\".\"corequisites\", \"course\".\"is_ge_1a\", \"course\".\"is_ge_1b\", \"course\".\"is_ge_2\", \"course\".\"is_ge_3\", \"course\".\"is_ge_4\", \"course\".\"is_ge_5a\", \"course\".\"is_ge_5b\", \"course\".\"is_ge_6\", \"course\".\"is_ge_7\", \"course\".\"is_ge_8\", \"course\".\"ge_text\", \n ARRAY_REMOVE(COALESCE(\n (\n SELECT ARRAY_AGG(\n CASE WHEN \"prerequisite_course\".\"id\" IS NULL THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'id', \"prerequisite_course\".\"id\",\n 'title', \"prerequisite_course\".\"title\",\n 'department', \"prerequisite_course\".\"department\",\n 'courseNumber', \"prerequisite_course\".\"course_number\"\n )\n END\n )\n FROM \"prerequisite\"\n LEFT JOIN \"course\" \"prerequisite_course\" ON \"prerequisite_course\".\"id\" = \"prerequisite\".\"prerequisite_id\"\n WHERE \"prerequisite\".\"dependency_id\" = \"course\".\"id\"\n ),\n ARRAY[]::JSONB[]), NULL)\n as \"prerequisites\", \n ARRAY_REMOVE(COALESCE(\n (\n SELECT ARRAY_AGG(\n CASE WHEN \"dependency_course\".\"id\" IS NULL THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'id', \"dependency_course\".\"id\",\n 'title', \"dependency_course\".\"title\",\n 'department', \"dependency_course\".\"department\",\n 'courseNumber', \"dependency_course\".\"course_number\"\n )\n END\n )\n FROM \"prerequisite\" \"dependency\"\n LEFT JOIN \"course\" \"dependency_course\" ON \"dependency_course\".\"id\" = \"dependency\".\"dependency_id\"\n WHERE \"dependency\".\"prerequisite_id\" = \"course\".\"id\"\n ),\n ARRAY[]::JSONB[]), NULL)\n as \"dependencies\", \n ARRAY_REMOVE(ARRAY_AGG(DISTINCT\n CASE WHEN \"websoc_course\".\"year\" IS NULL THEN NULL\n ELSE CONCAT(\"websoc_course\".\"year\", ' ', \"websoc_course\".\"quarter\")\n END\n ), NULL)\n as \"terms\", \n ARRAY_REMOVE(COALESCE(ARRAY_AGG(DISTINCT\n CASE WHEN \"instructor\".\"ucinetid\" IS NULL THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'ucinetid', \"instructor\".\"ucinetid\",\n 'name', \"instructor\".\"name\",\n 'title', \"instructor\".\"title\",\n 'email', \"instructor\".\"email\",\n 'department', \"instructor\".\"department\",\n 'shortenedNames', ARRAY(\n SELECT \"instructor_to_websoc_instructor\".\"websoc_instructor_name\"\n FROM \"instructor_to_websoc_instructor\"\n WHERE \"instructor_to_websoc_instructor\".\"instructor_ucinetid\" = \"instructor\".\"ucinetid\"\n )\n )\n END\n ), ARRAY[]::JSONB[]), NULL)\n as \"instructors\" from \"course\" left join \"websoc_course\" on \"websoc_course\".\"course_id\" = \"course\".\"id\" left join \"websoc_section\" on \"websoc_section\".\"course_id\" = \"websoc_course\".\"id\" left join \"websoc_section_to_instructor\" on \"websoc_section_to_instructor\".\"section_id\" = \"websoc_section\".\"id\" left join \"websoc_instructor\" on \"websoc_instructor\".\"name\" = \"websoc_section_to_instructor\".\"instructor_name\" left join \"instructor_to_websoc_instructor\" on \"instructor_to_websoc_instructor\".\"websoc_instructor_name\" = \"websoc_instructor\".\"name\" left join \"instructor\" on (\"instructor\".\"ucinetid\" = \"instructor_to_websoc_instructor\".\"instructor_ucinetid\" and \"instructor\".\"ucinetid\" is not null and \"instructor\".\"ucinetid\" <> 'student') group by \"course\".\"id\"", - "name": "course_view", - "schema": "public", - "isExisting": false, - "materialized": true - }, - "public.instructor_view": { - "columns": { - "ucinetid": { - "name": "ucinetid", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "department": { - "name": "department", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "definition": "with \"shortened_names_cte\" as (select \"instructor_ucinetid\", ARRAY_AGG(\"websoc_instructor_name\") as \"shortened_names\" from \"instructor_to_websoc_instructor\" group by \"instructor_to_websoc_instructor\".\"instructor_ucinetid\"), \"courses_cte\" as (with \"terms_cte\" as (select \"course\".\"id\", \"instructor_to_websoc_instructor\".\"instructor_ucinetid\", \n ARRAY_REMOVE(ARRAY_AGG(DISTINCT\n CASE WHEN \"websoc_course\".\"year\" IS NULL THEN NULL\n ELSE CONCAT(\"websoc_course\".\"year\", ' ', \"websoc_course\".\"quarter\")\n END\n ), NULL) as \"terms\" from \"course\" left join \"websoc_course\" on \"websoc_course\".\"course_id\" = \"course\".\"id\" left join \"websoc_section\" on \"websoc_section\".\"course_id\" = \"websoc_course\".\"id\" left join \"websoc_section_to_instructor\" on \"websoc_section_to_instructor\".\"section_id\" = \"websoc_section\".\"id\" left join \"websoc_instructor\" on \"websoc_instructor\".\"name\" = \"websoc_section_to_instructor\".\"instructor_name\" left join \"instructor_to_websoc_instructor\" on \"instructor_to_websoc_instructor\".\"websoc_instructor_name\" = \"websoc_instructor\".\"name\" group by \"course\".\"id\", \"instructor_to_websoc_instructor\".\"instructor_ucinetid\") select \"terms_cte\".\"instructor_ucinetid\", \"course\".\"id\", \n CASE WHEN \"course\".\"id\" IS NULL\n THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'id', \"course\".\"id\",\n 'title', \"course\".\"title\",\n 'department', \"course\".\"department\",\n 'courseNumber', \"course\".\"course_number\",\n 'terms', COALESCE(\"terms\", ARRAY[]::TEXT[])\n )\n END\n as \"course_info\" from \"course\" left join \"terms_cte\" on \"terms_cte\".\"id\" = \"course\".\"id\" group by \"course\".\"id\", \"terms_cte\".\"instructor_ucinetid\", \"terms\") select \"instructor\".\"ucinetid\", \"instructor\".\"name\", \"instructor\".\"title\", \"instructor\".\"email\", \"instructor\".\"department\", COALESCE(\"shortened_names\", ARRAY[]::TEXT[]) as \"shortened_names\", \n ARRAY_REMOVE(ARRAY_AGG(DISTINCT \"course_info\"), NULL)\n as \"courses\" from \"instructor\" left join \"shortened_names_cte\" on \"shortened_names_cte\".\"instructor_ucinetid\" = \"instructor\".\"ucinetid\" left join \"courses_cte\" on \"courses_cte\".\"instructor_ucinetid\" = \"instructor\".\"ucinetid\" where \"instructor\".\"ucinetid\" <> 'student' group by \"instructor\".\"ucinetid\", \"shortened_names\"", - "name": "instructor_view", - "schema": "public", - "isExisting": false, - "materialized": true - } - }, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} diff --git a/packages/db/migrations/meta/0024_snapshot.json b/packages/db/migrations/meta/0024_snapshot.json deleted file mode 100644 index 494947b7..00000000 --- a/packages/db/migrations/meta/0024_snapshot.json +++ /dev/null @@ -1,3852 +0,0 @@ -{ - "id": "f26b0ba2-71c0-4bec-a749-dd90bfe40b40", - "prevId": "02076c7e-4d5b-47e4-9722-3a6ee9849b3f", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.ap_exam": { - "name": "ap_exam", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "catalogue_name": { - "name": "catalogue_name", - "type": "varchar", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.ap_exam_reward": { - "name": "ap_exam_reward", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "units_granted": { - "name": "units_granted", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "elective_units_granted": { - "name": "elective_units_granted", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "ge_1a_courses_granted": { - "name": "ge_1a_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_1b_courses_granted": { - "name": "ge_1b_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_2_courses_granted": { - "name": "ge_2_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_3_courses_granted": { - "name": "ge_3_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_4_courses_granted": { - "name": "ge_4_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_5a_courses_granted": { - "name": "ge_5a_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_5b_courses_granted": { - "name": "ge_5b_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_6_courses_granted": { - "name": "ge_6_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_7_courses_granted": { - "name": "ge_7_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_8_courses_granted": { - "name": "ge_8_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "courses_granted": { - "name": "courses_granted", - "type": "json", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.ap_exam_to_reward": { - "name": "ap_exam_to_reward", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "exam_id": { - "name": "exam_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "score": { - "name": "score", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "reward": { - "name": "reward", - "type": "uuid", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "ap_exam_to_reward_exam_id_score_index": { - "name": "ap_exam_to_reward_exam_id_score_index", - "columns": [ - { - "expression": "exam_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "score", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "ap_exam_to_reward_exam_id_ap_exam_id_fk": { - "name": "ap_exam_to_reward_exam_id_ap_exam_id_fk", - "tableFrom": "ap_exam_to_reward", - "tableTo": "ap_exam", - "columnsFrom": ["exam_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "ap_exam_to_reward_reward_ap_exam_reward_id_fk": { - "name": "ap_exam_to_reward_reward_ap_exam_reward_id_fk", - "tableFrom": "ap_exam_to_reward", - "tableTo": "ap_exam_reward", - "columnsFrom": ["reward"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.calendar_term": { - "name": "calendar_term", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true, - "generated": { - "as": "\"calendar_term\".\"year\" || ' ' || CASE WHEN \"calendar_term\".\"quarter\" = 'Fall' THEN 'Fall' WHEN \"calendar_term\".\"quarter\" = 'Winter' THEN 'Winter' WHEN \"calendar_term\".\"quarter\" = 'Spring' THEN 'Spring' WHEN \"calendar_term\".\"quarter\" = 'Summer1' THEN 'Summer1' WHEN \"calendar_term\".\"quarter\" = 'Summer10wk' THEN 'Summer10wk' WHEN \"calendar_term\".\"quarter\" = 'Summer2' THEN 'Summer2' ELSE '' END", - "type": "stored" - } - }, - "year": { - "name": "year", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "quarter": { - "name": "quarter", - "type": "term", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "instruction_start": { - "name": "instruction_start", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "instruction_end": { - "name": "instruction_end", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "finals_start": { - "name": "finals_start", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "finals_end": { - "name": "finals_end", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "soc_available": { - "name": "soc_available", - "type": "date", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.catalogue_program": { - "name": "catalogue_program", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "program_name": { - "name": "program_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.college_requirement": { - "name": "college_requirement", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "requirements": { - "name": "requirements", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "college_requirement_requirements_unique": { - "name": "college_requirement_requirements_unique", - "nullsNotDistinct": false, - "columns": ["requirements"] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.course": { - "name": "course", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "department": { - "name": "department", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "shortened_dept": { - "name": "shortened_dept", - "type": "varchar", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "REPLACE(\"course\".\"department\", ' ', '')", - "type": "stored" - } - }, - "department_alias": { - "name": "department_alias", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "course_number": { - "name": "course_number", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "course_numeric": { - "name": "course_numeric", - "type": "integer", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "CASE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g') WHEN '' THEN 0 ELSE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g')::INTEGER END", - "type": "stored" - } - }, - "school": { - "name": "school", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "course_level": { - "name": "course_level", - "type": "course_level", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "min_units": { - "name": "min_units", - "type": "numeric(4, 2)", - "primaryKey": false, - "notNull": true - }, - "max_units": { - "name": "max_units", - "type": "numeric(4, 2)", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "department_name": { - "name": "department_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "prerequisite_tree": { - "name": "prerequisite_tree", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "prerequisite_text": { - "name": "prerequisite_text", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "repeatability": { - "name": "repeatability", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "grading_option": { - "name": "grading_option", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "concurrent": { - "name": "concurrent", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "same_as": { - "name": "same_as", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "restriction": { - "name": "restriction", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "overlap": { - "name": "overlap", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "corequisites": { - "name": "corequisites", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "is_ge_1a": { - "name": "is_ge_1a", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_1b": { - "name": "is_ge_1b", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_2": { - "name": "is_ge_2", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_3": { - "name": "is_ge_3", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_4": { - "name": "is_ge_4", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_5a": { - "name": "is_ge_5a", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_5b": { - "name": "is_ge_5b", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_6": { - "name": "is_ge_6", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_7": { - "name": "is_ge_7", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_8": { - "name": "is_ge_8", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "ge_text": { - "name": "ge_text", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "course_search_index": { - "name": "course_search_index", - "columns": [ - { - "expression": "(\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"id\", '')), 'A') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"department\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"department_alias\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"shortened_dept\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"course_number\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"course_numeric\"::TEXT, '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"title\", '')), 'C') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"description\", '')), 'D')\n)", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "shortened_dept": { - "name": "shortened_dept", - "columns": [ - { - "expression": "shortened_dept", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.degree": { - "name": "degree", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "division": { - "name": "division", - "type": "division", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.instructor": { - "name": "instructor", - "schema": "", - "columns": { - "ucinetid": { - "name": "ucinetid", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "department": { - "name": "department", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "instructor_search_index": { - "name": "instructor_search_index", - "columns": [ - { - "expression": "(\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"ucinetid\", '')), 'A') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"name\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"title\", '')), 'B')\n)", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.instructor_to_websoc_instructor": { - "name": "instructor_to_websoc_instructor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "instructor_ucinetid": { - "name": "instructor_ucinetid", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "websoc_instructor_name": { - "name": "websoc_instructor_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "instructor_to_websoc_instructor_instructor_ucinetid_index": { - "name": "instructor_to_websoc_instructor_instructor_ucinetid_index", - "columns": [ - { - "expression": "instructor_ucinetid", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "instructor_to_websoc_instructor_websoc_instructor_name_index": { - "name": "instructor_to_websoc_instructor_websoc_instructor_name_index", - "columns": [ - { - "expression": "websoc_instructor_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "instructor_to_websoc_instructor_instructor_ucinetid_websoc_instructor_name_index": { - "name": "instructor_to_websoc_instructor_instructor_ucinetid_websoc_instructor_name_index", - "columns": [ - { - "expression": "instructor_ucinetid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "websoc_instructor_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "instructor_to_websoc_instructor_instructor_ucinetid_instructor_ucinetid_fk": { - "name": "instructor_to_websoc_instructor_instructor_ucinetid_instructor_ucinetid_fk", - "tableFrom": "instructor_to_websoc_instructor", - "tableTo": "instructor", - "columnsFrom": ["instructor_ucinetid"], - "columnsTo": ["ucinetid"], - "onDelete": "no action", - "onUpdate": "no action" - }, - "instructor_to_websoc_instructor_websoc_instructor_name_websoc_instructor_name_fk": { - "name": "instructor_to_websoc_instructor_websoc_instructor_name_websoc_instructor_name_fk", - "tableFrom": "instructor_to_websoc_instructor", - "tableTo": "websoc_instructor", - "columnsFrom": ["websoc_instructor_name"], - "columnsTo": ["name"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.larc_section": { - "name": "larc_section", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "course_id": { - "name": "course_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "days_string": { - "name": "days_string", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "time_string": { - "name": "time_string", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "start_time": { - "name": "start_time", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "end_time": { - "name": "end_time", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "instructor": { - "name": "instructor", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "building": { - "name": "building", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "meets_monday": { - "name": "meets_monday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_tuesday": { - "name": "meets_tuesday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_wednesday": { - "name": "meets_wednesday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_thursday": { - "name": "meets_thursday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_friday": { - "name": "meets_friday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_saturday": { - "name": "meets_saturday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_sunday": { - "name": "meets_sunday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "larc_section_course_id_index": { - "name": "larc_section_course_id_index", - "columns": [ - { - "expression": "course_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "larc_section_course_id_websoc_course_id_fk": { - "name": "larc_section_course_id_websoc_course_id_fk", - "tableFrom": "larc_section", - "tableTo": "websoc_course", - "columnsFrom": ["course_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.library_traffic": { - "name": "library_traffic", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "library_name": { - "name": "library_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "location_name": { - "name": "location_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "traffic_count": { - "name": "traffic_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "traffic_percentage": { - "name": "traffic_percentage", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "timestamp": { - "name": "timestamp", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "library_traffic_library_name_index": { - "name": "library_traffic_library_name_index", - "columns": [ - { - "expression": "library_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "library_traffic_location_name_index": { - "name": "library_traffic_location_name_index", - "columns": [ - { - "expression": "location_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.library_traffic_history": { - "name": "library_traffic_history", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "location_id": { - "name": "location_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "traffic_count": { - "name": "traffic_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "traffic_percentage": { - "name": "traffic_percentage", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "timestamp": { - "name": "timestamp", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "library_traffic_history_location_id_timestamp_index": { - "name": "library_traffic_history_location_id_timestamp_index", - "columns": [ - { - "expression": "location_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "timestamp", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "library_traffic_history_location_id_library_traffic_id_fk": { - "name": "library_traffic_history_location_id_library_traffic_id_fk", - "tableFrom": "library_traffic_history", - "tableTo": "library_traffic", - "columnsFrom": ["location_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.major": { - "name": "major", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "degree_id": { - "name": "degree_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "code": { - "name": "code", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "require_spec": { - "name": "require_spec", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "college_requirement": { - "name": "college_requirement", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "requirements": { - "name": "requirements", - "type": "json", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "major_degree_id_index": { - "name": "major_degree_id_index", - "columns": [ - { - "expression": "degree_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "major_college_requirement_index": { - "name": "major_college_requirement_index", - "columns": [ - { - "expression": "college_requirement", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "major_degree_id_degree_id_fk": { - "name": "major_degree_id_degree_id_fk", - "tableFrom": "major", - "tableTo": "degree", - "columnsFrom": ["degree_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - }, - "major_college_requirement_college_requirement_id_fk": { - "name": "major_college_requirement_college_requirement_id_fk", - "tableFrom": "major", - "tableTo": "college_requirement", - "columnsFrom": ["college_requirement"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.minor": { - "name": "minor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "requirements": { - "name": "requirements", - "type": "json", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.prerequisite": { - "name": "prerequisite", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "dep_dept": { - "name": "dep_dept", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "prerequisite_id": { - "name": "prerequisite_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "dependency_id": { - "name": "dependency_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "prerequisite_dep_dept_index": { - "name": "prerequisite_dep_dept_index", - "columns": [ - { - "expression": "dep_dept", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "prerequisite_prerequisite_id_index": { - "name": "prerequisite_prerequisite_id_index", - "columns": [ - { - "expression": "prerequisite_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "prerequisite_dependency_id_index": { - "name": "prerequisite_dependency_id_index", - "columns": [ - { - "expression": "dependency_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "prerequisite_prerequisite_id_dependency_id_index": { - "name": "prerequisite_prerequisite_id_dependency_id_index", - "columns": [ - { - "expression": "prerequisite_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dependency_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.sample_program_variation": { - "name": "sample_program_variation", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "program_id": { - "name": "program_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "label": { - "name": "label", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "sample_program": { - "name": "sample_program", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "variation_notes": { - "name": "variation_notes", - "type": "varchar[]", - "primaryKey": false, - "notNull": true, - "default": "ARRAY[]::VARCHAR[]" - } - }, - "indexes": {}, - "foreignKeys": { - "sample_program_variation_program_id_catalogue_program_id_fk": { - "name": "sample_program_variation_program_id_catalogue_program_id_fk", - "tableFrom": "sample_program_variation", - "tableTo": "catalogue_program", - "columnsFrom": ["program_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.school_requirement": { - "name": "school_requirement", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "requirements": { - "name": "requirements", - "type": "json", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.specialization": { - "name": "specialization", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "major_id": { - "name": "major_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "requirements": { - "name": "requirements", - "type": "json", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "specialization_major_id_index": { - "name": "specialization_major_id_index", - "columns": [ - { - "expression": "major_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "specialization_major_id_major_id_fk": { - "name": "specialization_major_id_major_id_fk", - "tableFrom": "specialization", - "tableTo": "major", - "columnsFrom": ["major_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.study_location": { - "name": "study_location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.study_room": { - "name": "study_room", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "capacity": { - "name": "capacity", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "location": { - "name": "location", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "directions": { - "name": "directions", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "tech_enhanced": { - "name": "tech_enhanced", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "study_location_id": { - "name": "study_location_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "study_room_study_location_id_index": { - "name": "study_room_study_location_id_index", - "columns": [ - { - "expression": "study_location_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "study_room_study_location_id_study_location_id_fk": { - "name": "study_room_study_location_id_study_location_id_fk", - "tableFrom": "study_room", - "tableTo": "study_location", - "columnsFrom": ["study_location_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.study_room_slot": { - "name": "study_room_slot", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "study_room_id": { - "name": "study_room_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "start": { - "name": "start", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "end": { - "name": "end", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "is_available": { - "name": "is_available", - "type": "boolean", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "study_room_slot_study_room_id_index": { - "name": "study_room_slot_study_room_id_index", - "columns": [ - { - "expression": "study_room_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "study_room_slot_study_room_id_start_end_index": { - "name": "study_room_slot_study_room_id_start_end_index", - "columns": [ - { - "expression": "study_room_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "start", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "end", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "study_room_slot_study_room_id_study_room_id_fk": { - "name": "study_room_slot_study_room_id_study_room_id_fk", - "tableFrom": "study_room_slot", - "tableTo": "study_room", - "columnsFrom": ["study_room_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_course": { - "name": "websoc_course", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "department_id": { - "name": "department_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "course_id": { - "name": "course_id", - "type": "varchar", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "REPLACE(\"websoc_course\".\"dept_code\", ' ', '') || \"websoc_course\".\"course_number\"", - "type": "stored" - } - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "year": { - "name": "year", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "quarter": { - "name": "quarter", - "type": "term", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "school_name": { - "name": "school_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "dept_code": { - "name": "dept_code", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "course_title": { - "name": "course_title", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "course_number": { - "name": "course_number", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "course_numeric": { - "name": "course_numeric", - "type": "integer", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "CASE REGEXP_REPLACE(\"websoc_course\".\"course_number\", '\\D', '', 'g') WHEN '' THEN 0 ELSE REGEXP_REPLACE(\"websoc_course\".\"course_number\", '\\D', '', 'g')::INTEGER END", - "type": "stored" - } - }, - "course_comment": { - "name": "course_comment", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "prerequisite_link": { - "name": "prerequisite_link", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "is_ge_1a": { - "name": "is_ge_1a", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_1b": { - "name": "is_ge_1b", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_2": { - "name": "is_ge_2", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_3": { - "name": "is_ge_3", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_4": { - "name": "is_ge_4", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_5a": { - "name": "is_ge_5a", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_5b": { - "name": "is_ge_5b", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_6": { - "name": "is_ge_6", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_7": { - "name": "is_ge_7", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_8": { - "name": "is_ge_8", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "websoc_course_department_id_index": { - "name": "websoc_course_department_id_index", - "columns": [ - { - "expression": "department_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_course_id_index": { - "name": "websoc_course_course_id_index", - "columns": [ - { - "expression": "course_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_school_name_dept_code_course_number_course_title_index": { - "name": "websoc_course_year_quarter_school_name_dept_code_course_number_course_title_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "school_name", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dept_code", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "course_number", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "course_title", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_1a_index": { - "name": "websoc_course_year_quarter_is_ge_1a_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_1a", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_1b_index": { - "name": "websoc_course_year_quarter_is_ge_1b_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_1b", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_2_index": { - "name": "websoc_course_year_quarter_is_ge_2_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_2", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_3_index": { - "name": "websoc_course_year_quarter_is_ge_3_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_3", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_4_index": { - "name": "websoc_course_year_quarter_is_ge_4_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_4", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_5a_index": { - "name": "websoc_course_year_quarter_is_ge_5a_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_5a", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_5b_index": { - "name": "websoc_course_year_quarter_is_ge_5b_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_5b", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_6_index": { - "name": "websoc_course_year_quarter_is_ge_6_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_6", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_7_index": { - "name": "websoc_course_year_quarter_is_ge_7_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_7", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_8_index": { - "name": "websoc_course_year_quarter_is_ge_8_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_8", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_dept_code_index": { - "name": "websoc_course_year_quarter_dept_code_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dept_code", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_dept_code_course_number_index": { - "name": "websoc_course_year_quarter_dept_code_course_number_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dept_code", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "course_number", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_course_department_id_websoc_department_id_fk": { - "name": "websoc_course_department_id_websoc_department_id_fk", - "tableFrom": "websoc_course", - "tableTo": "websoc_department", - "columnsFrom": ["department_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_department": { - "name": "websoc_department", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "school_id": { - "name": "school_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "year": { - "name": "year", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "quarter": { - "name": "quarter", - "type": "term", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "dept_code": { - "name": "dept_code", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "dept_name": { - "name": "dept_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "dept_comment": { - "name": "dept_comment", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "section_code_range_comments": { - "name": "section_code_range_comments", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "course_number_range_comments": { - "name": "course_number_range_comments", - "type": "text[]", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "websoc_department_school_id_index": { - "name": "websoc_department_school_id_index", - "columns": [ - { - "expression": "school_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_department_year_quarter_school_id_dept_code_index": { - "name": "websoc_department_year_quarter_school_id_dept_code_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "school_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dept_code", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_department_school_id_websoc_school_id_fk": { - "name": "websoc_department_school_id_websoc_school_id_fk", - "tableFrom": "websoc_department", - "tableTo": "websoc_school", - "columnsFrom": ["school_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_instructor": { - "name": "websoc_instructor", - "schema": "", - "columns": { - "name": { - "name": "name", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_location": { - "name": "websoc_location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "building": { - "name": "building", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "room": { - "name": "room", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "websoc_location_building_room_index": { - "name": "websoc_location_building_room_index", - "columns": [ - { - "expression": "building", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "room", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_meta": { - "name": "websoc_meta", - "schema": "", - "columns": { - "name": { - "name": "name", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "last_scraped": { - "name": "last_scraped", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_dept_scraped": { - "name": "last_dept_scraped", - "type": "varchar", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_school": { - "name": "websoc_school", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "year": { - "name": "year", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "quarter": { - "name": "quarter", - "type": "term", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "school_name": { - "name": "school_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "school_comment": { - "name": "school_comment", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "websoc_school_year_quarter_school_name_index": { - "name": "websoc_school_year_quarter_school_name_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "school_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_section": { - "name": "websoc_section", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "course_id": { - "name": "course_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "year": { - "name": "year", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "quarter": { - "name": "quarter", - "type": "term", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "units": { - "name": "units", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "websoc_status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "instructors": { - "name": "instructors", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "meetings": { - "name": "meetings", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "final_exam_string": { - "name": "final_exam_string", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "final_exam": { - "name": "final_exam", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "section_num": { - "name": "section_num", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "max_capacity": { - "name": "max_capacity", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "section_code": { - "name": "section_code", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "section_type": { - "name": "section_type", - "type": "websoc_section_type", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "num_requested": { - "name": "num_requested", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "restriction_string": { - "name": "restriction_string", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "restriction_a": { - "name": "restriction_a", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_b": { - "name": "restriction_b", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_c": { - "name": "restriction_c", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_d": { - "name": "restriction_d", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_e": { - "name": "restriction_e", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_f": { - "name": "restriction_f", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_g": { - "name": "restriction_g", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_h": { - "name": "restriction_h", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_i": { - "name": "restriction_i", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_j": { - "name": "restriction_j", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_k": { - "name": "restriction_k", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_l": { - "name": "restriction_l", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_m": { - "name": "restriction_m", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_n": { - "name": "restriction_n", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_o": { - "name": "restriction_o", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_r": { - "name": "restriction_r", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_s": { - "name": "restriction_s", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_x": { - "name": "restriction_x", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "num_on_waitlist": { - "name": "num_on_waitlist", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "num_waitlist_cap": { - "name": "num_waitlist_cap", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "section_comment": { - "name": "section_comment", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "num_new_only_reserved": { - "name": "num_new_only_reserved", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "num_currently_total_enrolled": { - "name": "num_currently_total_enrolled", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "num_currently_section_enrolled": { - "name": "num_currently_section_enrolled", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "is_cancelled": { - "name": "is_cancelled", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "\"websoc_section\".\"section_comment\" LIKE '%*** CANCELLED ***%' OR \"websoc_section\".\"section_comment\" LIKE '%*** CANCELED ***%'", - "type": "stored" - } - }, - "web_url": { - "name": "web_url", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "websoc_section_course_id_index": { - "name": "websoc_section_course_id_index", - "columns": [ - { - "expression": "course_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_section_year_quarter_section_code_index": { - "name": "websoc_section_year_quarter_section_code_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "section_code", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_section_course_id_websoc_course_id_fk": { - "name": "websoc_section_course_id_websoc_course_id_fk", - "tableFrom": "websoc_section", - "tableTo": "websoc_course", - "columnsFrom": ["course_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_section_enrollment": { - "name": "websoc_section_enrollment", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "section_id": { - "name": "section_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "date", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "year": { - "name": "year", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "quarter": { - "name": "quarter", - "type": "term", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "max_capacity": { - "name": "max_capacity", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "num_currently_total_enrolled": { - "name": "num_currently_total_enrolled", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "num_on_waitlist": { - "name": "num_on_waitlist", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "num_waitlist_cap": { - "name": "num_waitlist_cap", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "num_requested": { - "name": "num_requested", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "num_new_only_reserved": { - "name": "num_new_only_reserved", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "websoc_status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "websoc_section_enrollment_section_id_index": { - "name": "websoc_section_enrollment_section_id_index", - "columns": [ - { - "expression": "section_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_section_enrollment_section_id_created_at_index": { - "name": "websoc_section_enrollment_section_id_created_at_index", - "columns": [ - { - "expression": "section_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_section_enrollment_section_id_websoc_section_id_fk": { - "name": "websoc_section_enrollment_section_id_websoc_section_id_fk", - "tableFrom": "websoc_section_enrollment", - "tableTo": "websoc_section", - "columnsFrom": ["section_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_section_grade": { - "name": "websoc_section_grade", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "section_id": { - "name": "section_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "grade_a_count": { - "name": "grade_a_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "grade_b_count": { - "name": "grade_b_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "grade_c_count": { - "name": "grade_c_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "grade_d_count": { - "name": "grade_d_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "grade_f_count": { - "name": "grade_f_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "grade_p_count": { - "name": "grade_p_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "grade_np_count": { - "name": "grade_np_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "grade_w_count": { - "name": "grade_w_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "average_gpa": { - "name": "average_gpa", - "type": "numeric(3, 2)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "websoc_section_grade_section_id_index": { - "name": "websoc_section_grade_section_id_index", - "columns": [ - { - "expression": "section_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_section_grade_section_id_websoc_section_id_fk": { - "name": "websoc_section_grade_section_id_websoc_section_id_fk", - "tableFrom": "websoc_section_grade", - "tableTo": "websoc_section", - "columnsFrom": ["section_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "websoc_section_grade_section_id_unique": { - "name": "websoc_section_grade_section_id_unique", - "nullsNotDistinct": false, - "columns": ["section_id"] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_section_meeting": { - "name": "websoc_section_meeting", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "section_id": { - "name": "section_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "section_code": { - "name": "section_code", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "meeting_index": { - "name": "meeting_index", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "time_string": { - "name": "time_string", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "time_is_tba": { - "name": "time_is_tba", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "\"websoc_section_meeting\".\"time_string\" LIKE '%TBA%'", - "type": "stored" - } - }, - "start_time": { - "name": "start_time", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "end_time": { - "name": "end_time", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "days_string": { - "name": "days_string", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "meets_monday": { - "name": "meets_monday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_tuesday": { - "name": "meets_tuesday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_wednesday": { - "name": "meets_wednesday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_thursday": { - "name": "meets_thursday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_friday": { - "name": "meets_friday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_saturday": { - "name": "meets_saturday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_sunday": { - "name": "meets_sunday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "websoc_section_meeting_section_id_index": { - "name": "websoc_section_meeting_section_id_index", - "columns": [ - { - "expression": "section_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_section_meeting_section_id_websoc_section_id_fk": { - "name": "websoc_section_meeting_section_id_websoc_section_id_fk", - "tableFrom": "websoc_section_meeting", - "tableTo": "websoc_section", - "columnsFrom": ["section_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_section_meeting_to_location": { - "name": "websoc_section_meeting_to_location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "meeting_id": { - "name": "meeting_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "location_id": { - "name": "location_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "websoc_section_meeting_to_location_meeting_id_index": { - "name": "websoc_section_meeting_to_location_meeting_id_index", - "columns": [ - { - "expression": "meeting_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_section_meeting_to_location_location_id_index": { - "name": "websoc_section_meeting_to_location_location_id_index", - "columns": [ - { - "expression": "location_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_section_meeting_to_location_meeting_id_location_id_index": { - "name": "websoc_section_meeting_to_location_meeting_id_location_id_index", - "columns": [ - { - "expression": "meeting_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "location_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_section_meeting_to_location_meeting_id_websoc_section_meeting_id_fk": { - "name": "websoc_section_meeting_to_location_meeting_id_websoc_section_meeting_id_fk", - "tableFrom": "websoc_section_meeting_to_location", - "tableTo": "websoc_section_meeting", - "columnsFrom": ["meeting_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "websoc_section_meeting_to_location_location_id_websoc_location_id_fk": { - "name": "websoc_section_meeting_to_location_location_id_websoc_location_id_fk", - "tableFrom": "websoc_section_meeting_to_location", - "tableTo": "websoc_location", - "columnsFrom": ["location_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_section_to_instructor": { - "name": "websoc_section_to_instructor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "section_id": { - "name": "section_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "instructor_name": { - "name": "instructor_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "websoc_section_to_instructor_section_id_index": { - "name": "websoc_section_to_instructor_section_id_index", - "columns": [ - { - "expression": "section_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_section_to_instructor_instructor_name_index": { - "name": "websoc_section_to_instructor_instructor_name_index", - "columns": [ - { - "expression": "instructor_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_section_to_instructor_section_id_websoc_section_id_fk": { - "name": "websoc_section_to_instructor_section_id_websoc_section_id_fk", - "tableFrom": "websoc_section_to_instructor", - "tableTo": "websoc_section", - "columnsFrom": ["section_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - }, - "websoc_section_to_instructor_instructor_name_websoc_instructor_name_fk": { - "name": "websoc_section_to_instructor_instructor_name_websoc_instructor_name_fk", - "tableFrom": "websoc_section_to_instructor", - "tableTo": "websoc_instructor", - "columnsFrom": ["instructor_name"], - "columnsTo": ["name"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.course_level": { - "name": "course_level", - "schema": "public", - "values": ["LowerDiv", "UpperDiv", "Graduate"] - }, - "public.division": { - "name": "division", - "schema": "public", - "values": ["Undergraduate", "Graduate"] - }, - "public.term": { - "name": "term", - "schema": "public", - "values": ["Fall", "Winter", "Spring", "Summer1", "Summer10wk", "Summer2"] - }, - "public.websoc_section_type": { - "name": "websoc_section_type", - "schema": "public", - "values": [ - "Act", - "Col", - "Dis", - "Fld", - "Lab", - "Lec", - "Qiz", - "Res", - "Sem", - "Stu", - "Tap", - "Tut" - ] - }, - "public.websoc_status": { - "name": "websoc_status", - "schema": "public", - "values": ["OPEN", "Waitl", "FULL", "NewOnly"] - } - }, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": { - "public.course_view": { - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "department": { - "name": "department", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "shortened_dept": { - "name": "shortened_dept", - "type": "varchar", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "REPLACE(\"course\".\"department\", ' ', '')", - "type": "stored" - } - }, - "department_alias": { - "name": "department_alias", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "course_number": { - "name": "course_number", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "course_numeric": { - "name": "course_numeric", - "type": "integer", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "CASE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g') WHEN '' THEN 0 ELSE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g')::INTEGER END", - "type": "stored" - } - }, - "school": { - "name": "school", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "course_level": { - "name": "course_level", - "type": "course_level", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "min_units": { - "name": "min_units", - "type": "numeric(4, 2)", - "primaryKey": false, - "notNull": true - }, - "max_units": { - "name": "max_units", - "type": "numeric(4, 2)", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "department_name": { - "name": "department_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "prerequisite_tree": { - "name": "prerequisite_tree", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "prerequisite_text": { - "name": "prerequisite_text", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "repeatability": { - "name": "repeatability", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "grading_option": { - "name": "grading_option", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "concurrent": { - "name": "concurrent", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "same_as": { - "name": "same_as", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "restriction": { - "name": "restriction", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "overlap": { - "name": "overlap", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "corequisites": { - "name": "corequisites", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "is_ge_1a": { - "name": "is_ge_1a", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_1b": { - "name": "is_ge_1b", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_2": { - "name": "is_ge_2", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_3": { - "name": "is_ge_3", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_4": { - "name": "is_ge_4", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_5a": { - "name": "is_ge_5a", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_5b": { - "name": "is_ge_5b", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_6": { - "name": "is_ge_6", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_7": { - "name": "is_ge_7", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_8": { - "name": "is_ge_8", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "ge_text": { - "name": "ge_text", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "definition": "select \"course\".\"id\", \"course\".\"updated_at\", \"course\".\"department\", \"course\".\"shortened_dept\", \"course\".\"department_alias\", \"course\".\"course_number\", \"course\".\"course_numeric\", \"course\".\"school\", \"course\".\"title\", \"course\".\"course_level\", \"course\".\"min_units\", \"course\".\"max_units\", \"course\".\"description\", \"course\".\"department_name\", \"course\".\"prerequisite_tree\", \"course\".\"prerequisite_text\", \"course\".\"repeatability\", \"course\".\"grading_option\", \"course\".\"concurrent\", \"course\".\"same_as\", \"course\".\"restriction\", \"course\".\"overlap\", \"course\".\"corequisites\", \"course\".\"is_ge_1a\", \"course\".\"is_ge_1b\", \"course\".\"is_ge_2\", \"course\".\"is_ge_3\", \"course\".\"is_ge_4\", \"course\".\"is_ge_5a\", \"course\".\"is_ge_5b\", \"course\".\"is_ge_6\", \"course\".\"is_ge_7\", \"course\".\"is_ge_8\", \"course\".\"ge_text\", \n ARRAY_REMOVE(COALESCE(\n (\n SELECT ARRAY_AGG(\n CASE WHEN \"prerequisite_course\".\"id\" IS NULL THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'id', \"prerequisite_course\".\"id\",\n 'title', \"prerequisite_course\".\"title\",\n 'department', \"prerequisite_course\".\"department\",\n 'courseNumber', \"prerequisite_course\".\"course_number\"\n )\n END\n )\n FROM \"prerequisite\"\n LEFT JOIN \"course\" \"prerequisite_course\" ON \"prerequisite_course\".\"id\" = \"prerequisite\".\"prerequisite_id\"\n WHERE \"prerequisite\".\"dependency_id\" = \"course\".\"id\"\n ),\n ARRAY[]::JSONB[]), NULL)\n as \"prerequisites\", \n ARRAY_REMOVE(COALESCE(\n (\n SELECT ARRAY_AGG(\n CASE WHEN \"dependency_course\".\"id\" IS NULL THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'id', \"dependency_course\".\"id\",\n 'title', \"dependency_course\".\"title\",\n 'department', \"dependency_course\".\"department\",\n 'courseNumber', \"dependency_course\".\"course_number\"\n )\n END\n )\n FROM \"prerequisite\" \"dependency\"\n LEFT JOIN \"course\" \"dependency_course\" ON \"dependency_course\".\"id\" = \"dependency\".\"dependency_id\"\n WHERE \"dependency\".\"prerequisite_id\" = \"course\".\"id\"\n ),\n ARRAY[]::JSONB[]), NULL)\n as \"dependencies\", \n ARRAY_REMOVE(ARRAY_AGG(DISTINCT\n CASE WHEN \"websoc_course\".\"year\" IS NULL THEN NULL\n ELSE CONCAT(\"websoc_course\".\"year\", ' ', \"websoc_course\".\"quarter\")\n END\n ), NULL)\n as \"terms\", \n ARRAY_REMOVE(COALESCE(ARRAY_AGG(DISTINCT\n CASE WHEN \"instructor\".\"ucinetid\" IS NULL THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'ucinetid', \"instructor\".\"ucinetid\",\n 'name', \"instructor\".\"name\",\n 'title', \"instructor\".\"title\",\n 'email', \"instructor\".\"email\",\n 'department', \"instructor\".\"department\",\n 'shortenedNames', ARRAY(\n SELECT \"instructor_to_websoc_instructor\".\"websoc_instructor_name\"\n FROM \"instructor_to_websoc_instructor\"\n WHERE \"instructor_to_websoc_instructor\".\"instructor_ucinetid\" = \"instructor\".\"ucinetid\"\n )\n )\n END\n ), ARRAY[]::JSONB[]), NULL)\n as \"instructors\" from \"course\" left join \"websoc_course\" on \"websoc_course\".\"course_id\" = \"course\".\"id\" left join \"websoc_section\" on \"websoc_section\".\"course_id\" = \"websoc_course\".\"id\" left join \"websoc_section_to_instructor\" on \"websoc_section_to_instructor\".\"section_id\" = \"websoc_section\".\"id\" left join \"websoc_instructor\" on \"websoc_instructor\".\"name\" = \"websoc_section_to_instructor\".\"instructor_name\" left join \"instructor_to_websoc_instructor\" on \"instructor_to_websoc_instructor\".\"websoc_instructor_name\" = \"websoc_instructor\".\"name\" left join \"instructor\" on (\"instructor\".\"ucinetid\" = \"instructor_to_websoc_instructor\".\"instructor_ucinetid\" and \"instructor\".\"ucinetid\" is not null and \"instructor\".\"ucinetid\" <> 'student') group by \"course\".\"id\"", - "name": "course_view", - "schema": "public", - "isExisting": false, - "materialized": true - }, - "public.instructor_view": { - "columns": { - "ucinetid": { - "name": "ucinetid", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "department": { - "name": "department", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "definition": "with \"shortened_names_cte\" as (select \"instructor_ucinetid\", ARRAY_AGG(\"websoc_instructor_name\") as \"shortened_names\" from \"instructor_to_websoc_instructor\" group by \"instructor_to_websoc_instructor\".\"instructor_ucinetid\"), \"courses_cte\" as (with \"terms_cte\" as (select \"course\".\"id\", \"instructor_to_websoc_instructor\".\"instructor_ucinetid\", \n ARRAY_REMOVE(ARRAY_AGG(DISTINCT\n CASE WHEN \"websoc_course\".\"year\" IS NULL THEN NULL\n ELSE CONCAT(\"websoc_course\".\"year\", ' ', \"websoc_course\".\"quarter\")\n END\n ), NULL) as \"terms\" from \"course\" left join \"websoc_course\" on \"websoc_course\".\"course_id\" = \"course\".\"id\" left join \"websoc_section\" on \"websoc_section\".\"course_id\" = \"websoc_course\".\"id\" left join \"websoc_section_to_instructor\" on \"websoc_section_to_instructor\".\"section_id\" = \"websoc_section\".\"id\" left join \"websoc_instructor\" on \"websoc_instructor\".\"name\" = \"websoc_section_to_instructor\".\"instructor_name\" left join \"instructor_to_websoc_instructor\" on \"instructor_to_websoc_instructor\".\"websoc_instructor_name\" = \"websoc_instructor\".\"name\" group by \"course\".\"id\", \"instructor_to_websoc_instructor\".\"instructor_ucinetid\") select \"terms_cte\".\"instructor_ucinetid\", \"course\".\"id\", \n CASE WHEN \"course\".\"id\" IS NULL\n THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'id', \"course\".\"id\",\n 'title', \"course\".\"title\",\n 'department', \"course\".\"department\",\n 'courseNumber', \"course\".\"course_number\",\n 'terms', COALESCE(\"terms\", ARRAY[]::TEXT[])\n )\n END\n as \"course_info\" from \"course\" left join \"terms_cte\" on \"terms_cte\".\"id\" = \"course\".\"id\" group by \"course\".\"id\", \"terms_cte\".\"instructor_ucinetid\", \"terms\") select \"instructor\".\"ucinetid\", \"instructor\".\"name\", \"instructor\".\"title\", \"instructor\".\"email\", \"instructor\".\"department\", COALESCE(\"shortened_names\", ARRAY[]::TEXT[]) as \"shortened_names\", \n ARRAY_REMOVE(ARRAY_AGG(DISTINCT \"course_info\"), NULL)\n as \"courses\" from \"instructor\" left join \"shortened_names_cte\" on \"shortened_names_cte\".\"instructor_ucinetid\" = \"instructor\".\"ucinetid\" left join \"courses_cte\" on \"courses_cte\".\"instructor_ucinetid\" = \"instructor\".\"ucinetid\" where \"instructor\".\"ucinetid\" <> 'student' group by \"instructor\".\"ucinetid\", \"shortened_names\"", - "name": "instructor_view", - "schema": "public", - "isExisting": false, - "materialized": true - } - }, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} diff --git a/packages/db/migrations/meta/_journal.json b/packages/db/migrations/meta/_journal.json index 4ad64e3a..9a7f9aea 100644 --- a/packages/db/migrations/meta/_journal.json +++ b/packages/db/migrations/meta/_journal.json @@ -162,20 +162,6 @@ "when": 1766088418349, "tag": "0022_fix_websoc_is_cancelled", "breakpoints": true - }, - { - "idx": 23, - "version": "7", - "when": 1769640710103, - "tag": "0023_fresh_chimera", - "breakpoints": true - }, - { - "idx": 24, - "version": "7", - "when": 1769714498160, - "tag": "0024_nebulous_chronomancer", - "breakpoints": true } ] } From 50e0f4f667424ad9219bda6b48d7ab47404d629e Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Sat, 7 Feb 2026 15:38:41 -0800 Subject: [PATCH 14/91] reran migration with --name flag --- .../migrations/0023_add_req_spec_to_major.sql | 1 + .../db/migrations/meta/0023_snapshot.json | 3852 +++++++++++++++++ packages/db/migrations/meta/_journal.json | 7 + 3 files changed, 3860 insertions(+) create mode 100644 packages/db/migrations/0023_add_req_spec_to_major.sql create mode 100644 packages/db/migrations/meta/0023_snapshot.json diff --git a/packages/db/migrations/0023_add_req_spec_to_major.sql b/packages/db/migrations/0023_add_req_spec_to_major.sql new file mode 100644 index 00000000..69395a96 --- /dev/null +++ b/packages/db/migrations/0023_add_req_spec_to_major.sql @@ -0,0 +1 @@ +ALTER TABLE "major" ADD COLUMN "require_spec" boolean NOT NULL; \ No newline at end of file diff --git a/packages/db/migrations/meta/0023_snapshot.json b/packages/db/migrations/meta/0023_snapshot.json new file mode 100644 index 00000000..374fee6c --- /dev/null +++ b/packages/db/migrations/meta/0023_snapshot.json @@ -0,0 +1,3852 @@ +{ + "id": "5c7497e0-f570-40bb-9deb-67b139214c0e", + "prevId": "169622b6-bb25-46af-9384-cb3825533964", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.ap_exam": { + "name": "ap_exam", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "catalogue_name": { + "name": "catalogue_name", + "type": "varchar", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.ap_exam_reward": { + "name": "ap_exam_reward", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "units_granted": { + "name": "units_granted", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "elective_units_granted": { + "name": "elective_units_granted", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "ge_1a_courses_granted": { + "name": "ge_1a_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_1b_courses_granted": { + "name": "ge_1b_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_2_courses_granted": { + "name": "ge_2_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_3_courses_granted": { + "name": "ge_3_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_4_courses_granted": { + "name": "ge_4_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_5a_courses_granted": { + "name": "ge_5a_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_5b_courses_granted": { + "name": "ge_5b_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_6_courses_granted": { + "name": "ge_6_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_7_courses_granted": { + "name": "ge_7_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_8_courses_granted": { + "name": "ge_8_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "courses_granted": { + "name": "courses_granted", + "type": "json", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.ap_exam_to_reward": { + "name": "ap_exam_to_reward", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "exam_id": { + "name": "exam_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "score": { + "name": "score", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "reward": { + "name": "reward", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "ap_exam_to_reward_exam_id_score_index": { + "name": "ap_exam_to_reward_exam_id_score_index", + "columns": [ + { + "expression": "exam_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "score", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "ap_exam_to_reward_exam_id_ap_exam_id_fk": { + "name": "ap_exam_to_reward_exam_id_ap_exam_id_fk", + "tableFrom": "ap_exam_to_reward", + "tableTo": "ap_exam", + "columnsFrom": ["exam_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "ap_exam_to_reward_reward_ap_exam_reward_id_fk": { + "name": "ap_exam_to_reward_reward_ap_exam_reward_id_fk", + "tableFrom": "ap_exam_to_reward", + "tableTo": "ap_exam_reward", + "columnsFrom": ["reward"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.calendar_term": { + "name": "calendar_term", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true, + "generated": { + "as": "\"calendar_term\".\"year\" || ' ' || CASE WHEN \"calendar_term\".\"quarter\" = 'Fall' THEN 'Fall' WHEN \"calendar_term\".\"quarter\" = 'Winter' THEN 'Winter' WHEN \"calendar_term\".\"quarter\" = 'Spring' THEN 'Spring' WHEN \"calendar_term\".\"quarter\" = 'Summer1' THEN 'Summer1' WHEN \"calendar_term\".\"quarter\" = 'Summer10wk' THEN 'Summer10wk' WHEN \"calendar_term\".\"quarter\" = 'Summer2' THEN 'Summer2' ELSE '' END", + "type": "stored" + } + }, + "year": { + "name": "year", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "quarter": { + "name": "quarter", + "type": "term", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "instruction_start": { + "name": "instruction_start", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "instruction_end": { + "name": "instruction_end", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "finals_start": { + "name": "finals_start", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "finals_end": { + "name": "finals_end", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "soc_available": { + "name": "soc_available", + "type": "date", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.catalogue_program": { + "name": "catalogue_program", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "program_name": { + "name": "program_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.college_requirement": { + "name": "college_requirement", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "requirements": { + "name": "requirements", + "type": "jsonb", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "college_requirement_requirements_unique": { + "name": "college_requirement_requirements_unique", + "nullsNotDistinct": false, + "columns": ["requirements"] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.course": { + "name": "course", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "department": { + "name": "department", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "shortened_dept": { + "name": "shortened_dept", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "REPLACE(\"course\".\"department\", ' ', '')", + "type": "stored" + } + }, + "department_alias": { + "name": "department_alias", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "course_number": { + "name": "course_number", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_numeric": { + "name": "course_numeric", + "type": "integer", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "CASE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g') WHEN '' THEN 0 ELSE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g')::INTEGER END", + "type": "stored" + } + }, + "school": { + "name": "school", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_level": { + "name": "course_level", + "type": "course_level", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "min_units": { + "name": "min_units", + "type": "numeric(4, 2)", + "primaryKey": false, + "notNull": true + }, + "max_units": { + "name": "max_units", + "type": "numeric(4, 2)", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "department_name": { + "name": "department_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "prerequisite_tree": { + "name": "prerequisite_tree", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "prerequisite_text": { + "name": "prerequisite_text", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "repeatability": { + "name": "repeatability", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "grading_option": { + "name": "grading_option", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "concurrent": { + "name": "concurrent", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "same_as": { + "name": "same_as", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "restriction": { + "name": "restriction", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "overlap": { + "name": "overlap", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "corequisites": { + "name": "corequisites", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "is_ge_1a": { + "name": "is_ge_1a", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_1b": { + "name": "is_ge_1b", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_2": { + "name": "is_ge_2", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_3": { + "name": "is_ge_3", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_4": { + "name": "is_ge_4", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_5a": { + "name": "is_ge_5a", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_5b": { + "name": "is_ge_5b", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_6": { + "name": "is_ge_6", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_7": { + "name": "is_ge_7", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_8": { + "name": "is_ge_8", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "ge_text": { + "name": "ge_text", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "course_search_index": { + "name": "course_search_index", + "columns": [ + { + "expression": "(\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"id\", '')), 'A') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"department\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"department_alias\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"shortened_dept\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"course_number\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"course_numeric\"::TEXT, '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"title\", '')), 'C') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"description\", '')), 'D')\n)", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "gin", + "with": {} + }, + "shortened_dept": { + "name": "shortened_dept", + "columns": [ + { + "expression": "shortened_dept", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.degree": { + "name": "degree", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "division": { + "name": "division", + "type": "division", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.instructor": { + "name": "instructor", + "schema": "", + "columns": { + "ucinetid": { + "name": "ucinetid", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "email": { + "name": "email", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "department": { + "name": "department", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "instructor_search_index": { + "name": "instructor_search_index", + "columns": [ + { + "expression": "(\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"ucinetid\", '')), 'A') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"name\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"title\", '')), 'B')\n)", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "gin", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.instructor_to_websoc_instructor": { + "name": "instructor_to_websoc_instructor", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "instructor_ucinetid": { + "name": "instructor_ucinetid", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "websoc_instructor_name": { + "name": "websoc_instructor_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "instructor_to_websoc_instructor_instructor_ucinetid_index": { + "name": "instructor_to_websoc_instructor_instructor_ucinetid_index", + "columns": [ + { + "expression": "instructor_ucinetid", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "instructor_to_websoc_instructor_websoc_instructor_name_index": { + "name": "instructor_to_websoc_instructor_websoc_instructor_name_index", + "columns": [ + { + "expression": "websoc_instructor_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "instructor_to_websoc_instructor_instructor_ucinetid_websoc_instructor_name_index": { + "name": "instructor_to_websoc_instructor_instructor_ucinetid_websoc_instructor_name_index", + "columns": [ + { + "expression": "instructor_ucinetid", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "websoc_instructor_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "instructor_to_websoc_instructor_instructor_ucinetid_instructor_ucinetid_fk": { + "name": "instructor_to_websoc_instructor_instructor_ucinetid_instructor_ucinetid_fk", + "tableFrom": "instructor_to_websoc_instructor", + "tableTo": "instructor", + "columnsFrom": ["instructor_ucinetid"], + "columnsTo": ["ucinetid"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "instructor_to_websoc_instructor_websoc_instructor_name_websoc_instructor_name_fk": { + "name": "instructor_to_websoc_instructor_websoc_instructor_name_websoc_instructor_name_fk", + "tableFrom": "instructor_to_websoc_instructor", + "tableTo": "websoc_instructor", + "columnsFrom": ["websoc_instructor_name"], + "columnsTo": ["name"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.larc_section": { + "name": "larc_section", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "course_id": { + "name": "course_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "days_string": { + "name": "days_string", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "time_string": { + "name": "time_string", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "start_time": { + "name": "start_time", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "end_time": { + "name": "end_time", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "instructor": { + "name": "instructor", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "building": { + "name": "building", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "meets_monday": { + "name": "meets_monday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_tuesday": { + "name": "meets_tuesday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_wednesday": { + "name": "meets_wednesday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_thursday": { + "name": "meets_thursday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_friday": { + "name": "meets_friday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_saturday": { + "name": "meets_saturday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_sunday": { + "name": "meets_sunday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": { + "larc_section_course_id_index": { + "name": "larc_section_course_id_index", + "columns": [ + { + "expression": "course_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "larc_section_course_id_websoc_course_id_fk": { + "name": "larc_section_course_id_websoc_course_id_fk", + "tableFrom": "larc_section", + "tableTo": "websoc_course", + "columnsFrom": ["course_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.library_traffic": { + "name": "library_traffic", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true + }, + "library_name": { + "name": "library_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "location_name": { + "name": "location_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "traffic_count": { + "name": "traffic_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "traffic_percentage": { + "name": "traffic_percentage", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "timestamp": { + "name": "timestamp", + "type": "timestamp", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "library_traffic_library_name_index": { + "name": "library_traffic_library_name_index", + "columns": [ + { + "expression": "library_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "library_traffic_location_name_index": { + "name": "library_traffic_location_name_index", + "columns": [ + { + "expression": "location_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.library_traffic_history": { + "name": "library_traffic_history", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "location_id": { + "name": "location_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "traffic_count": { + "name": "traffic_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "traffic_percentage": { + "name": "traffic_percentage", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "timestamp": { + "name": "timestamp", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "library_traffic_history_location_id_timestamp_index": { + "name": "library_traffic_history_location_id_timestamp_index", + "columns": [ + { + "expression": "location_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "timestamp", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "library_traffic_history_location_id_library_traffic_id_fk": { + "name": "library_traffic_history_location_id_library_traffic_id_fk", + "tableFrom": "library_traffic_history", + "tableTo": "library_traffic", + "columnsFrom": ["location_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.major": { + "name": "major", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "degree_id": { + "name": "degree_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "code": { + "name": "code", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "require_spec": { + "name": "require_spec", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "college_requirement": { + "name": "college_requirement", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "requirements": { + "name": "requirements", + "type": "json", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "major_degree_id_index": { + "name": "major_degree_id_index", + "columns": [ + { + "expression": "degree_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "major_college_requirement_index": { + "name": "major_college_requirement_index", + "columns": [ + { + "expression": "college_requirement", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "major_degree_id_degree_id_fk": { + "name": "major_degree_id_degree_id_fk", + "tableFrom": "major", + "tableTo": "degree", + "columnsFrom": ["degree_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "major_college_requirement_college_requirement_id_fk": { + "name": "major_college_requirement_college_requirement_id_fk", + "tableFrom": "major", + "tableTo": "college_requirement", + "columnsFrom": ["college_requirement"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.minor": { + "name": "minor", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "requirements": { + "name": "requirements", + "type": "json", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.prerequisite": { + "name": "prerequisite", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "dep_dept": { + "name": "dep_dept", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "prerequisite_id": { + "name": "prerequisite_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "dependency_id": { + "name": "dependency_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "prerequisite_dep_dept_index": { + "name": "prerequisite_dep_dept_index", + "columns": [ + { + "expression": "dep_dept", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "prerequisite_prerequisite_id_index": { + "name": "prerequisite_prerequisite_id_index", + "columns": [ + { + "expression": "prerequisite_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "prerequisite_dependency_id_index": { + "name": "prerequisite_dependency_id_index", + "columns": [ + { + "expression": "dependency_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "prerequisite_prerequisite_id_dependency_id_index": { + "name": "prerequisite_prerequisite_id_dependency_id_index", + "columns": [ + { + "expression": "prerequisite_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "dependency_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.sample_program_variation": { + "name": "sample_program_variation", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "program_id": { + "name": "program_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "label": { + "name": "label", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "sample_program": { + "name": "sample_program", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "variation_notes": { + "name": "variation_notes", + "type": "varchar[]", + "primaryKey": false, + "notNull": true, + "default": "ARRAY[]::VARCHAR[]" + } + }, + "indexes": {}, + "foreignKeys": { + "sample_program_variation_program_id_catalogue_program_id_fk": { + "name": "sample_program_variation_program_id_catalogue_program_id_fk", + "tableFrom": "sample_program_variation", + "tableTo": "catalogue_program", + "columnsFrom": ["program_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.school_requirement": { + "name": "school_requirement", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "requirements": { + "name": "requirements", + "type": "json", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.specialization": { + "name": "specialization", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "major_id": { + "name": "major_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "requirements": { + "name": "requirements", + "type": "json", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "specialization_major_id_index": { + "name": "specialization_major_id_index", + "columns": [ + { + "expression": "major_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "specialization_major_id_major_id_fk": { + "name": "specialization_major_id_major_id_fk", + "tableFrom": "specialization", + "tableTo": "major", + "columnsFrom": ["major_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.study_location": { + "name": "study_location", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.study_room": { + "name": "study_room", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "capacity": { + "name": "capacity", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "location": { + "name": "location", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "directions": { + "name": "directions", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "tech_enhanced": { + "name": "tech_enhanced", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "study_location_id": { + "name": "study_location_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "study_room_study_location_id_index": { + "name": "study_room_study_location_id_index", + "columns": [ + { + "expression": "study_location_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "study_room_study_location_id_study_location_id_fk": { + "name": "study_room_study_location_id_study_location_id_fk", + "tableFrom": "study_room", + "tableTo": "study_location", + "columnsFrom": ["study_location_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.study_room_slot": { + "name": "study_room_slot", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "study_room_id": { + "name": "study_room_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "start": { + "name": "start", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "end": { + "name": "end", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "is_available": { + "name": "is_available", + "type": "boolean", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "study_room_slot_study_room_id_index": { + "name": "study_room_slot_study_room_id_index", + "columns": [ + { + "expression": "study_room_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "study_room_slot_study_room_id_start_end_index": { + "name": "study_room_slot_study_room_id_start_end_index", + "columns": [ + { + "expression": "study_room_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "start", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "end", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "study_room_slot_study_room_id_study_room_id_fk": { + "name": "study_room_slot_study_room_id_study_room_id_fk", + "tableFrom": "study_room_slot", + "tableTo": "study_room", + "columnsFrom": ["study_room_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_course": { + "name": "websoc_course", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "department_id": { + "name": "department_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "course_id": { + "name": "course_id", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "REPLACE(\"websoc_course\".\"dept_code\", ' ', '') || \"websoc_course\".\"course_number\"", + "type": "stored" + } + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "year": { + "name": "year", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "quarter": { + "name": "quarter", + "type": "term", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "school_name": { + "name": "school_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "dept_code": { + "name": "dept_code", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_title": { + "name": "course_title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_number": { + "name": "course_number", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_numeric": { + "name": "course_numeric", + "type": "integer", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "CASE REGEXP_REPLACE(\"websoc_course\".\"course_number\", '\\D', '', 'g') WHEN '' THEN 0 ELSE REGEXP_REPLACE(\"websoc_course\".\"course_number\", '\\D', '', 'g')::INTEGER END", + "type": "stored" + } + }, + "course_comment": { + "name": "course_comment", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "prerequisite_link": { + "name": "prerequisite_link", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "is_ge_1a": { + "name": "is_ge_1a", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_1b": { + "name": "is_ge_1b", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_2": { + "name": "is_ge_2", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_3": { + "name": "is_ge_3", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_4": { + "name": "is_ge_4", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_5a": { + "name": "is_ge_5a", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_5b": { + "name": "is_ge_5b", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_6": { + "name": "is_ge_6", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_7": { + "name": "is_ge_7", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_8": { + "name": "is_ge_8", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": { + "websoc_course_department_id_index": { + "name": "websoc_course_department_id_index", + "columns": [ + { + "expression": "department_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_course_id_index": { + "name": "websoc_course_course_id_index", + "columns": [ + { + "expression": "course_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_school_name_dept_code_course_number_course_title_index": { + "name": "websoc_course_year_quarter_school_name_dept_code_course_number_course_title_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "school_name", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "dept_code", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "course_number", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "course_title", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_1a_index": { + "name": "websoc_course_year_quarter_is_ge_1a_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_1a", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_1b_index": { + "name": "websoc_course_year_quarter_is_ge_1b_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_1b", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_2_index": { + "name": "websoc_course_year_quarter_is_ge_2_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_2", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_3_index": { + "name": "websoc_course_year_quarter_is_ge_3_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_3", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_4_index": { + "name": "websoc_course_year_quarter_is_ge_4_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_4", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_5a_index": { + "name": "websoc_course_year_quarter_is_ge_5a_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_5a", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_5b_index": { + "name": "websoc_course_year_quarter_is_ge_5b_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_5b", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_6_index": { + "name": "websoc_course_year_quarter_is_ge_6_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_6", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_7_index": { + "name": "websoc_course_year_quarter_is_ge_7_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_7", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_8_index": { + "name": "websoc_course_year_quarter_is_ge_8_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_8", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_dept_code_index": { + "name": "websoc_course_year_quarter_dept_code_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "dept_code", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_dept_code_course_number_index": { + "name": "websoc_course_year_quarter_dept_code_course_number_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "dept_code", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "course_number", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_course_department_id_websoc_department_id_fk": { + "name": "websoc_course_department_id_websoc_department_id_fk", + "tableFrom": "websoc_course", + "tableTo": "websoc_department", + "columnsFrom": ["department_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_department": { + "name": "websoc_department", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "school_id": { + "name": "school_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "year": { + "name": "year", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "quarter": { + "name": "quarter", + "type": "term", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "dept_code": { + "name": "dept_code", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "dept_name": { + "name": "dept_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "dept_comment": { + "name": "dept_comment", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "section_code_range_comments": { + "name": "section_code_range_comments", + "type": "text[]", + "primaryKey": false, + "notNull": true + }, + "course_number_range_comments": { + "name": "course_number_range_comments", + "type": "text[]", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "websoc_department_school_id_index": { + "name": "websoc_department_school_id_index", + "columns": [ + { + "expression": "school_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_department_year_quarter_school_id_dept_code_index": { + "name": "websoc_department_year_quarter_school_id_dept_code_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "school_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "dept_code", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_department_school_id_websoc_school_id_fk": { + "name": "websoc_department_school_id_websoc_school_id_fk", + "tableFrom": "websoc_department", + "tableTo": "websoc_school", + "columnsFrom": ["school_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_instructor": { + "name": "websoc_instructor", + "schema": "", + "columns": { + "name": { + "name": "name", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_location": { + "name": "websoc_location", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "building": { + "name": "building", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "room": { + "name": "room", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "websoc_location_building_room_index": { + "name": "websoc_location_building_room_index", + "columns": [ + { + "expression": "building", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "room", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_meta": { + "name": "websoc_meta", + "schema": "", + "columns": { + "name": { + "name": "name", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "last_scraped": { + "name": "last_scraped", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "last_dept_scraped": { + "name": "last_dept_scraped", + "type": "varchar", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_school": { + "name": "websoc_school", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "year": { + "name": "year", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "quarter": { + "name": "quarter", + "type": "term", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "school_name": { + "name": "school_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "school_comment": { + "name": "school_comment", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "websoc_school_year_quarter_school_name_index": { + "name": "websoc_school_year_quarter_school_name_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "school_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_section": { + "name": "websoc_section", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "course_id": { + "name": "course_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "year": { + "name": "year", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "quarter": { + "name": "quarter", + "type": "term", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "units": { + "name": "units", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "websoc_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "instructors": { + "name": "instructors", + "type": "text[]", + "primaryKey": false, + "notNull": true + }, + "meetings": { + "name": "meetings", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "final_exam_string": { + "name": "final_exam_string", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "final_exam": { + "name": "final_exam", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "section_num": { + "name": "section_num", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "max_capacity": { + "name": "max_capacity", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "section_code": { + "name": "section_code", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "section_type": { + "name": "section_type", + "type": "websoc_section_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "num_requested": { + "name": "num_requested", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "restriction_string": { + "name": "restriction_string", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "restriction_a": { + "name": "restriction_a", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_b": { + "name": "restriction_b", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_c": { + "name": "restriction_c", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_d": { + "name": "restriction_d", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_e": { + "name": "restriction_e", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_f": { + "name": "restriction_f", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_g": { + "name": "restriction_g", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_h": { + "name": "restriction_h", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_i": { + "name": "restriction_i", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_j": { + "name": "restriction_j", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_k": { + "name": "restriction_k", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_l": { + "name": "restriction_l", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_m": { + "name": "restriction_m", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_n": { + "name": "restriction_n", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_o": { + "name": "restriction_o", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_r": { + "name": "restriction_r", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_s": { + "name": "restriction_s", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_x": { + "name": "restriction_x", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "num_on_waitlist": { + "name": "num_on_waitlist", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_waitlist_cap": { + "name": "num_waitlist_cap", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "section_comment": { + "name": "section_comment", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "num_new_only_reserved": { + "name": "num_new_only_reserved", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_currently_total_enrolled": { + "name": "num_currently_total_enrolled", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_currently_section_enrolled": { + "name": "num_currently_section_enrolled", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "is_cancelled": { + "name": "is_cancelled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "\"websoc_section\".\"section_comment\" LIKE '%*** CANCELLED ***%' OR \"websoc_section\".\"section_comment\" LIKE '%*** CANCELED ***%'", + "type": "stored" + } + }, + "web_url": { + "name": "web_url", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "''" + } + }, + "indexes": { + "websoc_section_course_id_index": { + "name": "websoc_section_course_id_index", + "columns": [ + { + "expression": "course_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_section_year_quarter_section_code_index": { + "name": "websoc_section_year_quarter_section_code_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "section_code", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_section_course_id_websoc_course_id_fk": { + "name": "websoc_section_course_id_websoc_course_id_fk", + "tableFrom": "websoc_section", + "tableTo": "websoc_course", + "columnsFrom": ["course_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_section_enrollment": { + "name": "websoc_section_enrollment", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "section_id": { + "name": "section_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "date", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "year": { + "name": "year", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "quarter": { + "name": "quarter", + "type": "term", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "max_capacity": { + "name": "max_capacity", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "num_currently_total_enrolled": { + "name": "num_currently_total_enrolled", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_on_waitlist": { + "name": "num_on_waitlist", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_waitlist_cap": { + "name": "num_waitlist_cap", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_requested": { + "name": "num_requested", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_new_only_reserved": { + "name": "num_new_only_reserved", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "websoc_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "websoc_section_enrollment_section_id_index": { + "name": "websoc_section_enrollment_section_id_index", + "columns": [ + { + "expression": "section_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_section_enrollment_section_id_created_at_index": { + "name": "websoc_section_enrollment_section_id_created_at_index", + "columns": [ + { + "expression": "section_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_section_enrollment_section_id_websoc_section_id_fk": { + "name": "websoc_section_enrollment_section_id_websoc_section_id_fk", + "tableFrom": "websoc_section_enrollment", + "tableTo": "websoc_section", + "columnsFrom": ["section_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_section_grade": { + "name": "websoc_section_grade", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "section_id": { + "name": "section_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "grade_a_count": { + "name": "grade_a_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_b_count": { + "name": "grade_b_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_c_count": { + "name": "grade_c_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_d_count": { + "name": "grade_d_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_f_count": { + "name": "grade_f_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_p_count": { + "name": "grade_p_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_np_count": { + "name": "grade_np_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_w_count": { + "name": "grade_w_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "average_gpa": { + "name": "average_gpa", + "type": "numeric(3, 2)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "websoc_section_grade_section_id_index": { + "name": "websoc_section_grade_section_id_index", + "columns": [ + { + "expression": "section_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_section_grade_section_id_websoc_section_id_fk": { + "name": "websoc_section_grade_section_id_websoc_section_id_fk", + "tableFrom": "websoc_section_grade", + "tableTo": "websoc_section", + "columnsFrom": ["section_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "websoc_section_grade_section_id_unique": { + "name": "websoc_section_grade_section_id_unique", + "nullsNotDistinct": false, + "columns": ["section_id"] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_section_meeting": { + "name": "websoc_section_meeting", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "section_id": { + "name": "section_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "section_code": { + "name": "section_code", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "meeting_index": { + "name": "meeting_index", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "time_string": { + "name": "time_string", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "time_is_tba": { + "name": "time_is_tba", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "\"websoc_section_meeting\".\"time_string\" LIKE '%TBA%'", + "type": "stored" + } + }, + "start_time": { + "name": "start_time", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "end_time": { + "name": "end_time", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "days_string": { + "name": "days_string", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "meets_monday": { + "name": "meets_monday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_tuesday": { + "name": "meets_tuesday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_wednesday": { + "name": "meets_wednesday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_thursday": { + "name": "meets_thursday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_friday": { + "name": "meets_friday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_saturday": { + "name": "meets_saturday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_sunday": { + "name": "meets_sunday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": { + "websoc_section_meeting_section_id_index": { + "name": "websoc_section_meeting_section_id_index", + "columns": [ + { + "expression": "section_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_section_meeting_section_id_websoc_section_id_fk": { + "name": "websoc_section_meeting_section_id_websoc_section_id_fk", + "tableFrom": "websoc_section_meeting", + "tableTo": "websoc_section", + "columnsFrom": ["section_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_section_meeting_to_location": { + "name": "websoc_section_meeting_to_location", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "meeting_id": { + "name": "meeting_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "location_id": { + "name": "location_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "websoc_section_meeting_to_location_meeting_id_index": { + "name": "websoc_section_meeting_to_location_meeting_id_index", + "columns": [ + { + "expression": "meeting_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_section_meeting_to_location_location_id_index": { + "name": "websoc_section_meeting_to_location_location_id_index", + "columns": [ + { + "expression": "location_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_section_meeting_to_location_meeting_id_location_id_index": { + "name": "websoc_section_meeting_to_location_meeting_id_location_id_index", + "columns": [ + { + "expression": "meeting_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "location_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_section_meeting_to_location_meeting_id_websoc_section_meeting_id_fk": { + "name": "websoc_section_meeting_to_location_meeting_id_websoc_section_meeting_id_fk", + "tableFrom": "websoc_section_meeting_to_location", + "tableTo": "websoc_section_meeting", + "columnsFrom": ["meeting_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "websoc_section_meeting_to_location_location_id_websoc_location_id_fk": { + "name": "websoc_section_meeting_to_location_location_id_websoc_location_id_fk", + "tableFrom": "websoc_section_meeting_to_location", + "tableTo": "websoc_location", + "columnsFrom": ["location_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_section_to_instructor": { + "name": "websoc_section_to_instructor", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "section_id": { + "name": "section_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "instructor_name": { + "name": "instructor_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "websoc_section_to_instructor_section_id_index": { + "name": "websoc_section_to_instructor_section_id_index", + "columns": [ + { + "expression": "section_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_section_to_instructor_instructor_name_index": { + "name": "websoc_section_to_instructor_instructor_name_index", + "columns": [ + { + "expression": "instructor_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_section_to_instructor_section_id_websoc_section_id_fk": { + "name": "websoc_section_to_instructor_section_id_websoc_section_id_fk", + "tableFrom": "websoc_section_to_instructor", + "tableTo": "websoc_section", + "columnsFrom": ["section_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "websoc_section_to_instructor_instructor_name_websoc_instructor_name_fk": { + "name": "websoc_section_to_instructor_instructor_name_websoc_instructor_name_fk", + "tableFrom": "websoc_section_to_instructor", + "tableTo": "websoc_instructor", + "columnsFrom": ["instructor_name"], + "columnsTo": ["name"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": { + "public.course_level": { + "name": "course_level", + "schema": "public", + "values": ["LowerDiv", "UpperDiv", "Graduate"] + }, + "public.division": { + "name": "division", + "schema": "public", + "values": ["Undergraduate", "Graduate"] + }, + "public.term": { + "name": "term", + "schema": "public", + "values": ["Fall", "Winter", "Spring", "Summer1", "Summer10wk", "Summer2"] + }, + "public.websoc_section_type": { + "name": "websoc_section_type", + "schema": "public", + "values": [ + "Act", + "Col", + "Dis", + "Fld", + "Lab", + "Lec", + "Qiz", + "Res", + "Sem", + "Stu", + "Tap", + "Tut" + ] + }, + "public.websoc_status": { + "name": "websoc_status", + "schema": "public", + "values": ["OPEN", "Waitl", "FULL", "NewOnly"] + } + }, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": { + "public.course_view": { + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "department": { + "name": "department", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "shortened_dept": { + "name": "shortened_dept", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "REPLACE(\"course\".\"department\", ' ', '')", + "type": "stored" + } + }, + "department_alias": { + "name": "department_alias", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "course_number": { + "name": "course_number", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_numeric": { + "name": "course_numeric", + "type": "integer", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "CASE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g') WHEN '' THEN 0 ELSE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g')::INTEGER END", + "type": "stored" + } + }, + "school": { + "name": "school", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_level": { + "name": "course_level", + "type": "course_level", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "min_units": { + "name": "min_units", + "type": "numeric(4, 2)", + "primaryKey": false, + "notNull": true + }, + "max_units": { + "name": "max_units", + "type": "numeric(4, 2)", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "department_name": { + "name": "department_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "prerequisite_tree": { + "name": "prerequisite_tree", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "prerequisite_text": { + "name": "prerequisite_text", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "repeatability": { + "name": "repeatability", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "grading_option": { + "name": "grading_option", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "concurrent": { + "name": "concurrent", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "same_as": { + "name": "same_as", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "restriction": { + "name": "restriction", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "overlap": { + "name": "overlap", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "corequisites": { + "name": "corequisites", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "is_ge_1a": { + "name": "is_ge_1a", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_1b": { + "name": "is_ge_1b", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_2": { + "name": "is_ge_2", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_3": { + "name": "is_ge_3", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_4": { + "name": "is_ge_4", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_5a": { + "name": "is_ge_5a", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_5b": { + "name": "is_ge_5b", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_6": { + "name": "is_ge_6", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_7": { + "name": "is_ge_7", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_8": { + "name": "is_ge_8", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "ge_text": { + "name": "ge_text", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "definition": "select \"course\".\"id\", \"course\".\"updated_at\", \"course\".\"department\", \"course\".\"shortened_dept\", \"course\".\"department_alias\", \"course\".\"course_number\", \"course\".\"course_numeric\", \"course\".\"school\", \"course\".\"title\", \"course\".\"course_level\", \"course\".\"min_units\", \"course\".\"max_units\", \"course\".\"description\", \"course\".\"department_name\", \"course\".\"prerequisite_tree\", \"course\".\"prerequisite_text\", \"course\".\"repeatability\", \"course\".\"grading_option\", \"course\".\"concurrent\", \"course\".\"same_as\", \"course\".\"restriction\", \"course\".\"overlap\", \"course\".\"corequisites\", \"course\".\"is_ge_1a\", \"course\".\"is_ge_1b\", \"course\".\"is_ge_2\", \"course\".\"is_ge_3\", \"course\".\"is_ge_4\", \"course\".\"is_ge_5a\", \"course\".\"is_ge_5b\", \"course\".\"is_ge_6\", \"course\".\"is_ge_7\", \"course\".\"is_ge_8\", \"course\".\"ge_text\", \n ARRAY_REMOVE(COALESCE(\n (\n SELECT ARRAY_AGG(\n CASE WHEN \"prerequisite_course\".\"id\" IS NULL THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'id', \"prerequisite_course\".\"id\",\n 'title', \"prerequisite_course\".\"title\",\n 'department', \"prerequisite_course\".\"department\",\n 'courseNumber', \"prerequisite_course\".\"course_number\"\n )\n END\n )\n FROM \"prerequisite\"\n LEFT JOIN \"course\" \"prerequisite_course\" ON \"prerequisite_course\".\"id\" = \"prerequisite\".\"prerequisite_id\"\n WHERE \"prerequisite\".\"dependency_id\" = \"course\".\"id\"\n ),\n ARRAY[]::JSONB[]), NULL)\n as \"prerequisites\", \n ARRAY_REMOVE(COALESCE(\n (\n SELECT ARRAY_AGG(\n CASE WHEN \"dependency_course\".\"id\" IS NULL THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'id', \"dependency_course\".\"id\",\n 'title', \"dependency_course\".\"title\",\n 'department', \"dependency_course\".\"department\",\n 'courseNumber', \"dependency_course\".\"course_number\"\n )\n END\n )\n FROM \"prerequisite\" \"dependency\"\n LEFT JOIN \"course\" \"dependency_course\" ON \"dependency_course\".\"id\" = \"dependency\".\"dependency_id\"\n WHERE \"dependency\".\"prerequisite_id\" = \"course\".\"id\"\n ),\n ARRAY[]::JSONB[]), NULL)\n as \"dependencies\", \n ARRAY_REMOVE(ARRAY_AGG(DISTINCT\n CASE WHEN \"websoc_course\".\"year\" IS NULL THEN NULL\n ELSE CONCAT(\"websoc_course\".\"year\", ' ', \"websoc_course\".\"quarter\")\n END\n ), NULL)\n as \"terms\", \n ARRAY_REMOVE(COALESCE(ARRAY_AGG(DISTINCT\n CASE WHEN \"instructor\".\"ucinetid\" IS NULL THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'ucinetid', \"instructor\".\"ucinetid\",\n 'name', \"instructor\".\"name\",\n 'title', \"instructor\".\"title\",\n 'email', \"instructor\".\"email\",\n 'department', \"instructor\".\"department\",\n 'shortenedNames', ARRAY(\n SELECT \"instructor_to_websoc_instructor\".\"websoc_instructor_name\"\n FROM \"instructor_to_websoc_instructor\"\n WHERE \"instructor_to_websoc_instructor\".\"instructor_ucinetid\" = \"instructor\".\"ucinetid\"\n )\n )\n END\n ), ARRAY[]::JSONB[]), NULL)\n as \"instructors\" from \"course\" left join \"websoc_course\" on \"websoc_course\".\"course_id\" = \"course\".\"id\" left join \"websoc_section\" on \"websoc_section\".\"course_id\" = \"websoc_course\".\"id\" left join \"websoc_section_to_instructor\" on \"websoc_section_to_instructor\".\"section_id\" = \"websoc_section\".\"id\" left join \"websoc_instructor\" on \"websoc_instructor\".\"name\" = \"websoc_section_to_instructor\".\"instructor_name\" left join \"instructor_to_websoc_instructor\" on \"instructor_to_websoc_instructor\".\"websoc_instructor_name\" = \"websoc_instructor\".\"name\" left join \"instructor\" on (\"instructor\".\"ucinetid\" = \"instructor_to_websoc_instructor\".\"instructor_ucinetid\" and \"instructor\".\"ucinetid\" is not null and \"instructor\".\"ucinetid\" <> 'student') group by \"course\".\"id\"", + "name": "course_view", + "schema": "public", + "isExisting": false, + "materialized": true + }, + "public.instructor_view": { + "columns": { + "ucinetid": { + "name": "ucinetid", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "email": { + "name": "email", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "department": { + "name": "department", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "definition": "with \"shortened_names_cte\" as (select \"instructor_ucinetid\", ARRAY_AGG(\"websoc_instructor_name\") as \"shortened_names\" from \"instructor_to_websoc_instructor\" group by \"instructor_to_websoc_instructor\".\"instructor_ucinetid\"), \"courses_cte\" as (with \"terms_cte\" as (select \"course\".\"id\", \"instructor_to_websoc_instructor\".\"instructor_ucinetid\", \n ARRAY_REMOVE(ARRAY_AGG(DISTINCT\n CASE WHEN \"websoc_course\".\"year\" IS NULL THEN NULL\n ELSE CONCAT(\"websoc_course\".\"year\", ' ', \"websoc_course\".\"quarter\")\n END\n ), NULL) as \"terms\" from \"course\" left join \"websoc_course\" on \"websoc_course\".\"course_id\" = \"course\".\"id\" left join \"websoc_section\" on \"websoc_section\".\"course_id\" = \"websoc_course\".\"id\" left join \"websoc_section_to_instructor\" on \"websoc_section_to_instructor\".\"section_id\" = \"websoc_section\".\"id\" left join \"websoc_instructor\" on \"websoc_instructor\".\"name\" = \"websoc_section_to_instructor\".\"instructor_name\" left join \"instructor_to_websoc_instructor\" on \"instructor_to_websoc_instructor\".\"websoc_instructor_name\" = \"websoc_instructor\".\"name\" group by \"course\".\"id\", \"instructor_to_websoc_instructor\".\"instructor_ucinetid\") select \"terms_cte\".\"instructor_ucinetid\", \"course\".\"id\", \n CASE WHEN \"course\".\"id\" IS NULL\n THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'id', \"course\".\"id\",\n 'title', \"course\".\"title\",\n 'department', \"course\".\"department\",\n 'courseNumber', \"course\".\"course_number\",\n 'terms', COALESCE(\"terms\", ARRAY[]::TEXT[])\n )\n END\n as \"course_info\" from \"course\" left join \"terms_cte\" on \"terms_cte\".\"id\" = \"course\".\"id\" group by \"course\".\"id\", \"terms_cte\".\"instructor_ucinetid\", \"terms\") select \"instructor\".\"ucinetid\", \"instructor\".\"name\", \"instructor\".\"title\", \"instructor\".\"email\", \"instructor\".\"department\", COALESCE(\"shortened_names\", ARRAY[]::TEXT[]) as \"shortened_names\", \n ARRAY_REMOVE(ARRAY_AGG(DISTINCT \"course_info\"), NULL)\n as \"courses\" from \"instructor\" left join \"shortened_names_cte\" on \"shortened_names_cte\".\"instructor_ucinetid\" = \"instructor\".\"ucinetid\" left join \"courses_cte\" on \"courses_cte\".\"instructor_ucinetid\" = \"instructor\".\"ucinetid\" where \"instructor\".\"ucinetid\" <> 'student' group by \"instructor\".\"ucinetid\", \"shortened_names\"", + "name": "instructor_view", + "schema": "public", + "isExisting": false, + "materialized": true + } + }, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} diff --git a/packages/db/migrations/meta/_journal.json b/packages/db/migrations/meta/_journal.json index 9a7f9aea..9e7c5143 100644 --- a/packages/db/migrations/meta/_journal.json +++ b/packages/db/migrations/meta/_journal.json @@ -162,6 +162,13 @@ "when": 1766088418349, "tag": "0022_fix_websoc_is_cancelled", "breakpoints": true + }, + { + "idx": 23, + "version": "7", + "when": 1770506250379, + "tag": "0023_add_req_spec_to_major", + "breakpoints": true } ] } From ba20f4f85b7f50aea74bf75f143553f151af4cf7 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Mon, 9 Feb 2026 19:23:54 -0800 Subject: [PATCH 15/91] refactored parsedPrograms to store majorDegrees of (major, spec) pairs --- .../src/components/DegreeworksClient.ts | 2 + .../src/components/Scraper.ts | 45 ++++++++++--------- 2 files changed, 27 insertions(+), 20 deletions(-) diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/DegreeworksClient.ts b/apps/data-pipeline/degreeworks-scraper/src/components/DegreeworksClient.ts index c88c340c..d7693958 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/DegreeworksClient.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/DegreeworksClient.ts @@ -95,6 +95,7 @@ export class DegreeworksClient { school: string, majorCode: string, college?: string, + spec?: string, ): Promise< | { college?: Block; @@ -113,6 +114,7 @@ export class DegreeworksClient { goals: [ { code: "MAJOR", value: majorCode }, ...(college ? [{ code: "COLLEGE", value: college }] : []), + ...(spec ? [{ code: "SPEC", value: spec }] : []), ], }), headers: this.headers, diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts index 72206723..65c0dbf8 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts @@ -37,7 +37,9 @@ export class Scraper { private parsedUgradRequirements = new Map(); private parsedMinorPrograms = new Map(); // both undergrad majors and grad programs; tuple of (school, program) - private parsedPrograms = new Map(); + //private parsedPrograms = new Map(); + // both undergrad majors and grad programs; key is tuple of (majorName, specID?), value is tuple of (school, program) + private parsedPrograms = new Map<[string, string?], MajorProgram>(); // (parent major, name, program object) private parsedSpecializations = new Map< string, @@ -142,15 +144,16 @@ export class Scraper { }); } - private async scrapePrograms(degrees: Iterable) { - const ret = new Map(); - for (const [schoolCode, majorCode, degreeCode] of degrees) { + private async scrapePrograms(degrees: Iterable<[ProgramTriplet, string?]>) { + const ret = new Map<[string, string?], MajorProgram>(); + for (const [[schoolCode, majorCode, degreeCode], specCode] of degrees) { const audit = await this.dw.getMajorAudit( degreeCode, // bachelor's degrees probably get an abbreviation starting with B degreeCode.startsWith("B") ? "U" : "G", majorCode, schoolCode, + specCode, ); const majorAudit = audit?.major; @@ -161,23 +164,25 @@ export class Scraper { ); continue; } - - if (ret.has(majorAudit.title)) { + if (ret.keys().some(([title]) => title === majorAudit.title)) { console.log( `Requirements block already exists for "${majorAudit.title}" (majorCode = ${majorCode}, degree = ${degreeCode})`, ); continue; } - ret.set(majorAudit.title, [ - audit?.college - ? await this.ap.parseBlock( - `${schoolCode}-COLLEGE-${majorCode}-${degreeCode}`, - audit?.college, - ) - : undefined, - await this.ap.parseBlock(`${schoolCode}-MAJOR-${majorCode}-${degreeCode}`, majorAudit), - ]); + ret.set( + [majorAudit.title, specCode], + [ + audit?.college + ? await this.ap.parseBlock( + `${schoolCode}-COLLEGE-${majorCode}-${degreeCode}`, + audit?.college, + ) + : undefined, + await this.ap.parseBlock(`${schoolCode}-MAJOR-${majorCode}-${degreeCode}`, majorAudit), + ], + ); console.log( `Requirements block found and parsed for "${majorAudit.title}" (majorCode = ${majorCode}, degree = ${degreeCode})`, @@ -196,7 +201,7 @@ export class Scraper { // as of this commit, this spec is seemingly valid with any major but that's not really true if (specCode === "OACSC") { // "optional american chemical society certification" - const inMap = this.parsedPrograms.get("Major in Chemistry") as MajorProgram; + const inMap = this.parsedPrograms.get(["Major in Chemistry", undefined]) as MajorProgram; return inMap ? [inMap[1]] : []; } @@ -278,7 +283,7 @@ export class Scraper { } console.log("Scraping undergraduate and graduate program requirements"); - this.parsedPrograms = await this.scrapePrograms(validDegrees); + this.parsedPrograms = await this.scrapePrograms(validDegrees.map((d) => [d, undefined])); this.parsedSpecializations = new Map(); console.log("Scraping all specialization requirements"); @@ -387,7 +392,7 @@ export class Scraper { new Set(this.parsedPrograms.entries().map(([, [_s, program]]) => program.degreeType ?? "")), ).map((x): [string, string] => [x, this.degrees?.get(x) ?? ""]), ); - + // Check that this doesn't break! // Post-processing steps. // As of this commit, the only program which seems to require both of @@ -395,7 +400,7 @@ export class Scraper { // cleaner way to address this, but this is such an insanely niche case // that it's probably not worth the effort to write a general solution. - const x = this.parsedPrograms.get("Major in Art History") as MajorProgram; + const x = this.parsedPrograms.get(["Major in Art History", undefined]) as MajorProgram; const y = this.parsedSpecializations.get("AHGEO")?.[2] as DegreeWorksProgram; const z = this.parsedSpecializations.get("AHPER")?.[2] as DegreeWorksProgram; if (x && y && z) { @@ -403,7 +408,7 @@ export class Scraper { x[1].requirements = [...x[1].requirements, ...y.requirements, ...z.requirements]; this.parsedSpecializations.delete("AHGEO"); this.parsedSpecializations.delete("AHPER"); - this.parsedPrograms.set("Major in Art History", x); + this.parsedPrograms.set(["Major in Art History", undefined], x); } this.done = true; From c7c3997dd94476beb2453273b2b2c632ac5a1436 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Mon, 9 Feb 2026 20:17:03 -0800 Subject: [PATCH 16/91] save found major, spec pairs when finding specs --- .../degreeworks-scraper/src/components/Scraper.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts index 65c0dbf8..cb91942e 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts @@ -298,6 +298,7 @@ export class Scraper { console.log(`loading ${this.specializationCache.size} cached specializations`); this.knownSpecializations = await this.dw.getMapping("specializations"); + const foundMajorSpecPairs: [ProgramTriplet, string][] = []; for (const [specCode, specName] of this.knownSpecializations.entries()) { let specBlock: Block | undefined; @@ -347,7 +348,14 @@ export class Scraper { `(majorCode = ${foundMajorAssured.code}, degree = ${foundMajorAssured.degreeType})`, ); - foundMajorAssured.specs.push(specCode); + foundMajorSpecPairs.push([ + [ + foundMajorAssured.degreeType?.startsWith("B") ? "U" : "G", + foundMajorAssured.code, + foundMajorAssured.degreeType, + ] as ProgramTriplet, + specCode, + ]); this.specializationCache.set(specCode, { // we are storing the entire program even though we only need the DegreeWorksProgramId supertype From c561897dda47c6497409dede9746576a7a1a877a Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Tue, 10 Feb 2026 09:46:19 -0800 Subject: [PATCH 17/91] temp commit, upserting is currently broken --- .../src/components/DegreeworksClient.ts | 2 +- .../src/components/Scraper.ts | 8 +- .../degreeworks-scraper/src/index.ts | 18 +- .../migrations/0024_glamorous_maria_hill.sql | 20 + .../db/migrations/meta/0024_snapshot.json | 3903 +++++++++++++++++ packages/db/migrations/meta/_journal.json | 7 + packages/db/src/schema.ts | 11 +- 7 files changed, 3961 insertions(+), 8 deletions(-) create mode 100644 packages/db/migrations/0024_glamorous_maria_hill.sql create mode 100644 packages/db/migrations/meta/0024_snapshot.json diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/DegreeworksClient.ts b/apps/data-pipeline/degreeworks-scraper/src/components/DegreeworksClient.ts index d7693958..60cd3f68 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/DegreeworksClient.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/DegreeworksClient.ts @@ -15,7 +15,7 @@ export class DegreeworksClient { static async new( studentId: string, headers: HeadersInit, - delay = 1000, + delay = 700, ): Promise { const dw = new DegreeworksClient(studentId, headers, delay); /** diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts index cb91942e..a8df6300 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts @@ -164,9 +164,9 @@ export class Scraper { ); continue; } - if (ret.keys().some(([title]) => title === majorAudit.title)) { + if (ret.has([majorAudit.title, specCode])) { console.log( - `Requirements block already exists for "${majorAudit.title}" (majorCode = ${majorCode}, degree = ${degreeCode})`, + `Requirements block already exists for "${majorAudit.title}" with specialization "${specCode ? `with spec: ${specCode}` : ""}" (majorCode = ${majorCode}, degree = ${degreeCode})`, ); continue; } @@ -185,7 +185,7 @@ export class Scraper { ); console.log( - `Requirements block found and parsed for "${majorAudit.title}" (majorCode = ${majorCode}, degree = ${degreeCode})`, + `Requirements block found and parsed for "${majorAudit.title}" ${specCode ? `with spec: ${specCode}` : ""} (majorCode = ${majorCode}, degree = ${degreeCode})`, ); } return ret; @@ -395,6 +395,8 @@ export class Scraper { } } + // this.parsedPrograms = new Map([...this.parsedPrograms, ...await this.scrapePrograms(foundMajorSpecPairs)]) + this.degreesAwarded = new Map( Array.from( new Set(this.parsedPrograms.entries().map(([, [_s, program]]) => program.degreeType ?? "")), diff --git a/apps/data-pipeline/degreeworks-scraper/src/index.ts b/apps/data-pipeline/degreeworks-scraper/src/index.ts index 7aff6de0..0e01f278 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/index.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/index.ts @@ -43,9 +43,9 @@ async function main() { .toArray(); const collegeBlocks = [] as (typeof collegeRequirement.$inferInsert)[]; - const majorData = parsedPrograms - .values() - .map(([college, { name, degreeType, code, requirements }]) => { + let majorData = parsedPrograms + .entries() + .map(([[, specCode], [college, { name, degreeType, code, requirements }]]) => { let collegeBlockIndex: number | undefined; if (college?.requirements) { const wouldInsert = { name: college.name, requirements: college.requirements }; @@ -70,6 +70,7 @@ async function main() { id: `${degreeType}-${code}`, degreeId: degreeType ?? "", code, + specCode, name, requirements, ...(collegeBlockIndex !== undefined ? { collegeBlockIndex } : {}), @@ -77,6 +78,12 @@ async function main() { }) .toArray(); + const majorRequirementData = majorData.map(({ id, specCode, requirements }) => ({ + majorId: id, + specId: specCode, + majorRequirements: requirements, + })); + majorData = majorData.filter(({ specCode }) => specCode === undefined); const minorData = parsedMinorPrograms .values() .map(({ name, code: id, requirements }) => ({ id, name, requirements })) @@ -161,6 +168,11 @@ async function main() { .insert(specialization) .values(specData) .onConflictDoUpdate({ target: major.id, set: conflictUpdateSetAllCols(specialization) }); + // await tx + // .insert(majorRequirement) + // .values(majorRequirementData) + // .onConflictDoNothing() + //.onConflictDoUpdate({target: major.id, set: conflictUpdateSetAllCols(majorRequirement)}) }); exit(0); } diff --git a/packages/db/migrations/0024_glamorous_maria_hill.sql b/packages/db/migrations/0024_glamorous_maria_hill.sql new file mode 100644 index 00000000..df85bb17 --- /dev/null +++ b/packages/db/migrations/0024_glamorous_maria_hill.sql @@ -0,0 +1,20 @@ +CREATE TABLE IF NOT EXISTS "major_requirement" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL, + "major_id" varchar NOT NULL, + "spec_id" varchar, + "requirements" json NOT NULL +); +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "major_requirement" ADD CONSTRAINT "major_requirement_major_id_specialization_id_fk" FOREIGN KEY ("major_id") REFERENCES "public"."specialization"("id") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "major_requirement" ADD CONSTRAINT "major_requirement_spec_id_specialization_id_fk" FOREIGN KEY ("spec_id") REFERENCES "public"."specialization"("id") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +ALTER TABLE "major" DROP COLUMN IF EXISTS "requirements"; \ No newline at end of file diff --git a/packages/db/migrations/meta/0024_snapshot.json b/packages/db/migrations/meta/0024_snapshot.json new file mode 100644 index 00000000..a041dd50 --- /dev/null +++ b/packages/db/migrations/meta/0024_snapshot.json @@ -0,0 +1,3903 @@ +{ + "id": "49339d5c-621f-4a10-a42c-e527106d76f5", + "prevId": "b1dd1ce5-36ad-4ce8-a66d-02dd8630ce63", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.ap_exam": { + "name": "ap_exam", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "catalogue_name": { + "name": "catalogue_name", + "type": "varchar", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.ap_exam_reward": { + "name": "ap_exam_reward", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "units_granted": { + "name": "units_granted", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "elective_units_granted": { + "name": "elective_units_granted", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "ge_1a_courses_granted": { + "name": "ge_1a_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_1b_courses_granted": { + "name": "ge_1b_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_2_courses_granted": { + "name": "ge_2_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_3_courses_granted": { + "name": "ge_3_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_4_courses_granted": { + "name": "ge_4_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_5a_courses_granted": { + "name": "ge_5a_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_5b_courses_granted": { + "name": "ge_5b_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_6_courses_granted": { + "name": "ge_6_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_7_courses_granted": { + "name": "ge_7_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_8_courses_granted": { + "name": "ge_8_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "courses_granted": { + "name": "courses_granted", + "type": "json", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.ap_exam_to_reward": { + "name": "ap_exam_to_reward", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "exam_id": { + "name": "exam_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "score": { + "name": "score", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "reward": { + "name": "reward", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "ap_exam_to_reward_exam_id_score_index": { + "name": "ap_exam_to_reward_exam_id_score_index", + "columns": [ + { + "expression": "exam_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "score", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "ap_exam_to_reward_exam_id_ap_exam_id_fk": { + "name": "ap_exam_to_reward_exam_id_ap_exam_id_fk", + "tableFrom": "ap_exam_to_reward", + "tableTo": "ap_exam", + "columnsFrom": ["exam_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "ap_exam_to_reward_reward_ap_exam_reward_id_fk": { + "name": "ap_exam_to_reward_reward_ap_exam_reward_id_fk", + "tableFrom": "ap_exam_to_reward", + "tableTo": "ap_exam_reward", + "columnsFrom": ["reward"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.calendar_term": { + "name": "calendar_term", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true, + "generated": { + "as": "\"calendar_term\".\"year\" || ' ' || CASE WHEN \"calendar_term\".\"quarter\" = 'Fall' THEN 'Fall' WHEN \"calendar_term\".\"quarter\" = 'Winter' THEN 'Winter' WHEN \"calendar_term\".\"quarter\" = 'Spring' THEN 'Spring' WHEN \"calendar_term\".\"quarter\" = 'Summer1' THEN 'Summer1' WHEN \"calendar_term\".\"quarter\" = 'Summer10wk' THEN 'Summer10wk' WHEN \"calendar_term\".\"quarter\" = 'Summer2' THEN 'Summer2' ELSE '' END", + "type": "stored" + } + }, + "year": { + "name": "year", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "quarter": { + "name": "quarter", + "type": "term", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "instruction_start": { + "name": "instruction_start", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "instruction_end": { + "name": "instruction_end", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "finals_start": { + "name": "finals_start", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "finals_end": { + "name": "finals_end", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "soc_available": { + "name": "soc_available", + "type": "date", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.catalogue_program": { + "name": "catalogue_program", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "program_name": { + "name": "program_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.college_requirement": { + "name": "college_requirement", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "requirements": { + "name": "requirements", + "type": "jsonb", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "college_requirement_requirements_unique": { + "name": "college_requirement_requirements_unique", + "nullsNotDistinct": false, + "columns": ["requirements"] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.course": { + "name": "course", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "department": { + "name": "department", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "shortened_dept": { + "name": "shortened_dept", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "REPLACE(\"course\".\"department\", ' ', '')", + "type": "stored" + } + }, + "department_alias": { + "name": "department_alias", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "course_number": { + "name": "course_number", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_numeric": { + "name": "course_numeric", + "type": "integer", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "CASE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g') WHEN '' THEN 0 ELSE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g')::INTEGER END", + "type": "stored" + } + }, + "school": { + "name": "school", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_level": { + "name": "course_level", + "type": "course_level", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "min_units": { + "name": "min_units", + "type": "numeric(4, 2)", + "primaryKey": false, + "notNull": true + }, + "max_units": { + "name": "max_units", + "type": "numeric(4, 2)", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "department_name": { + "name": "department_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "prerequisite_tree": { + "name": "prerequisite_tree", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "prerequisite_text": { + "name": "prerequisite_text", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "repeatability": { + "name": "repeatability", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "grading_option": { + "name": "grading_option", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "concurrent": { + "name": "concurrent", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "same_as": { + "name": "same_as", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "restriction": { + "name": "restriction", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "overlap": { + "name": "overlap", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "corequisites": { + "name": "corequisites", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "is_ge_1a": { + "name": "is_ge_1a", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_1b": { + "name": "is_ge_1b", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_2": { + "name": "is_ge_2", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_3": { + "name": "is_ge_3", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_4": { + "name": "is_ge_4", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_5a": { + "name": "is_ge_5a", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_5b": { + "name": "is_ge_5b", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_6": { + "name": "is_ge_6", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_7": { + "name": "is_ge_7", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_8": { + "name": "is_ge_8", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "ge_text": { + "name": "ge_text", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "course_search_index": { + "name": "course_search_index", + "columns": [ + { + "expression": "(\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"id\", '')), 'A') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"department\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"department_alias\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"shortened_dept\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"course_number\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"course_numeric\"::TEXT, '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"title\", '')), 'C') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"description\", '')), 'D')\n)", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "gin", + "with": {} + }, + "shortened_dept": { + "name": "shortened_dept", + "columns": [ + { + "expression": "shortened_dept", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.degree": { + "name": "degree", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "division": { + "name": "division", + "type": "division", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.instructor": { + "name": "instructor", + "schema": "", + "columns": { + "ucinetid": { + "name": "ucinetid", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "email": { + "name": "email", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "department": { + "name": "department", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "instructor_search_index": { + "name": "instructor_search_index", + "columns": [ + { + "expression": "(\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"ucinetid\", '')), 'A') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"name\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"title\", '')), 'B')\n)", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "gin", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.instructor_to_websoc_instructor": { + "name": "instructor_to_websoc_instructor", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "instructor_ucinetid": { + "name": "instructor_ucinetid", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "websoc_instructor_name": { + "name": "websoc_instructor_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "instructor_to_websoc_instructor_instructor_ucinetid_index": { + "name": "instructor_to_websoc_instructor_instructor_ucinetid_index", + "columns": [ + { + "expression": "instructor_ucinetid", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "instructor_to_websoc_instructor_websoc_instructor_name_index": { + "name": "instructor_to_websoc_instructor_websoc_instructor_name_index", + "columns": [ + { + "expression": "websoc_instructor_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "instructor_to_websoc_instructor_instructor_ucinetid_websoc_instructor_name_index": { + "name": "instructor_to_websoc_instructor_instructor_ucinetid_websoc_instructor_name_index", + "columns": [ + { + "expression": "instructor_ucinetid", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "websoc_instructor_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "instructor_to_websoc_instructor_instructor_ucinetid_instructor_ucinetid_fk": { + "name": "instructor_to_websoc_instructor_instructor_ucinetid_instructor_ucinetid_fk", + "tableFrom": "instructor_to_websoc_instructor", + "tableTo": "instructor", + "columnsFrom": ["instructor_ucinetid"], + "columnsTo": ["ucinetid"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "instructor_to_websoc_instructor_websoc_instructor_name_websoc_instructor_name_fk": { + "name": "instructor_to_websoc_instructor_websoc_instructor_name_websoc_instructor_name_fk", + "tableFrom": "instructor_to_websoc_instructor", + "tableTo": "websoc_instructor", + "columnsFrom": ["websoc_instructor_name"], + "columnsTo": ["name"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.larc_section": { + "name": "larc_section", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "course_id": { + "name": "course_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "days_string": { + "name": "days_string", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "time_string": { + "name": "time_string", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "start_time": { + "name": "start_time", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "end_time": { + "name": "end_time", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "instructor": { + "name": "instructor", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "building": { + "name": "building", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "meets_monday": { + "name": "meets_monday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_tuesday": { + "name": "meets_tuesday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_wednesday": { + "name": "meets_wednesday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_thursday": { + "name": "meets_thursday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_friday": { + "name": "meets_friday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_saturday": { + "name": "meets_saturday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_sunday": { + "name": "meets_sunday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": { + "larc_section_course_id_index": { + "name": "larc_section_course_id_index", + "columns": [ + { + "expression": "course_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "larc_section_course_id_websoc_course_id_fk": { + "name": "larc_section_course_id_websoc_course_id_fk", + "tableFrom": "larc_section", + "tableTo": "websoc_course", + "columnsFrom": ["course_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.library_traffic": { + "name": "library_traffic", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true + }, + "library_name": { + "name": "library_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "location_name": { + "name": "location_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "traffic_count": { + "name": "traffic_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "traffic_percentage": { + "name": "traffic_percentage", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "timestamp": { + "name": "timestamp", + "type": "timestamp", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "library_traffic_library_name_index": { + "name": "library_traffic_library_name_index", + "columns": [ + { + "expression": "library_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "library_traffic_location_name_index": { + "name": "library_traffic_location_name_index", + "columns": [ + { + "expression": "location_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.library_traffic_history": { + "name": "library_traffic_history", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "location_id": { + "name": "location_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "traffic_count": { + "name": "traffic_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "traffic_percentage": { + "name": "traffic_percentage", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "timestamp": { + "name": "timestamp", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "library_traffic_history_location_id_timestamp_index": { + "name": "library_traffic_history_location_id_timestamp_index", + "columns": [ + { + "expression": "location_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "timestamp", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "library_traffic_history_location_id_library_traffic_id_fk": { + "name": "library_traffic_history_location_id_library_traffic_id_fk", + "tableFrom": "library_traffic_history", + "tableTo": "library_traffic", + "columnsFrom": ["location_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.major": { + "name": "major", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "degree_id": { + "name": "degree_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "code": { + "name": "code", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "college_requirement": { + "name": "college_requirement", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "major_degree_id_index": { + "name": "major_degree_id_index", + "columns": [ + { + "expression": "degree_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "major_college_requirement_index": { + "name": "major_college_requirement_index", + "columns": [ + { + "expression": "college_requirement", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "major_degree_id_degree_id_fk": { + "name": "major_degree_id_degree_id_fk", + "tableFrom": "major", + "tableTo": "degree", + "columnsFrom": ["degree_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "major_college_requirement_college_requirement_id_fk": { + "name": "major_college_requirement_college_requirement_id_fk", + "tableFrom": "major", + "tableTo": "college_requirement", + "columnsFrom": ["college_requirement"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.major_requirement": { + "name": "major_requirement", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "major_id": { + "name": "major_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "spec_id": { + "name": "spec_id", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "requirements": { + "name": "requirements", + "type": "json", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "major_requirement_major_id_specialization_id_fk": { + "name": "major_requirement_major_id_specialization_id_fk", + "tableFrom": "major_requirement", + "tableTo": "specialization", + "columnsFrom": ["major_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "major_requirement_spec_id_specialization_id_fk": { + "name": "major_requirement_spec_id_specialization_id_fk", + "tableFrom": "major_requirement", + "tableTo": "specialization", + "columnsFrom": ["spec_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.minor": { + "name": "minor", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "requirements": { + "name": "requirements", + "type": "json", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.prerequisite": { + "name": "prerequisite", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "dep_dept": { + "name": "dep_dept", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "prerequisite_id": { + "name": "prerequisite_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "dependency_id": { + "name": "dependency_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "prerequisite_dep_dept_index": { + "name": "prerequisite_dep_dept_index", + "columns": [ + { + "expression": "dep_dept", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "prerequisite_prerequisite_id_index": { + "name": "prerequisite_prerequisite_id_index", + "columns": [ + { + "expression": "prerequisite_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "prerequisite_dependency_id_index": { + "name": "prerequisite_dependency_id_index", + "columns": [ + { + "expression": "dependency_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "prerequisite_prerequisite_id_dependency_id_index": { + "name": "prerequisite_prerequisite_id_dependency_id_index", + "columns": [ + { + "expression": "prerequisite_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "dependency_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.sample_program_variation": { + "name": "sample_program_variation", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "program_id": { + "name": "program_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "label": { + "name": "label", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "sample_program": { + "name": "sample_program", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "variation_notes": { + "name": "variation_notes", + "type": "varchar[]", + "primaryKey": false, + "notNull": true, + "default": "ARRAY[]::VARCHAR[]" + } + }, + "indexes": {}, + "foreignKeys": { + "sample_program_variation_program_id_catalogue_program_id_fk": { + "name": "sample_program_variation_program_id_catalogue_program_id_fk", + "tableFrom": "sample_program_variation", + "tableTo": "catalogue_program", + "columnsFrom": ["program_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.school_requirement": { + "name": "school_requirement", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "requirements": { + "name": "requirements", + "type": "json", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.specialization": { + "name": "specialization", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "major_id": { + "name": "major_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "requirements": { + "name": "requirements", + "type": "json", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "specialization_major_id_index": { + "name": "specialization_major_id_index", + "columns": [ + { + "expression": "major_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "specialization_major_id_major_id_fk": { + "name": "specialization_major_id_major_id_fk", + "tableFrom": "specialization", + "tableTo": "major", + "columnsFrom": ["major_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.study_location": { + "name": "study_location", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.study_room": { + "name": "study_room", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "capacity": { + "name": "capacity", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "location": { + "name": "location", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "directions": { + "name": "directions", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "tech_enhanced": { + "name": "tech_enhanced", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "url": { + "name": "url", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "study_location_id": { + "name": "study_location_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "study_room_study_location_id_index": { + "name": "study_room_study_location_id_index", + "columns": [ + { + "expression": "study_location_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "study_room_study_location_id_study_location_id_fk": { + "name": "study_room_study_location_id_study_location_id_fk", + "tableFrom": "study_room", + "tableTo": "study_location", + "columnsFrom": ["study_location_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.study_room_slot": { + "name": "study_room_slot", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "study_room_id": { + "name": "study_room_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "start": { + "name": "start", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "end": { + "name": "end", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "is_available": { + "name": "is_available", + "type": "boolean", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "study_room_slot_study_room_id_index": { + "name": "study_room_slot_study_room_id_index", + "columns": [ + { + "expression": "study_room_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "study_room_slot_study_room_id_start_end_index": { + "name": "study_room_slot_study_room_id_start_end_index", + "columns": [ + { + "expression": "study_room_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "start", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "end", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "study_room_slot_study_room_id_study_room_id_fk": { + "name": "study_room_slot_study_room_id_study_room_id_fk", + "tableFrom": "study_room_slot", + "tableTo": "study_room", + "columnsFrom": ["study_room_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_course": { + "name": "websoc_course", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "department_id": { + "name": "department_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "course_id": { + "name": "course_id", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "REPLACE(\"websoc_course\".\"dept_code\", ' ', '') || \"websoc_course\".\"course_number\"", + "type": "stored" + } + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "year": { + "name": "year", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "quarter": { + "name": "quarter", + "type": "term", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "school_name": { + "name": "school_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "dept_code": { + "name": "dept_code", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_title": { + "name": "course_title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_number": { + "name": "course_number", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_numeric": { + "name": "course_numeric", + "type": "integer", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "CASE REGEXP_REPLACE(\"websoc_course\".\"course_number\", '\\D', '', 'g') WHEN '' THEN 0 ELSE REGEXP_REPLACE(\"websoc_course\".\"course_number\", '\\D', '', 'g')::INTEGER END", + "type": "stored" + } + }, + "course_comment": { + "name": "course_comment", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "prerequisite_link": { + "name": "prerequisite_link", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "is_ge_1a": { + "name": "is_ge_1a", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_1b": { + "name": "is_ge_1b", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_2": { + "name": "is_ge_2", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_3": { + "name": "is_ge_3", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_4": { + "name": "is_ge_4", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_5a": { + "name": "is_ge_5a", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_5b": { + "name": "is_ge_5b", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_6": { + "name": "is_ge_6", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_7": { + "name": "is_ge_7", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_8": { + "name": "is_ge_8", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": { + "websoc_course_department_id_index": { + "name": "websoc_course_department_id_index", + "columns": [ + { + "expression": "department_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_course_id_index": { + "name": "websoc_course_course_id_index", + "columns": [ + { + "expression": "course_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_school_name_dept_code_course_number_course_title_index": { + "name": "websoc_course_year_quarter_school_name_dept_code_course_number_course_title_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "school_name", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "dept_code", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "course_number", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "course_title", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_1a_index": { + "name": "websoc_course_year_quarter_is_ge_1a_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_1a", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_1b_index": { + "name": "websoc_course_year_quarter_is_ge_1b_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_1b", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_2_index": { + "name": "websoc_course_year_quarter_is_ge_2_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_2", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_3_index": { + "name": "websoc_course_year_quarter_is_ge_3_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_3", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_4_index": { + "name": "websoc_course_year_quarter_is_ge_4_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_4", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_5a_index": { + "name": "websoc_course_year_quarter_is_ge_5a_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_5a", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_5b_index": { + "name": "websoc_course_year_quarter_is_ge_5b_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_5b", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_6_index": { + "name": "websoc_course_year_quarter_is_ge_6_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_6", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_7_index": { + "name": "websoc_course_year_quarter_is_ge_7_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_7", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_8_index": { + "name": "websoc_course_year_quarter_is_ge_8_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_8", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_dept_code_index": { + "name": "websoc_course_year_quarter_dept_code_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "dept_code", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_dept_code_course_number_index": { + "name": "websoc_course_year_quarter_dept_code_course_number_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "dept_code", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "course_number", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_course_department_id_websoc_department_id_fk": { + "name": "websoc_course_department_id_websoc_department_id_fk", + "tableFrom": "websoc_course", + "tableTo": "websoc_department", + "columnsFrom": ["department_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_department": { + "name": "websoc_department", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "school_id": { + "name": "school_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "year": { + "name": "year", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "quarter": { + "name": "quarter", + "type": "term", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "dept_code": { + "name": "dept_code", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "dept_name": { + "name": "dept_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "dept_comment": { + "name": "dept_comment", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "section_code_range_comments": { + "name": "section_code_range_comments", + "type": "text[]", + "primaryKey": false, + "notNull": true + }, + "course_number_range_comments": { + "name": "course_number_range_comments", + "type": "text[]", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "websoc_department_school_id_index": { + "name": "websoc_department_school_id_index", + "columns": [ + { + "expression": "school_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_department_year_quarter_school_id_dept_code_index": { + "name": "websoc_department_year_quarter_school_id_dept_code_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "school_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "dept_code", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_department_school_id_websoc_school_id_fk": { + "name": "websoc_department_school_id_websoc_school_id_fk", + "tableFrom": "websoc_department", + "tableTo": "websoc_school", + "columnsFrom": ["school_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_instructor": { + "name": "websoc_instructor", + "schema": "", + "columns": { + "name": { + "name": "name", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_location": { + "name": "websoc_location", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "building": { + "name": "building", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "room": { + "name": "room", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "websoc_location_building_room_index": { + "name": "websoc_location_building_room_index", + "columns": [ + { + "expression": "building", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "room", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_meta": { + "name": "websoc_meta", + "schema": "", + "columns": { + "name": { + "name": "name", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "last_scraped": { + "name": "last_scraped", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "last_dept_scraped": { + "name": "last_dept_scraped", + "type": "varchar", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_school": { + "name": "websoc_school", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "year": { + "name": "year", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "quarter": { + "name": "quarter", + "type": "term", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "school_name": { + "name": "school_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "school_comment": { + "name": "school_comment", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "websoc_school_year_quarter_school_name_index": { + "name": "websoc_school_year_quarter_school_name_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "school_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_section": { + "name": "websoc_section", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "course_id": { + "name": "course_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "year": { + "name": "year", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "quarter": { + "name": "quarter", + "type": "term", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "units": { + "name": "units", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "websoc_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "instructors": { + "name": "instructors", + "type": "text[]", + "primaryKey": false, + "notNull": true + }, + "meetings": { + "name": "meetings", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "final_exam_string": { + "name": "final_exam_string", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "final_exam": { + "name": "final_exam", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "section_num": { + "name": "section_num", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "max_capacity": { + "name": "max_capacity", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "section_code": { + "name": "section_code", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "section_type": { + "name": "section_type", + "type": "websoc_section_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "num_requested": { + "name": "num_requested", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "restriction_string": { + "name": "restriction_string", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "restriction_a": { + "name": "restriction_a", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_b": { + "name": "restriction_b", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_c": { + "name": "restriction_c", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_d": { + "name": "restriction_d", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_e": { + "name": "restriction_e", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_f": { + "name": "restriction_f", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_g": { + "name": "restriction_g", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_h": { + "name": "restriction_h", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_i": { + "name": "restriction_i", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_j": { + "name": "restriction_j", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_k": { + "name": "restriction_k", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_l": { + "name": "restriction_l", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_m": { + "name": "restriction_m", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_n": { + "name": "restriction_n", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_o": { + "name": "restriction_o", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_r": { + "name": "restriction_r", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_s": { + "name": "restriction_s", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_x": { + "name": "restriction_x", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "num_on_waitlist": { + "name": "num_on_waitlist", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_waitlist_cap": { + "name": "num_waitlist_cap", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "section_comment": { + "name": "section_comment", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "num_new_only_reserved": { + "name": "num_new_only_reserved", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_currently_total_enrolled": { + "name": "num_currently_total_enrolled", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_currently_section_enrolled": { + "name": "num_currently_section_enrolled", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "is_cancelled": { + "name": "is_cancelled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "\"websoc_section\".\"section_comment\" LIKE '%*** CANCELLED ***%' OR \"websoc_section\".\"section_comment\" LIKE '%*** CANCELED ***%'", + "type": "stored" + } + }, + "web_url": { + "name": "web_url", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "''" + } + }, + "indexes": { + "websoc_section_course_id_index": { + "name": "websoc_section_course_id_index", + "columns": [ + { + "expression": "course_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_section_year_quarter_section_code_index": { + "name": "websoc_section_year_quarter_section_code_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "section_code", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_section_course_id_websoc_course_id_fk": { + "name": "websoc_section_course_id_websoc_course_id_fk", + "tableFrom": "websoc_section", + "tableTo": "websoc_course", + "columnsFrom": ["course_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_section_enrollment": { + "name": "websoc_section_enrollment", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "section_id": { + "name": "section_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "date", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "year": { + "name": "year", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "quarter": { + "name": "quarter", + "type": "term", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "max_capacity": { + "name": "max_capacity", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "num_currently_total_enrolled": { + "name": "num_currently_total_enrolled", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_on_waitlist": { + "name": "num_on_waitlist", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_waitlist_cap": { + "name": "num_waitlist_cap", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_requested": { + "name": "num_requested", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_new_only_reserved": { + "name": "num_new_only_reserved", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "websoc_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "websoc_section_enrollment_section_id_index": { + "name": "websoc_section_enrollment_section_id_index", + "columns": [ + { + "expression": "section_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_section_enrollment_section_id_created_at_index": { + "name": "websoc_section_enrollment_section_id_created_at_index", + "columns": [ + { + "expression": "section_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_section_enrollment_section_id_websoc_section_id_fk": { + "name": "websoc_section_enrollment_section_id_websoc_section_id_fk", + "tableFrom": "websoc_section_enrollment", + "tableTo": "websoc_section", + "columnsFrom": ["section_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_section_grade": { + "name": "websoc_section_grade", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "section_id": { + "name": "section_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "grade_a_count": { + "name": "grade_a_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_b_count": { + "name": "grade_b_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_c_count": { + "name": "grade_c_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_d_count": { + "name": "grade_d_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_f_count": { + "name": "grade_f_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_p_count": { + "name": "grade_p_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_np_count": { + "name": "grade_np_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_w_count": { + "name": "grade_w_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "average_gpa": { + "name": "average_gpa", + "type": "numeric(3, 2)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "websoc_section_grade_section_id_index": { + "name": "websoc_section_grade_section_id_index", + "columns": [ + { + "expression": "section_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_section_grade_section_id_websoc_section_id_fk": { + "name": "websoc_section_grade_section_id_websoc_section_id_fk", + "tableFrom": "websoc_section_grade", + "tableTo": "websoc_section", + "columnsFrom": ["section_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "websoc_section_grade_section_id_unique": { + "name": "websoc_section_grade_section_id_unique", + "nullsNotDistinct": false, + "columns": ["section_id"] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_section_meeting": { + "name": "websoc_section_meeting", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "section_id": { + "name": "section_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "section_code": { + "name": "section_code", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "meeting_index": { + "name": "meeting_index", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "time_string": { + "name": "time_string", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "time_is_tba": { + "name": "time_is_tba", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "\"websoc_section_meeting\".\"time_string\" LIKE '%TBA%'", + "type": "stored" + } + }, + "start_time": { + "name": "start_time", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "end_time": { + "name": "end_time", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "days_string": { + "name": "days_string", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "meets_monday": { + "name": "meets_monday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_tuesday": { + "name": "meets_tuesday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_wednesday": { + "name": "meets_wednesday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_thursday": { + "name": "meets_thursday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_friday": { + "name": "meets_friday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_saturday": { + "name": "meets_saturday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_sunday": { + "name": "meets_sunday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": { + "websoc_section_meeting_section_id_index": { + "name": "websoc_section_meeting_section_id_index", + "columns": [ + { + "expression": "section_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_section_meeting_section_id_websoc_section_id_fk": { + "name": "websoc_section_meeting_section_id_websoc_section_id_fk", + "tableFrom": "websoc_section_meeting", + "tableTo": "websoc_section", + "columnsFrom": ["section_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_section_meeting_to_location": { + "name": "websoc_section_meeting_to_location", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "meeting_id": { + "name": "meeting_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "location_id": { + "name": "location_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "websoc_section_meeting_to_location_meeting_id_index": { + "name": "websoc_section_meeting_to_location_meeting_id_index", + "columns": [ + { + "expression": "meeting_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_section_meeting_to_location_location_id_index": { + "name": "websoc_section_meeting_to_location_location_id_index", + "columns": [ + { + "expression": "location_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_section_meeting_to_location_meeting_id_location_id_index": { + "name": "websoc_section_meeting_to_location_meeting_id_location_id_index", + "columns": [ + { + "expression": "meeting_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "location_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_section_meeting_to_location_meeting_id_websoc_section_meeting_id_fk": { + "name": "websoc_section_meeting_to_location_meeting_id_websoc_section_meeting_id_fk", + "tableFrom": "websoc_section_meeting_to_location", + "tableTo": "websoc_section_meeting", + "columnsFrom": ["meeting_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "websoc_section_meeting_to_location_location_id_websoc_location_id_fk": { + "name": "websoc_section_meeting_to_location_location_id_websoc_location_id_fk", + "tableFrom": "websoc_section_meeting_to_location", + "tableTo": "websoc_location", + "columnsFrom": ["location_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_section_to_instructor": { + "name": "websoc_section_to_instructor", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "section_id": { + "name": "section_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "instructor_name": { + "name": "instructor_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "websoc_section_to_instructor_section_id_index": { + "name": "websoc_section_to_instructor_section_id_index", + "columns": [ + { + "expression": "section_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_section_to_instructor_instructor_name_index": { + "name": "websoc_section_to_instructor_instructor_name_index", + "columns": [ + { + "expression": "instructor_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_section_to_instructor_section_id_websoc_section_id_fk": { + "name": "websoc_section_to_instructor_section_id_websoc_section_id_fk", + "tableFrom": "websoc_section_to_instructor", + "tableTo": "websoc_section", + "columnsFrom": ["section_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "websoc_section_to_instructor_instructor_name_websoc_instructor_name_fk": { + "name": "websoc_section_to_instructor_instructor_name_websoc_instructor_name_fk", + "tableFrom": "websoc_section_to_instructor", + "tableTo": "websoc_instructor", + "columnsFrom": ["instructor_name"], + "columnsTo": ["name"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": { + "public.course_level": { + "name": "course_level", + "schema": "public", + "values": ["LowerDiv", "UpperDiv", "Graduate"] + }, + "public.division": { + "name": "division", + "schema": "public", + "values": ["Undergraduate", "Graduate"] + }, + "public.term": { + "name": "term", + "schema": "public", + "values": ["Fall", "Winter", "Spring", "Summer1", "Summer10wk", "Summer2"] + }, + "public.websoc_section_type": { + "name": "websoc_section_type", + "schema": "public", + "values": [ + "Act", + "Col", + "Dis", + "Fld", + "Lab", + "Lec", + "Qiz", + "Res", + "Sem", + "Stu", + "Tap", + "Tut" + ] + }, + "public.websoc_status": { + "name": "websoc_status", + "schema": "public", + "values": ["OPEN", "Waitl", "FULL", "NewOnly"] + } + }, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": { + "public.course_view": { + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "department": { + "name": "department", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "shortened_dept": { + "name": "shortened_dept", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "REPLACE(\"course\".\"department\", ' ', '')", + "type": "stored" + } + }, + "department_alias": { + "name": "department_alias", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "course_number": { + "name": "course_number", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_numeric": { + "name": "course_numeric", + "type": "integer", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "CASE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g') WHEN '' THEN 0 ELSE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g')::INTEGER END", + "type": "stored" + } + }, + "school": { + "name": "school", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_level": { + "name": "course_level", + "type": "course_level", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "min_units": { + "name": "min_units", + "type": "numeric(4, 2)", + "primaryKey": false, + "notNull": true + }, + "max_units": { + "name": "max_units", + "type": "numeric(4, 2)", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "department_name": { + "name": "department_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "prerequisite_tree": { + "name": "prerequisite_tree", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "prerequisite_text": { + "name": "prerequisite_text", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "repeatability": { + "name": "repeatability", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "grading_option": { + "name": "grading_option", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "concurrent": { + "name": "concurrent", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "same_as": { + "name": "same_as", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "restriction": { + "name": "restriction", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "overlap": { + "name": "overlap", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "corequisites": { + "name": "corequisites", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "is_ge_1a": { + "name": "is_ge_1a", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_1b": { + "name": "is_ge_1b", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_2": { + "name": "is_ge_2", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_3": { + "name": "is_ge_3", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_4": { + "name": "is_ge_4", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_5a": { + "name": "is_ge_5a", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_5b": { + "name": "is_ge_5b", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_6": { + "name": "is_ge_6", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_7": { + "name": "is_ge_7", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_8": { + "name": "is_ge_8", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "ge_text": { + "name": "ge_text", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "definition": "select \"course\".\"id\", \"course\".\"updated_at\", \"course\".\"department\", \"course\".\"shortened_dept\", \"course\".\"department_alias\", \"course\".\"course_number\", \"course\".\"course_numeric\", \"course\".\"school\", \"course\".\"title\", \"course\".\"course_level\", \"course\".\"min_units\", \"course\".\"max_units\", \"course\".\"description\", \"course\".\"department_name\", \"course\".\"prerequisite_tree\", \"course\".\"prerequisite_text\", \"course\".\"repeatability\", \"course\".\"grading_option\", \"course\".\"concurrent\", \"course\".\"same_as\", \"course\".\"restriction\", \"course\".\"overlap\", \"course\".\"corequisites\", \"course\".\"is_ge_1a\", \"course\".\"is_ge_1b\", \"course\".\"is_ge_2\", \"course\".\"is_ge_3\", \"course\".\"is_ge_4\", \"course\".\"is_ge_5a\", \"course\".\"is_ge_5b\", \"course\".\"is_ge_6\", \"course\".\"is_ge_7\", \"course\".\"is_ge_8\", \"course\".\"ge_text\", \n ARRAY_REMOVE(COALESCE(\n (\n SELECT ARRAY_AGG(\n CASE WHEN \"prerequisite_course\".\"id\" IS NULL THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'id', \"prerequisite_course\".\"id\",\n 'title', \"prerequisite_course\".\"title\",\n 'department', \"prerequisite_course\".\"department\",\n 'courseNumber', \"prerequisite_course\".\"course_number\"\n )\n END\n )\n FROM \"prerequisite\"\n LEFT JOIN \"course\" \"prerequisite_course\" ON \"prerequisite_course\".\"id\" = \"prerequisite\".\"prerequisite_id\"\n WHERE \"prerequisite\".\"dependency_id\" = \"course\".\"id\"\n ),\n ARRAY[]::JSONB[]), NULL)\n as \"prerequisites\", \n ARRAY_REMOVE(COALESCE(\n (\n SELECT ARRAY_AGG(\n CASE WHEN \"dependency_course\".\"id\" IS NULL THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'id', \"dependency_course\".\"id\",\n 'title', \"dependency_course\".\"title\",\n 'department', \"dependency_course\".\"department\",\n 'courseNumber', \"dependency_course\".\"course_number\"\n )\n END\n )\n FROM \"prerequisite\" \"dependency\"\n LEFT JOIN \"course\" \"dependency_course\" ON \"dependency_course\".\"id\" = \"dependency\".\"dependency_id\"\n WHERE \"dependency\".\"prerequisite_id\" = \"course\".\"id\"\n ),\n ARRAY[]::JSONB[]), NULL)\n as \"dependencies\", \n ARRAY_REMOVE(ARRAY_AGG(DISTINCT\n CASE WHEN \"websoc_course\".\"year\" IS NULL THEN NULL\n ELSE CONCAT(\"websoc_course\".\"year\", ' ', \"websoc_course\".\"quarter\")\n END\n ), NULL)\n as \"terms\", \n ARRAY_REMOVE(COALESCE(ARRAY_AGG(DISTINCT\n CASE WHEN \"instructor\".\"ucinetid\" IS NULL THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'ucinetid', \"instructor\".\"ucinetid\",\n 'name', \"instructor\".\"name\",\n 'title', \"instructor\".\"title\",\n 'email', \"instructor\".\"email\",\n 'department', \"instructor\".\"department\",\n 'shortenedNames', ARRAY(\n SELECT \"instructor_to_websoc_instructor\".\"websoc_instructor_name\"\n FROM \"instructor_to_websoc_instructor\"\n WHERE \"instructor_to_websoc_instructor\".\"instructor_ucinetid\" = \"instructor\".\"ucinetid\"\n )\n )\n END\n ), ARRAY[]::JSONB[]), NULL)\n as \"instructors\" from \"course\" left join \"websoc_course\" on \"websoc_course\".\"course_id\" = \"course\".\"id\" left join \"websoc_section\" on \"websoc_section\".\"course_id\" = \"websoc_course\".\"id\" left join \"websoc_section_to_instructor\" on \"websoc_section_to_instructor\".\"section_id\" = \"websoc_section\".\"id\" left join \"websoc_instructor\" on \"websoc_instructor\".\"name\" = \"websoc_section_to_instructor\".\"instructor_name\" left join \"instructor_to_websoc_instructor\" on \"instructor_to_websoc_instructor\".\"websoc_instructor_name\" = \"websoc_instructor\".\"name\" left join \"instructor\" on (\"instructor\".\"ucinetid\" = \"instructor_to_websoc_instructor\".\"instructor_ucinetid\" and \"instructor\".\"ucinetid\" is not null and \"instructor\".\"ucinetid\" <> 'student') group by \"course\".\"id\"", + "name": "course_view", + "schema": "public", + "isExisting": false, + "materialized": true + }, + "public.instructor_view": { + "columns": { + "ucinetid": { + "name": "ucinetid", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "email": { + "name": "email", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "department": { + "name": "department", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "definition": "with \"shortened_names_cte\" as (select \"instructor_ucinetid\", ARRAY_AGG(\"websoc_instructor_name\") as \"shortened_names\" from \"instructor_to_websoc_instructor\" group by \"instructor_to_websoc_instructor\".\"instructor_ucinetid\"), \"courses_cte\" as (with \"terms_cte\" as (select \"course\".\"id\", \"instructor_to_websoc_instructor\".\"instructor_ucinetid\", \n ARRAY_REMOVE(ARRAY_AGG(DISTINCT\n CASE WHEN \"websoc_course\".\"year\" IS NULL THEN NULL\n ELSE CONCAT(\"websoc_course\".\"year\", ' ', \"websoc_course\".\"quarter\")\n END\n ), NULL) as \"terms\" from \"course\" left join \"websoc_course\" on \"websoc_course\".\"course_id\" = \"course\".\"id\" left join \"websoc_section\" on \"websoc_section\".\"course_id\" = \"websoc_course\".\"id\" left join \"websoc_section_to_instructor\" on \"websoc_section_to_instructor\".\"section_id\" = \"websoc_section\".\"id\" left join \"websoc_instructor\" on \"websoc_instructor\".\"name\" = \"websoc_section_to_instructor\".\"instructor_name\" left join \"instructor_to_websoc_instructor\" on \"instructor_to_websoc_instructor\".\"websoc_instructor_name\" = \"websoc_instructor\".\"name\" group by \"course\".\"id\", \"instructor_to_websoc_instructor\".\"instructor_ucinetid\") select \"terms_cte\".\"instructor_ucinetid\", \"course\".\"id\", \n CASE WHEN \"course\".\"id\" IS NULL\n THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'id', \"course\".\"id\",\n 'title', \"course\".\"title\",\n 'department', \"course\".\"department\",\n 'courseNumber', \"course\".\"course_number\",\n 'terms', COALESCE(\"terms\", ARRAY[]::TEXT[])\n )\n END\n as \"course_info\" from \"course\" left join \"terms_cte\" on \"terms_cte\".\"id\" = \"course\".\"id\" group by \"course\".\"id\", \"terms_cte\".\"instructor_ucinetid\", \"terms\") select \"instructor\".\"ucinetid\", \"instructor\".\"name\", \"instructor\".\"title\", \"instructor\".\"email\", \"instructor\".\"department\", COALESCE(\"shortened_names\", ARRAY[]::TEXT[]) as \"shortened_names\", \n ARRAY_REMOVE(ARRAY_AGG(DISTINCT \"course_info\"), NULL)\n as \"courses\" from \"instructor\" left join \"shortened_names_cte\" on \"shortened_names_cte\".\"instructor_ucinetid\" = \"instructor\".\"ucinetid\" left join \"courses_cte\" on \"courses_cte\".\"instructor_ucinetid\" = \"instructor\".\"ucinetid\" where \"instructor\".\"ucinetid\" <> 'student' group by \"instructor\".\"ucinetid\", \"shortened_names\"", + "name": "instructor_view", + "schema": "public", + "isExisting": false, + "materialized": true + } + }, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} diff --git a/packages/db/migrations/meta/_journal.json b/packages/db/migrations/meta/_journal.json index 350e0a99..75edd9ad 100644 --- a/packages/db/migrations/meta/_journal.json +++ b/packages/db/migrations/meta/_journal.json @@ -169,6 +169,13 @@ "when": 1770072497788, "tag": "0023_pv_study_rooms", "breakpoints": true + }, + { + "idx": 24, + "version": "7", + "when": 1770700619910, + "tag": "0024_glamorous_maria_hill", + "breakpoints": true } ] } diff --git a/packages/db/src/schema.ts b/packages/db/src/schema.ts index 90db96dd..60128cb2 100644 --- a/packages/db/src/schema.ts +++ b/packages/db/src/schema.ts @@ -662,6 +662,15 @@ export const collegeRequirement = pgTable("college_requirement", { requirements: jsonb("requirements").$type().unique().notNull(), }); +export const majorRequirement = pgTable("major_requirement", { + id: uuid("id").primaryKey().defaultRandom(), + majorId: varchar("major_id") + .notNull() + .references(() => major.id), + specId: varchar("spec_id").references(() => specialization.id), + majorRequirements: json("requirements").$type().notNull(), +}); + export const major = pgTable( "major", { @@ -672,7 +681,7 @@ export const major = pgTable( code: varchar("code").notNull(), name: varchar("name").notNull(), collegeRequirement: uuid("college_requirement").references(() => collegeRequirement.id), - requirements: json("requirements").$type().notNull(), + // requirements: json("requirements").$type().notNull(), }, (table) => [index().on(table.degreeId), index().on(table.collegeRequirement)], ); From a32e91af8c235713eccb65d0fa8de41cc76dcb88 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Fri, 13 Feb 2026 17:50:03 -0800 Subject: [PATCH 18/91] encoded parsed Program key into a string instead of a list so that map works properly --- .../src/components/Scraper.ts | 41 +++++++++---------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts index a8df6300..1cf852d4 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts @@ -37,9 +37,8 @@ export class Scraper { private parsedUgradRequirements = new Map(); private parsedMinorPrograms = new Map(); // both undergrad majors and grad programs; tuple of (school, program) - //private parsedPrograms = new Map(); // both undergrad majors and grad programs; key is tuple of (majorName, specID?), value is tuple of (school, program) - private parsedPrograms = new Map<[string, string?], MajorProgram>(); + private parsedPrograms = new Map(); // (parent major, name, program object) private parsedSpecializations = new Map< string, @@ -145,7 +144,7 @@ export class Scraper { } private async scrapePrograms(degrees: Iterable<[ProgramTriplet, string?]>) { - const ret = new Map<[string, string?], MajorProgram>(); + const ret = new Map(); for (const [[schoolCode, majorCode, degreeCode], specCode] of degrees) { const audit = await this.dw.getMajorAudit( degreeCode, @@ -164,25 +163,22 @@ export class Scraper { ); continue; } - if (ret.has([majorAudit.title, specCode])) { + if (ret.has([majorAudit.title, specCode].join(";"))) { console.log( - `Requirements block already exists for "${majorAudit.title}" with specialization "${specCode ? `with spec: ${specCode}` : ""}" (majorCode = ${majorCode}, degree = ${degreeCode})`, + `Requirements block already exists for "${majorAudit.title}" ${specCode ? `with spec: '${specCode}'` : ""} (majorCode = ${majorCode}, degree = ${degreeCode})`, ); continue; } - ret.set( - [majorAudit.title, specCode], - [ - audit?.college - ? await this.ap.parseBlock( - `${schoolCode}-COLLEGE-${majorCode}-${degreeCode}`, - audit?.college, - ) - : undefined, - await this.ap.parseBlock(`${schoolCode}-MAJOR-${majorCode}-${degreeCode}`, majorAudit), - ], - ); + ret.set([majorAudit.title, specCode].join(";"), [ + audit?.college + ? await this.ap.parseBlock( + `${schoolCode}-COLLEGE-${majorCode}-${degreeCode}`, + audit?.college, + ) + : undefined, + await this.ap.parseBlock(`${schoolCode}-MAJOR-${majorCode}-${degreeCode}`, majorAudit), + ]); console.log( `Requirements block found and parsed for "${majorAudit.title}" ${specCode ? `with spec: ${specCode}` : ""} (majorCode = ${majorCode}, degree = ${degreeCode})`, @@ -201,7 +197,7 @@ export class Scraper { // as of this commit, this spec is seemingly valid with any major but that's not really true if (specCode === "OACSC") { // "optional american chemical society certification" - const inMap = this.parsedPrograms.get(["Major in Chemistry", undefined]) as MajorProgram; + const inMap = this.parsedPrograms.get("Major in Chemistry") as MajorProgram; return inMap ? [inMap[1]] : []; } @@ -395,7 +391,10 @@ export class Scraper { } } - // this.parsedPrograms = new Map([...this.parsedPrograms, ...await this.scrapePrograms(foundMajorSpecPairs)]) + this.parsedPrograms = new Map([ + ...this.parsedPrograms, + ...(await this.scrapePrograms(foundMajorSpecPairs)), + ]); this.degreesAwarded = new Map( Array.from( @@ -410,7 +409,7 @@ export class Scraper { // cleaner way to address this, but this is such an insanely niche case // that it's probably not worth the effort to write a general solution. - const x = this.parsedPrograms.get(["Major in Art History", undefined]) as MajorProgram; + const x = this.parsedPrograms.get("Major in Art History") as MajorProgram; const y = this.parsedSpecializations.get("AHGEO")?.[2] as DegreeWorksProgram; const z = this.parsedSpecializations.get("AHPER")?.[2] as DegreeWorksProgram; if (x && y && z) { @@ -418,7 +417,7 @@ export class Scraper { x[1].requirements = [...x[1].requirements, ...y.requirements, ...z.requirements]; this.parsedSpecializations.delete("AHGEO"); this.parsedSpecializations.delete("AHPER"); - this.parsedPrograms.set(["Major in Art History", undefined], x); + this.parsedPrograms.set("Major in Art History", x); } this.done = true; From a42d151a8a1bf652b8fea49d0b2739b6ac3e0798 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Fri, 13 Feb 2026 19:29:18 -0800 Subject: [PATCH 19/91] saved spec_id in major_requirement in coorect - format to match with id of specialization table --- .../degreeworks-scraper/src/index.ts | 48 +++++++++++++++---- 1 file changed, 38 insertions(+), 10 deletions(-) diff --git a/apps/data-pipeline/degreeworks-scraper/src/index.ts b/apps/data-pipeline/degreeworks-scraper/src/index.ts index 0e01f278..2bf53c33 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/index.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/index.ts @@ -1,4 +1,5 @@ import * as assert from "node:assert"; +import * as fs from "node:fs/promises"; import { exit } from "node:process"; import { Scraper } from "$components"; import { database } from "@packages/db"; @@ -6,6 +7,7 @@ import { collegeRequirement, degree, major, + majorRequirement, minor, schoolRequirement, specialization, @@ -45,7 +47,9 @@ async function main() { const collegeBlocks = [] as (typeof collegeRequirement.$inferInsert)[]; let majorData = parsedPrograms .entries() - .map(([[, specCode], [college, { name, degreeType, code, requirements }]]) => { + .map(([k, [college, { name, degreeType, code, requirements }]]) => { + const specCode = k.split(";")[1] !== "" ? `${degreeType}-${k.split(";")[1]}` : undefined; + console.log(`got spec code: '${specCode}' from '${k}'`); let collegeBlockIndex: number | undefined; if (college?.requirements) { const wouldInsert = { name: college.name, requirements: college.requirements }; @@ -70,14 +74,17 @@ async function main() { id: `${degreeType}-${code}`, degreeId: degreeType ?? "", code, - specCode, + ...(specCode !== undefined ? { specCode } : {}), name, requirements, ...(collegeBlockIndex !== undefined ? { collegeBlockIndex } : {}), }; }) .toArray(); - + console.log( + `length of parsedProgarms: ${parsedPrograms.size}. lengthed of objectified parsedPrograms: ${Object.fromEntries(parsedPrograms)}.length of majorData: ${majorData.length}`, + ); + await fs.writeFile("./MajorDataFirst.json", JSON.stringify(majorData, null, 2)); const majorRequirementData = majorData.map(({ id, specCode, requirements }) => ({ majorId: id, specId: specCode, @@ -98,6 +105,13 @@ async function main() { requirements, })) .toArray(); + + await fs.writeFile( + "./ParsedPrograms.json", + JSON.stringify(Object.fromEntries(parsedPrograms), null, 2), + ); + await fs.writeFile("./MajorData.json", JSON.stringify(majorData, null, 2)); + await fs.writeFile("./MajorReq.json", JSON.stringify(majorRequirementData, null, 2)); await db.transaction(async (tx) => { if (ucRequirementData && geRequirementData) { await tx @@ -117,6 +131,7 @@ async function main() { set: conflictUpdateSetAllCols(schoolRequirement), }); } + console.log("Updated GE and UC req"); if (honorsFourRequirementData) { await tx @@ -132,11 +147,13 @@ async function main() { set: conflictUpdateSetAllCols(schoolRequirement), }); } + console.log("Updated School Req"); await tx .insert(degree) .values(degreeData) .onConflictDoUpdate({ target: degree.id, set: conflictUpdateSetAllCols(degree) }); + console.log("Updated Degree Data"); // we need to determine the db ID of school blocks and update major objects accordingly first const collegeBlockIds = await tx @@ -148,6 +165,7 @@ async function main() { }) .returning({ id: collegeRequirement.id }) .then((rows) => rows.map(({ id }) => id)); + console.log("Updated college requirements"); for (const majorObj of majorData) { if (majorObj.collegeBlockIndex !== undefined) { @@ -155,24 +173,34 @@ async function main() { collegeBlockIds[majorObj.collegeBlockIndex]; } } + console.log("Set college Req on majorData"); await tx .insert(major) .values(majorData) .onConflictDoUpdate({ target: major.id, set: conflictUpdateSetAllCols(major) }); + console.log("Updated Major"); await tx .insert(minor) .values(minorData) - .onConflictDoUpdate({ target: major.id, set: conflictUpdateSetAllCols(minor) }); + .onConflictDoUpdate({ target: minor.id, set: conflictUpdateSetAllCols(minor) }); + console.log("Updated Minors"); await tx .insert(specialization) .values(specData) - .onConflictDoUpdate({ target: major.id, set: conflictUpdateSetAllCols(specialization) }); - // await tx - // .insert(majorRequirement) - // .values(majorRequirementData) - // .onConflictDoNothing() - //.onConflictDoUpdate({target: major.id, set: conflictUpdateSetAllCols(majorRequirement)}) + .onConflictDoUpdate({ + target: specialization.id, + set: conflictUpdateSetAllCols(specialization), + }); + console.log("Updated Specs"); + await tx + .insert(majorRequirement) + .values(majorRequirementData) + .onConflictDoUpdate({ + target: majorRequirement.id, + set: conflictUpdateSetAllCols(majorRequirement), + }); + console.log("Updated major requirements"); }); exit(0); } From c44cba03d86275b1c78b3a31d5efe1fd0ec79e64 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Sat, 14 Feb 2026 15:48:16 -0800 Subject: [PATCH 20/91] feat: changed schema to contain major_spec_pair_to_requirement table that points to seperate major_requirement table --- .../degreeworks-scraper/src/index.ts | 73 +++++++++++++++---- packages/db/src/schema.ts | 11 ++- 2 files changed, 66 insertions(+), 18 deletions(-) diff --git a/apps/data-pipeline/degreeworks-scraper/src/index.ts b/apps/data-pipeline/degreeworks-scraper/src/index.ts index 2bf53c33..f72791d8 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/index.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/index.ts @@ -8,6 +8,7 @@ import { degree, major, majorRequirement, + majorSpecPairToRequirement, minor, schoolRequirement, specialization, @@ -45,11 +46,11 @@ async function main() { .toArray(); const collegeBlocks = [] as (typeof collegeRequirement.$inferInsert)[]; - let majorData = parsedPrograms + + const majorSpecData = parsedPrograms .entries() .map(([k, [college, { name, degreeType, code, requirements }]]) => { const specCode = k.split(";")[1] !== "" ? `${degreeType}-${k.split(";")[1]}` : undefined; - console.log(`got spec code: '${specCode}' from '${k}'`); let collegeBlockIndex: number | undefined; if (college?.requirements) { const wouldInsert = { name: college.name, requirements: college.requirements }; @@ -82,15 +83,38 @@ async function main() { }) .toArray(); console.log( - `length of parsedProgarms: ${parsedPrograms.size}. lengthed of objectified parsedPrograms: ${Object.fromEntries(parsedPrograms)}.length of majorData: ${majorData.length}`, + `length of parsedProgarms: ${parsedPrograms.size}. lengthed of objectified parsedPrograms: ${Object.fromEntries(parsedPrograms)}.length of majorData: ${majorSpecData.length}`, ); - await fs.writeFile("./MajorDataFirst.json", JSON.stringify(majorData, null, 2)); - const majorRequirementData = majorData.map(({ id, specCode, requirements }) => ({ - majorId: id, - specId: specCode, - majorRequirements: requirements, - })); - majorData = majorData.filter(({ specCode }) => specCode === undefined); + await fs.writeFile("./MajorDataFirst.json", JSON.stringify(majorSpecData, null, 2)); + + const majorRequirementBlocks = [] as (typeof majorRequirement.$inferInsert)[]; + const majorSpecToRequirementData = majorSpecData.map(({ id, specCode, requirements }) => { + const wouldInsert = { requirements }; + let majorRequirementBlockIndex: number | undefined = undefined; + const existing = majorRequirementBlocks.findIndex((req) => { + try { + assert.deepEqual(wouldInsert, req); + return true; + } catch { + return false; + } + }); + if (existing === -1) { + majorRequirementBlocks.push(wouldInsert); + majorRequirementBlockIndex = majorRequirementBlocks.length - 1; + } else { + majorRequirementBlockIndex = existing; + } + return { + id: `${id}+${specCode}`, + majorId: id, + specId: specCode, + majorRequirementBlockIndex, + }; + }); + + const majorData = majorSpecData.filter(({ specCode }) => specCode === undefined); + const minorData = parsedMinorPrograms .values() .map(({ name, code: id, requirements }) => ({ id, name, requirements })) @@ -111,7 +135,7 @@ async function main() { JSON.stringify(Object.fromEntries(parsedPrograms), null, 2), ); await fs.writeFile("./MajorData.json", JSON.stringify(majorData, null, 2)); - await fs.writeFile("./MajorReq.json", JSON.stringify(majorRequirementData, null, 2)); + await fs.writeFile("./MajorReq.json", JSON.stringify(majorSpecToRequirementData, null, 2)); await db.transaction(async (tx) => { if (ucRequirementData && geRequirementData) { await tx @@ -167,6 +191,17 @@ async function main() { .then((rows) => rows.map(({ id }) => id)); console.log("Updated college requirements"); + const majorRequirementBlockIds = await tx + .insert(majorRequirement) + .values(majorRequirementBlocks) + .onConflictDoUpdate({ + target: majorRequirement.requirements, + set: conflictUpdateSetAllCols(majorRequirement), + }) + .returning({ id: majorRequirement.id }) + .then((rows) => rows.map(({ id }) => id)); + console.log("Update Major Requirements"); + for (const majorObj of majorData) { if (majorObj.collegeBlockIndex !== undefined) { (majorObj as typeof major.$inferInsert).collegeRequirement = @@ -175,6 +210,13 @@ async function main() { } console.log("Set college Req on majorData"); + for (const majorSpecObj of majorSpecToRequirementData) { + if (majorSpecObj.majorRequirementBlockIndex !== undefined) { + (majorSpecObj as typeof majorSpecPairToRequirement.$inferInsert).requirementId = + majorRequirementBlockIds[majorSpecObj.majorRequirementBlockIndex]; + } + } + console.log("Set majorRequirement Id on majorSpecToRequirementData"); await tx .insert(major) .values(majorData) @@ -193,14 +235,15 @@ async function main() { set: conflictUpdateSetAllCols(specialization), }); console.log("Updated Specs"); + await tx - .insert(majorRequirement) - .values(majorRequirementData) + .insert(majorSpecPairToRequirement) + .values(majorSpecToRequirementData) .onConflictDoUpdate({ - target: majorRequirement.id, + target: majorSpecPairToRequirement.id, set: conflictUpdateSetAllCols(majorRequirement), }); - console.log("Updated major requirements"); + console.log("Updated Major Spec pair to Requirements table"); }); exit(0); } diff --git a/packages/db/src/schema.ts b/packages/db/src/schema.ts index 60128cb2..561e352e 100644 --- a/packages/db/src/schema.ts +++ b/packages/db/src/schema.ts @@ -662,13 +662,18 @@ export const collegeRequirement = pgTable("college_requirement", { requirements: jsonb("requirements").$type().unique().notNull(), }); -export const majorRequirement = pgTable("major_requirement", { - id: uuid("id").primaryKey().defaultRandom(), +export const majorSpecPairToRequirement = pgTable("major_spec_pair_to_requirement", { + id: varchar("id").primaryKey(), majorId: varchar("major_id") .notNull() .references(() => major.id), specId: varchar("spec_id").references(() => specialization.id), - majorRequirements: json("requirements").$type().notNull(), + requirementId: uuid("requirementId").references(() => majorRequirement.id), +}); + +export const majorRequirement = pgTable("major_requirement", { + id: uuid("id").primaryKey().defaultRandom(), + requirements: jsonb("requirements").$type().unique().notNull(), }); export const major = pgTable( From 11c23a5869480000ffa998023c6d75185f50c29e Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Sat, 14 Feb 2026 16:48:12 -0800 Subject: [PATCH 21/91] Auogenerate id in major_spec_pair_to_requirement table --- .../degreeworks-scraper/src/index.ts | 5 ++-- packages/db/src/schema.ts | 28 +++++++++++++++---- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/apps/data-pipeline/degreeworks-scraper/src/index.ts b/apps/data-pipeline/degreeworks-scraper/src/index.ts index f72791d8..b69e23de 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/index.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/index.ts @@ -106,7 +106,6 @@ async function main() { majorRequirementBlockIndex = existing; } return { - id: `${id}+${specCode}`, majorId: id, specId: specCode, majorRequirementBlockIndex, @@ -195,7 +194,7 @@ async function main() { .insert(majorRequirement) .values(majorRequirementBlocks) .onConflictDoUpdate({ - target: majorRequirement.requirements, + target: majorRequirement.requirementsHash, set: conflictUpdateSetAllCols(majorRequirement), }) .returning({ id: majorRequirement.id }) @@ -241,7 +240,7 @@ async function main() { .values(majorSpecToRequirementData) .onConflictDoUpdate({ target: majorSpecPairToRequirement.id, - set: conflictUpdateSetAllCols(majorRequirement), + set: conflictUpdateSetAllCols(majorSpecPairToRequirement), }); console.log("Updated Major Spec pair to Requirements table"); }); diff --git a/packages/db/src/schema.ts b/packages/db/src/schema.ts index 561e352e..25fa755a 100644 --- a/packages/db/src/schema.ts +++ b/packages/db/src/schema.ts @@ -1,6 +1,7 @@ import type { SQL } from "drizzle-orm"; import { and, eq, getTableColumns, isNotNull, ne, sql } from "drizzle-orm"; import { + bigint, boolean, date, decimal, @@ -663,18 +664,33 @@ export const collegeRequirement = pgTable("college_requirement", { }); export const majorSpecPairToRequirement = pgTable("major_spec_pair_to_requirement", { - id: varchar("id").primaryKey(), + id: varchar("id") + .primaryKey() + .generatedAlwaysAs((): SQL => { + return sql` + CASE WHEN ${majorSpecPairToRequirement.specId} IS NOT NULL + THEN ${majorSpecPairToRequirement.majorId} || '+' || ${majorSpecPairToRequirement.specId} + ELSE ${majorSpecPairToRequirement.majorId} + END`; + }), majorId: varchar("major_id") .notNull() .references(() => major.id), specId: varchar("spec_id").references(() => specialization.id), - requirementId: uuid("requirementId").references(() => majorRequirement.id), + requirementId: uuid("requirement_id").references(() => majorRequirement.id), }); -export const majorRequirement = pgTable("major_requirement", { - id: uuid("id").primaryKey().defaultRandom(), - requirements: jsonb("requirements").$type().unique().notNull(), -}); +export const majorRequirement = pgTable( + "major_requirement", + { + id: uuid("id").primaryKey().defaultRandom(), + requirements: jsonb("requirements").$type().notNull(), + requirementsHash: bigint("requirements_hash", { mode: "bigint" }) + .generatedAlwaysAs(sql`jsonb_hash_extended(requirements, 0)`) + .unique(), + }, + (table) => [], +); export const major = pgTable( "major", From f9e8b26082c7bf74e1fffb4793e9a6a238739c1e Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Sat, 14 Feb 2026 17:28:26 -0800 Subject: [PATCH 22/91] db migration --- .../migrations/0024_glamorous_maria_hill.sql | 20 ----- .../db/migrations/0024_polymorphic_majors.sql | 37 +++++++++ .../db/migrations/meta/0024_snapshot.json | 78 ++++++++++++++++--- packages/db/migrations/meta/_journal.json | 4 +- 4 files changed, 105 insertions(+), 34 deletions(-) delete mode 100644 packages/db/migrations/0024_glamorous_maria_hill.sql create mode 100644 packages/db/migrations/0024_polymorphic_majors.sql diff --git a/packages/db/migrations/0024_glamorous_maria_hill.sql b/packages/db/migrations/0024_glamorous_maria_hill.sql deleted file mode 100644 index df85bb17..00000000 --- a/packages/db/migrations/0024_glamorous_maria_hill.sql +++ /dev/null @@ -1,20 +0,0 @@ -CREATE TABLE IF NOT EXISTS "major_requirement" ( - "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL, - "major_id" varchar NOT NULL, - "spec_id" varchar, - "requirements" json NOT NULL -); ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "major_requirement" ADD CONSTRAINT "major_requirement_major_id_specialization_id_fk" FOREIGN KEY ("major_id") REFERENCES "public"."specialization"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "major_requirement" ADD CONSTRAINT "major_requirement_spec_id_specialization_id_fk" FOREIGN KEY ("spec_id") REFERENCES "public"."specialization"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -ALTER TABLE "major" DROP COLUMN IF EXISTS "requirements"; \ No newline at end of file diff --git a/packages/db/migrations/0024_polymorphic_majors.sql b/packages/db/migrations/0024_polymorphic_majors.sql new file mode 100644 index 00000000..d4d2edff --- /dev/null +++ b/packages/db/migrations/0024_polymorphic_majors.sql @@ -0,0 +1,37 @@ +CREATE TABLE IF NOT EXISTS "major_requirement" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL, + "requirements" jsonb NOT NULL, + "requirements_hash" bigint GENERATED ALWAYS AS (jsonb_hash_extended(requirements, 0)) STORED, + CONSTRAINT "major_requirement_requirements_hash_unique" UNIQUE("requirements_hash") +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "major_spec_pair_to_requirement" ( + "id" varchar PRIMARY KEY GENERATED ALWAYS AS ( + CASE WHEN "major_spec_pair_to_requirement"."spec_id" IS NOT NULL + THEN "major_spec_pair_to_requirement"."major_id" || '+' || "major_spec_pair_to_requirement"."spec_id" + ELSE "major_spec_pair_to_requirement"."major_id" + END) STORED NOT NULL, + "major_id" varchar NOT NULL, + "spec_id" varchar, + "requirement_id" uuid +); +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "major_spec_pair_to_requirement" ADD CONSTRAINT "major_spec_pair_to_requirement_major_id_major_id_fk" FOREIGN KEY ("major_id") REFERENCES "public"."major"("id") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "major_spec_pair_to_requirement" ADD CONSTRAINT "major_spec_pair_to_requirement_spec_id_specialization_id_fk" FOREIGN KEY ("spec_id") REFERENCES "public"."specialization"("id") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "major_spec_pair_to_requirement" ADD CONSTRAINT "major_spec_pair_to_requirement_requirement_id_major_requirement_id_fk" FOREIGN KEY ("requirement_id") REFERENCES "public"."major_requirement"("id") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +ALTER TABLE "major" DROP COLUMN IF EXISTS "requirements"; \ No newline at end of file diff --git a/packages/db/migrations/meta/0024_snapshot.json b/packages/db/migrations/meta/0024_snapshot.json index a041dd50..79e492c8 100644 --- a/packages/db/migrations/meta/0024_snapshot.json +++ b/packages/db/migrations/meta/0024_snapshot.json @@ -1,5 +1,5 @@ { - "id": "49339d5c-621f-4a10-a42c-e527106d76f5", + "id": "b80d8f96-6e0a-4fa5-ac52-b848764a8705", "prevId": "b1dd1ce5-36ad-4ce8-a66d-02dd8630ce63", "version": "7", "dialect": "postgresql", @@ -1194,6 +1194,51 @@ "notNull": true, "default": "gen_random_uuid()" }, + "requirements": { + "name": "requirements", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "requirements_hash": { + "name": "requirements_hash", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "generated": { + "as": "jsonb_hash_extended(requirements, 0)", + "type": "stored" + } + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "major_requirement_requirements_hash_unique": { + "name": "major_requirement_requirements_hash_unique", + "nullsNotDistinct": false, + "columns": ["requirements_hash"] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.major_spec_pair_to_requirement": { + "name": "major_spec_pair_to_requirement", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true, + "generated": { + "as": "\n CASE WHEN \"major_spec_pair_to_requirement\".\"spec_id\" IS NOT NULL\n THEN \"major_spec_pair_to_requirement\".\"major_id\" || '+' || \"major_spec_pair_to_requirement\".\"spec_id\"\n ELSE \"major_spec_pair_to_requirement\".\"major_id\"\n END", + "type": "stored" + } + }, "major_id": { "name": "major_id", "type": "varchar", @@ -1206,32 +1251,41 @@ "primaryKey": false, "notNull": false }, - "requirements": { - "name": "requirements", - "type": "json", + "requirement_id": { + "name": "requirement_id", + "type": "uuid", "primaryKey": false, - "notNull": true + "notNull": false } }, "indexes": {}, "foreignKeys": { - "major_requirement_major_id_specialization_id_fk": { - "name": "major_requirement_major_id_specialization_id_fk", - "tableFrom": "major_requirement", - "tableTo": "specialization", + "major_spec_pair_to_requirement_major_id_major_id_fk": { + "name": "major_spec_pair_to_requirement_major_id_major_id_fk", + "tableFrom": "major_spec_pair_to_requirement", + "tableTo": "major", "columnsFrom": ["major_id"], "columnsTo": ["id"], "onDelete": "no action", "onUpdate": "no action" }, - "major_requirement_spec_id_specialization_id_fk": { - "name": "major_requirement_spec_id_specialization_id_fk", - "tableFrom": "major_requirement", + "major_spec_pair_to_requirement_spec_id_specialization_id_fk": { + "name": "major_spec_pair_to_requirement_spec_id_specialization_id_fk", + "tableFrom": "major_spec_pair_to_requirement", "tableTo": "specialization", "columnsFrom": ["spec_id"], "columnsTo": ["id"], "onDelete": "no action", "onUpdate": "no action" + }, + "major_spec_pair_to_requirement_requirement_id_major_requirement_id_fk": { + "name": "major_spec_pair_to_requirement_requirement_id_major_requirement_id_fk", + "tableFrom": "major_spec_pair_to_requirement", + "tableTo": "major_requirement", + "columnsFrom": ["requirement_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, diff --git a/packages/db/migrations/meta/_journal.json b/packages/db/migrations/meta/_journal.json index 75edd9ad..41187d67 100644 --- a/packages/db/migrations/meta/_journal.json +++ b/packages/db/migrations/meta/_journal.json @@ -173,8 +173,8 @@ { "idx": 24, "version": "7", - "when": 1770700619910, - "tag": "0024_glamorous_maria_hill", + "when": 1771116564370, + "tag": "0024_polymorphic_majors", "breakpoints": true } ] From 0fbcf1876254c79ab130fa935290c2d4f60b2430 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Sat, 14 Feb 2026 17:35:07 -0800 Subject: [PATCH 23/91] deleted outdated numbered migration files --- .../migrations/0023_add_req_spec_to_major.sql | 1 - .../db/migrations/meta/0023_snapshot.json | 3852 ----------------- packages/db/migrations/meta/_journal.json | 7 - 3 files changed, 3860 deletions(-) delete mode 100644 packages/db/migrations/0023_add_req_spec_to_major.sql delete mode 100644 packages/db/migrations/meta/0023_snapshot.json diff --git a/packages/db/migrations/0023_add_req_spec_to_major.sql b/packages/db/migrations/0023_add_req_spec_to_major.sql deleted file mode 100644 index 69395a96..00000000 --- a/packages/db/migrations/0023_add_req_spec_to_major.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "major" ADD COLUMN "require_spec" boolean NOT NULL; \ No newline at end of file diff --git a/packages/db/migrations/meta/0023_snapshot.json b/packages/db/migrations/meta/0023_snapshot.json deleted file mode 100644 index 374fee6c..00000000 --- a/packages/db/migrations/meta/0023_snapshot.json +++ /dev/null @@ -1,3852 +0,0 @@ -{ - "id": "5c7497e0-f570-40bb-9deb-67b139214c0e", - "prevId": "169622b6-bb25-46af-9384-cb3825533964", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.ap_exam": { - "name": "ap_exam", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "catalogue_name": { - "name": "catalogue_name", - "type": "varchar", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.ap_exam_reward": { - "name": "ap_exam_reward", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "units_granted": { - "name": "units_granted", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "elective_units_granted": { - "name": "elective_units_granted", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "ge_1a_courses_granted": { - "name": "ge_1a_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_1b_courses_granted": { - "name": "ge_1b_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_2_courses_granted": { - "name": "ge_2_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_3_courses_granted": { - "name": "ge_3_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_4_courses_granted": { - "name": "ge_4_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_5a_courses_granted": { - "name": "ge_5a_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_5b_courses_granted": { - "name": "ge_5b_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_6_courses_granted": { - "name": "ge_6_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_7_courses_granted": { - "name": "ge_7_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_8_courses_granted": { - "name": "ge_8_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "courses_granted": { - "name": "courses_granted", - "type": "json", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.ap_exam_to_reward": { - "name": "ap_exam_to_reward", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "exam_id": { - "name": "exam_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "score": { - "name": "score", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "reward": { - "name": "reward", - "type": "uuid", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "ap_exam_to_reward_exam_id_score_index": { - "name": "ap_exam_to_reward_exam_id_score_index", - "columns": [ - { - "expression": "exam_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "score", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "ap_exam_to_reward_exam_id_ap_exam_id_fk": { - "name": "ap_exam_to_reward_exam_id_ap_exam_id_fk", - "tableFrom": "ap_exam_to_reward", - "tableTo": "ap_exam", - "columnsFrom": ["exam_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "ap_exam_to_reward_reward_ap_exam_reward_id_fk": { - "name": "ap_exam_to_reward_reward_ap_exam_reward_id_fk", - "tableFrom": "ap_exam_to_reward", - "tableTo": "ap_exam_reward", - "columnsFrom": ["reward"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.calendar_term": { - "name": "calendar_term", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true, - "generated": { - "as": "\"calendar_term\".\"year\" || ' ' || CASE WHEN \"calendar_term\".\"quarter\" = 'Fall' THEN 'Fall' WHEN \"calendar_term\".\"quarter\" = 'Winter' THEN 'Winter' WHEN \"calendar_term\".\"quarter\" = 'Spring' THEN 'Spring' WHEN \"calendar_term\".\"quarter\" = 'Summer1' THEN 'Summer1' WHEN \"calendar_term\".\"quarter\" = 'Summer10wk' THEN 'Summer10wk' WHEN \"calendar_term\".\"quarter\" = 'Summer2' THEN 'Summer2' ELSE '' END", - "type": "stored" - } - }, - "year": { - "name": "year", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "quarter": { - "name": "quarter", - "type": "term", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "instruction_start": { - "name": "instruction_start", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "instruction_end": { - "name": "instruction_end", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "finals_start": { - "name": "finals_start", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "finals_end": { - "name": "finals_end", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "soc_available": { - "name": "soc_available", - "type": "date", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.catalogue_program": { - "name": "catalogue_program", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "program_name": { - "name": "program_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.college_requirement": { - "name": "college_requirement", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "requirements": { - "name": "requirements", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "college_requirement_requirements_unique": { - "name": "college_requirement_requirements_unique", - "nullsNotDistinct": false, - "columns": ["requirements"] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.course": { - "name": "course", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "department": { - "name": "department", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "shortened_dept": { - "name": "shortened_dept", - "type": "varchar", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "REPLACE(\"course\".\"department\", ' ', '')", - "type": "stored" - } - }, - "department_alias": { - "name": "department_alias", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "course_number": { - "name": "course_number", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "course_numeric": { - "name": "course_numeric", - "type": "integer", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "CASE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g') WHEN '' THEN 0 ELSE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g')::INTEGER END", - "type": "stored" - } - }, - "school": { - "name": "school", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "course_level": { - "name": "course_level", - "type": "course_level", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "min_units": { - "name": "min_units", - "type": "numeric(4, 2)", - "primaryKey": false, - "notNull": true - }, - "max_units": { - "name": "max_units", - "type": "numeric(4, 2)", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "department_name": { - "name": "department_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "prerequisite_tree": { - "name": "prerequisite_tree", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "prerequisite_text": { - "name": "prerequisite_text", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "repeatability": { - "name": "repeatability", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "grading_option": { - "name": "grading_option", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "concurrent": { - "name": "concurrent", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "same_as": { - "name": "same_as", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "restriction": { - "name": "restriction", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "overlap": { - "name": "overlap", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "corequisites": { - "name": "corequisites", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "is_ge_1a": { - "name": "is_ge_1a", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_1b": { - "name": "is_ge_1b", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_2": { - "name": "is_ge_2", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_3": { - "name": "is_ge_3", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_4": { - "name": "is_ge_4", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_5a": { - "name": "is_ge_5a", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_5b": { - "name": "is_ge_5b", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_6": { - "name": "is_ge_6", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_7": { - "name": "is_ge_7", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_8": { - "name": "is_ge_8", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "ge_text": { - "name": "ge_text", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "course_search_index": { - "name": "course_search_index", - "columns": [ - { - "expression": "(\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"id\", '')), 'A') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"department\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"department_alias\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"shortened_dept\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"course_number\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"course_numeric\"::TEXT, '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"title\", '')), 'C') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"description\", '')), 'D')\n)", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "shortened_dept": { - "name": "shortened_dept", - "columns": [ - { - "expression": "shortened_dept", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.degree": { - "name": "degree", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "division": { - "name": "division", - "type": "division", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.instructor": { - "name": "instructor", - "schema": "", - "columns": { - "ucinetid": { - "name": "ucinetid", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "department": { - "name": "department", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "instructor_search_index": { - "name": "instructor_search_index", - "columns": [ - { - "expression": "(\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"ucinetid\", '')), 'A') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"name\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"title\", '')), 'B')\n)", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.instructor_to_websoc_instructor": { - "name": "instructor_to_websoc_instructor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "instructor_ucinetid": { - "name": "instructor_ucinetid", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "websoc_instructor_name": { - "name": "websoc_instructor_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "instructor_to_websoc_instructor_instructor_ucinetid_index": { - "name": "instructor_to_websoc_instructor_instructor_ucinetid_index", - "columns": [ - { - "expression": "instructor_ucinetid", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "instructor_to_websoc_instructor_websoc_instructor_name_index": { - "name": "instructor_to_websoc_instructor_websoc_instructor_name_index", - "columns": [ - { - "expression": "websoc_instructor_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "instructor_to_websoc_instructor_instructor_ucinetid_websoc_instructor_name_index": { - "name": "instructor_to_websoc_instructor_instructor_ucinetid_websoc_instructor_name_index", - "columns": [ - { - "expression": "instructor_ucinetid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "websoc_instructor_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "instructor_to_websoc_instructor_instructor_ucinetid_instructor_ucinetid_fk": { - "name": "instructor_to_websoc_instructor_instructor_ucinetid_instructor_ucinetid_fk", - "tableFrom": "instructor_to_websoc_instructor", - "tableTo": "instructor", - "columnsFrom": ["instructor_ucinetid"], - "columnsTo": ["ucinetid"], - "onDelete": "no action", - "onUpdate": "no action" - }, - "instructor_to_websoc_instructor_websoc_instructor_name_websoc_instructor_name_fk": { - "name": "instructor_to_websoc_instructor_websoc_instructor_name_websoc_instructor_name_fk", - "tableFrom": "instructor_to_websoc_instructor", - "tableTo": "websoc_instructor", - "columnsFrom": ["websoc_instructor_name"], - "columnsTo": ["name"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.larc_section": { - "name": "larc_section", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "course_id": { - "name": "course_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "days_string": { - "name": "days_string", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "time_string": { - "name": "time_string", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "start_time": { - "name": "start_time", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "end_time": { - "name": "end_time", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "instructor": { - "name": "instructor", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "building": { - "name": "building", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "meets_monday": { - "name": "meets_monday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_tuesday": { - "name": "meets_tuesday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_wednesday": { - "name": "meets_wednesday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_thursday": { - "name": "meets_thursday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_friday": { - "name": "meets_friday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_saturday": { - "name": "meets_saturday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_sunday": { - "name": "meets_sunday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "larc_section_course_id_index": { - "name": "larc_section_course_id_index", - "columns": [ - { - "expression": "course_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "larc_section_course_id_websoc_course_id_fk": { - "name": "larc_section_course_id_websoc_course_id_fk", - "tableFrom": "larc_section", - "tableTo": "websoc_course", - "columnsFrom": ["course_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.library_traffic": { - "name": "library_traffic", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "library_name": { - "name": "library_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "location_name": { - "name": "location_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "traffic_count": { - "name": "traffic_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "traffic_percentage": { - "name": "traffic_percentage", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "timestamp": { - "name": "timestamp", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "library_traffic_library_name_index": { - "name": "library_traffic_library_name_index", - "columns": [ - { - "expression": "library_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "library_traffic_location_name_index": { - "name": "library_traffic_location_name_index", - "columns": [ - { - "expression": "location_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.library_traffic_history": { - "name": "library_traffic_history", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "location_id": { - "name": "location_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "traffic_count": { - "name": "traffic_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "traffic_percentage": { - "name": "traffic_percentage", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "timestamp": { - "name": "timestamp", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "library_traffic_history_location_id_timestamp_index": { - "name": "library_traffic_history_location_id_timestamp_index", - "columns": [ - { - "expression": "location_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "timestamp", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "library_traffic_history_location_id_library_traffic_id_fk": { - "name": "library_traffic_history_location_id_library_traffic_id_fk", - "tableFrom": "library_traffic_history", - "tableTo": "library_traffic", - "columnsFrom": ["location_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.major": { - "name": "major", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "degree_id": { - "name": "degree_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "code": { - "name": "code", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "require_spec": { - "name": "require_spec", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "college_requirement": { - "name": "college_requirement", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "requirements": { - "name": "requirements", - "type": "json", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "major_degree_id_index": { - "name": "major_degree_id_index", - "columns": [ - { - "expression": "degree_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "major_college_requirement_index": { - "name": "major_college_requirement_index", - "columns": [ - { - "expression": "college_requirement", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "major_degree_id_degree_id_fk": { - "name": "major_degree_id_degree_id_fk", - "tableFrom": "major", - "tableTo": "degree", - "columnsFrom": ["degree_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - }, - "major_college_requirement_college_requirement_id_fk": { - "name": "major_college_requirement_college_requirement_id_fk", - "tableFrom": "major", - "tableTo": "college_requirement", - "columnsFrom": ["college_requirement"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.minor": { - "name": "minor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "requirements": { - "name": "requirements", - "type": "json", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.prerequisite": { - "name": "prerequisite", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "dep_dept": { - "name": "dep_dept", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "prerequisite_id": { - "name": "prerequisite_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "dependency_id": { - "name": "dependency_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "prerequisite_dep_dept_index": { - "name": "prerequisite_dep_dept_index", - "columns": [ - { - "expression": "dep_dept", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "prerequisite_prerequisite_id_index": { - "name": "prerequisite_prerequisite_id_index", - "columns": [ - { - "expression": "prerequisite_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "prerequisite_dependency_id_index": { - "name": "prerequisite_dependency_id_index", - "columns": [ - { - "expression": "dependency_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "prerequisite_prerequisite_id_dependency_id_index": { - "name": "prerequisite_prerequisite_id_dependency_id_index", - "columns": [ - { - "expression": "prerequisite_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dependency_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.sample_program_variation": { - "name": "sample_program_variation", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "program_id": { - "name": "program_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "label": { - "name": "label", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "sample_program": { - "name": "sample_program", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "variation_notes": { - "name": "variation_notes", - "type": "varchar[]", - "primaryKey": false, - "notNull": true, - "default": "ARRAY[]::VARCHAR[]" - } - }, - "indexes": {}, - "foreignKeys": { - "sample_program_variation_program_id_catalogue_program_id_fk": { - "name": "sample_program_variation_program_id_catalogue_program_id_fk", - "tableFrom": "sample_program_variation", - "tableTo": "catalogue_program", - "columnsFrom": ["program_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.school_requirement": { - "name": "school_requirement", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "requirements": { - "name": "requirements", - "type": "json", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.specialization": { - "name": "specialization", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "major_id": { - "name": "major_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "requirements": { - "name": "requirements", - "type": "json", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "specialization_major_id_index": { - "name": "specialization_major_id_index", - "columns": [ - { - "expression": "major_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "specialization_major_id_major_id_fk": { - "name": "specialization_major_id_major_id_fk", - "tableFrom": "specialization", - "tableTo": "major", - "columnsFrom": ["major_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.study_location": { - "name": "study_location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.study_room": { - "name": "study_room", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "capacity": { - "name": "capacity", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "location": { - "name": "location", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "directions": { - "name": "directions", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "tech_enhanced": { - "name": "tech_enhanced", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "study_location_id": { - "name": "study_location_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "study_room_study_location_id_index": { - "name": "study_room_study_location_id_index", - "columns": [ - { - "expression": "study_location_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "study_room_study_location_id_study_location_id_fk": { - "name": "study_room_study_location_id_study_location_id_fk", - "tableFrom": "study_room", - "tableTo": "study_location", - "columnsFrom": ["study_location_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.study_room_slot": { - "name": "study_room_slot", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "study_room_id": { - "name": "study_room_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "start": { - "name": "start", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "end": { - "name": "end", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "is_available": { - "name": "is_available", - "type": "boolean", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "study_room_slot_study_room_id_index": { - "name": "study_room_slot_study_room_id_index", - "columns": [ - { - "expression": "study_room_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "study_room_slot_study_room_id_start_end_index": { - "name": "study_room_slot_study_room_id_start_end_index", - "columns": [ - { - "expression": "study_room_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "start", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "end", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "study_room_slot_study_room_id_study_room_id_fk": { - "name": "study_room_slot_study_room_id_study_room_id_fk", - "tableFrom": "study_room_slot", - "tableTo": "study_room", - "columnsFrom": ["study_room_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_course": { - "name": "websoc_course", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "department_id": { - "name": "department_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "course_id": { - "name": "course_id", - "type": "varchar", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "REPLACE(\"websoc_course\".\"dept_code\", ' ', '') || \"websoc_course\".\"course_number\"", - "type": "stored" - } - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "year": { - "name": "year", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "quarter": { - "name": "quarter", - "type": "term", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "school_name": { - "name": "school_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "dept_code": { - "name": "dept_code", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "course_title": { - "name": "course_title", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "course_number": { - "name": "course_number", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "course_numeric": { - "name": "course_numeric", - "type": "integer", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "CASE REGEXP_REPLACE(\"websoc_course\".\"course_number\", '\\D', '', 'g') WHEN '' THEN 0 ELSE REGEXP_REPLACE(\"websoc_course\".\"course_number\", '\\D', '', 'g')::INTEGER END", - "type": "stored" - } - }, - "course_comment": { - "name": "course_comment", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "prerequisite_link": { - "name": "prerequisite_link", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "is_ge_1a": { - "name": "is_ge_1a", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_1b": { - "name": "is_ge_1b", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_2": { - "name": "is_ge_2", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_3": { - "name": "is_ge_3", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_4": { - "name": "is_ge_4", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_5a": { - "name": "is_ge_5a", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_5b": { - "name": "is_ge_5b", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_6": { - "name": "is_ge_6", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_7": { - "name": "is_ge_7", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_8": { - "name": "is_ge_8", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "websoc_course_department_id_index": { - "name": "websoc_course_department_id_index", - "columns": [ - { - "expression": "department_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_course_id_index": { - "name": "websoc_course_course_id_index", - "columns": [ - { - "expression": "course_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_school_name_dept_code_course_number_course_title_index": { - "name": "websoc_course_year_quarter_school_name_dept_code_course_number_course_title_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "school_name", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dept_code", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "course_number", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "course_title", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_1a_index": { - "name": "websoc_course_year_quarter_is_ge_1a_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_1a", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_1b_index": { - "name": "websoc_course_year_quarter_is_ge_1b_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_1b", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_2_index": { - "name": "websoc_course_year_quarter_is_ge_2_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_2", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_3_index": { - "name": "websoc_course_year_quarter_is_ge_3_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_3", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_4_index": { - "name": "websoc_course_year_quarter_is_ge_4_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_4", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_5a_index": { - "name": "websoc_course_year_quarter_is_ge_5a_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_5a", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_5b_index": { - "name": "websoc_course_year_quarter_is_ge_5b_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_5b", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_6_index": { - "name": "websoc_course_year_quarter_is_ge_6_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_6", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_7_index": { - "name": "websoc_course_year_quarter_is_ge_7_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_7", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_8_index": { - "name": "websoc_course_year_quarter_is_ge_8_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_8", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_dept_code_index": { - "name": "websoc_course_year_quarter_dept_code_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dept_code", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_dept_code_course_number_index": { - "name": "websoc_course_year_quarter_dept_code_course_number_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dept_code", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "course_number", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_course_department_id_websoc_department_id_fk": { - "name": "websoc_course_department_id_websoc_department_id_fk", - "tableFrom": "websoc_course", - "tableTo": "websoc_department", - "columnsFrom": ["department_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_department": { - "name": "websoc_department", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "school_id": { - "name": "school_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "year": { - "name": "year", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "quarter": { - "name": "quarter", - "type": "term", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "dept_code": { - "name": "dept_code", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "dept_name": { - "name": "dept_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "dept_comment": { - "name": "dept_comment", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "section_code_range_comments": { - "name": "section_code_range_comments", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "course_number_range_comments": { - "name": "course_number_range_comments", - "type": "text[]", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "websoc_department_school_id_index": { - "name": "websoc_department_school_id_index", - "columns": [ - { - "expression": "school_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_department_year_quarter_school_id_dept_code_index": { - "name": "websoc_department_year_quarter_school_id_dept_code_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "school_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dept_code", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_department_school_id_websoc_school_id_fk": { - "name": "websoc_department_school_id_websoc_school_id_fk", - "tableFrom": "websoc_department", - "tableTo": "websoc_school", - "columnsFrom": ["school_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_instructor": { - "name": "websoc_instructor", - "schema": "", - "columns": { - "name": { - "name": "name", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_location": { - "name": "websoc_location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "building": { - "name": "building", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "room": { - "name": "room", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "websoc_location_building_room_index": { - "name": "websoc_location_building_room_index", - "columns": [ - { - "expression": "building", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "room", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_meta": { - "name": "websoc_meta", - "schema": "", - "columns": { - "name": { - "name": "name", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "last_scraped": { - "name": "last_scraped", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_dept_scraped": { - "name": "last_dept_scraped", - "type": "varchar", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_school": { - "name": "websoc_school", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "year": { - "name": "year", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "quarter": { - "name": "quarter", - "type": "term", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "school_name": { - "name": "school_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "school_comment": { - "name": "school_comment", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "websoc_school_year_quarter_school_name_index": { - "name": "websoc_school_year_quarter_school_name_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "school_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_section": { - "name": "websoc_section", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "course_id": { - "name": "course_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "year": { - "name": "year", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "quarter": { - "name": "quarter", - "type": "term", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "units": { - "name": "units", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "websoc_status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "instructors": { - "name": "instructors", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "meetings": { - "name": "meetings", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "final_exam_string": { - "name": "final_exam_string", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "final_exam": { - "name": "final_exam", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "section_num": { - "name": "section_num", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "max_capacity": { - "name": "max_capacity", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "section_code": { - "name": "section_code", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "section_type": { - "name": "section_type", - "type": "websoc_section_type", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "num_requested": { - "name": "num_requested", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "restriction_string": { - "name": "restriction_string", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "restriction_a": { - "name": "restriction_a", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_b": { - "name": "restriction_b", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_c": { - "name": "restriction_c", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_d": { - "name": "restriction_d", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_e": { - "name": "restriction_e", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_f": { - "name": "restriction_f", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_g": { - "name": "restriction_g", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_h": { - "name": "restriction_h", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_i": { - "name": "restriction_i", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_j": { - "name": "restriction_j", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_k": { - "name": "restriction_k", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_l": { - "name": "restriction_l", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_m": { - "name": "restriction_m", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_n": { - "name": "restriction_n", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_o": { - "name": "restriction_o", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_r": { - "name": "restriction_r", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_s": { - "name": "restriction_s", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_x": { - "name": "restriction_x", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "num_on_waitlist": { - "name": "num_on_waitlist", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "num_waitlist_cap": { - "name": "num_waitlist_cap", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "section_comment": { - "name": "section_comment", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "num_new_only_reserved": { - "name": "num_new_only_reserved", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "num_currently_total_enrolled": { - "name": "num_currently_total_enrolled", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "num_currently_section_enrolled": { - "name": "num_currently_section_enrolled", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "is_cancelled": { - "name": "is_cancelled", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "\"websoc_section\".\"section_comment\" LIKE '%*** CANCELLED ***%' OR \"websoc_section\".\"section_comment\" LIKE '%*** CANCELED ***%'", - "type": "stored" - } - }, - "web_url": { - "name": "web_url", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "websoc_section_course_id_index": { - "name": "websoc_section_course_id_index", - "columns": [ - { - "expression": "course_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_section_year_quarter_section_code_index": { - "name": "websoc_section_year_quarter_section_code_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "section_code", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_section_course_id_websoc_course_id_fk": { - "name": "websoc_section_course_id_websoc_course_id_fk", - "tableFrom": "websoc_section", - "tableTo": "websoc_course", - "columnsFrom": ["course_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_section_enrollment": { - "name": "websoc_section_enrollment", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "section_id": { - "name": "section_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "date", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "year": { - "name": "year", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "quarter": { - "name": "quarter", - "type": "term", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "max_capacity": { - "name": "max_capacity", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "num_currently_total_enrolled": { - "name": "num_currently_total_enrolled", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "num_on_waitlist": { - "name": "num_on_waitlist", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "num_waitlist_cap": { - "name": "num_waitlist_cap", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "num_requested": { - "name": "num_requested", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "num_new_only_reserved": { - "name": "num_new_only_reserved", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "websoc_status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "websoc_section_enrollment_section_id_index": { - "name": "websoc_section_enrollment_section_id_index", - "columns": [ - { - "expression": "section_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_section_enrollment_section_id_created_at_index": { - "name": "websoc_section_enrollment_section_id_created_at_index", - "columns": [ - { - "expression": "section_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_section_enrollment_section_id_websoc_section_id_fk": { - "name": "websoc_section_enrollment_section_id_websoc_section_id_fk", - "tableFrom": "websoc_section_enrollment", - "tableTo": "websoc_section", - "columnsFrom": ["section_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_section_grade": { - "name": "websoc_section_grade", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "section_id": { - "name": "section_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "grade_a_count": { - "name": "grade_a_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "grade_b_count": { - "name": "grade_b_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "grade_c_count": { - "name": "grade_c_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "grade_d_count": { - "name": "grade_d_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "grade_f_count": { - "name": "grade_f_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "grade_p_count": { - "name": "grade_p_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "grade_np_count": { - "name": "grade_np_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "grade_w_count": { - "name": "grade_w_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "average_gpa": { - "name": "average_gpa", - "type": "numeric(3, 2)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "websoc_section_grade_section_id_index": { - "name": "websoc_section_grade_section_id_index", - "columns": [ - { - "expression": "section_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_section_grade_section_id_websoc_section_id_fk": { - "name": "websoc_section_grade_section_id_websoc_section_id_fk", - "tableFrom": "websoc_section_grade", - "tableTo": "websoc_section", - "columnsFrom": ["section_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "websoc_section_grade_section_id_unique": { - "name": "websoc_section_grade_section_id_unique", - "nullsNotDistinct": false, - "columns": ["section_id"] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_section_meeting": { - "name": "websoc_section_meeting", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "section_id": { - "name": "section_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "section_code": { - "name": "section_code", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "meeting_index": { - "name": "meeting_index", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "time_string": { - "name": "time_string", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "time_is_tba": { - "name": "time_is_tba", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "\"websoc_section_meeting\".\"time_string\" LIKE '%TBA%'", - "type": "stored" - } - }, - "start_time": { - "name": "start_time", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "end_time": { - "name": "end_time", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "days_string": { - "name": "days_string", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "meets_monday": { - "name": "meets_monday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_tuesday": { - "name": "meets_tuesday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_wednesday": { - "name": "meets_wednesday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_thursday": { - "name": "meets_thursday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_friday": { - "name": "meets_friday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_saturday": { - "name": "meets_saturday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_sunday": { - "name": "meets_sunday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "websoc_section_meeting_section_id_index": { - "name": "websoc_section_meeting_section_id_index", - "columns": [ - { - "expression": "section_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_section_meeting_section_id_websoc_section_id_fk": { - "name": "websoc_section_meeting_section_id_websoc_section_id_fk", - "tableFrom": "websoc_section_meeting", - "tableTo": "websoc_section", - "columnsFrom": ["section_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_section_meeting_to_location": { - "name": "websoc_section_meeting_to_location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "meeting_id": { - "name": "meeting_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "location_id": { - "name": "location_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "websoc_section_meeting_to_location_meeting_id_index": { - "name": "websoc_section_meeting_to_location_meeting_id_index", - "columns": [ - { - "expression": "meeting_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_section_meeting_to_location_location_id_index": { - "name": "websoc_section_meeting_to_location_location_id_index", - "columns": [ - { - "expression": "location_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_section_meeting_to_location_meeting_id_location_id_index": { - "name": "websoc_section_meeting_to_location_meeting_id_location_id_index", - "columns": [ - { - "expression": "meeting_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "location_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_section_meeting_to_location_meeting_id_websoc_section_meeting_id_fk": { - "name": "websoc_section_meeting_to_location_meeting_id_websoc_section_meeting_id_fk", - "tableFrom": "websoc_section_meeting_to_location", - "tableTo": "websoc_section_meeting", - "columnsFrom": ["meeting_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "websoc_section_meeting_to_location_location_id_websoc_location_id_fk": { - "name": "websoc_section_meeting_to_location_location_id_websoc_location_id_fk", - "tableFrom": "websoc_section_meeting_to_location", - "tableTo": "websoc_location", - "columnsFrom": ["location_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_section_to_instructor": { - "name": "websoc_section_to_instructor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "section_id": { - "name": "section_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "instructor_name": { - "name": "instructor_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "websoc_section_to_instructor_section_id_index": { - "name": "websoc_section_to_instructor_section_id_index", - "columns": [ - { - "expression": "section_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_section_to_instructor_instructor_name_index": { - "name": "websoc_section_to_instructor_instructor_name_index", - "columns": [ - { - "expression": "instructor_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_section_to_instructor_section_id_websoc_section_id_fk": { - "name": "websoc_section_to_instructor_section_id_websoc_section_id_fk", - "tableFrom": "websoc_section_to_instructor", - "tableTo": "websoc_section", - "columnsFrom": ["section_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - }, - "websoc_section_to_instructor_instructor_name_websoc_instructor_name_fk": { - "name": "websoc_section_to_instructor_instructor_name_websoc_instructor_name_fk", - "tableFrom": "websoc_section_to_instructor", - "tableTo": "websoc_instructor", - "columnsFrom": ["instructor_name"], - "columnsTo": ["name"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.course_level": { - "name": "course_level", - "schema": "public", - "values": ["LowerDiv", "UpperDiv", "Graduate"] - }, - "public.division": { - "name": "division", - "schema": "public", - "values": ["Undergraduate", "Graduate"] - }, - "public.term": { - "name": "term", - "schema": "public", - "values": ["Fall", "Winter", "Spring", "Summer1", "Summer10wk", "Summer2"] - }, - "public.websoc_section_type": { - "name": "websoc_section_type", - "schema": "public", - "values": [ - "Act", - "Col", - "Dis", - "Fld", - "Lab", - "Lec", - "Qiz", - "Res", - "Sem", - "Stu", - "Tap", - "Tut" - ] - }, - "public.websoc_status": { - "name": "websoc_status", - "schema": "public", - "values": ["OPEN", "Waitl", "FULL", "NewOnly"] - } - }, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": { - "public.course_view": { - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "department": { - "name": "department", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "shortened_dept": { - "name": "shortened_dept", - "type": "varchar", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "REPLACE(\"course\".\"department\", ' ', '')", - "type": "stored" - } - }, - "department_alias": { - "name": "department_alias", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "course_number": { - "name": "course_number", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "course_numeric": { - "name": "course_numeric", - "type": "integer", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "CASE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g') WHEN '' THEN 0 ELSE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g')::INTEGER END", - "type": "stored" - } - }, - "school": { - "name": "school", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "course_level": { - "name": "course_level", - "type": "course_level", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "min_units": { - "name": "min_units", - "type": "numeric(4, 2)", - "primaryKey": false, - "notNull": true - }, - "max_units": { - "name": "max_units", - "type": "numeric(4, 2)", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "department_name": { - "name": "department_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "prerequisite_tree": { - "name": "prerequisite_tree", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "prerequisite_text": { - "name": "prerequisite_text", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "repeatability": { - "name": "repeatability", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "grading_option": { - "name": "grading_option", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "concurrent": { - "name": "concurrent", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "same_as": { - "name": "same_as", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "restriction": { - "name": "restriction", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "overlap": { - "name": "overlap", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "corequisites": { - "name": "corequisites", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "is_ge_1a": { - "name": "is_ge_1a", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_1b": { - "name": "is_ge_1b", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_2": { - "name": "is_ge_2", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_3": { - "name": "is_ge_3", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_4": { - "name": "is_ge_4", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_5a": { - "name": "is_ge_5a", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_5b": { - "name": "is_ge_5b", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_6": { - "name": "is_ge_6", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_7": { - "name": "is_ge_7", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_8": { - "name": "is_ge_8", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "ge_text": { - "name": "ge_text", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "definition": "select \"course\".\"id\", \"course\".\"updated_at\", \"course\".\"department\", \"course\".\"shortened_dept\", \"course\".\"department_alias\", \"course\".\"course_number\", \"course\".\"course_numeric\", \"course\".\"school\", \"course\".\"title\", \"course\".\"course_level\", \"course\".\"min_units\", \"course\".\"max_units\", \"course\".\"description\", \"course\".\"department_name\", \"course\".\"prerequisite_tree\", \"course\".\"prerequisite_text\", \"course\".\"repeatability\", \"course\".\"grading_option\", \"course\".\"concurrent\", \"course\".\"same_as\", \"course\".\"restriction\", \"course\".\"overlap\", \"course\".\"corequisites\", \"course\".\"is_ge_1a\", \"course\".\"is_ge_1b\", \"course\".\"is_ge_2\", \"course\".\"is_ge_3\", \"course\".\"is_ge_4\", \"course\".\"is_ge_5a\", \"course\".\"is_ge_5b\", \"course\".\"is_ge_6\", \"course\".\"is_ge_7\", \"course\".\"is_ge_8\", \"course\".\"ge_text\", \n ARRAY_REMOVE(COALESCE(\n (\n SELECT ARRAY_AGG(\n CASE WHEN \"prerequisite_course\".\"id\" IS NULL THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'id', \"prerequisite_course\".\"id\",\n 'title', \"prerequisite_course\".\"title\",\n 'department', \"prerequisite_course\".\"department\",\n 'courseNumber', \"prerequisite_course\".\"course_number\"\n )\n END\n )\n FROM \"prerequisite\"\n LEFT JOIN \"course\" \"prerequisite_course\" ON \"prerequisite_course\".\"id\" = \"prerequisite\".\"prerequisite_id\"\n WHERE \"prerequisite\".\"dependency_id\" = \"course\".\"id\"\n ),\n ARRAY[]::JSONB[]), NULL)\n as \"prerequisites\", \n ARRAY_REMOVE(COALESCE(\n (\n SELECT ARRAY_AGG(\n CASE WHEN \"dependency_course\".\"id\" IS NULL THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'id', \"dependency_course\".\"id\",\n 'title', \"dependency_course\".\"title\",\n 'department', \"dependency_course\".\"department\",\n 'courseNumber', \"dependency_course\".\"course_number\"\n )\n END\n )\n FROM \"prerequisite\" \"dependency\"\n LEFT JOIN \"course\" \"dependency_course\" ON \"dependency_course\".\"id\" = \"dependency\".\"dependency_id\"\n WHERE \"dependency\".\"prerequisite_id\" = \"course\".\"id\"\n ),\n ARRAY[]::JSONB[]), NULL)\n as \"dependencies\", \n ARRAY_REMOVE(ARRAY_AGG(DISTINCT\n CASE WHEN \"websoc_course\".\"year\" IS NULL THEN NULL\n ELSE CONCAT(\"websoc_course\".\"year\", ' ', \"websoc_course\".\"quarter\")\n END\n ), NULL)\n as \"terms\", \n ARRAY_REMOVE(COALESCE(ARRAY_AGG(DISTINCT\n CASE WHEN \"instructor\".\"ucinetid\" IS NULL THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'ucinetid', \"instructor\".\"ucinetid\",\n 'name', \"instructor\".\"name\",\n 'title', \"instructor\".\"title\",\n 'email', \"instructor\".\"email\",\n 'department', \"instructor\".\"department\",\n 'shortenedNames', ARRAY(\n SELECT \"instructor_to_websoc_instructor\".\"websoc_instructor_name\"\n FROM \"instructor_to_websoc_instructor\"\n WHERE \"instructor_to_websoc_instructor\".\"instructor_ucinetid\" = \"instructor\".\"ucinetid\"\n )\n )\n END\n ), ARRAY[]::JSONB[]), NULL)\n as \"instructors\" from \"course\" left join \"websoc_course\" on \"websoc_course\".\"course_id\" = \"course\".\"id\" left join \"websoc_section\" on \"websoc_section\".\"course_id\" = \"websoc_course\".\"id\" left join \"websoc_section_to_instructor\" on \"websoc_section_to_instructor\".\"section_id\" = \"websoc_section\".\"id\" left join \"websoc_instructor\" on \"websoc_instructor\".\"name\" = \"websoc_section_to_instructor\".\"instructor_name\" left join \"instructor_to_websoc_instructor\" on \"instructor_to_websoc_instructor\".\"websoc_instructor_name\" = \"websoc_instructor\".\"name\" left join \"instructor\" on (\"instructor\".\"ucinetid\" = \"instructor_to_websoc_instructor\".\"instructor_ucinetid\" and \"instructor\".\"ucinetid\" is not null and \"instructor\".\"ucinetid\" <> 'student') group by \"course\".\"id\"", - "name": "course_view", - "schema": "public", - "isExisting": false, - "materialized": true - }, - "public.instructor_view": { - "columns": { - "ucinetid": { - "name": "ucinetid", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "department": { - "name": "department", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "definition": "with \"shortened_names_cte\" as (select \"instructor_ucinetid\", ARRAY_AGG(\"websoc_instructor_name\") as \"shortened_names\" from \"instructor_to_websoc_instructor\" group by \"instructor_to_websoc_instructor\".\"instructor_ucinetid\"), \"courses_cte\" as (with \"terms_cte\" as (select \"course\".\"id\", \"instructor_to_websoc_instructor\".\"instructor_ucinetid\", \n ARRAY_REMOVE(ARRAY_AGG(DISTINCT\n CASE WHEN \"websoc_course\".\"year\" IS NULL THEN NULL\n ELSE CONCAT(\"websoc_course\".\"year\", ' ', \"websoc_course\".\"quarter\")\n END\n ), NULL) as \"terms\" from \"course\" left join \"websoc_course\" on \"websoc_course\".\"course_id\" = \"course\".\"id\" left join \"websoc_section\" on \"websoc_section\".\"course_id\" = \"websoc_course\".\"id\" left join \"websoc_section_to_instructor\" on \"websoc_section_to_instructor\".\"section_id\" = \"websoc_section\".\"id\" left join \"websoc_instructor\" on \"websoc_instructor\".\"name\" = \"websoc_section_to_instructor\".\"instructor_name\" left join \"instructor_to_websoc_instructor\" on \"instructor_to_websoc_instructor\".\"websoc_instructor_name\" = \"websoc_instructor\".\"name\" group by \"course\".\"id\", \"instructor_to_websoc_instructor\".\"instructor_ucinetid\") select \"terms_cte\".\"instructor_ucinetid\", \"course\".\"id\", \n CASE WHEN \"course\".\"id\" IS NULL\n THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'id', \"course\".\"id\",\n 'title', \"course\".\"title\",\n 'department', \"course\".\"department\",\n 'courseNumber', \"course\".\"course_number\",\n 'terms', COALESCE(\"terms\", ARRAY[]::TEXT[])\n )\n END\n as \"course_info\" from \"course\" left join \"terms_cte\" on \"terms_cte\".\"id\" = \"course\".\"id\" group by \"course\".\"id\", \"terms_cte\".\"instructor_ucinetid\", \"terms\") select \"instructor\".\"ucinetid\", \"instructor\".\"name\", \"instructor\".\"title\", \"instructor\".\"email\", \"instructor\".\"department\", COALESCE(\"shortened_names\", ARRAY[]::TEXT[]) as \"shortened_names\", \n ARRAY_REMOVE(ARRAY_AGG(DISTINCT \"course_info\"), NULL)\n as \"courses\" from \"instructor\" left join \"shortened_names_cte\" on \"shortened_names_cte\".\"instructor_ucinetid\" = \"instructor\".\"ucinetid\" left join \"courses_cte\" on \"courses_cte\".\"instructor_ucinetid\" = \"instructor\".\"ucinetid\" where \"instructor\".\"ucinetid\" <> 'student' group by \"instructor\".\"ucinetid\", \"shortened_names\"", - "name": "instructor_view", - "schema": "public", - "isExisting": false, - "materialized": true - } - }, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} diff --git a/packages/db/migrations/meta/_journal.json b/packages/db/migrations/meta/_journal.json index 9e7c5143..9a7f9aea 100644 --- a/packages/db/migrations/meta/_journal.json +++ b/packages/db/migrations/meta/_journal.json @@ -162,13 +162,6 @@ "when": 1766088418349, "tag": "0022_fix_websoc_is_cancelled", "breakpoints": true - }, - { - "idx": 23, - "version": "7", - "when": 1770506250379, - "tag": "0023_add_req_spec_to_major", - "breakpoints": true } ] } From 97f79858c75e0605266290509d821d6a2ec73e7a Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Sat, 14 Feb 2026 18:26:18 -0800 Subject: [PATCH 24/91] re-migrated --- .../0024_add_req_spec_to_major_table.sql | 1 + .../db/migrations/meta/0024_snapshot.json | 3858 +++++++++++++++++ packages/db/migrations/meta/_journal.json | 7 + 3 files changed, 3866 insertions(+) create mode 100644 packages/db/migrations/0024_add_req_spec_to_major_table.sql create mode 100644 packages/db/migrations/meta/0024_snapshot.json diff --git a/packages/db/migrations/0024_add_req_spec_to_major_table.sql b/packages/db/migrations/0024_add_req_spec_to_major_table.sql new file mode 100644 index 00000000..69395a96 --- /dev/null +++ b/packages/db/migrations/0024_add_req_spec_to_major_table.sql @@ -0,0 +1 @@ +ALTER TABLE "major" ADD COLUMN "require_spec" boolean NOT NULL; \ No newline at end of file diff --git a/packages/db/migrations/meta/0024_snapshot.json b/packages/db/migrations/meta/0024_snapshot.json new file mode 100644 index 00000000..2edc7a5d --- /dev/null +++ b/packages/db/migrations/meta/0024_snapshot.json @@ -0,0 +1,3858 @@ +{ + "id": "c4146ec9-7406-4087-9c77-ce8e73661fe8", + "prevId": "b1dd1ce5-36ad-4ce8-a66d-02dd8630ce63", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.ap_exam": { + "name": "ap_exam", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "catalogue_name": { + "name": "catalogue_name", + "type": "varchar", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.ap_exam_reward": { + "name": "ap_exam_reward", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "units_granted": { + "name": "units_granted", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "elective_units_granted": { + "name": "elective_units_granted", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "ge_1a_courses_granted": { + "name": "ge_1a_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_1b_courses_granted": { + "name": "ge_1b_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_2_courses_granted": { + "name": "ge_2_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_3_courses_granted": { + "name": "ge_3_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_4_courses_granted": { + "name": "ge_4_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_5a_courses_granted": { + "name": "ge_5a_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_5b_courses_granted": { + "name": "ge_5b_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_6_courses_granted": { + "name": "ge_6_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_7_courses_granted": { + "name": "ge_7_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_8_courses_granted": { + "name": "ge_8_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "courses_granted": { + "name": "courses_granted", + "type": "json", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.ap_exam_to_reward": { + "name": "ap_exam_to_reward", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "exam_id": { + "name": "exam_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "score": { + "name": "score", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "reward": { + "name": "reward", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "ap_exam_to_reward_exam_id_score_index": { + "name": "ap_exam_to_reward_exam_id_score_index", + "columns": [ + { + "expression": "exam_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "score", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "ap_exam_to_reward_exam_id_ap_exam_id_fk": { + "name": "ap_exam_to_reward_exam_id_ap_exam_id_fk", + "tableFrom": "ap_exam_to_reward", + "tableTo": "ap_exam", + "columnsFrom": ["exam_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "ap_exam_to_reward_reward_ap_exam_reward_id_fk": { + "name": "ap_exam_to_reward_reward_ap_exam_reward_id_fk", + "tableFrom": "ap_exam_to_reward", + "tableTo": "ap_exam_reward", + "columnsFrom": ["reward"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.calendar_term": { + "name": "calendar_term", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true, + "generated": { + "as": "\"calendar_term\".\"year\" || ' ' || CASE WHEN \"calendar_term\".\"quarter\" = 'Fall' THEN 'Fall' WHEN \"calendar_term\".\"quarter\" = 'Winter' THEN 'Winter' WHEN \"calendar_term\".\"quarter\" = 'Spring' THEN 'Spring' WHEN \"calendar_term\".\"quarter\" = 'Summer1' THEN 'Summer1' WHEN \"calendar_term\".\"quarter\" = 'Summer10wk' THEN 'Summer10wk' WHEN \"calendar_term\".\"quarter\" = 'Summer2' THEN 'Summer2' ELSE '' END", + "type": "stored" + } + }, + "year": { + "name": "year", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "quarter": { + "name": "quarter", + "type": "term", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "instruction_start": { + "name": "instruction_start", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "instruction_end": { + "name": "instruction_end", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "finals_start": { + "name": "finals_start", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "finals_end": { + "name": "finals_end", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "soc_available": { + "name": "soc_available", + "type": "date", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.catalogue_program": { + "name": "catalogue_program", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "program_name": { + "name": "program_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.college_requirement": { + "name": "college_requirement", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "requirements": { + "name": "requirements", + "type": "jsonb", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "college_requirement_requirements_unique": { + "name": "college_requirement_requirements_unique", + "nullsNotDistinct": false, + "columns": ["requirements"] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.course": { + "name": "course", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "department": { + "name": "department", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "shortened_dept": { + "name": "shortened_dept", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "REPLACE(\"course\".\"department\", ' ', '')", + "type": "stored" + } + }, + "department_alias": { + "name": "department_alias", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "course_number": { + "name": "course_number", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_numeric": { + "name": "course_numeric", + "type": "integer", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "CASE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g') WHEN '' THEN 0 ELSE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g')::INTEGER END", + "type": "stored" + } + }, + "school": { + "name": "school", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_level": { + "name": "course_level", + "type": "course_level", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "min_units": { + "name": "min_units", + "type": "numeric(4, 2)", + "primaryKey": false, + "notNull": true + }, + "max_units": { + "name": "max_units", + "type": "numeric(4, 2)", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "department_name": { + "name": "department_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "prerequisite_tree": { + "name": "prerequisite_tree", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "prerequisite_text": { + "name": "prerequisite_text", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "repeatability": { + "name": "repeatability", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "grading_option": { + "name": "grading_option", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "concurrent": { + "name": "concurrent", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "same_as": { + "name": "same_as", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "restriction": { + "name": "restriction", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "overlap": { + "name": "overlap", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "corequisites": { + "name": "corequisites", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "is_ge_1a": { + "name": "is_ge_1a", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_1b": { + "name": "is_ge_1b", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_2": { + "name": "is_ge_2", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_3": { + "name": "is_ge_3", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_4": { + "name": "is_ge_4", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_5a": { + "name": "is_ge_5a", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_5b": { + "name": "is_ge_5b", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_6": { + "name": "is_ge_6", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_7": { + "name": "is_ge_7", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_8": { + "name": "is_ge_8", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "ge_text": { + "name": "ge_text", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "course_search_index": { + "name": "course_search_index", + "columns": [ + { + "expression": "(\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"id\", '')), 'A') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"department\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"department_alias\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"shortened_dept\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"course_number\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"course_numeric\"::TEXT, '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"title\", '')), 'C') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"description\", '')), 'D')\n)", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "gin", + "with": {} + }, + "shortened_dept": { + "name": "shortened_dept", + "columns": [ + { + "expression": "shortened_dept", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.degree": { + "name": "degree", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "division": { + "name": "division", + "type": "division", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.instructor": { + "name": "instructor", + "schema": "", + "columns": { + "ucinetid": { + "name": "ucinetid", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "email": { + "name": "email", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "department": { + "name": "department", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "instructor_search_index": { + "name": "instructor_search_index", + "columns": [ + { + "expression": "(\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"ucinetid\", '')), 'A') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"name\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"title\", '')), 'B')\n)", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "gin", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.instructor_to_websoc_instructor": { + "name": "instructor_to_websoc_instructor", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "instructor_ucinetid": { + "name": "instructor_ucinetid", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "websoc_instructor_name": { + "name": "websoc_instructor_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "instructor_to_websoc_instructor_instructor_ucinetid_index": { + "name": "instructor_to_websoc_instructor_instructor_ucinetid_index", + "columns": [ + { + "expression": "instructor_ucinetid", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "instructor_to_websoc_instructor_websoc_instructor_name_index": { + "name": "instructor_to_websoc_instructor_websoc_instructor_name_index", + "columns": [ + { + "expression": "websoc_instructor_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "instructor_to_websoc_instructor_instructor_ucinetid_websoc_instructor_name_index": { + "name": "instructor_to_websoc_instructor_instructor_ucinetid_websoc_instructor_name_index", + "columns": [ + { + "expression": "instructor_ucinetid", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "websoc_instructor_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "instructor_to_websoc_instructor_instructor_ucinetid_instructor_ucinetid_fk": { + "name": "instructor_to_websoc_instructor_instructor_ucinetid_instructor_ucinetid_fk", + "tableFrom": "instructor_to_websoc_instructor", + "tableTo": "instructor", + "columnsFrom": ["instructor_ucinetid"], + "columnsTo": ["ucinetid"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "instructor_to_websoc_instructor_websoc_instructor_name_websoc_instructor_name_fk": { + "name": "instructor_to_websoc_instructor_websoc_instructor_name_websoc_instructor_name_fk", + "tableFrom": "instructor_to_websoc_instructor", + "tableTo": "websoc_instructor", + "columnsFrom": ["websoc_instructor_name"], + "columnsTo": ["name"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.larc_section": { + "name": "larc_section", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "course_id": { + "name": "course_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "days_string": { + "name": "days_string", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "time_string": { + "name": "time_string", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "start_time": { + "name": "start_time", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "end_time": { + "name": "end_time", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "instructor": { + "name": "instructor", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "building": { + "name": "building", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "meets_monday": { + "name": "meets_monday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_tuesday": { + "name": "meets_tuesday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_wednesday": { + "name": "meets_wednesday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_thursday": { + "name": "meets_thursday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_friday": { + "name": "meets_friday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_saturday": { + "name": "meets_saturday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_sunday": { + "name": "meets_sunday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": { + "larc_section_course_id_index": { + "name": "larc_section_course_id_index", + "columns": [ + { + "expression": "course_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "larc_section_course_id_websoc_course_id_fk": { + "name": "larc_section_course_id_websoc_course_id_fk", + "tableFrom": "larc_section", + "tableTo": "websoc_course", + "columnsFrom": ["course_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.library_traffic": { + "name": "library_traffic", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true + }, + "library_name": { + "name": "library_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "location_name": { + "name": "location_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "traffic_count": { + "name": "traffic_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "traffic_percentage": { + "name": "traffic_percentage", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "timestamp": { + "name": "timestamp", + "type": "timestamp", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "library_traffic_library_name_index": { + "name": "library_traffic_library_name_index", + "columns": [ + { + "expression": "library_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "library_traffic_location_name_index": { + "name": "library_traffic_location_name_index", + "columns": [ + { + "expression": "location_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.library_traffic_history": { + "name": "library_traffic_history", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "location_id": { + "name": "location_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "traffic_count": { + "name": "traffic_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "traffic_percentage": { + "name": "traffic_percentage", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "timestamp": { + "name": "timestamp", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "library_traffic_history_location_id_timestamp_index": { + "name": "library_traffic_history_location_id_timestamp_index", + "columns": [ + { + "expression": "location_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "timestamp", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "library_traffic_history_location_id_library_traffic_id_fk": { + "name": "library_traffic_history_location_id_library_traffic_id_fk", + "tableFrom": "library_traffic_history", + "tableTo": "library_traffic", + "columnsFrom": ["location_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.major": { + "name": "major", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "degree_id": { + "name": "degree_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "code": { + "name": "code", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "require_spec": { + "name": "require_spec", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "college_requirement": { + "name": "college_requirement", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "requirements": { + "name": "requirements", + "type": "json", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "major_degree_id_index": { + "name": "major_degree_id_index", + "columns": [ + { + "expression": "degree_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "major_college_requirement_index": { + "name": "major_college_requirement_index", + "columns": [ + { + "expression": "college_requirement", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "major_degree_id_degree_id_fk": { + "name": "major_degree_id_degree_id_fk", + "tableFrom": "major", + "tableTo": "degree", + "columnsFrom": ["degree_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "major_college_requirement_college_requirement_id_fk": { + "name": "major_college_requirement_college_requirement_id_fk", + "tableFrom": "major", + "tableTo": "college_requirement", + "columnsFrom": ["college_requirement"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.minor": { + "name": "minor", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "requirements": { + "name": "requirements", + "type": "json", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.prerequisite": { + "name": "prerequisite", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "dep_dept": { + "name": "dep_dept", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "prerequisite_id": { + "name": "prerequisite_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "dependency_id": { + "name": "dependency_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "prerequisite_dep_dept_index": { + "name": "prerequisite_dep_dept_index", + "columns": [ + { + "expression": "dep_dept", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "prerequisite_prerequisite_id_index": { + "name": "prerequisite_prerequisite_id_index", + "columns": [ + { + "expression": "prerequisite_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "prerequisite_dependency_id_index": { + "name": "prerequisite_dependency_id_index", + "columns": [ + { + "expression": "dependency_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "prerequisite_prerequisite_id_dependency_id_index": { + "name": "prerequisite_prerequisite_id_dependency_id_index", + "columns": [ + { + "expression": "prerequisite_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "dependency_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.sample_program_variation": { + "name": "sample_program_variation", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "program_id": { + "name": "program_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "label": { + "name": "label", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "sample_program": { + "name": "sample_program", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "variation_notes": { + "name": "variation_notes", + "type": "varchar[]", + "primaryKey": false, + "notNull": true, + "default": "ARRAY[]::VARCHAR[]" + } + }, + "indexes": {}, + "foreignKeys": { + "sample_program_variation_program_id_catalogue_program_id_fk": { + "name": "sample_program_variation_program_id_catalogue_program_id_fk", + "tableFrom": "sample_program_variation", + "tableTo": "catalogue_program", + "columnsFrom": ["program_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.school_requirement": { + "name": "school_requirement", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "requirements": { + "name": "requirements", + "type": "json", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.specialization": { + "name": "specialization", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "major_id": { + "name": "major_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "requirements": { + "name": "requirements", + "type": "json", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "specialization_major_id_index": { + "name": "specialization_major_id_index", + "columns": [ + { + "expression": "major_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "specialization_major_id_major_id_fk": { + "name": "specialization_major_id_major_id_fk", + "tableFrom": "specialization", + "tableTo": "major", + "columnsFrom": ["major_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.study_location": { + "name": "study_location", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.study_room": { + "name": "study_room", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "capacity": { + "name": "capacity", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "location": { + "name": "location", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "directions": { + "name": "directions", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "tech_enhanced": { + "name": "tech_enhanced", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "url": { + "name": "url", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "study_location_id": { + "name": "study_location_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "study_room_study_location_id_index": { + "name": "study_room_study_location_id_index", + "columns": [ + { + "expression": "study_location_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "study_room_study_location_id_study_location_id_fk": { + "name": "study_room_study_location_id_study_location_id_fk", + "tableFrom": "study_room", + "tableTo": "study_location", + "columnsFrom": ["study_location_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.study_room_slot": { + "name": "study_room_slot", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "study_room_id": { + "name": "study_room_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "start": { + "name": "start", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "end": { + "name": "end", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "is_available": { + "name": "is_available", + "type": "boolean", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "study_room_slot_study_room_id_index": { + "name": "study_room_slot_study_room_id_index", + "columns": [ + { + "expression": "study_room_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "study_room_slot_study_room_id_start_end_index": { + "name": "study_room_slot_study_room_id_start_end_index", + "columns": [ + { + "expression": "study_room_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "start", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "end", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "study_room_slot_study_room_id_study_room_id_fk": { + "name": "study_room_slot_study_room_id_study_room_id_fk", + "tableFrom": "study_room_slot", + "tableTo": "study_room", + "columnsFrom": ["study_room_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_course": { + "name": "websoc_course", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "department_id": { + "name": "department_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "course_id": { + "name": "course_id", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "REPLACE(\"websoc_course\".\"dept_code\", ' ', '') || \"websoc_course\".\"course_number\"", + "type": "stored" + } + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "year": { + "name": "year", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "quarter": { + "name": "quarter", + "type": "term", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "school_name": { + "name": "school_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "dept_code": { + "name": "dept_code", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_title": { + "name": "course_title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_number": { + "name": "course_number", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_numeric": { + "name": "course_numeric", + "type": "integer", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "CASE REGEXP_REPLACE(\"websoc_course\".\"course_number\", '\\D', '', 'g') WHEN '' THEN 0 ELSE REGEXP_REPLACE(\"websoc_course\".\"course_number\", '\\D', '', 'g')::INTEGER END", + "type": "stored" + } + }, + "course_comment": { + "name": "course_comment", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "prerequisite_link": { + "name": "prerequisite_link", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "is_ge_1a": { + "name": "is_ge_1a", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_1b": { + "name": "is_ge_1b", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_2": { + "name": "is_ge_2", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_3": { + "name": "is_ge_3", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_4": { + "name": "is_ge_4", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_5a": { + "name": "is_ge_5a", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_5b": { + "name": "is_ge_5b", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_6": { + "name": "is_ge_6", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_7": { + "name": "is_ge_7", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_8": { + "name": "is_ge_8", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": { + "websoc_course_department_id_index": { + "name": "websoc_course_department_id_index", + "columns": [ + { + "expression": "department_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_course_id_index": { + "name": "websoc_course_course_id_index", + "columns": [ + { + "expression": "course_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_school_name_dept_code_course_number_course_title_index": { + "name": "websoc_course_year_quarter_school_name_dept_code_course_number_course_title_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "school_name", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "dept_code", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "course_number", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "course_title", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_1a_index": { + "name": "websoc_course_year_quarter_is_ge_1a_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_1a", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_1b_index": { + "name": "websoc_course_year_quarter_is_ge_1b_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_1b", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_2_index": { + "name": "websoc_course_year_quarter_is_ge_2_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_2", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_3_index": { + "name": "websoc_course_year_quarter_is_ge_3_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_3", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_4_index": { + "name": "websoc_course_year_quarter_is_ge_4_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_4", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_5a_index": { + "name": "websoc_course_year_quarter_is_ge_5a_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_5a", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_5b_index": { + "name": "websoc_course_year_quarter_is_ge_5b_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_5b", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_6_index": { + "name": "websoc_course_year_quarter_is_ge_6_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_6", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_7_index": { + "name": "websoc_course_year_quarter_is_ge_7_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_7", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_8_index": { + "name": "websoc_course_year_quarter_is_ge_8_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_8", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_dept_code_index": { + "name": "websoc_course_year_quarter_dept_code_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "dept_code", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_dept_code_course_number_index": { + "name": "websoc_course_year_quarter_dept_code_course_number_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "dept_code", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "course_number", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_course_department_id_websoc_department_id_fk": { + "name": "websoc_course_department_id_websoc_department_id_fk", + "tableFrom": "websoc_course", + "tableTo": "websoc_department", + "columnsFrom": ["department_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_department": { + "name": "websoc_department", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "school_id": { + "name": "school_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "year": { + "name": "year", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "quarter": { + "name": "quarter", + "type": "term", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "dept_code": { + "name": "dept_code", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "dept_name": { + "name": "dept_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "dept_comment": { + "name": "dept_comment", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "section_code_range_comments": { + "name": "section_code_range_comments", + "type": "text[]", + "primaryKey": false, + "notNull": true + }, + "course_number_range_comments": { + "name": "course_number_range_comments", + "type": "text[]", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "websoc_department_school_id_index": { + "name": "websoc_department_school_id_index", + "columns": [ + { + "expression": "school_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_department_year_quarter_school_id_dept_code_index": { + "name": "websoc_department_year_quarter_school_id_dept_code_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "school_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "dept_code", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_department_school_id_websoc_school_id_fk": { + "name": "websoc_department_school_id_websoc_school_id_fk", + "tableFrom": "websoc_department", + "tableTo": "websoc_school", + "columnsFrom": ["school_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_instructor": { + "name": "websoc_instructor", + "schema": "", + "columns": { + "name": { + "name": "name", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_location": { + "name": "websoc_location", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "building": { + "name": "building", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "room": { + "name": "room", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "websoc_location_building_room_index": { + "name": "websoc_location_building_room_index", + "columns": [ + { + "expression": "building", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "room", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_meta": { + "name": "websoc_meta", + "schema": "", + "columns": { + "name": { + "name": "name", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "last_scraped": { + "name": "last_scraped", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "last_dept_scraped": { + "name": "last_dept_scraped", + "type": "varchar", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_school": { + "name": "websoc_school", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "year": { + "name": "year", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "quarter": { + "name": "quarter", + "type": "term", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "school_name": { + "name": "school_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "school_comment": { + "name": "school_comment", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "websoc_school_year_quarter_school_name_index": { + "name": "websoc_school_year_quarter_school_name_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "school_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_section": { + "name": "websoc_section", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "course_id": { + "name": "course_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "year": { + "name": "year", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "quarter": { + "name": "quarter", + "type": "term", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "units": { + "name": "units", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "websoc_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "instructors": { + "name": "instructors", + "type": "text[]", + "primaryKey": false, + "notNull": true + }, + "meetings": { + "name": "meetings", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "final_exam_string": { + "name": "final_exam_string", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "final_exam": { + "name": "final_exam", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "section_num": { + "name": "section_num", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "max_capacity": { + "name": "max_capacity", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "section_code": { + "name": "section_code", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "section_type": { + "name": "section_type", + "type": "websoc_section_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "num_requested": { + "name": "num_requested", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "restriction_string": { + "name": "restriction_string", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "restriction_a": { + "name": "restriction_a", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_b": { + "name": "restriction_b", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_c": { + "name": "restriction_c", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_d": { + "name": "restriction_d", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_e": { + "name": "restriction_e", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_f": { + "name": "restriction_f", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_g": { + "name": "restriction_g", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_h": { + "name": "restriction_h", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_i": { + "name": "restriction_i", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_j": { + "name": "restriction_j", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_k": { + "name": "restriction_k", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_l": { + "name": "restriction_l", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_m": { + "name": "restriction_m", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_n": { + "name": "restriction_n", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_o": { + "name": "restriction_o", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_r": { + "name": "restriction_r", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_s": { + "name": "restriction_s", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_x": { + "name": "restriction_x", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "num_on_waitlist": { + "name": "num_on_waitlist", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_waitlist_cap": { + "name": "num_waitlist_cap", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "section_comment": { + "name": "section_comment", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "num_new_only_reserved": { + "name": "num_new_only_reserved", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_currently_total_enrolled": { + "name": "num_currently_total_enrolled", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_currently_section_enrolled": { + "name": "num_currently_section_enrolled", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "is_cancelled": { + "name": "is_cancelled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "\"websoc_section\".\"section_comment\" LIKE '%*** CANCELLED ***%' OR \"websoc_section\".\"section_comment\" LIKE '%*** CANCELED ***%'", + "type": "stored" + } + }, + "web_url": { + "name": "web_url", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "''" + } + }, + "indexes": { + "websoc_section_course_id_index": { + "name": "websoc_section_course_id_index", + "columns": [ + { + "expression": "course_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_section_year_quarter_section_code_index": { + "name": "websoc_section_year_quarter_section_code_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "section_code", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_section_course_id_websoc_course_id_fk": { + "name": "websoc_section_course_id_websoc_course_id_fk", + "tableFrom": "websoc_section", + "tableTo": "websoc_course", + "columnsFrom": ["course_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_section_enrollment": { + "name": "websoc_section_enrollment", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "section_id": { + "name": "section_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "date", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "year": { + "name": "year", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "quarter": { + "name": "quarter", + "type": "term", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "max_capacity": { + "name": "max_capacity", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "num_currently_total_enrolled": { + "name": "num_currently_total_enrolled", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_on_waitlist": { + "name": "num_on_waitlist", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_waitlist_cap": { + "name": "num_waitlist_cap", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_requested": { + "name": "num_requested", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_new_only_reserved": { + "name": "num_new_only_reserved", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "websoc_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "websoc_section_enrollment_section_id_index": { + "name": "websoc_section_enrollment_section_id_index", + "columns": [ + { + "expression": "section_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_section_enrollment_section_id_created_at_index": { + "name": "websoc_section_enrollment_section_id_created_at_index", + "columns": [ + { + "expression": "section_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_section_enrollment_section_id_websoc_section_id_fk": { + "name": "websoc_section_enrollment_section_id_websoc_section_id_fk", + "tableFrom": "websoc_section_enrollment", + "tableTo": "websoc_section", + "columnsFrom": ["section_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_section_grade": { + "name": "websoc_section_grade", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "section_id": { + "name": "section_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "grade_a_count": { + "name": "grade_a_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_b_count": { + "name": "grade_b_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_c_count": { + "name": "grade_c_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_d_count": { + "name": "grade_d_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_f_count": { + "name": "grade_f_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_p_count": { + "name": "grade_p_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_np_count": { + "name": "grade_np_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_w_count": { + "name": "grade_w_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "average_gpa": { + "name": "average_gpa", + "type": "numeric(3, 2)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "websoc_section_grade_section_id_index": { + "name": "websoc_section_grade_section_id_index", + "columns": [ + { + "expression": "section_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_section_grade_section_id_websoc_section_id_fk": { + "name": "websoc_section_grade_section_id_websoc_section_id_fk", + "tableFrom": "websoc_section_grade", + "tableTo": "websoc_section", + "columnsFrom": ["section_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "websoc_section_grade_section_id_unique": { + "name": "websoc_section_grade_section_id_unique", + "nullsNotDistinct": false, + "columns": ["section_id"] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_section_meeting": { + "name": "websoc_section_meeting", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "section_id": { + "name": "section_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "section_code": { + "name": "section_code", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "meeting_index": { + "name": "meeting_index", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "time_string": { + "name": "time_string", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "time_is_tba": { + "name": "time_is_tba", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "\"websoc_section_meeting\".\"time_string\" LIKE '%TBA%'", + "type": "stored" + } + }, + "start_time": { + "name": "start_time", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "end_time": { + "name": "end_time", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "days_string": { + "name": "days_string", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "meets_monday": { + "name": "meets_monday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_tuesday": { + "name": "meets_tuesday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_wednesday": { + "name": "meets_wednesday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_thursday": { + "name": "meets_thursday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_friday": { + "name": "meets_friday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_saturday": { + "name": "meets_saturday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_sunday": { + "name": "meets_sunday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": { + "websoc_section_meeting_section_id_index": { + "name": "websoc_section_meeting_section_id_index", + "columns": [ + { + "expression": "section_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_section_meeting_section_id_websoc_section_id_fk": { + "name": "websoc_section_meeting_section_id_websoc_section_id_fk", + "tableFrom": "websoc_section_meeting", + "tableTo": "websoc_section", + "columnsFrom": ["section_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_section_meeting_to_location": { + "name": "websoc_section_meeting_to_location", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "meeting_id": { + "name": "meeting_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "location_id": { + "name": "location_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "websoc_section_meeting_to_location_meeting_id_index": { + "name": "websoc_section_meeting_to_location_meeting_id_index", + "columns": [ + { + "expression": "meeting_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_section_meeting_to_location_location_id_index": { + "name": "websoc_section_meeting_to_location_location_id_index", + "columns": [ + { + "expression": "location_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_section_meeting_to_location_meeting_id_location_id_index": { + "name": "websoc_section_meeting_to_location_meeting_id_location_id_index", + "columns": [ + { + "expression": "meeting_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "location_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_section_meeting_to_location_meeting_id_websoc_section_meeting_id_fk": { + "name": "websoc_section_meeting_to_location_meeting_id_websoc_section_meeting_id_fk", + "tableFrom": "websoc_section_meeting_to_location", + "tableTo": "websoc_section_meeting", + "columnsFrom": ["meeting_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "websoc_section_meeting_to_location_location_id_websoc_location_id_fk": { + "name": "websoc_section_meeting_to_location_location_id_websoc_location_id_fk", + "tableFrom": "websoc_section_meeting_to_location", + "tableTo": "websoc_location", + "columnsFrom": ["location_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_section_to_instructor": { + "name": "websoc_section_to_instructor", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "section_id": { + "name": "section_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "instructor_name": { + "name": "instructor_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "websoc_section_to_instructor_section_id_index": { + "name": "websoc_section_to_instructor_section_id_index", + "columns": [ + { + "expression": "section_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_section_to_instructor_instructor_name_index": { + "name": "websoc_section_to_instructor_instructor_name_index", + "columns": [ + { + "expression": "instructor_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_section_to_instructor_section_id_websoc_section_id_fk": { + "name": "websoc_section_to_instructor_section_id_websoc_section_id_fk", + "tableFrom": "websoc_section_to_instructor", + "tableTo": "websoc_section", + "columnsFrom": ["section_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "websoc_section_to_instructor_instructor_name_websoc_instructor_name_fk": { + "name": "websoc_section_to_instructor_instructor_name_websoc_instructor_name_fk", + "tableFrom": "websoc_section_to_instructor", + "tableTo": "websoc_instructor", + "columnsFrom": ["instructor_name"], + "columnsTo": ["name"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": { + "public.course_level": { + "name": "course_level", + "schema": "public", + "values": ["LowerDiv", "UpperDiv", "Graduate"] + }, + "public.division": { + "name": "division", + "schema": "public", + "values": ["Undergraduate", "Graduate"] + }, + "public.term": { + "name": "term", + "schema": "public", + "values": ["Fall", "Winter", "Spring", "Summer1", "Summer10wk", "Summer2"] + }, + "public.websoc_section_type": { + "name": "websoc_section_type", + "schema": "public", + "values": [ + "Act", + "Col", + "Dis", + "Fld", + "Lab", + "Lec", + "Qiz", + "Res", + "Sem", + "Stu", + "Tap", + "Tut" + ] + }, + "public.websoc_status": { + "name": "websoc_status", + "schema": "public", + "values": ["OPEN", "Waitl", "FULL", "NewOnly"] + } + }, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": { + "public.course_view": { + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "department": { + "name": "department", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "shortened_dept": { + "name": "shortened_dept", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "REPLACE(\"course\".\"department\", ' ', '')", + "type": "stored" + } + }, + "department_alias": { + "name": "department_alias", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "course_number": { + "name": "course_number", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_numeric": { + "name": "course_numeric", + "type": "integer", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "CASE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g') WHEN '' THEN 0 ELSE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g')::INTEGER END", + "type": "stored" + } + }, + "school": { + "name": "school", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_level": { + "name": "course_level", + "type": "course_level", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "min_units": { + "name": "min_units", + "type": "numeric(4, 2)", + "primaryKey": false, + "notNull": true + }, + "max_units": { + "name": "max_units", + "type": "numeric(4, 2)", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "department_name": { + "name": "department_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "prerequisite_tree": { + "name": "prerequisite_tree", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "prerequisite_text": { + "name": "prerequisite_text", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "repeatability": { + "name": "repeatability", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "grading_option": { + "name": "grading_option", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "concurrent": { + "name": "concurrent", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "same_as": { + "name": "same_as", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "restriction": { + "name": "restriction", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "overlap": { + "name": "overlap", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "corequisites": { + "name": "corequisites", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "is_ge_1a": { + "name": "is_ge_1a", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_1b": { + "name": "is_ge_1b", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_2": { + "name": "is_ge_2", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_3": { + "name": "is_ge_3", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_4": { + "name": "is_ge_4", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_5a": { + "name": "is_ge_5a", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_5b": { + "name": "is_ge_5b", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_6": { + "name": "is_ge_6", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_7": { + "name": "is_ge_7", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_8": { + "name": "is_ge_8", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "ge_text": { + "name": "ge_text", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "definition": "select \"course\".\"id\", \"course\".\"updated_at\", \"course\".\"department\", \"course\".\"shortened_dept\", \"course\".\"department_alias\", \"course\".\"course_number\", \"course\".\"course_numeric\", \"course\".\"school\", \"course\".\"title\", \"course\".\"course_level\", \"course\".\"min_units\", \"course\".\"max_units\", \"course\".\"description\", \"course\".\"department_name\", \"course\".\"prerequisite_tree\", \"course\".\"prerequisite_text\", \"course\".\"repeatability\", \"course\".\"grading_option\", \"course\".\"concurrent\", \"course\".\"same_as\", \"course\".\"restriction\", \"course\".\"overlap\", \"course\".\"corequisites\", \"course\".\"is_ge_1a\", \"course\".\"is_ge_1b\", \"course\".\"is_ge_2\", \"course\".\"is_ge_3\", \"course\".\"is_ge_4\", \"course\".\"is_ge_5a\", \"course\".\"is_ge_5b\", \"course\".\"is_ge_6\", \"course\".\"is_ge_7\", \"course\".\"is_ge_8\", \"course\".\"ge_text\", \n ARRAY_REMOVE(COALESCE(\n (\n SELECT ARRAY_AGG(\n CASE WHEN \"prerequisite_course\".\"id\" IS NULL THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'id', \"prerequisite_course\".\"id\",\n 'title', \"prerequisite_course\".\"title\",\n 'department', \"prerequisite_course\".\"department\",\n 'courseNumber', \"prerequisite_course\".\"course_number\"\n )\n END\n )\n FROM \"prerequisite\"\n LEFT JOIN \"course\" \"prerequisite_course\" ON \"prerequisite_course\".\"id\" = \"prerequisite\".\"prerequisite_id\"\n WHERE \"prerequisite\".\"dependency_id\" = \"course\".\"id\"\n ),\n ARRAY[]::JSONB[]), NULL)\n as \"prerequisites\", \n ARRAY_REMOVE(COALESCE(\n (\n SELECT ARRAY_AGG(\n CASE WHEN \"dependency_course\".\"id\" IS NULL THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'id', \"dependency_course\".\"id\",\n 'title', \"dependency_course\".\"title\",\n 'department', \"dependency_course\".\"department\",\n 'courseNumber', \"dependency_course\".\"course_number\"\n )\n END\n )\n FROM \"prerequisite\" \"dependency\"\n LEFT JOIN \"course\" \"dependency_course\" ON \"dependency_course\".\"id\" = \"dependency\".\"dependency_id\"\n WHERE \"dependency\".\"prerequisite_id\" = \"course\".\"id\"\n ),\n ARRAY[]::JSONB[]), NULL)\n as \"dependencies\", \n ARRAY_REMOVE(ARRAY_AGG(DISTINCT\n CASE WHEN \"websoc_course\".\"year\" IS NULL THEN NULL\n ELSE CONCAT(\"websoc_course\".\"year\", ' ', \"websoc_course\".\"quarter\")\n END\n ), NULL)\n as \"terms\", \n ARRAY_REMOVE(COALESCE(ARRAY_AGG(DISTINCT\n CASE WHEN \"instructor\".\"ucinetid\" IS NULL THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'ucinetid', \"instructor\".\"ucinetid\",\n 'name', \"instructor\".\"name\",\n 'title', \"instructor\".\"title\",\n 'email', \"instructor\".\"email\",\n 'department', \"instructor\".\"department\",\n 'shortenedNames', ARRAY(\n SELECT \"instructor_to_websoc_instructor\".\"websoc_instructor_name\"\n FROM \"instructor_to_websoc_instructor\"\n WHERE \"instructor_to_websoc_instructor\".\"instructor_ucinetid\" = \"instructor\".\"ucinetid\"\n )\n )\n END\n ), ARRAY[]::JSONB[]), NULL)\n as \"instructors\" from \"course\" left join \"websoc_course\" on \"websoc_course\".\"course_id\" = \"course\".\"id\" left join \"websoc_section\" on \"websoc_section\".\"course_id\" = \"websoc_course\".\"id\" left join \"websoc_section_to_instructor\" on \"websoc_section_to_instructor\".\"section_id\" = \"websoc_section\".\"id\" left join \"websoc_instructor\" on \"websoc_instructor\".\"name\" = \"websoc_section_to_instructor\".\"instructor_name\" left join \"instructor_to_websoc_instructor\" on \"instructor_to_websoc_instructor\".\"websoc_instructor_name\" = \"websoc_instructor\".\"name\" left join \"instructor\" on (\"instructor\".\"ucinetid\" = \"instructor_to_websoc_instructor\".\"instructor_ucinetid\" and \"instructor\".\"ucinetid\" is not null and \"instructor\".\"ucinetid\" <> 'student') group by \"course\".\"id\"", + "name": "course_view", + "schema": "public", + "isExisting": false, + "materialized": true + }, + "public.instructor_view": { + "columns": { + "ucinetid": { + "name": "ucinetid", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "email": { + "name": "email", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "department": { + "name": "department", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "definition": "with \"shortened_names_cte\" as (select \"instructor_ucinetid\", ARRAY_AGG(\"websoc_instructor_name\") as \"shortened_names\" from \"instructor_to_websoc_instructor\" group by \"instructor_to_websoc_instructor\".\"instructor_ucinetid\"), \"courses_cte\" as (with \"terms_cte\" as (select \"course\".\"id\", \"instructor_to_websoc_instructor\".\"instructor_ucinetid\", \n ARRAY_REMOVE(ARRAY_AGG(DISTINCT\n CASE WHEN \"websoc_course\".\"year\" IS NULL THEN NULL\n ELSE CONCAT(\"websoc_course\".\"year\", ' ', \"websoc_course\".\"quarter\")\n END\n ), NULL) as \"terms\" from \"course\" left join \"websoc_course\" on \"websoc_course\".\"course_id\" = \"course\".\"id\" left join \"websoc_section\" on \"websoc_section\".\"course_id\" = \"websoc_course\".\"id\" left join \"websoc_section_to_instructor\" on \"websoc_section_to_instructor\".\"section_id\" = \"websoc_section\".\"id\" left join \"websoc_instructor\" on \"websoc_instructor\".\"name\" = \"websoc_section_to_instructor\".\"instructor_name\" left join \"instructor_to_websoc_instructor\" on \"instructor_to_websoc_instructor\".\"websoc_instructor_name\" = \"websoc_instructor\".\"name\" group by \"course\".\"id\", \"instructor_to_websoc_instructor\".\"instructor_ucinetid\") select \"terms_cte\".\"instructor_ucinetid\", \"course\".\"id\", \n CASE WHEN \"course\".\"id\" IS NULL\n THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'id', \"course\".\"id\",\n 'title', \"course\".\"title\",\n 'department', \"course\".\"department\",\n 'courseNumber', \"course\".\"course_number\",\n 'terms', COALESCE(\"terms\", ARRAY[]::TEXT[])\n )\n END\n as \"course_info\" from \"course\" left join \"terms_cte\" on \"terms_cte\".\"id\" = \"course\".\"id\" group by \"course\".\"id\", \"terms_cte\".\"instructor_ucinetid\", \"terms\") select \"instructor\".\"ucinetid\", \"instructor\".\"name\", \"instructor\".\"title\", \"instructor\".\"email\", \"instructor\".\"department\", COALESCE(\"shortened_names\", ARRAY[]::TEXT[]) as \"shortened_names\", \n ARRAY_REMOVE(ARRAY_AGG(DISTINCT \"course_info\"), NULL)\n as \"courses\" from \"instructor\" left join \"shortened_names_cte\" on \"shortened_names_cte\".\"instructor_ucinetid\" = \"instructor\".\"ucinetid\" left join \"courses_cte\" on \"courses_cte\".\"instructor_ucinetid\" = \"instructor\".\"ucinetid\" where \"instructor\".\"ucinetid\" <> 'student' group by \"instructor\".\"ucinetid\", \"shortened_names\"", + "name": "instructor_view", + "schema": "public", + "isExisting": false, + "materialized": true + } + }, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} diff --git a/packages/db/migrations/meta/_journal.json b/packages/db/migrations/meta/_journal.json index 350e0a99..493a98ac 100644 --- a/packages/db/migrations/meta/_journal.json +++ b/packages/db/migrations/meta/_journal.json @@ -169,6 +169,13 @@ "when": 1770072497788, "tag": "0023_pv_study_rooms", "breakpoints": true + }, + { + "idx": 24, + "version": "7", + "when": 1771120329194, + "tag": "0024_add_req_spec_to_major_table", + "breakpoints": true } ] } From bd47eaaee965470b28376e165acdb85a141d1595 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Sat, 14 Feb 2026 19:37:24 -0800 Subject: [PATCH 25/91] made specRequirement a subtype of markerRequirement --- packages/db/src/schema.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/db/src/schema.ts b/packages/db/src/schema.ts index 307c1770..ab293ef3 100644 --- a/packages/db/src/schema.ts +++ b/packages/db/src/schema.ts @@ -124,9 +124,11 @@ export type DegreeWorksGroupRequirement = { requirements: DegreeWorksRequirement[]; }; -export type DegreeWorksMarkerRequirement = { - requirementType: "Marker"; -}; +export type DegreeWorksMarkerRequirement = + | { + requirementType: "Marker"; + } + | DegreeWorksSpecRequirement; export type DegreeWorksSpecRequirement = { requirementType: "Spec"; @@ -140,7 +142,6 @@ export type DegreeWorksRequirement = DegreeWorksRequirementBase & | DegreeWorksUnitRequirement | DegreeWorksGroupRequirement | DegreeWorksMarkerRequirement - | DegreeWorksSpecRequirement ); export type APCoursesGrantedTree = From 2b81a701e858a15d40f4cb0274cdbbcde2f7c217 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Sat, 14 Feb 2026 20:41:28 -0800 Subject: [PATCH 26/91] hard coded setting ChemE to have opitonal Specs --- .../degreeworks-scraper/src/components/AuditParser.ts | 1 - .../degreeworks-scraper/src/components/Scraper.ts | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts b/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts index 3478ddec..4a3e41c0 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts @@ -161,7 +161,6 @@ export class AuditParser { const ret: DegreeWorksRequirement[] = []; for (const rule of ruleArray) { // heuristic for matching a specialization requirement - // false positive on B.S. ChemE (pr#295) if ( rule.ifElsePart === "ElsePart" && rule.proxyAdvice?.textList.some((x) => diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts index 72206723..407eb4bf 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts @@ -406,6 +406,11 @@ export class Scraper { this.parsedPrograms.set("Major in Art History", x); } + // Chemical Engineering is falsely marked as requiring a specialization (pr#295) + + const chemE = this.parsedPrograms.get("Major in Chemical Engineering") as MajorProgram; + chemE[1].requirements = chemE[1].requirements.filter((req) => req.requirementType !== "Spec"); + this.done = true; } get() { From 1a56be08e8c9a1f0ed9fbbfe2ed597d1866c2b3f Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Sun, 15 Feb 2026 14:32:45 -0800 Subject: [PATCH 27/91] refactored major_requirement table to use hashed json as its primary key --- apps/data-pipeline/degreeworks-scraper/src/index.ts | 2 +- packages/db/src/schema.ts | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/apps/data-pipeline/degreeworks-scraper/src/index.ts b/apps/data-pipeline/degreeworks-scraper/src/index.ts index b69e23de..dab84fe5 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/index.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/index.ts @@ -194,7 +194,7 @@ async function main() { .insert(majorRequirement) .values(majorRequirementBlocks) .onConflictDoUpdate({ - target: majorRequirement.requirementsHash, + target: majorRequirement.id, set: conflictUpdateSetAllCols(majorRequirement), }) .returning({ id: majorRequirement.id }) diff --git a/packages/db/src/schema.ts b/packages/db/src/schema.ts index 25fa755a..cf52b124 100644 --- a/packages/db/src/schema.ts +++ b/packages/db/src/schema.ts @@ -677,17 +677,16 @@ export const majorSpecPairToRequirement = pgTable("major_spec_pair_to_requiremen .notNull() .references(() => major.id), specId: varchar("spec_id").references(() => specialization.id), - requirementId: uuid("requirement_id").references(() => majorRequirement.id), + requirementId: bigint("requirement_id", { mode: "bigint" }).references(() => majorRequirement.id), }); export const majorRequirement = pgTable( "major_requirement", { - id: uuid("id").primaryKey().defaultRandom(), requirements: jsonb("requirements").$type().notNull(), - requirementsHash: bigint("requirements_hash", { mode: "bigint" }) - .generatedAlwaysAs(sql`jsonb_hash_extended(requirements, 0)`) - .unique(), + id: bigint("id", { mode: "bigint" }) + .primaryKey() + .generatedAlwaysAs(sql`jsonb_hash_extended(requirements, 0)`), }, (table) => [], ); From b67922fd310c99004c2c62447da6a5019ed4e2b5 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Sun, 15 Feb 2026 14:34:05 -0800 Subject: [PATCH 28/91] removed debug logs used during testing --- apps/data-pipeline/degreeworks-scraper/src/index.ts | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/apps/data-pipeline/degreeworks-scraper/src/index.ts b/apps/data-pipeline/degreeworks-scraper/src/index.ts index dab84fe5..889aaef4 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/index.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/index.ts @@ -1,5 +1,4 @@ import * as assert from "node:assert"; -import * as fs from "node:fs/promises"; import { exit } from "node:process"; import { Scraper } from "$components"; import { database } from "@packages/db"; @@ -82,10 +81,6 @@ async function main() { }; }) .toArray(); - console.log( - `length of parsedProgarms: ${parsedPrograms.size}. lengthed of objectified parsedPrograms: ${Object.fromEntries(parsedPrograms)}.length of majorData: ${majorSpecData.length}`, - ); - await fs.writeFile("./MajorDataFirst.json", JSON.stringify(majorSpecData, null, 2)); const majorRequirementBlocks = [] as (typeof majorRequirement.$inferInsert)[]; const majorSpecToRequirementData = majorSpecData.map(({ id, specCode, requirements }) => { @@ -129,12 +124,6 @@ async function main() { })) .toArray(); - await fs.writeFile( - "./ParsedPrograms.json", - JSON.stringify(Object.fromEntries(parsedPrograms), null, 2), - ); - await fs.writeFile("./MajorData.json", JSON.stringify(majorData, null, 2)); - await fs.writeFile("./MajorReq.json", JSON.stringify(majorSpecToRequirementData, null, 2)); await db.transaction(async (tx) => { if (ucRequirementData && geRequirementData) { await tx From 950864c59f8cc3bf8ee47faa5263243733a31189 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Sun, 15 Feb 2026 15:05:26 -0800 Subject: [PATCH 29/91] reran migration --- .../db/migrations/0024_polymorphic_majors.sql | 37 - .../db/migrations/meta/0024_snapshot.json | 3957 ----------------- packages/db/migrations/meta/_journal.json | 7 - 3 files changed, 4001 deletions(-) delete mode 100644 packages/db/migrations/0024_polymorphic_majors.sql delete mode 100644 packages/db/migrations/meta/0024_snapshot.json diff --git a/packages/db/migrations/0024_polymorphic_majors.sql b/packages/db/migrations/0024_polymorphic_majors.sql deleted file mode 100644 index d4d2edff..00000000 --- a/packages/db/migrations/0024_polymorphic_majors.sql +++ /dev/null @@ -1,37 +0,0 @@ -CREATE TABLE IF NOT EXISTS "major_requirement" ( - "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL, - "requirements" jsonb NOT NULL, - "requirements_hash" bigint GENERATED ALWAYS AS (jsonb_hash_extended(requirements, 0)) STORED, - CONSTRAINT "major_requirement_requirements_hash_unique" UNIQUE("requirements_hash") -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "major_spec_pair_to_requirement" ( - "id" varchar PRIMARY KEY GENERATED ALWAYS AS ( - CASE WHEN "major_spec_pair_to_requirement"."spec_id" IS NOT NULL - THEN "major_spec_pair_to_requirement"."major_id" || '+' || "major_spec_pair_to_requirement"."spec_id" - ELSE "major_spec_pair_to_requirement"."major_id" - END) STORED NOT NULL, - "major_id" varchar NOT NULL, - "spec_id" varchar, - "requirement_id" uuid -); ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "major_spec_pair_to_requirement" ADD CONSTRAINT "major_spec_pair_to_requirement_major_id_major_id_fk" FOREIGN KEY ("major_id") REFERENCES "public"."major"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "major_spec_pair_to_requirement" ADD CONSTRAINT "major_spec_pair_to_requirement_spec_id_specialization_id_fk" FOREIGN KEY ("spec_id") REFERENCES "public"."specialization"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "major_spec_pair_to_requirement" ADD CONSTRAINT "major_spec_pair_to_requirement_requirement_id_major_requirement_id_fk" FOREIGN KEY ("requirement_id") REFERENCES "public"."major_requirement"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -ALTER TABLE "major" DROP COLUMN IF EXISTS "requirements"; \ No newline at end of file diff --git a/packages/db/migrations/meta/0024_snapshot.json b/packages/db/migrations/meta/0024_snapshot.json deleted file mode 100644 index 79e492c8..00000000 --- a/packages/db/migrations/meta/0024_snapshot.json +++ /dev/null @@ -1,3957 +0,0 @@ -{ - "id": "b80d8f96-6e0a-4fa5-ac52-b848764a8705", - "prevId": "b1dd1ce5-36ad-4ce8-a66d-02dd8630ce63", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.ap_exam": { - "name": "ap_exam", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "catalogue_name": { - "name": "catalogue_name", - "type": "varchar", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.ap_exam_reward": { - "name": "ap_exam_reward", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "units_granted": { - "name": "units_granted", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "elective_units_granted": { - "name": "elective_units_granted", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "ge_1a_courses_granted": { - "name": "ge_1a_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_1b_courses_granted": { - "name": "ge_1b_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_2_courses_granted": { - "name": "ge_2_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_3_courses_granted": { - "name": "ge_3_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_4_courses_granted": { - "name": "ge_4_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_5a_courses_granted": { - "name": "ge_5a_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_5b_courses_granted": { - "name": "ge_5b_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_6_courses_granted": { - "name": "ge_6_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_7_courses_granted": { - "name": "ge_7_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_8_courses_granted": { - "name": "ge_8_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "courses_granted": { - "name": "courses_granted", - "type": "json", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.ap_exam_to_reward": { - "name": "ap_exam_to_reward", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "exam_id": { - "name": "exam_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "score": { - "name": "score", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "reward": { - "name": "reward", - "type": "uuid", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "ap_exam_to_reward_exam_id_score_index": { - "name": "ap_exam_to_reward_exam_id_score_index", - "columns": [ - { - "expression": "exam_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "score", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "ap_exam_to_reward_exam_id_ap_exam_id_fk": { - "name": "ap_exam_to_reward_exam_id_ap_exam_id_fk", - "tableFrom": "ap_exam_to_reward", - "tableTo": "ap_exam", - "columnsFrom": ["exam_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "ap_exam_to_reward_reward_ap_exam_reward_id_fk": { - "name": "ap_exam_to_reward_reward_ap_exam_reward_id_fk", - "tableFrom": "ap_exam_to_reward", - "tableTo": "ap_exam_reward", - "columnsFrom": ["reward"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.calendar_term": { - "name": "calendar_term", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true, - "generated": { - "as": "\"calendar_term\".\"year\" || ' ' || CASE WHEN \"calendar_term\".\"quarter\" = 'Fall' THEN 'Fall' WHEN \"calendar_term\".\"quarter\" = 'Winter' THEN 'Winter' WHEN \"calendar_term\".\"quarter\" = 'Spring' THEN 'Spring' WHEN \"calendar_term\".\"quarter\" = 'Summer1' THEN 'Summer1' WHEN \"calendar_term\".\"quarter\" = 'Summer10wk' THEN 'Summer10wk' WHEN \"calendar_term\".\"quarter\" = 'Summer2' THEN 'Summer2' ELSE '' END", - "type": "stored" - } - }, - "year": { - "name": "year", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "quarter": { - "name": "quarter", - "type": "term", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "instruction_start": { - "name": "instruction_start", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "instruction_end": { - "name": "instruction_end", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "finals_start": { - "name": "finals_start", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "finals_end": { - "name": "finals_end", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "soc_available": { - "name": "soc_available", - "type": "date", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.catalogue_program": { - "name": "catalogue_program", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "program_name": { - "name": "program_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.college_requirement": { - "name": "college_requirement", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "requirements": { - "name": "requirements", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "college_requirement_requirements_unique": { - "name": "college_requirement_requirements_unique", - "nullsNotDistinct": false, - "columns": ["requirements"] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.course": { - "name": "course", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "department": { - "name": "department", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "shortened_dept": { - "name": "shortened_dept", - "type": "varchar", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "REPLACE(\"course\".\"department\", ' ', '')", - "type": "stored" - } - }, - "department_alias": { - "name": "department_alias", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "course_number": { - "name": "course_number", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "course_numeric": { - "name": "course_numeric", - "type": "integer", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "CASE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g') WHEN '' THEN 0 ELSE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g')::INTEGER END", - "type": "stored" - } - }, - "school": { - "name": "school", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "course_level": { - "name": "course_level", - "type": "course_level", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "min_units": { - "name": "min_units", - "type": "numeric(4, 2)", - "primaryKey": false, - "notNull": true - }, - "max_units": { - "name": "max_units", - "type": "numeric(4, 2)", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "department_name": { - "name": "department_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "prerequisite_tree": { - "name": "prerequisite_tree", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "prerequisite_text": { - "name": "prerequisite_text", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "repeatability": { - "name": "repeatability", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "grading_option": { - "name": "grading_option", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "concurrent": { - "name": "concurrent", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "same_as": { - "name": "same_as", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "restriction": { - "name": "restriction", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "overlap": { - "name": "overlap", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "corequisites": { - "name": "corequisites", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "is_ge_1a": { - "name": "is_ge_1a", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_1b": { - "name": "is_ge_1b", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_2": { - "name": "is_ge_2", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_3": { - "name": "is_ge_3", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_4": { - "name": "is_ge_4", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_5a": { - "name": "is_ge_5a", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_5b": { - "name": "is_ge_5b", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_6": { - "name": "is_ge_6", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_7": { - "name": "is_ge_7", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_8": { - "name": "is_ge_8", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "ge_text": { - "name": "ge_text", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "course_search_index": { - "name": "course_search_index", - "columns": [ - { - "expression": "(\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"id\", '')), 'A') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"department\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"department_alias\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"shortened_dept\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"course_number\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"course_numeric\"::TEXT, '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"title\", '')), 'C') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"description\", '')), 'D')\n)", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "shortened_dept": { - "name": "shortened_dept", - "columns": [ - { - "expression": "shortened_dept", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.degree": { - "name": "degree", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "division": { - "name": "division", - "type": "division", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.instructor": { - "name": "instructor", - "schema": "", - "columns": { - "ucinetid": { - "name": "ucinetid", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "department": { - "name": "department", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "instructor_search_index": { - "name": "instructor_search_index", - "columns": [ - { - "expression": "(\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"ucinetid\", '')), 'A') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"name\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"title\", '')), 'B')\n)", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.instructor_to_websoc_instructor": { - "name": "instructor_to_websoc_instructor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "instructor_ucinetid": { - "name": "instructor_ucinetid", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "websoc_instructor_name": { - "name": "websoc_instructor_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "instructor_to_websoc_instructor_instructor_ucinetid_index": { - "name": "instructor_to_websoc_instructor_instructor_ucinetid_index", - "columns": [ - { - "expression": "instructor_ucinetid", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "instructor_to_websoc_instructor_websoc_instructor_name_index": { - "name": "instructor_to_websoc_instructor_websoc_instructor_name_index", - "columns": [ - { - "expression": "websoc_instructor_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "instructor_to_websoc_instructor_instructor_ucinetid_websoc_instructor_name_index": { - "name": "instructor_to_websoc_instructor_instructor_ucinetid_websoc_instructor_name_index", - "columns": [ - { - "expression": "instructor_ucinetid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "websoc_instructor_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "instructor_to_websoc_instructor_instructor_ucinetid_instructor_ucinetid_fk": { - "name": "instructor_to_websoc_instructor_instructor_ucinetid_instructor_ucinetid_fk", - "tableFrom": "instructor_to_websoc_instructor", - "tableTo": "instructor", - "columnsFrom": ["instructor_ucinetid"], - "columnsTo": ["ucinetid"], - "onDelete": "no action", - "onUpdate": "no action" - }, - "instructor_to_websoc_instructor_websoc_instructor_name_websoc_instructor_name_fk": { - "name": "instructor_to_websoc_instructor_websoc_instructor_name_websoc_instructor_name_fk", - "tableFrom": "instructor_to_websoc_instructor", - "tableTo": "websoc_instructor", - "columnsFrom": ["websoc_instructor_name"], - "columnsTo": ["name"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.larc_section": { - "name": "larc_section", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "course_id": { - "name": "course_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "days_string": { - "name": "days_string", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "time_string": { - "name": "time_string", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "start_time": { - "name": "start_time", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "end_time": { - "name": "end_time", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "instructor": { - "name": "instructor", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "building": { - "name": "building", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "meets_monday": { - "name": "meets_monday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_tuesday": { - "name": "meets_tuesday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_wednesday": { - "name": "meets_wednesday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_thursday": { - "name": "meets_thursday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_friday": { - "name": "meets_friday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_saturday": { - "name": "meets_saturday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_sunday": { - "name": "meets_sunday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "larc_section_course_id_index": { - "name": "larc_section_course_id_index", - "columns": [ - { - "expression": "course_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "larc_section_course_id_websoc_course_id_fk": { - "name": "larc_section_course_id_websoc_course_id_fk", - "tableFrom": "larc_section", - "tableTo": "websoc_course", - "columnsFrom": ["course_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.library_traffic": { - "name": "library_traffic", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "library_name": { - "name": "library_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "location_name": { - "name": "location_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "traffic_count": { - "name": "traffic_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "traffic_percentage": { - "name": "traffic_percentage", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "timestamp": { - "name": "timestamp", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "library_traffic_library_name_index": { - "name": "library_traffic_library_name_index", - "columns": [ - { - "expression": "library_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "library_traffic_location_name_index": { - "name": "library_traffic_location_name_index", - "columns": [ - { - "expression": "location_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.library_traffic_history": { - "name": "library_traffic_history", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "location_id": { - "name": "location_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "traffic_count": { - "name": "traffic_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "traffic_percentage": { - "name": "traffic_percentage", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "timestamp": { - "name": "timestamp", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "library_traffic_history_location_id_timestamp_index": { - "name": "library_traffic_history_location_id_timestamp_index", - "columns": [ - { - "expression": "location_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "timestamp", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "library_traffic_history_location_id_library_traffic_id_fk": { - "name": "library_traffic_history_location_id_library_traffic_id_fk", - "tableFrom": "library_traffic_history", - "tableTo": "library_traffic", - "columnsFrom": ["location_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.major": { - "name": "major", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "degree_id": { - "name": "degree_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "code": { - "name": "code", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "college_requirement": { - "name": "college_requirement", - "type": "uuid", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "major_degree_id_index": { - "name": "major_degree_id_index", - "columns": [ - { - "expression": "degree_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "major_college_requirement_index": { - "name": "major_college_requirement_index", - "columns": [ - { - "expression": "college_requirement", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "major_degree_id_degree_id_fk": { - "name": "major_degree_id_degree_id_fk", - "tableFrom": "major", - "tableTo": "degree", - "columnsFrom": ["degree_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - }, - "major_college_requirement_college_requirement_id_fk": { - "name": "major_college_requirement_college_requirement_id_fk", - "tableFrom": "major", - "tableTo": "college_requirement", - "columnsFrom": ["college_requirement"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.major_requirement": { - "name": "major_requirement", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "requirements": { - "name": "requirements", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "requirements_hash": { - "name": "requirements_hash", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "generated": { - "as": "jsonb_hash_extended(requirements, 0)", - "type": "stored" - } - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "major_requirement_requirements_hash_unique": { - "name": "major_requirement_requirements_hash_unique", - "nullsNotDistinct": false, - "columns": ["requirements_hash"] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.major_spec_pair_to_requirement": { - "name": "major_spec_pair_to_requirement", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true, - "generated": { - "as": "\n CASE WHEN \"major_spec_pair_to_requirement\".\"spec_id\" IS NOT NULL\n THEN \"major_spec_pair_to_requirement\".\"major_id\" || '+' || \"major_spec_pair_to_requirement\".\"spec_id\"\n ELSE \"major_spec_pair_to_requirement\".\"major_id\"\n END", - "type": "stored" - } - }, - "major_id": { - "name": "major_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "spec_id": { - "name": "spec_id", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "requirement_id": { - "name": "requirement_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "major_spec_pair_to_requirement_major_id_major_id_fk": { - "name": "major_spec_pair_to_requirement_major_id_major_id_fk", - "tableFrom": "major_spec_pair_to_requirement", - "tableTo": "major", - "columnsFrom": ["major_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - }, - "major_spec_pair_to_requirement_spec_id_specialization_id_fk": { - "name": "major_spec_pair_to_requirement_spec_id_specialization_id_fk", - "tableFrom": "major_spec_pair_to_requirement", - "tableTo": "specialization", - "columnsFrom": ["spec_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - }, - "major_spec_pair_to_requirement_requirement_id_major_requirement_id_fk": { - "name": "major_spec_pair_to_requirement_requirement_id_major_requirement_id_fk", - "tableFrom": "major_spec_pair_to_requirement", - "tableTo": "major_requirement", - "columnsFrom": ["requirement_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.minor": { - "name": "minor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "requirements": { - "name": "requirements", - "type": "json", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.prerequisite": { - "name": "prerequisite", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "dep_dept": { - "name": "dep_dept", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "prerequisite_id": { - "name": "prerequisite_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "dependency_id": { - "name": "dependency_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "prerequisite_dep_dept_index": { - "name": "prerequisite_dep_dept_index", - "columns": [ - { - "expression": "dep_dept", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "prerequisite_prerequisite_id_index": { - "name": "prerequisite_prerequisite_id_index", - "columns": [ - { - "expression": "prerequisite_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "prerequisite_dependency_id_index": { - "name": "prerequisite_dependency_id_index", - "columns": [ - { - "expression": "dependency_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "prerequisite_prerequisite_id_dependency_id_index": { - "name": "prerequisite_prerequisite_id_dependency_id_index", - "columns": [ - { - "expression": "prerequisite_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dependency_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.sample_program_variation": { - "name": "sample_program_variation", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "program_id": { - "name": "program_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "label": { - "name": "label", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "sample_program": { - "name": "sample_program", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "variation_notes": { - "name": "variation_notes", - "type": "varchar[]", - "primaryKey": false, - "notNull": true, - "default": "ARRAY[]::VARCHAR[]" - } - }, - "indexes": {}, - "foreignKeys": { - "sample_program_variation_program_id_catalogue_program_id_fk": { - "name": "sample_program_variation_program_id_catalogue_program_id_fk", - "tableFrom": "sample_program_variation", - "tableTo": "catalogue_program", - "columnsFrom": ["program_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.school_requirement": { - "name": "school_requirement", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "requirements": { - "name": "requirements", - "type": "json", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.specialization": { - "name": "specialization", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "major_id": { - "name": "major_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "requirements": { - "name": "requirements", - "type": "json", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "specialization_major_id_index": { - "name": "specialization_major_id_index", - "columns": [ - { - "expression": "major_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "specialization_major_id_major_id_fk": { - "name": "specialization_major_id_major_id_fk", - "tableFrom": "specialization", - "tableTo": "major", - "columnsFrom": ["major_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.study_location": { - "name": "study_location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.study_room": { - "name": "study_room", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "capacity": { - "name": "capacity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "location": { - "name": "location", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "directions": { - "name": "directions", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "tech_enhanced": { - "name": "tech_enhanced", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "url": { - "name": "url", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "study_location_id": { - "name": "study_location_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "study_room_study_location_id_index": { - "name": "study_room_study_location_id_index", - "columns": [ - { - "expression": "study_location_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "study_room_study_location_id_study_location_id_fk": { - "name": "study_room_study_location_id_study_location_id_fk", - "tableFrom": "study_room", - "tableTo": "study_location", - "columnsFrom": ["study_location_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.study_room_slot": { - "name": "study_room_slot", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "study_room_id": { - "name": "study_room_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "start": { - "name": "start", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "end": { - "name": "end", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "is_available": { - "name": "is_available", - "type": "boolean", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "study_room_slot_study_room_id_index": { - "name": "study_room_slot_study_room_id_index", - "columns": [ - { - "expression": "study_room_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "study_room_slot_study_room_id_start_end_index": { - "name": "study_room_slot_study_room_id_start_end_index", - "columns": [ - { - "expression": "study_room_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "start", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "end", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "study_room_slot_study_room_id_study_room_id_fk": { - "name": "study_room_slot_study_room_id_study_room_id_fk", - "tableFrom": "study_room_slot", - "tableTo": "study_room", - "columnsFrom": ["study_room_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_course": { - "name": "websoc_course", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "department_id": { - "name": "department_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "course_id": { - "name": "course_id", - "type": "varchar", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "REPLACE(\"websoc_course\".\"dept_code\", ' ', '') || \"websoc_course\".\"course_number\"", - "type": "stored" - } - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "year": { - "name": "year", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "quarter": { - "name": "quarter", - "type": "term", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "school_name": { - "name": "school_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "dept_code": { - "name": "dept_code", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "course_title": { - "name": "course_title", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "course_number": { - "name": "course_number", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "course_numeric": { - "name": "course_numeric", - "type": "integer", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "CASE REGEXP_REPLACE(\"websoc_course\".\"course_number\", '\\D', '', 'g') WHEN '' THEN 0 ELSE REGEXP_REPLACE(\"websoc_course\".\"course_number\", '\\D', '', 'g')::INTEGER END", - "type": "stored" - } - }, - "course_comment": { - "name": "course_comment", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "prerequisite_link": { - "name": "prerequisite_link", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "is_ge_1a": { - "name": "is_ge_1a", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_1b": { - "name": "is_ge_1b", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_2": { - "name": "is_ge_2", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_3": { - "name": "is_ge_3", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_4": { - "name": "is_ge_4", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_5a": { - "name": "is_ge_5a", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_5b": { - "name": "is_ge_5b", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_6": { - "name": "is_ge_6", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_7": { - "name": "is_ge_7", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_8": { - "name": "is_ge_8", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "websoc_course_department_id_index": { - "name": "websoc_course_department_id_index", - "columns": [ - { - "expression": "department_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_course_id_index": { - "name": "websoc_course_course_id_index", - "columns": [ - { - "expression": "course_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_school_name_dept_code_course_number_course_title_index": { - "name": "websoc_course_year_quarter_school_name_dept_code_course_number_course_title_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "school_name", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dept_code", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "course_number", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "course_title", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_1a_index": { - "name": "websoc_course_year_quarter_is_ge_1a_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_1a", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_1b_index": { - "name": "websoc_course_year_quarter_is_ge_1b_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_1b", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_2_index": { - "name": "websoc_course_year_quarter_is_ge_2_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_2", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_3_index": { - "name": "websoc_course_year_quarter_is_ge_3_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_3", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_4_index": { - "name": "websoc_course_year_quarter_is_ge_4_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_4", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_5a_index": { - "name": "websoc_course_year_quarter_is_ge_5a_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_5a", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_5b_index": { - "name": "websoc_course_year_quarter_is_ge_5b_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_5b", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_6_index": { - "name": "websoc_course_year_quarter_is_ge_6_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_6", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_7_index": { - "name": "websoc_course_year_quarter_is_ge_7_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_7", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_8_index": { - "name": "websoc_course_year_quarter_is_ge_8_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_8", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_dept_code_index": { - "name": "websoc_course_year_quarter_dept_code_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dept_code", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_dept_code_course_number_index": { - "name": "websoc_course_year_quarter_dept_code_course_number_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dept_code", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "course_number", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_course_department_id_websoc_department_id_fk": { - "name": "websoc_course_department_id_websoc_department_id_fk", - "tableFrom": "websoc_course", - "tableTo": "websoc_department", - "columnsFrom": ["department_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_department": { - "name": "websoc_department", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "school_id": { - "name": "school_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "year": { - "name": "year", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "quarter": { - "name": "quarter", - "type": "term", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "dept_code": { - "name": "dept_code", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "dept_name": { - "name": "dept_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "dept_comment": { - "name": "dept_comment", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "section_code_range_comments": { - "name": "section_code_range_comments", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "course_number_range_comments": { - "name": "course_number_range_comments", - "type": "text[]", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "websoc_department_school_id_index": { - "name": "websoc_department_school_id_index", - "columns": [ - { - "expression": "school_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_department_year_quarter_school_id_dept_code_index": { - "name": "websoc_department_year_quarter_school_id_dept_code_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "school_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dept_code", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_department_school_id_websoc_school_id_fk": { - "name": "websoc_department_school_id_websoc_school_id_fk", - "tableFrom": "websoc_department", - "tableTo": "websoc_school", - "columnsFrom": ["school_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_instructor": { - "name": "websoc_instructor", - "schema": "", - "columns": { - "name": { - "name": "name", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_location": { - "name": "websoc_location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "building": { - "name": "building", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "room": { - "name": "room", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "websoc_location_building_room_index": { - "name": "websoc_location_building_room_index", - "columns": [ - { - "expression": "building", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "room", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_meta": { - "name": "websoc_meta", - "schema": "", - "columns": { - "name": { - "name": "name", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "last_scraped": { - "name": "last_scraped", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_dept_scraped": { - "name": "last_dept_scraped", - "type": "varchar", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_school": { - "name": "websoc_school", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "year": { - "name": "year", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "quarter": { - "name": "quarter", - "type": "term", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "school_name": { - "name": "school_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "school_comment": { - "name": "school_comment", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "websoc_school_year_quarter_school_name_index": { - "name": "websoc_school_year_quarter_school_name_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "school_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_section": { - "name": "websoc_section", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "course_id": { - "name": "course_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "year": { - "name": "year", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "quarter": { - "name": "quarter", - "type": "term", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "units": { - "name": "units", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "websoc_status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "instructors": { - "name": "instructors", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "meetings": { - "name": "meetings", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "final_exam_string": { - "name": "final_exam_string", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "final_exam": { - "name": "final_exam", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "section_num": { - "name": "section_num", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "max_capacity": { - "name": "max_capacity", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "section_code": { - "name": "section_code", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "section_type": { - "name": "section_type", - "type": "websoc_section_type", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "num_requested": { - "name": "num_requested", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "restriction_string": { - "name": "restriction_string", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "restriction_a": { - "name": "restriction_a", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_b": { - "name": "restriction_b", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_c": { - "name": "restriction_c", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_d": { - "name": "restriction_d", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_e": { - "name": "restriction_e", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_f": { - "name": "restriction_f", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_g": { - "name": "restriction_g", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_h": { - "name": "restriction_h", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_i": { - "name": "restriction_i", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_j": { - "name": "restriction_j", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_k": { - "name": "restriction_k", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_l": { - "name": "restriction_l", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_m": { - "name": "restriction_m", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_n": { - "name": "restriction_n", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_o": { - "name": "restriction_o", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_r": { - "name": "restriction_r", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_s": { - "name": "restriction_s", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_x": { - "name": "restriction_x", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "num_on_waitlist": { - "name": "num_on_waitlist", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "num_waitlist_cap": { - "name": "num_waitlist_cap", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "section_comment": { - "name": "section_comment", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "num_new_only_reserved": { - "name": "num_new_only_reserved", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "num_currently_total_enrolled": { - "name": "num_currently_total_enrolled", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "num_currently_section_enrolled": { - "name": "num_currently_section_enrolled", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "is_cancelled": { - "name": "is_cancelled", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "\"websoc_section\".\"section_comment\" LIKE '%*** CANCELLED ***%' OR \"websoc_section\".\"section_comment\" LIKE '%*** CANCELED ***%'", - "type": "stored" - } - }, - "web_url": { - "name": "web_url", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "websoc_section_course_id_index": { - "name": "websoc_section_course_id_index", - "columns": [ - { - "expression": "course_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_section_year_quarter_section_code_index": { - "name": "websoc_section_year_quarter_section_code_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "section_code", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_section_course_id_websoc_course_id_fk": { - "name": "websoc_section_course_id_websoc_course_id_fk", - "tableFrom": "websoc_section", - "tableTo": "websoc_course", - "columnsFrom": ["course_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_section_enrollment": { - "name": "websoc_section_enrollment", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "section_id": { - "name": "section_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "date", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "year": { - "name": "year", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "quarter": { - "name": "quarter", - "type": "term", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "max_capacity": { - "name": "max_capacity", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "num_currently_total_enrolled": { - "name": "num_currently_total_enrolled", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "num_on_waitlist": { - "name": "num_on_waitlist", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "num_waitlist_cap": { - "name": "num_waitlist_cap", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "num_requested": { - "name": "num_requested", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "num_new_only_reserved": { - "name": "num_new_only_reserved", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "websoc_status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "websoc_section_enrollment_section_id_index": { - "name": "websoc_section_enrollment_section_id_index", - "columns": [ - { - "expression": "section_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_section_enrollment_section_id_created_at_index": { - "name": "websoc_section_enrollment_section_id_created_at_index", - "columns": [ - { - "expression": "section_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_section_enrollment_section_id_websoc_section_id_fk": { - "name": "websoc_section_enrollment_section_id_websoc_section_id_fk", - "tableFrom": "websoc_section_enrollment", - "tableTo": "websoc_section", - "columnsFrom": ["section_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_section_grade": { - "name": "websoc_section_grade", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "section_id": { - "name": "section_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "grade_a_count": { - "name": "grade_a_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "grade_b_count": { - "name": "grade_b_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "grade_c_count": { - "name": "grade_c_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "grade_d_count": { - "name": "grade_d_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "grade_f_count": { - "name": "grade_f_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "grade_p_count": { - "name": "grade_p_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "grade_np_count": { - "name": "grade_np_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "grade_w_count": { - "name": "grade_w_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "average_gpa": { - "name": "average_gpa", - "type": "numeric(3, 2)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "websoc_section_grade_section_id_index": { - "name": "websoc_section_grade_section_id_index", - "columns": [ - { - "expression": "section_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_section_grade_section_id_websoc_section_id_fk": { - "name": "websoc_section_grade_section_id_websoc_section_id_fk", - "tableFrom": "websoc_section_grade", - "tableTo": "websoc_section", - "columnsFrom": ["section_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "websoc_section_grade_section_id_unique": { - "name": "websoc_section_grade_section_id_unique", - "nullsNotDistinct": false, - "columns": ["section_id"] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_section_meeting": { - "name": "websoc_section_meeting", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "section_id": { - "name": "section_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "section_code": { - "name": "section_code", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "meeting_index": { - "name": "meeting_index", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "time_string": { - "name": "time_string", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "time_is_tba": { - "name": "time_is_tba", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "\"websoc_section_meeting\".\"time_string\" LIKE '%TBA%'", - "type": "stored" - } - }, - "start_time": { - "name": "start_time", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "end_time": { - "name": "end_time", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "days_string": { - "name": "days_string", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "meets_monday": { - "name": "meets_monday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_tuesday": { - "name": "meets_tuesday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_wednesday": { - "name": "meets_wednesday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_thursday": { - "name": "meets_thursday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_friday": { - "name": "meets_friday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_saturday": { - "name": "meets_saturday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_sunday": { - "name": "meets_sunday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "websoc_section_meeting_section_id_index": { - "name": "websoc_section_meeting_section_id_index", - "columns": [ - { - "expression": "section_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_section_meeting_section_id_websoc_section_id_fk": { - "name": "websoc_section_meeting_section_id_websoc_section_id_fk", - "tableFrom": "websoc_section_meeting", - "tableTo": "websoc_section", - "columnsFrom": ["section_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_section_meeting_to_location": { - "name": "websoc_section_meeting_to_location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "meeting_id": { - "name": "meeting_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "location_id": { - "name": "location_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "websoc_section_meeting_to_location_meeting_id_index": { - "name": "websoc_section_meeting_to_location_meeting_id_index", - "columns": [ - { - "expression": "meeting_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_section_meeting_to_location_location_id_index": { - "name": "websoc_section_meeting_to_location_location_id_index", - "columns": [ - { - "expression": "location_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_section_meeting_to_location_meeting_id_location_id_index": { - "name": "websoc_section_meeting_to_location_meeting_id_location_id_index", - "columns": [ - { - "expression": "meeting_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "location_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_section_meeting_to_location_meeting_id_websoc_section_meeting_id_fk": { - "name": "websoc_section_meeting_to_location_meeting_id_websoc_section_meeting_id_fk", - "tableFrom": "websoc_section_meeting_to_location", - "tableTo": "websoc_section_meeting", - "columnsFrom": ["meeting_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "websoc_section_meeting_to_location_location_id_websoc_location_id_fk": { - "name": "websoc_section_meeting_to_location_location_id_websoc_location_id_fk", - "tableFrom": "websoc_section_meeting_to_location", - "tableTo": "websoc_location", - "columnsFrom": ["location_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_section_to_instructor": { - "name": "websoc_section_to_instructor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "section_id": { - "name": "section_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "instructor_name": { - "name": "instructor_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "websoc_section_to_instructor_section_id_index": { - "name": "websoc_section_to_instructor_section_id_index", - "columns": [ - { - "expression": "section_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_section_to_instructor_instructor_name_index": { - "name": "websoc_section_to_instructor_instructor_name_index", - "columns": [ - { - "expression": "instructor_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_section_to_instructor_section_id_websoc_section_id_fk": { - "name": "websoc_section_to_instructor_section_id_websoc_section_id_fk", - "tableFrom": "websoc_section_to_instructor", - "tableTo": "websoc_section", - "columnsFrom": ["section_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - }, - "websoc_section_to_instructor_instructor_name_websoc_instructor_name_fk": { - "name": "websoc_section_to_instructor_instructor_name_websoc_instructor_name_fk", - "tableFrom": "websoc_section_to_instructor", - "tableTo": "websoc_instructor", - "columnsFrom": ["instructor_name"], - "columnsTo": ["name"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.course_level": { - "name": "course_level", - "schema": "public", - "values": ["LowerDiv", "UpperDiv", "Graduate"] - }, - "public.division": { - "name": "division", - "schema": "public", - "values": ["Undergraduate", "Graduate"] - }, - "public.term": { - "name": "term", - "schema": "public", - "values": ["Fall", "Winter", "Spring", "Summer1", "Summer10wk", "Summer2"] - }, - "public.websoc_section_type": { - "name": "websoc_section_type", - "schema": "public", - "values": [ - "Act", - "Col", - "Dis", - "Fld", - "Lab", - "Lec", - "Qiz", - "Res", - "Sem", - "Stu", - "Tap", - "Tut" - ] - }, - "public.websoc_status": { - "name": "websoc_status", - "schema": "public", - "values": ["OPEN", "Waitl", "FULL", "NewOnly"] - } - }, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": { - "public.course_view": { - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "department": { - "name": "department", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "shortened_dept": { - "name": "shortened_dept", - "type": "varchar", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "REPLACE(\"course\".\"department\", ' ', '')", - "type": "stored" - } - }, - "department_alias": { - "name": "department_alias", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "course_number": { - "name": "course_number", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "course_numeric": { - "name": "course_numeric", - "type": "integer", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "CASE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g') WHEN '' THEN 0 ELSE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g')::INTEGER END", - "type": "stored" - } - }, - "school": { - "name": "school", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "course_level": { - "name": "course_level", - "type": "course_level", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "min_units": { - "name": "min_units", - "type": "numeric(4, 2)", - "primaryKey": false, - "notNull": true - }, - "max_units": { - "name": "max_units", - "type": "numeric(4, 2)", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "department_name": { - "name": "department_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "prerequisite_tree": { - "name": "prerequisite_tree", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "prerequisite_text": { - "name": "prerequisite_text", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "repeatability": { - "name": "repeatability", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "grading_option": { - "name": "grading_option", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "concurrent": { - "name": "concurrent", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "same_as": { - "name": "same_as", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "restriction": { - "name": "restriction", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "overlap": { - "name": "overlap", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "corequisites": { - "name": "corequisites", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "is_ge_1a": { - "name": "is_ge_1a", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_1b": { - "name": "is_ge_1b", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_2": { - "name": "is_ge_2", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_3": { - "name": "is_ge_3", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_4": { - "name": "is_ge_4", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_5a": { - "name": "is_ge_5a", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_5b": { - "name": "is_ge_5b", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_6": { - "name": "is_ge_6", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_7": { - "name": "is_ge_7", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_8": { - "name": "is_ge_8", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "ge_text": { - "name": "ge_text", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "definition": "select \"course\".\"id\", \"course\".\"updated_at\", \"course\".\"department\", \"course\".\"shortened_dept\", \"course\".\"department_alias\", \"course\".\"course_number\", \"course\".\"course_numeric\", \"course\".\"school\", \"course\".\"title\", \"course\".\"course_level\", \"course\".\"min_units\", \"course\".\"max_units\", \"course\".\"description\", \"course\".\"department_name\", \"course\".\"prerequisite_tree\", \"course\".\"prerequisite_text\", \"course\".\"repeatability\", \"course\".\"grading_option\", \"course\".\"concurrent\", \"course\".\"same_as\", \"course\".\"restriction\", \"course\".\"overlap\", \"course\".\"corequisites\", \"course\".\"is_ge_1a\", \"course\".\"is_ge_1b\", \"course\".\"is_ge_2\", \"course\".\"is_ge_3\", \"course\".\"is_ge_4\", \"course\".\"is_ge_5a\", \"course\".\"is_ge_5b\", \"course\".\"is_ge_6\", \"course\".\"is_ge_7\", \"course\".\"is_ge_8\", \"course\".\"ge_text\", \n ARRAY_REMOVE(COALESCE(\n (\n SELECT ARRAY_AGG(\n CASE WHEN \"prerequisite_course\".\"id\" IS NULL THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'id', \"prerequisite_course\".\"id\",\n 'title', \"prerequisite_course\".\"title\",\n 'department', \"prerequisite_course\".\"department\",\n 'courseNumber', \"prerequisite_course\".\"course_number\"\n )\n END\n )\n FROM \"prerequisite\"\n LEFT JOIN \"course\" \"prerequisite_course\" ON \"prerequisite_course\".\"id\" = \"prerequisite\".\"prerequisite_id\"\n WHERE \"prerequisite\".\"dependency_id\" = \"course\".\"id\"\n ),\n ARRAY[]::JSONB[]), NULL)\n as \"prerequisites\", \n ARRAY_REMOVE(COALESCE(\n (\n SELECT ARRAY_AGG(\n CASE WHEN \"dependency_course\".\"id\" IS NULL THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'id', \"dependency_course\".\"id\",\n 'title', \"dependency_course\".\"title\",\n 'department', \"dependency_course\".\"department\",\n 'courseNumber', \"dependency_course\".\"course_number\"\n )\n END\n )\n FROM \"prerequisite\" \"dependency\"\n LEFT JOIN \"course\" \"dependency_course\" ON \"dependency_course\".\"id\" = \"dependency\".\"dependency_id\"\n WHERE \"dependency\".\"prerequisite_id\" = \"course\".\"id\"\n ),\n ARRAY[]::JSONB[]), NULL)\n as \"dependencies\", \n ARRAY_REMOVE(ARRAY_AGG(DISTINCT\n CASE WHEN \"websoc_course\".\"year\" IS NULL THEN NULL\n ELSE CONCAT(\"websoc_course\".\"year\", ' ', \"websoc_course\".\"quarter\")\n END\n ), NULL)\n as \"terms\", \n ARRAY_REMOVE(COALESCE(ARRAY_AGG(DISTINCT\n CASE WHEN \"instructor\".\"ucinetid\" IS NULL THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'ucinetid', \"instructor\".\"ucinetid\",\n 'name', \"instructor\".\"name\",\n 'title', \"instructor\".\"title\",\n 'email', \"instructor\".\"email\",\n 'department', \"instructor\".\"department\",\n 'shortenedNames', ARRAY(\n SELECT \"instructor_to_websoc_instructor\".\"websoc_instructor_name\"\n FROM \"instructor_to_websoc_instructor\"\n WHERE \"instructor_to_websoc_instructor\".\"instructor_ucinetid\" = \"instructor\".\"ucinetid\"\n )\n )\n END\n ), ARRAY[]::JSONB[]), NULL)\n as \"instructors\" from \"course\" left join \"websoc_course\" on \"websoc_course\".\"course_id\" = \"course\".\"id\" left join \"websoc_section\" on \"websoc_section\".\"course_id\" = \"websoc_course\".\"id\" left join \"websoc_section_to_instructor\" on \"websoc_section_to_instructor\".\"section_id\" = \"websoc_section\".\"id\" left join \"websoc_instructor\" on \"websoc_instructor\".\"name\" = \"websoc_section_to_instructor\".\"instructor_name\" left join \"instructor_to_websoc_instructor\" on \"instructor_to_websoc_instructor\".\"websoc_instructor_name\" = \"websoc_instructor\".\"name\" left join \"instructor\" on (\"instructor\".\"ucinetid\" = \"instructor_to_websoc_instructor\".\"instructor_ucinetid\" and \"instructor\".\"ucinetid\" is not null and \"instructor\".\"ucinetid\" <> 'student') group by \"course\".\"id\"", - "name": "course_view", - "schema": "public", - "isExisting": false, - "materialized": true - }, - "public.instructor_view": { - "columns": { - "ucinetid": { - "name": "ucinetid", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "department": { - "name": "department", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "definition": "with \"shortened_names_cte\" as (select \"instructor_ucinetid\", ARRAY_AGG(\"websoc_instructor_name\") as \"shortened_names\" from \"instructor_to_websoc_instructor\" group by \"instructor_to_websoc_instructor\".\"instructor_ucinetid\"), \"courses_cte\" as (with \"terms_cte\" as (select \"course\".\"id\", \"instructor_to_websoc_instructor\".\"instructor_ucinetid\", \n ARRAY_REMOVE(ARRAY_AGG(DISTINCT\n CASE WHEN \"websoc_course\".\"year\" IS NULL THEN NULL\n ELSE CONCAT(\"websoc_course\".\"year\", ' ', \"websoc_course\".\"quarter\")\n END\n ), NULL) as \"terms\" from \"course\" left join \"websoc_course\" on \"websoc_course\".\"course_id\" = \"course\".\"id\" left join \"websoc_section\" on \"websoc_section\".\"course_id\" = \"websoc_course\".\"id\" left join \"websoc_section_to_instructor\" on \"websoc_section_to_instructor\".\"section_id\" = \"websoc_section\".\"id\" left join \"websoc_instructor\" on \"websoc_instructor\".\"name\" = \"websoc_section_to_instructor\".\"instructor_name\" left join \"instructor_to_websoc_instructor\" on \"instructor_to_websoc_instructor\".\"websoc_instructor_name\" = \"websoc_instructor\".\"name\" group by \"course\".\"id\", \"instructor_to_websoc_instructor\".\"instructor_ucinetid\") select \"terms_cte\".\"instructor_ucinetid\", \"course\".\"id\", \n CASE WHEN \"course\".\"id\" IS NULL\n THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'id', \"course\".\"id\",\n 'title', \"course\".\"title\",\n 'department', \"course\".\"department\",\n 'courseNumber', \"course\".\"course_number\",\n 'terms', COALESCE(\"terms\", ARRAY[]::TEXT[])\n )\n END\n as \"course_info\" from \"course\" left join \"terms_cte\" on \"terms_cte\".\"id\" = \"course\".\"id\" group by \"course\".\"id\", \"terms_cte\".\"instructor_ucinetid\", \"terms\") select \"instructor\".\"ucinetid\", \"instructor\".\"name\", \"instructor\".\"title\", \"instructor\".\"email\", \"instructor\".\"department\", COALESCE(\"shortened_names\", ARRAY[]::TEXT[]) as \"shortened_names\", \n ARRAY_REMOVE(ARRAY_AGG(DISTINCT \"course_info\"), NULL)\n as \"courses\" from \"instructor\" left join \"shortened_names_cte\" on \"shortened_names_cte\".\"instructor_ucinetid\" = \"instructor\".\"ucinetid\" left join \"courses_cte\" on \"courses_cte\".\"instructor_ucinetid\" = \"instructor\".\"ucinetid\" where \"instructor\".\"ucinetid\" <> 'student' group by \"instructor\".\"ucinetid\", \"shortened_names\"", - "name": "instructor_view", - "schema": "public", - "isExisting": false, - "materialized": true - } - }, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} diff --git a/packages/db/migrations/meta/_journal.json b/packages/db/migrations/meta/_journal.json index 41187d67..350e0a99 100644 --- a/packages/db/migrations/meta/_journal.json +++ b/packages/db/migrations/meta/_journal.json @@ -169,13 +169,6 @@ "when": 1770072497788, "tag": "0023_pv_study_rooms", "breakpoints": true - }, - { - "idx": 24, - "version": "7", - "when": 1771116564370, - "tag": "0024_polymorphic_majors", - "breakpoints": true } ] } From d4171d31c01c8a4d82e43b2ed0244773da8deeb7 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Sat, 21 Feb 2026 11:37:30 -0800 Subject: [PATCH 30/91] seperated parsing of specialization requirement to different function --- .../src/components/AuditParser.ts | 212 +++++++++--------- 1 file changed, 106 insertions(+), 106 deletions(-) diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts b/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts index 4a3e41c0..a49528ba 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts @@ -10,6 +10,8 @@ import { course } from "@packages/db/schema"; export class AuditParser { private static readonly specOrOtherMatcher = /"type":"(?:SPEC|OTHER)","value":"\w+"/g; + private static readonly specializationMatcher = + /specialization|concentration|emphasis|area|track|major/i; private static readonly electiveMatcher = /ELECTIVE @+/; private static readonly wildcardMatcher = /\w@/; private static readonly rangeMatcher = /-\w+/; @@ -157,34 +159,53 @@ export class AuditParser { return filteredClasses; } - async ruleArrayToRequirements(ruleArray: Rule[]) { - const ret: DegreeWorksRequirement[] = []; + async requiresSpecialization(ruleArray: Rule[]) { for (const rule of ruleArray) { - // heuristic for matching a specialization requirement if ( rule.ifElsePart === "ElsePart" && - rule.proxyAdvice?.textList.some((x) => - /specialization|concentration|emphasis|area|track|major/i.test(x), - ) + rule.proxyAdvice?.textList.some((x) => AuditParser.specializationMatcher.test(x)) ) { - ret.push({ - label: AuditParser.suppressLabelPolymorphism(rule.label), - requirementType: "Spec", - }); - } else { - switch (rule.ruleType) { - case "Block": - case "Noncourse": - break; - case "Course": { - const includedCourses: [string, WithClause[]][] = rule.requirement.courseArray.map( - (x) => [ - `${x.discipline} ${x.number}${x.numberEnd ? `-${x.numberEnd}` : ""}`, - x.withArray ? x.withArray : [], - ], - ); - const toInclude: [string, typeof course.$inferSelect][] = await Promise.all( - includedCourses.map(([x, withArray]) => + return true; + } + } + return false; + } + + async ruleArrayToRequirements(ruleArray: Rule[]) { + const ret: DegreeWorksRequirement[] = []; + for (const rule of ruleArray) { + // heuristic for matching a specialization requirement + switch (rule.ruleType) { + case "Block": + case "Noncourse": + break; + case "Course": { + const includedCourses: [string, WithClause[]][] = rule.requirement.courseArray.map( + (x) => [ + `${x.discipline} ${x.number}${x.numberEnd ? `-${x.numberEnd}` : ""}`, + x.withArray ? x.withArray : [], + ], + ); + const toInclude: [string, typeof course.$inferSelect][] = await Promise.all( + includedCourses.map(([x, withArray]) => + this.normalizeCourseId + .bind(this)(x) + .then((x) => [x, withArray] as [(typeof course.$inferSelect)[], WithClause[]]), + ), + ).then((x) => + x + .flatMap(([classes, withArray]) => this.filterThroughWithArray(classes, withArray)) + .map((y) => [y.id, y]), + ); + + const excludedCourses: [string, WithClause[]][] = + rule.requirement.except?.courseArray.map((x) => [ + `${x.discipline} ${x.number}${x.numberEnd ? `-${x.numberEnd}` : ""}`, + x.withArray ? x.withArray : [], + ]) ?? []; + const toExclude = new Set( + await Promise.all( + excludedCourses.map(([x, withArray]) => this.normalizeCourseId .bind(this)(x) .then((x) => [x, withArray] as [(typeof course.$inferSelect)[], WithClause[]]), @@ -192,95 +213,74 @@ export class AuditParser { ).then((x) => x .flatMap(([classes, withArray]) => this.filterThroughWithArray(classes, withArray)) - .map((y) => [y.id, y]), - ); - - const excludedCourses: [string, WithClause[]][] = - rule.requirement.except?.courseArray.map((x) => [ - `${x.discipline} ${x.number}${x.numberEnd ? `-${x.numberEnd}` : ""}`, - x.withArray ? x.withArray : [], - ]) ?? []; - const toExclude = new Set( - await Promise.all( - excludedCourses.map(([x, withArray]) => - this.normalizeCourseId - .bind(this)(x) - .then((x) => [x, withArray] as [(typeof course.$inferSelect)[], WithClause[]]), - ), - ).then((x) => - x - .flatMap(([classes, withArray]) => - this.filterThroughWithArray(classes, withArray), - ) - .map((y) => y.id), - ), - ); - const courses = Array.from(toInclude) - .filter(([x]) => !toExclude.has(x)) - .sort(([, a], [, b]) => - a.department === b.department - ? a.courseNumeric - b.courseNumeric || this.lexOrd(a.courseNumber, b.courseNumber) - : this.lexOrd(a.department, b.department), - ) - .map(([x]) => x); - if (rule.requirement.classesBegin) { - ret.push({ - label: AuditParser.suppressLabelPolymorphism(rule.label), - requirementType: "Course", - courseCount: Number.parseInt(rule.requirement.classesBegin, 10), - courses, - }); - } else if (rule.requirement.creditsBegin) { - ret.push({ - label: AuditParser.suppressLabelPolymorphism(rule.label), - requirementType: "Unit", - unitCount: Number.parseInt(rule.requirement.creditsBegin, 10), - courses, - }); - } - break; - } - case "Group": { - ret.push({ - label: AuditParser.suppressLabelPolymorphism(rule.label), - requirementType: "Group", - requirementCount: Number.parseInt(rule.requirement.numberOfGroups), - requirements: await this.ruleArrayToRequirements(rule.ruleArray), - }); - break; - } - case "IfStmt": { - const rules = this.flattenIfStmt([rule]); - if (!rules.some((x) => x.ruleType === "Block")) { - if (rules.length > 1) { - ret.push({ - label: "Select 1 of the following", - requirementType: "Group", - requirementCount: 1, - requirements: await this.ruleArrayToRequirements(rules), - }); - } else if (rules.length === 1) { - ret.push(...(await this.ruleArrayToRequirements(rules))); - } - } - break; - } - case "Complete": - case "Incomplete": + .map((y) => y.id), + ), + ); + const courses = Array.from(toInclude) + .filter(([x]) => !toExclude.has(x)) + .sort(([, a], [, b]) => + a.department === b.department + ? a.courseNumeric - b.courseNumeric || this.lexOrd(a.courseNumber, b.courseNumber) + : this.lexOrd(a.department, b.department), + ) + .map(([x]) => x); + if (rule.requirement.classesBegin) { ret.push({ label: AuditParser.suppressLabelPolymorphism(rule.label), - requirementType: "Marker", + requirementType: "Course", + courseCount: Number.parseInt(rule.requirement.classesBegin, 10), + courses, }); - break; - case "Subset": { - const requirements = await this.ruleArrayToRequirements(rule.ruleArray); + } else if (rule.requirement.creditsBegin) { ret.push({ label: AuditParser.suppressLabelPolymorphism(rule.label), - requirementType: "Group", - requirementCount: Object.keys(requirements).length, - requirements, + requirementType: "Unit", + unitCount: Number.parseInt(rule.requirement.creditsBegin, 10), + courses, }); } + break; + } + case "Group": { + ret.push({ + label: AuditParser.suppressLabelPolymorphism(rule.label), + requirementType: "Group", + requirementCount: Number.parseInt(rule.requirement.numberOfGroups), + requirements: await this.ruleArrayToRequirements(rule.ruleArray), + }); + break; + } + case "IfStmt": { + const rules = this.flattenIfStmt([rule]); + if (!rules.some((x) => x.ruleType === "Block")) { + if (rules.length > 1) { + ret.push({ + label: "Select 1 of the following", + requirementType: "Group", + requirementCount: 1, + requirements: await this.ruleArrayToRequirements(rules), + }); + } else if (rules.length === 1) { + ret.push(...(await this.ruleArrayToRequirements(rules))); + } + } + break; + } + case "Complete": + case "Incomplete": + ret.push({ + label: AuditParser.suppressLabelPolymorphism(rule.label), + requirementType: "Marker", + }); + break; + case "Subset": { + const requirements = await this.ruleArrayToRequirements(rule.ruleArray); + ret.push({ + label: AuditParser.suppressLabelPolymorphism(rule.label), + requirementType: "Group", + requirementCount: Object.keys(requirements).length, + requirements, + }); } } } From c236259abb2846f204ce7839facbaef7d049c306 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Sat, 21 Feb 2026 11:46:14 -0800 Subject: [PATCH 31/91] added requiresSpecialization member to Degree Works Program Type --- .../degreeworks-scraper/src/components/AuditParser.ts | 1 + packages/db/src/schema.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts b/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts index a49528ba..84faa07e 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts @@ -26,6 +26,7 @@ export class AuditParser { requirements: await this.ruleArrayToRequirements(block.ruleArray), // populate later; we cannot determine specializations on the spot specs: [], + requiresSpecialization: await this.requiresSpecialization(block.ruleArray), }); lexOrd = new Intl.Collator().compare; diff --git a/packages/db/src/schema.ts b/packages/db/src/schema.ts index ab293ef3..96876988 100644 --- a/packages/db/src/schema.ts +++ b/packages/db/src/schema.ts @@ -98,6 +98,7 @@ export type DegreeWorksProgram = DegreeWorksProgramId & { * to fulfill the requirements of the program. */ specs: string[]; + requiresSpecialization: boolean; }; /** From 0dd21419b46d33a5b0604a0f2af1a06ca7b98b02 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Sat, 21 Feb 2026 11:58:54 -0800 Subject: [PATCH 32/91] refactored index to get requiredSpecialization data from the Degreeorks Program --- apps/data-pipeline/degreeworks-scraper/src/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/data-pipeline/degreeworks-scraper/src/index.ts b/apps/data-pipeline/degreeworks-scraper/src/index.ts index 266cc8c1..171cb2be 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/index.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/index.ts @@ -45,7 +45,7 @@ async function main() { const collegeBlocks = [] as (typeof collegeRequirement.$inferInsert)[]; const majorData = parsedPrograms .values() - .map(([college, { name, degreeType, code, requirements }]) => { + .map(([college, { name, degreeType, code, requirements, requiresSpecialization }]) => { let collegeBlockIndex: number | undefined; if (college?.requirements) { const wouldInsert = { name: college.name, requirements: college.requirements }; @@ -71,8 +71,8 @@ async function main() { degreeId: degreeType ?? "", code, name, - requireSpec: requirements.some((x) => x.requirementType === "Spec"), - requirements: requirements.filter((x) => x.requirementType !== "Spec"), + requireSpec: requiresSpecialization, + requirements, ...(collegeBlockIndex !== undefined ? { collegeBlockIndex } : {}), }; }) From 83936670aae064fa7ba7a1ddbf95ecf7287fa750 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Sat, 21 Feb 2026 12:04:19 -0800 Subject: [PATCH 33/91] removed DegreeWorksRequireSpecialization type --- .../degreeworks-scraper/src/components/Scraper.ts | 2 +- packages/db/src/schema.ts | 10 ++-------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts index 407eb4bf..e7a7e2e2 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts @@ -409,7 +409,7 @@ export class Scraper { // Chemical Engineering is falsely marked as requiring a specialization (pr#295) const chemE = this.parsedPrograms.get("Major in Chemical Engineering") as MajorProgram; - chemE[1].requirements = chemE[1].requirements.filter((req) => req.requirementType !== "Spec"); + // chemE[1].requirements = chemE[1].requirements.filter((req) => req.requirementType !== "Spec"); this.done = true; } diff --git a/packages/db/src/schema.ts b/packages/db/src/schema.ts index 96876988..2d45e94d 100644 --- a/packages/db/src/schema.ts +++ b/packages/db/src/schema.ts @@ -125,14 +125,8 @@ export type DegreeWorksGroupRequirement = { requirements: DegreeWorksRequirement[]; }; -export type DegreeWorksMarkerRequirement = - | { - requirementType: "Marker"; - } - | DegreeWorksSpecRequirement; - -export type DegreeWorksSpecRequirement = { - requirementType: "Spec"; +export type DegreeWorksMarkerRequirement = { + requirementType: "Marker"; }; export type DegreeWorksRequirementBase = { label: string }; From b363c76daf09865c3b63da61cf9828bc55a84d01 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Sat, 21 Feb 2026 12:11:53 -0800 Subject: [PATCH 34/91] refactored hard coding requirespec to false for chemE major --- .../degreeworks-scraper/src/components/Scraper.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts index e7a7e2e2..02f2dae0 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts @@ -400,6 +400,7 @@ export class Scraper { const z = this.parsedSpecializations.get("AHPER")?.[2] as DegreeWorksProgram; if (x && y && z) { x[1].specs = []; + x[1].requiresSpecialization = false; x[1].requirements = [...x[1].requirements, ...y.requirements, ...z.requirements]; this.parsedSpecializations.delete("AHGEO"); this.parsedSpecializations.delete("AHPER"); @@ -409,7 +410,10 @@ export class Scraper { // Chemical Engineering is falsely marked as requiring a specialization (pr#295) const chemE = this.parsedPrograms.get("Major in Chemical Engineering") as MajorProgram; - // chemE[1].requirements = chemE[1].requirements.filter((req) => req.requirementType !== "Spec"); + + if (chemE) { + chemE[1].requiresSpecialization = false; + } this.done = true; } From d56e89c32cd9d6aabf10d425e77368065b19662e Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Sat, 21 Feb 2026 12:13:24 -0800 Subject: [PATCH 35/91] removed migrations for merge --- .../0024_add_req_spec_to_major_table.sql | 1 - .../db/migrations/meta/0024_snapshot.json | 3858 ----------------- packages/db/migrations/meta/_journal.json | 7 - 3 files changed, 3866 deletions(-) delete mode 100644 packages/db/migrations/0024_add_req_spec_to_major_table.sql delete mode 100644 packages/db/migrations/meta/0024_snapshot.json diff --git a/packages/db/migrations/0024_add_req_spec_to_major_table.sql b/packages/db/migrations/0024_add_req_spec_to_major_table.sql deleted file mode 100644 index 69395a96..00000000 --- a/packages/db/migrations/0024_add_req_spec_to_major_table.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "major" ADD COLUMN "require_spec" boolean NOT NULL; \ No newline at end of file diff --git a/packages/db/migrations/meta/0024_snapshot.json b/packages/db/migrations/meta/0024_snapshot.json deleted file mode 100644 index 2edc7a5d..00000000 --- a/packages/db/migrations/meta/0024_snapshot.json +++ /dev/null @@ -1,3858 +0,0 @@ -{ - "id": "c4146ec9-7406-4087-9c77-ce8e73661fe8", - "prevId": "b1dd1ce5-36ad-4ce8-a66d-02dd8630ce63", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.ap_exam": { - "name": "ap_exam", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "catalogue_name": { - "name": "catalogue_name", - "type": "varchar", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.ap_exam_reward": { - "name": "ap_exam_reward", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "units_granted": { - "name": "units_granted", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "elective_units_granted": { - "name": "elective_units_granted", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "ge_1a_courses_granted": { - "name": "ge_1a_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_1b_courses_granted": { - "name": "ge_1b_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_2_courses_granted": { - "name": "ge_2_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_3_courses_granted": { - "name": "ge_3_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_4_courses_granted": { - "name": "ge_4_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_5a_courses_granted": { - "name": "ge_5a_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_5b_courses_granted": { - "name": "ge_5b_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_6_courses_granted": { - "name": "ge_6_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_7_courses_granted": { - "name": "ge_7_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_8_courses_granted": { - "name": "ge_8_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "courses_granted": { - "name": "courses_granted", - "type": "json", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.ap_exam_to_reward": { - "name": "ap_exam_to_reward", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "exam_id": { - "name": "exam_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "score": { - "name": "score", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "reward": { - "name": "reward", - "type": "uuid", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "ap_exam_to_reward_exam_id_score_index": { - "name": "ap_exam_to_reward_exam_id_score_index", - "columns": [ - { - "expression": "exam_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "score", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "ap_exam_to_reward_exam_id_ap_exam_id_fk": { - "name": "ap_exam_to_reward_exam_id_ap_exam_id_fk", - "tableFrom": "ap_exam_to_reward", - "tableTo": "ap_exam", - "columnsFrom": ["exam_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "ap_exam_to_reward_reward_ap_exam_reward_id_fk": { - "name": "ap_exam_to_reward_reward_ap_exam_reward_id_fk", - "tableFrom": "ap_exam_to_reward", - "tableTo": "ap_exam_reward", - "columnsFrom": ["reward"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.calendar_term": { - "name": "calendar_term", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true, - "generated": { - "as": "\"calendar_term\".\"year\" || ' ' || CASE WHEN \"calendar_term\".\"quarter\" = 'Fall' THEN 'Fall' WHEN \"calendar_term\".\"quarter\" = 'Winter' THEN 'Winter' WHEN \"calendar_term\".\"quarter\" = 'Spring' THEN 'Spring' WHEN \"calendar_term\".\"quarter\" = 'Summer1' THEN 'Summer1' WHEN \"calendar_term\".\"quarter\" = 'Summer10wk' THEN 'Summer10wk' WHEN \"calendar_term\".\"quarter\" = 'Summer2' THEN 'Summer2' ELSE '' END", - "type": "stored" - } - }, - "year": { - "name": "year", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "quarter": { - "name": "quarter", - "type": "term", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "instruction_start": { - "name": "instruction_start", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "instruction_end": { - "name": "instruction_end", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "finals_start": { - "name": "finals_start", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "finals_end": { - "name": "finals_end", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "soc_available": { - "name": "soc_available", - "type": "date", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.catalogue_program": { - "name": "catalogue_program", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "program_name": { - "name": "program_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.college_requirement": { - "name": "college_requirement", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "requirements": { - "name": "requirements", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "college_requirement_requirements_unique": { - "name": "college_requirement_requirements_unique", - "nullsNotDistinct": false, - "columns": ["requirements"] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.course": { - "name": "course", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "department": { - "name": "department", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "shortened_dept": { - "name": "shortened_dept", - "type": "varchar", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "REPLACE(\"course\".\"department\", ' ', '')", - "type": "stored" - } - }, - "department_alias": { - "name": "department_alias", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "course_number": { - "name": "course_number", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "course_numeric": { - "name": "course_numeric", - "type": "integer", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "CASE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g') WHEN '' THEN 0 ELSE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g')::INTEGER END", - "type": "stored" - } - }, - "school": { - "name": "school", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "course_level": { - "name": "course_level", - "type": "course_level", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "min_units": { - "name": "min_units", - "type": "numeric(4, 2)", - "primaryKey": false, - "notNull": true - }, - "max_units": { - "name": "max_units", - "type": "numeric(4, 2)", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "department_name": { - "name": "department_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "prerequisite_tree": { - "name": "prerequisite_tree", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "prerequisite_text": { - "name": "prerequisite_text", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "repeatability": { - "name": "repeatability", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "grading_option": { - "name": "grading_option", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "concurrent": { - "name": "concurrent", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "same_as": { - "name": "same_as", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "restriction": { - "name": "restriction", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "overlap": { - "name": "overlap", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "corequisites": { - "name": "corequisites", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "is_ge_1a": { - "name": "is_ge_1a", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_1b": { - "name": "is_ge_1b", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_2": { - "name": "is_ge_2", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_3": { - "name": "is_ge_3", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_4": { - "name": "is_ge_4", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_5a": { - "name": "is_ge_5a", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_5b": { - "name": "is_ge_5b", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_6": { - "name": "is_ge_6", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_7": { - "name": "is_ge_7", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_8": { - "name": "is_ge_8", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "ge_text": { - "name": "ge_text", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "course_search_index": { - "name": "course_search_index", - "columns": [ - { - "expression": "(\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"id\", '')), 'A') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"department\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"department_alias\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"shortened_dept\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"course_number\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"course_numeric\"::TEXT, '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"title\", '')), 'C') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"description\", '')), 'D')\n)", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "shortened_dept": { - "name": "shortened_dept", - "columns": [ - { - "expression": "shortened_dept", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.degree": { - "name": "degree", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "division": { - "name": "division", - "type": "division", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.instructor": { - "name": "instructor", - "schema": "", - "columns": { - "ucinetid": { - "name": "ucinetid", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "department": { - "name": "department", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "instructor_search_index": { - "name": "instructor_search_index", - "columns": [ - { - "expression": "(\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"ucinetid\", '')), 'A') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"name\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"title\", '')), 'B')\n)", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.instructor_to_websoc_instructor": { - "name": "instructor_to_websoc_instructor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "instructor_ucinetid": { - "name": "instructor_ucinetid", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "websoc_instructor_name": { - "name": "websoc_instructor_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "instructor_to_websoc_instructor_instructor_ucinetid_index": { - "name": "instructor_to_websoc_instructor_instructor_ucinetid_index", - "columns": [ - { - "expression": "instructor_ucinetid", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "instructor_to_websoc_instructor_websoc_instructor_name_index": { - "name": "instructor_to_websoc_instructor_websoc_instructor_name_index", - "columns": [ - { - "expression": "websoc_instructor_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "instructor_to_websoc_instructor_instructor_ucinetid_websoc_instructor_name_index": { - "name": "instructor_to_websoc_instructor_instructor_ucinetid_websoc_instructor_name_index", - "columns": [ - { - "expression": "instructor_ucinetid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "websoc_instructor_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "instructor_to_websoc_instructor_instructor_ucinetid_instructor_ucinetid_fk": { - "name": "instructor_to_websoc_instructor_instructor_ucinetid_instructor_ucinetid_fk", - "tableFrom": "instructor_to_websoc_instructor", - "tableTo": "instructor", - "columnsFrom": ["instructor_ucinetid"], - "columnsTo": ["ucinetid"], - "onDelete": "no action", - "onUpdate": "no action" - }, - "instructor_to_websoc_instructor_websoc_instructor_name_websoc_instructor_name_fk": { - "name": "instructor_to_websoc_instructor_websoc_instructor_name_websoc_instructor_name_fk", - "tableFrom": "instructor_to_websoc_instructor", - "tableTo": "websoc_instructor", - "columnsFrom": ["websoc_instructor_name"], - "columnsTo": ["name"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.larc_section": { - "name": "larc_section", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "course_id": { - "name": "course_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "days_string": { - "name": "days_string", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "time_string": { - "name": "time_string", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "start_time": { - "name": "start_time", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "end_time": { - "name": "end_time", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "instructor": { - "name": "instructor", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "building": { - "name": "building", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "meets_monday": { - "name": "meets_monday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_tuesday": { - "name": "meets_tuesday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_wednesday": { - "name": "meets_wednesday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_thursday": { - "name": "meets_thursday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_friday": { - "name": "meets_friday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_saturday": { - "name": "meets_saturday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_sunday": { - "name": "meets_sunday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "larc_section_course_id_index": { - "name": "larc_section_course_id_index", - "columns": [ - { - "expression": "course_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "larc_section_course_id_websoc_course_id_fk": { - "name": "larc_section_course_id_websoc_course_id_fk", - "tableFrom": "larc_section", - "tableTo": "websoc_course", - "columnsFrom": ["course_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.library_traffic": { - "name": "library_traffic", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "library_name": { - "name": "library_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "location_name": { - "name": "location_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "traffic_count": { - "name": "traffic_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "traffic_percentage": { - "name": "traffic_percentage", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "timestamp": { - "name": "timestamp", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "library_traffic_library_name_index": { - "name": "library_traffic_library_name_index", - "columns": [ - { - "expression": "library_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "library_traffic_location_name_index": { - "name": "library_traffic_location_name_index", - "columns": [ - { - "expression": "location_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.library_traffic_history": { - "name": "library_traffic_history", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "location_id": { - "name": "location_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "traffic_count": { - "name": "traffic_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "traffic_percentage": { - "name": "traffic_percentage", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "timestamp": { - "name": "timestamp", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "library_traffic_history_location_id_timestamp_index": { - "name": "library_traffic_history_location_id_timestamp_index", - "columns": [ - { - "expression": "location_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "timestamp", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "library_traffic_history_location_id_library_traffic_id_fk": { - "name": "library_traffic_history_location_id_library_traffic_id_fk", - "tableFrom": "library_traffic_history", - "tableTo": "library_traffic", - "columnsFrom": ["location_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.major": { - "name": "major", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "degree_id": { - "name": "degree_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "code": { - "name": "code", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "require_spec": { - "name": "require_spec", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "college_requirement": { - "name": "college_requirement", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "requirements": { - "name": "requirements", - "type": "json", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "major_degree_id_index": { - "name": "major_degree_id_index", - "columns": [ - { - "expression": "degree_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "major_college_requirement_index": { - "name": "major_college_requirement_index", - "columns": [ - { - "expression": "college_requirement", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "major_degree_id_degree_id_fk": { - "name": "major_degree_id_degree_id_fk", - "tableFrom": "major", - "tableTo": "degree", - "columnsFrom": ["degree_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - }, - "major_college_requirement_college_requirement_id_fk": { - "name": "major_college_requirement_college_requirement_id_fk", - "tableFrom": "major", - "tableTo": "college_requirement", - "columnsFrom": ["college_requirement"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.minor": { - "name": "minor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "requirements": { - "name": "requirements", - "type": "json", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.prerequisite": { - "name": "prerequisite", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "dep_dept": { - "name": "dep_dept", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "prerequisite_id": { - "name": "prerequisite_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "dependency_id": { - "name": "dependency_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "prerequisite_dep_dept_index": { - "name": "prerequisite_dep_dept_index", - "columns": [ - { - "expression": "dep_dept", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "prerequisite_prerequisite_id_index": { - "name": "prerequisite_prerequisite_id_index", - "columns": [ - { - "expression": "prerequisite_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "prerequisite_dependency_id_index": { - "name": "prerequisite_dependency_id_index", - "columns": [ - { - "expression": "dependency_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "prerequisite_prerequisite_id_dependency_id_index": { - "name": "prerequisite_prerequisite_id_dependency_id_index", - "columns": [ - { - "expression": "prerequisite_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dependency_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.sample_program_variation": { - "name": "sample_program_variation", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "program_id": { - "name": "program_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "label": { - "name": "label", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "sample_program": { - "name": "sample_program", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "variation_notes": { - "name": "variation_notes", - "type": "varchar[]", - "primaryKey": false, - "notNull": true, - "default": "ARRAY[]::VARCHAR[]" - } - }, - "indexes": {}, - "foreignKeys": { - "sample_program_variation_program_id_catalogue_program_id_fk": { - "name": "sample_program_variation_program_id_catalogue_program_id_fk", - "tableFrom": "sample_program_variation", - "tableTo": "catalogue_program", - "columnsFrom": ["program_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.school_requirement": { - "name": "school_requirement", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "requirements": { - "name": "requirements", - "type": "json", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.specialization": { - "name": "specialization", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "major_id": { - "name": "major_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "requirements": { - "name": "requirements", - "type": "json", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "specialization_major_id_index": { - "name": "specialization_major_id_index", - "columns": [ - { - "expression": "major_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "specialization_major_id_major_id_fk": { - "name": "specialization_major_id_major_id_fk", - "tableFrom": "specialization", - "tableTo": "major", - "columnsFrom": ["major_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.study_location": { - "name": "study_location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.study_room": { - "name": "study_room", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "capacity": { - "name": "capacity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "location": { - "name": "location", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "directions": { - "name": "directions", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "tech_enhanced": { - "name": "tech_enhanced", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "url": { - "name": "url", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "study_location_id": { - "name": "study_location_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "study_room_study_location_id_index": { - "name": "study_room_study_location_id_index", - "columns": [ - { - "expression": "study_location_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "study_room_study_location_id_study_location_id_fk": { - "name": "study_room_study_location_id_study_location_id_fk", - "tableFrom": "study_room", - "tableTo": "study_location", - "columnsFrom": ["study_location_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.study_room_slot": { - "name": "study_room_slot", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "study_room_id": { - "name": "study_room_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "start": { - "name": "start", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "end": { - "name": "end", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "is_available": { - "name": "is_available", - "type": "boolean", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "study_room_slot_study_room_id_index": { - "name": "study_room_slot_study_room_id_index", - "columns": [ - { - "expression": "study_room_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "study_room_slot_study_room_id_start_end_index": { - "name": "study_room_slot_study_room_id_start_end_index", - "columns": [ - { - "expression": "study_room_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "start", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "end", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "study_room_slot_study_room_id_study_room_id_fk": { - "name": "study_room_slot_study_room_id_study_room_id_fk", - "tableFrom": "study_room_slot", - "tableTo": "study_room", - "columnsFrom": ["study_room_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_course": { - "name": "websoc_course", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "department_id": { - "name": "department_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "course_id": { - "name": "course_id", - "type": "varchar", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "REPLACE(\"websoc_course\".\"dept_code\", ' ', '') || \"websoc_course\".\"course_number\"", - "type": "stored" - } - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "year": { - "name": "year", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "quarter": { - "name": "quarter", - "type": "term", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "school_name": { - "name": "school_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "dept_code": { - "name": "dept_code", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "course_title": { - "name": "course_title", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "course_number": { - "name": "course_number", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "course_numeric": { - "name": "course_numeric", - "type": "integer", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "CASE REGEXP_REPLACE(\"websoc_course\".\"course_number\", '\\D', '', 'g') WHEN '' THEN 0 ELSE REGEXP_REPLACE(\"websoc_course\".\"course_number\", '\\D', '', 'g')::INTEGER END", - "type": "stored" - } - }, - "course_comment": { - "name": "course_comment", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "prerequisite_link": { - "name": "prerequisite_link", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "is_ge_1a": { - "name": "is_ge_1a", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_1b": { - "name": "is_ge_1b", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_2": { - "name": "is_ge_2", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_3": { - "name": "is_ge_3", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_4": { - "name": "is_ge_4", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_5a": { - "name": "is_ge_5a", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_5b": { - "name": "is_ge_5b", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_6": { - "name": "is_ge_6", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_7": { - "name": "is_ge_7", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_8": { - "name": "is_ge_8", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "websoc_course_department_id_index": { - "name": "websoc_course_department_id_index", - "columns": [ - { - "expression": "department_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_course_id_index": { - "name": "websoc_course_course_id_index", - "columns": [ - { - "expression": "course_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_school_name_dept_code_course_number_course_title_index": { - "name": "websoc_course_year_quarter_school_name_dept_code_course_number_course_title_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "school_name", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dept_code", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "course_number", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "course_title", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_1a_index": { - "name": "websoc_course_year_quarter_is_ge_1a_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_1a", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_1b_index": { - "name": "websoc_course_year_quarter_is_ge_1b_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_1b", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_2_index": { - "name": "websoc_course_year_quarter_is_ge_2_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_2", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_3_index": { - "name": "websoc_course_year_quarter_is_ge_3_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_3", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_4_index": { - "name": "websoc_course_year_quarter_is_ge_4_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_4", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_5a_index": { - "name": "websoc_course_year_quarter_is_ge_5a_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_5a", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_5b_index": { - "name": "websoc_course_year_quarter_is_ge_5b_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_5b", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_6_index": { - "name": "websoc_course_year_quarter_is_ge_6_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_6", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_7_index": { - "name": "websoc_course_year_quarter_is_ge_7_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_7", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_8_index": { - "name": "websoc_course_year_quarter_is_ge_8_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_8", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_dept_code_index": { - "name": "websoc_course_year_quarter_dept_code_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dept_code", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_dept_code_course_number_index": { - "name": "websoc_course_year_quarter_dept_code_course_number_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dept_code", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "course_number", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_course_department_id_websoc_department_id_fk": { - "name": "websoc_course_department_id_websoc_department_id_fk", - "tableFrom": "websoc_course", - "tableTo": "websoc_department", - "columnsFrom": ["department_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_department": { - "name": "websoc_department", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "school_id": { - "name": "school_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "year": { - "name": "year", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "quarter": { - "name": "quarter", - "type": "term", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "dept_code": { - "name": "dept_code", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "dept_name": { - "name": "dept_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "dept_comment": { - "name": "dept_comment", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "section_code_range_comments": { - "name": "section_code_range_comments", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "course_number_range_comments": { - "name": "course_number_range_comments", - "type": "text[]", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "websoc_department_school_id_index": { - "name": "websoc_department_school_id_index", - "columns": [ - { - "expression": "school_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_department_year_quarter_school_id_dept_code_index": { - "name": "websoc_department_year_quarter_school_id_dept_code_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "school_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dept_code", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_department_school_id_websoc_school_id_fk": { - "name": "websoc_department_school_id_websoc_school_id_fk", - "tableFrom": "websoc_department", - "tableTo": "websoc_school", - "columnsFrom": ["school_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_instructor": { - "name": "websoc_instructor", - "schema": "", - "columns": { - "name": { - "name": "name", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_location": { - "name": "websoc_location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "building": { - "name": "building", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "room": { - "name": "room", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "websoc_location_building_room_index": { - "name": "websoc_location_building_room_index", - "columns": [ - { - "expression": "building", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "room", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_meta": { - "name": "websoc_meta", - "schema": "", - "columns": { - "name": { - "name": "name", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "last_scraped": { - "name": "last_scraped", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_dept_scraped": { - "name": "last_dept_scraped", - "type": "varchar", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_school": { - "name": "websoc_school", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "year": { - "name": "year", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "quarter": { - "name": "quarter", - "type": "term", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "school_name": { - "name": "school_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "school_comment": { - "name": "school_comment", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "websoc_school_year_quarter_school_name_index": { - "name": "websoc_school_year_quarter_school_name_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "school_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_section": { - "name": "websoc_section", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "course_id": { - "name": "course_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "year": { - "name": "year", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "quarter": { - "name": "quarter", - "type": "term", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "units": { - "name": "units", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "websoc_status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "instructors": { - "name": "instructors", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "meetings": { - "name": "meetings", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "final_exam_string": { - "name": "final_exam_string", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "final_exam": { - "name": "final_exam", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "section_num": { - "name": "section_num", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "max_capacity": { - "name": "max_capacity", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "section_code": { - "name": "section_code", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "section_type": { - "name": "section_type", - "type": "websoc_section_type", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "num_requested": { - "name": "num_requested", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "restriction_string": { - "name": "restriction_string", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "restriction_a": { - "name": "restriction_a", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_b": { - "name": "restriction_b", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_c": { - "name": "restriction_c", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_d": { - "name": "restriction_d", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_e": { - "name": "restriction_e", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_f": { - "name": "restriction_f", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_g": { - "name": "restriction_g", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_h": { - "name": "restriction_h", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_i": { - "name": "restriction_i", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_j": { - "name": "restriction_j", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_k": { - "name": "restriction_k", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_l": { - "name": "restriction_l", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_m": { - "name": "restriction_m", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_n": { - "name": "restriction_n", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_o": { - "name": "restriction_o", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_r": { - "name": "restriction_r", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_s": { - "name": "restriction_s", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_x": { - "name": "restriction_x", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "num_on_waitlist": { - "name": "num_on_waitlist", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "num_waitlist_cap": { - "name": "num_waitlist_cap", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "section_comment": { - "name": "section_comment", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "num_new_only_reserved": { - "name": "num_new_only_reserved", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "num_currently_total_enrolled": { - "name": "num_currently_total_enrolled", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "num_currently_section_enrolled": { - "name": "num_currently_section_enrolled", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "is_cancelled": { - "name": "is_cancelled", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "\"websoc_section\".\"section_comment\" LIKE '%*** CANCELLED ***%' OR \"websoc_section\".\"section_comment\" LIKE '%*** CANCELED ***%'", - "type": "stored" - } - }, - "web_url": { - "name": "web_url", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "websoc_section_course_id_index": { - "name": "websoc_section_course_id_index", - "columns": [ - { - "expression": "course_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_section_year_quarter_section_code_index": { - "name": "websoc_section_year_quarter_section_code_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "section_code", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_section_course_id_websoc_course_id_fk": { - "name": "websoc_section_course_id_websoc_course_id_fk", - "tableFrom": "websoc_section", - "tableTo": "websoc_course", - "columnsFrom": ["course_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_section_enrollment": { - "name": "websoc_section_enrollment", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "section_id": { - "name": "section_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "date", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "year": { - "name": "year", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "quarter": { - "name": "quarter", - "type": "term", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "max_capacity": { - "name": "max_capacity", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "num_currently_total_enrolled": { - "name": "num_currently_total_enrolled", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "num_on_waitlist": { - "name": "num_on_waitlist", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "num_waitlist_cap": { - "name": "num_waitlist_cap", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "num_requested": { - "name": "num_requested", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "num_new_only_reserved": { - "name": "num_new_only_reserved", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "websoc_status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "websoc_section_enrollment_section_id_index": { - "name": "websoc_section_enrollment_section_id_index", - "columns": [ - { - "expression": "section_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_section_enrollment_section_id_created_at_index": { - "name": "websoc_section_enrollment_section_id_created_at_index", - "columns": [ - { - "expression": "section_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_section_enrollment_section_id_websoc_section_id_fk": { - "name": "websoc_section_enrollment_section_id_websoc_section_id_fk", - "tableFrom": "websoc_section_enrollment", - "tableTo": "websoc_section", - "columnsFrom": ["section_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_section_grade": { - "name": "websoc_section_grade", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "section_id": { - "name": "section_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "grade_a_count": { - "name": "grade_a_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "grade_b_count": { - "name": "grade_b_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "grade_c_count": { - "name": "grade_c_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "grade_d_count": { - "name": "grade_d_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "grade_f_count": { - "name": "grade_f_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "grade_p_count": { - "name": "grade_p_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "grade_np_count": { - "name": "grade_np_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "grade_w_count": { - "name": "grade_w_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "average_gpa": { - "name": "average_gpa", - "type": "numeric(3, 2)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "websoc_section_grade_section_id_index": { - "name": "websoc_section_grade_section_id_index", - "columns": [ - { - "expression": "section_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_section_grade_section_id_websoc_section_id_fk": { - "name": "websoc_section_grade_section_id_websoc_section_id_fk", - "tableFrom": "websoc_section_grade", - "tableTo": "websoc_section", - "columnsFrom": ["section_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "websoc_section_grade_section_id_unique": { - "name": "websoc_section_grade_section_id_unique", - "nullsNotDistinct": false, - "columns": ["section_id"] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_section_meeting": { - "name": "websoc_section_meeting", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "section_id": { - "name": "section_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "section_code": { - "name": "section_code", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "meeting_index": { - "name": "meeting_index", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "time_string": { - "name": "time_string", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "time_is_tba": { - "name": "time_is_tba", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "\"websoc_section_meeting\".\"time_string\" LIKE '%TBA%'", - "type": "stored" - } - }, - "start_time": { - "name": "start_time", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "end_time": { - "name": "end_time", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "days_string": { - "name": "days_string", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "meets_monday": { - "name": "meets_monday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_tuesday": { - "name": "meets_tuesday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_wednesday": { - "name": "meets_wednesday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_thursday": { - "name": "meets_thursday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_friday": { - "name": "meets_friday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_saturday": { - "name": "meets_saturday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_sunday": { - "name": "meets_sunday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "websoc_section_meeting_section_id_index": { - "name": "websoc_section_meeting_section_id_index", - "columns": [ - { - "expression": "section_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_section_meeting_section_id_websoc_section_id_fk": { - "name": "websoc_section_meeting_section_id_websoc_section_id_fk", - "tableFrom": "websoc_section_meeting", - "tableTo": "websoc_section", - "columnsFrom": ["section_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_section_meeting_to_location": { - "name": "websoc_section_meeting_to_location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "meeting_id": { - "name": "meeting_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "location_id": { - "name": "location_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "websoc_section_meeting_to_location_meeting_id_index": { - "name": "websoc_section_meeting_to_location_meeting_id_index", - "columns": [ - { - "expression": "meeting_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_section_meeting_to_location_location_id_index": { - "name": "websoc_section_meeting_to_location_location_id_index", - "columns": [ - { - "expression": "location_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_section_meeting_to_location_meeting_id_location_id_index": { - "name": "websoc_section_meeting_to_location_meeting_id_location_id_index", - "columns": [ - { - "expression": "meeting_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "location_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_section_meeting_to_location_meeting_id_websoc_section_meeting_id_fk": { - "name": "websoc_section_meeting_to_location_meeting_id_websoc_section_meeting_id_fk", - "tableFrom": "websoc_section_meeting_to_location", - "tableTo": "websoc_section_meeting", - "columnsFrom": ["meeting_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "websoc_section_meeting_to_location_location_id_websoc_location_id_fk": { - "name": "websoc_section_meeting_to_location_location_id_websoc_location_id_fk", - "tableFrom": "websoc_section_meeting_to_location", - "tableTo": "websoc_location", - "columnsFrom": ["location_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_section_to_instructor": { - "name": "websoc_section_to_instructor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "section_id": { - "name": "section_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "instructor_name": { - "name": "instructor_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "websoc_section_to_instructor_section_id_index": { - "name": "websoc_section_to_instructor_section_id_index", - "columns": [ - { - "expression": "section_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_section_to_instructor_instructor_name_index": { - "name": "websoc_section_to_instructor_instructor_name_index", - "columns": [ - { - "expression": "instructor_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_section_to_instructor_section_id_websoc_section_id_fk": { - "name": "websoc_section_to_instructor_section_id_websoc_section_id_fk", - "tableFrom": "websoc_section_to_instructor", - "tableTo": "websoc_section", - "columnsFrom": ["section_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - }, - "websoc_section_to_instructor_instructor_name_websoc_instructor_name_fk": { - "name": "websoc_section_to_instructor_instructor_name_websoc_instructor_name_fk", - "tableFrom": "websoc_section_to_instructor", - "tableTo": "websoc_instructor", - "columnsFrom": ["instructor_name"], - "columnsTo": ["name"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.course_level": { - "name": "course_level", - "schema": "public", - "values": ["LowerDiv", "UpperDiv", "Graduate"] - }, - "public.division": { - "name": "division", - "schema": "public", - "values": ["Undergraduate", "Graduate"] - }, - "public.term": { - "name": "term", - "schema": "public", - "values": ["Fall", "Winter", "Spring", "Summer1", "Summer10wk", "Summer2"] - }, - "public.websoc_section_type": { - "name": "websoc_section_type", - "schema": "public", - "values": [ - "Act", - "Col", - "Dis", - "Fld", - "Lab", - "Lec", - "Qiz", - "Res", - "Sem", - "Stu", - "Tap", - "Tut" - ] - }, - "public.websoc_status": { - "name": "websoc_status", - "schema": "public", - "values": ["OPEN", "Waitl", "FULL", "NewOnly"] - } - }, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": { - "public.course_view": { - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "department": { - "name": "department", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "shortened_dept": { - "name": "shortened_dept", - "type": "varchar", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "REPLACE(\"course\".\"department\", ' ', '')", - "type": "stored" - } - }, - "department_alias": { - "name": "department_alias", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "course_number": { - "name": "course_number", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "course_numeric": { - "name": "course_numeric", - "type": "integer", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "CASE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g') WHEN '' THEN 0 ELSE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g')::INTEGER END", - "type": "stored" - } - }, - "school": { - "name": "school", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "course_level": { - "name": "course_level", - "type": "course_level", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "min_units": { - "name": "min_units", - "type": "numeric(4, 2)", - "primaryKey": false, - "notNull": true - }, - "max_units": { - "name": "max_units", - "type": "numeric(4, 2)", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "department_name": { - "name": "department_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "prerequisite_tree": { - "name": "prerequisite_tree", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "prerequisite_text": { - "name": "prerequisite_text", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "repeatability": { - "name": "repeatability", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "grading_option": { - "name": "grading_option", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "concurrent": { - "name": "concurrent", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "same_as": { - "name": "same_as", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "restriction": { - "name": "restriction", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "overlap": { - "name": "overlap", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "corequisites": { - "name": "corequisites", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "is_ge_1a": { - "name": "is_ge_1a", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_1b": { - "name": "is_ge_1b", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_2": { - "name": "is_ge_2", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_3": { - "name": "is_ge_3", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_4": { - "name": "is_ge_4", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_5a": { - "name": "is_ge_5a", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_5b": { - "name": "is_ge_5b", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_6": { - "name": "is_ge_6", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_7": { - "name": "is_ge_7", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_8": { - "name": "is_ge_8", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "ge_text": { - "name": "ge_text", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "definition": "select \"course\".\"id\", \"course\".\"updated_at\", \"course\".\"department\", \"course\".\"shortened_dept\", \"course\".\"department_alias\", \"course\".\"course_number\", \"course\".\"course_numeric\", \"course\".\"school\", \"course\".\"title\", \"course\".\"course_level\", \"course\".\"min_units\", \"course\".\"max_units\", \"course\".\"description\", \"course\".\"department_name\", \"course\".\"prerequisite_tree\", \"course\".\"prerequisite_text\", \"course\".\"repeatability\", \"course\".\"grading_option\", \"course\".\"concurrent\", \"course\".\"same_as\", \"course\".\"restriction\", \"course\".\"overlap\", \"course\".\"corequisites\", \"course\".\"is_ge_1a\", \"course\".\"is_ge_1b\", \"course\".\"is_ge_2\", \"course\".\"is_ge_3\", \"course\".\"is_ge_4\", \"course\".\"is_ge_5a\", \"course\".\"is_ge_5b\", \"course\".\"is_ge_6\", \"course\".\"is_ge_7\", \"course\".\"is_ge_8\", \"course\".\"ge_text\", \n ARRAY_REMOVE(COALESCE(\n (\n SELECT ARRAY_AGG(\n CASE WHEN \"prerequisite_course\".\"id\" IS NULL THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'id', \"prerequisite_course\".\"id\",\n 'title', \"prerequisite_course\".\"title\",\n 'department', \"prerequisite_course\".\"department\",\n 'courseNumber', \"prerequisite_course\".\"course_number\"\n )\n END\n )\n FROM \"prerequisite\"\n LEFT JOIN \"course\" \"prerequisite_course\" ON \"prerequisite_course\".\"id\" = \"prerequisite\".\"prerequisite_id\"\n WHERE \"prerequisite\".\"dependency_id\" = \"course\".\"id\"\n ),\n ARRAY[]::JSONB[]), NULL)\n as \"prerequisites\", \n ARRAY_REMOVE(COALESCE(\n (\n SELECT ARRAY_AGG(\n CASE WHEN \"dependency_course\".\"id\" IS NULL THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'id', \"dependency_course\".\"id\",\n 'title', \"dependency_course\".\"title\",\n 'department', \"dependency_course\".\"department\",\n 'courseNumber', \"dependency_course\".\"course_number\"\n )\n END\n )\n FROM \"prerequisite\" \"dependency\"\n LEFT JOIN \"course\" \"dependency_course\" ON \"dependency_course\".\"id\" = \"dependency\".\"dependency_id\"\n WHERE \"dependency\".\"prerequisite_id\" = \"course\".\"id\"\n ),\n ARRAY[]::JSONB[]), NULL)\n as \"dependencies\", \n ARRAY_REMOVE(ARRAY_AGG(DISTINCT\n CASE WHEN \"websoc_course\".\"year\" IS NULL THEN NULL\n ELSE CONCAT(\"websoc_course\".\"year\", ' ', \"websoc_course\".\"quarter\")\n END\n ), NULL)\n as \"terms\", \n ARRAY_REMOVE(COALESCE(ARRAY_AGG(DISTINCT\n CASE WHEN \"instructor\".\"ucinetid\" IS NULL THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'ucinetid', \"instructor\".\"ucinetid\",\n 'name', \"instructor\".\"name\",\n 'title', \"instructor\".\"title\",\n 'email', \"instructor\".\"email\",\n 'department', \"instructor\".\"department\",\n 'shortenedNames', ARRAY(\n SELECT \"instructor_to_websoc_instructor\".\"websoc_instructor_name\"\n FROM \"instructor_to_websoc_instructor\"\n WHERE \"instructor_to_websoc_instructor\".\"instructor_ucinetid\" = \"instructor\".\"ucinetid\"\n )\n )\n END\n ), ARRAY[]::JSONB[]), NULL)\n as \"instructors\" from \"course\" left join \"websoc_course\" on \"websoc_course\".\"course_id\" = \"course\".\"id\" left join \"websoc_section\" on \"websoc_section\".\"course_id\" = \"websoc_course\".\"id\" left join \"websoc_section_to_instructor\" on \"websoc_section_to_instructor\".\"section_id\" = \"websoc_section\".\"id\" left join \"websoc_instructor\" on \"websoc_instructor\".\"name\" = \"websoc_section_to_instructor\".\"instructor_name\" left join \"instructor_to_websoc_instructor\" on \"instructor_to_websoc_instructor\".\"websoc_instructor_name\" = \"websoc_instructor\".\"name\" left join \"instructor\" on (\"instructor\".\"ucinetid\" = \"instructor_to_websoc_instructor\".\"instructor_ucinetid\" and \"instructor\".\"ucinetid\" is not null and \"instructor\".\"ucinetid\" <> 'student') group by \"course\".\"id\"", - "name": "course_view", - "schema": "public", - "isExisting": false, - "materialized": true - }, - "public.instructor_view": { - "columns": { - "ucinetid": { - "name": "ucinetid", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "department": { - "name": "department", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "definition": "with \"shortened_names_cte\" as (select \"instructor_ucinetid\", ARRAY_AGG(\"websoc_instructor_name\") as \"shortened_names\" from \"instructor_to_websoc_instructor\" group by \"instructor_to_websoc_instructor\".\"instructor_ucinetid\"), \"courses_cte\" as (with \"terms_cte\" as (select \"course\".\"id\", \"instructor_to_websoc_instructor\".\"instructor_ucinetid\", \n ARRAY_REMOVE(ARRAY_AGG(DISTINCT\n CASE WHEN \"websoc_course\".\"year\" IS NULL THEN NULL\n ELSE CONCAT(\"websoc_course\".\"year\", ' ', \"websoc_course\".\"quarter\")\n END\n ), NULL) as \"terms\" from \"course\" left join \"websoc_course\" on \"websoc_course\".\"course_id\" = \"course\".\"id\" left join \"websoc_section\" on \"websoc_section\".\"course_id\" = \"websoc_course\".\"id\" left join \"websoc_section_to_instructor\" on \"websoc_section_to_instructor\".\"section_id\" = \"websoc_section\".\"id\" left join \"websoc_instructor\" on \"websoc_instructor\".\"name\" = \"websoc_section_to_instructor\".\"instructor_name\" left join \"instructor_to_websoc_instructor\" on \"instructor_to_websoc_instructor\".\"websoc_instructor_name\" = \"websoc_instructor\".\"name\" group by \"course\".\"id\", \"instructor_to_websoc_instructor\".\"instructor_ucinetid\") select \"terms_cte\".\"instructor_ucinetid\", \"course\".\"id\", \n CASE WHEN \"course\".\"id\" IS NULL\n THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'id', \"course\".\"id\",\n 'title', \"course\".\"title\",\n 'department', \"course\".\"department\",\n 'courseNumber', \"course\".\"course_number\",\n 'terms', COALESCE(\"terms\", ARRAY[]::TEXT[])\n )\n END\n as \"course_info\" from \"course\" left join \"terms_cte\" on \"terms_cte\".\"id\" = \"course\".\"id\" group by \"course\".\"id\", \"terms_cte\".\"instructor_ucinetid\", \"terms\") select \"instructor\".\"ucinetid\", \"instructor\".\"name\", \"instructor\".\"title\", \"instructor\".\"email\", \"instructor\".\"department\", COALESCE(\"shortened_names\", ARRAY[]::TEXT[]) as \"shortened_names\", \n ARRAY_REMOVE(ARRAY_AGG(DISTINCT \"course_info\"), NULL)\n as \"courses\" from \"instructor\" left join \"shortened_names_cte\" on \"shortened_names_cte\".\"instructor_ucinetid\" = \"instructor\".\"ucinetid\" left join \"courses_cte\" on \"courses_cte\".\"instructor_ucinetid\" = \"instructor\".\"ucinetid\" where \"instructor\".\"ucinetid\" <> 'student' group by \"instructor\".\"ucinetid\", \"shortened_names\"", - "name": "instructor_view", - "schema": "public", - "isExisting": false, - "materialized": true - } - }, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} diff --git a/packages/db/migrations/meta/_journal.json b/packages/db/migrations/meta/_journal.json index 493a98ac..350e0a99 100644 --- a/packages/db/migrations/meta/_journal.json +++ b/packages/db/migrations/meta/_journal.json @@ -169,13 +169,6 @@ "when": 1770072497788, "tag": "0023_pv_study_rooms", "breakpoints": true - }, - { - "idx": 24, - "version": "7", - "when": 1771120329194, - "tag": "0024_add_req_spec_to_major_table", - "breakpoints": true } ] } From 5fcca0ae3c0a57ba40884178d1c61713ae4592b9 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Sat, 21 Feb 2026 12:20:36 -0800 Subject: [PATCH 36/91] reverted packaageManager update --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e769033b..c6d7d943 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "tsx": "4.19.2", "typescript": "5.6.3" }, - "packageManager": "pnpm@10.28.2", + "packageManager": "pnpm@10.17.0", "engines": { "pnpm": "^10.17.0" } From fd8a69be75b1c89117a2969d356d01c85ad12ea5 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Sat, 21 Feb 2026 12:35:07 -0800 Subject: [PATCH 37/91] renamed require_spec to specialization_required --- apps/api/src/graphql/schema/programs.ts | 2 +- apps/api/src/schema/programs.ts | 2 +- apps/api/src/services/programs.ts | 2 +- .../degreeworks-scraper/src/components/AuditParser.ts | 4 ++-- .../degreeworks-scraper/src/components/Scraper.ts | 4 ++-- apps/data-pipeline/degreeworks-scraper/src/index.ts | 4 ++-- .../db/migrations/0025_major_specialization_required.sql | 2 +- packages/db/migrations/meta/0025_snapshot.json | 6 +++--- packages/db/migrations/meta/_journal.json | 2 +- packages/db/src/schema.ts | 4 ++-- 10 files changed, 16 insertions(+), 16 deletions(-) diff --git a/apps/api/src/graphql/schema/programs.ts b/apps/api/src/graphql/schema/programs.ts index 48ac42ba..6a430e6d 100644 --- a/apps/api/src/graphql/schema/programs.ts +++ b/apps/api/src/graphql/schema/programs.ts @@ -14,7 +14,7 @@ type MajorPreview implements ProgramPreview @cacheControl(maxAge: 86400) { name: String! type: String! division: ProgramDivision! - requireSpec: Boolean! + specializationRequired: Boolean! specializations: [String!]! } diff --git a/apps/api/src/schema/programs.ts b/apps/api/src/schema/programs.ts index 9747a884..a584d899 100644 --- a/apps/api/src/schema/programs.ts +++ b/apps/api/src/schema/programs.ts @@ -187,7 +187,7 @@ export const majorsResponseSchema = z.array( division: z.literal("Undergraduate").or(z.literal("Graduate")).openapi({ description: "The division in which this major is offered", }), - requireSpec: z.boolean().openapi({ + specializationRequired: z.boolean().openapi({ description: "Whether a specialization must be completed to complete this degree", }), specializations: z.array(z.string()).openapi({ diff --git a/apps/api/src/services/programs.ts b/apps/api/src/services/programs.ts index 6de8c8e4..3aaa40e0 100644 --- a/apps/api/src/services/programs.ts +++ b/apps/api/src/services/programs.ts @@ -46,7 +46,7 @@ export class ProgramsService { .select({ id: majorSpecialization.id, name: majorSpecialization.name, - requireSpec: major.requireSpec, + specializationRequired: major.specializationRequired, specializations: majorSpecialization.specializations, type: degree.name, division: degree.division, diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts b/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts index 84faa07e..f4541efc 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts @@ -26,7 +26,7 @@ export class AuditParser { requirements: await this.ruleArrayToRequirements(block.ruleArray), // populate later; we cannot determine specializations on the spot specs: [], - requiresSpecialization: await this.requiresSpecialization(block.ruleArray), + specializationRequired: await this.specializationRequired(block.ruleArray), }); lexOrd = new Intl.Collator().compare; @@ -160,7 +160,7 @@ export class AuditParser { return filteredClasses; } - async requiresSpecialization(ruleArray: Rule[]) { + async specializationRequired(ruleArray: Rule[]) { for (const rule of ruleArray) { if ( rule.ifElsePart === "ElsePart" && diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts index 02f2dae0..18c2cc70 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts @@ -400,7 +400,7 @@ export class Scraper { const z = this.parsedSpecializations.get("AHPER")?.[2] as DegreeWorksProgram; if (x && y && z) { x[1].specs = []; - x[1].requiresSpecialization = false; + x[1].specializationRequired = false; x[1].requirements = [...x[1].requirements, ...y.requirements, ...z.requirements]; this.parsedSpecializations.delete("AHGEO"); this.parsedSpecializations.delete("AHPER"); @@ -412,7 +412,7 @@ export class Scraper { const chemE = this.parsedPrograms.get("Major in Chemical Engineering") as MajorProgram; if (chemE) { - chemE[1].requiresSpecialization = false; + chemE[1].specializationRequired = false; } this.done = true; diff --git a/apps/data-pipeline/degreeworks-scraper/src/index.ts b/apps/data-pipeline/degreeworks-scraper/src/index.ts index 171cb2be..762e4d79 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/index.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/index.ts @@ -45,7 +45,7 @@ async function main() { const collegeBlocks = [] as (typeof collegeRequirement.$inferInsert)[]; const majorData = parsedPrograms .values() - .map(([college, { name, degreeType, code, requirements, requiresSpecialization }]) => { + .map(([college, { name, degreeType, code, requirements, specializationRequired }]) => { let collegeBlockIndex: number | undefined; if (college?.requirements) { const wouldInsert = { name: college.name, requirements: college.requirements }; @@ -71,7 +71,7 @@ async function main() { degreeId: degreeType ?? "", code, name, - requireSpec: requiresSpecialization, + specializationRequired, requirements, ...(collegeBlockIndex !== undefined ? { collegeBlockIndex } : {}), }; diff --git a/packages/db/migrations/0025_major_specialization_required.sql b/packages/db/migrations/0025_major_specialization_required.sql index 69395a96..1b120ca0 100644 --- a/packages/db/migrations/0025_major_specialization_required.sql +++ b/packages/db/migrations/0025_major_specialization_required.sql @@ -1 +1 @@ -ALTER TABLE "major" ADD COLUMN "require_spec" boolean NOT NULL; \ No newline at end of file +ALTER TABLE "major" ADD COLUMN "specialization_required" boolean NOT NULL; \ No newline at end of file diff --git a/packages/db/migrations/meta/0025_snapshot.json b/packages/db/migrations/meta/0025_snapshot.json index dcf4a204..ee771f2e 100644 --- a/packages/db/migrations/meta/0025_snapshot.json +++ b/packages/db/migrations/meta/0025_snapshot.json @@ -1,5 +1,5 @@ { - "id": "ed2af9a4-9d46-4ff5-a107-f752a1ef4ae2", + "id": "b6f5eff6-d4a4-413e-841b-efecba276bb7", "prevId": "f1b90841-6952-48b7-a547-c974828883b2", "version": "7", "dialect": "postgresql", @@ -1799,8 +1799,8 @@ "primaryKey": false, "notNull": true }, - "require_spec": { - "name": "require_spec", + "specialization_required": { + "name": "specialization_required", "type": "boolean", "primaryKey": false, "notNull": true diff --git a/packages/db/migrations/meta/_journal.json b/packages/db/migrations/meta/_journal.json index e64cd39c..744e6e7d 100644 --- a/packages/db/migrations/meta/_journal.json +++ b/packages/db/migrations/meta/_journal.json @@ -180,7 +180,7 @@ { "idx": 25, "version": "7", - "when": 1771704889386, + "when": 1771706013738, "tag": "0025_major_specialization_required", "breakpoints": true } diff --git a/packages/db/src/schema.ts b/packages/db/src/schema.ts index ab7b278f..b0cd434c 100644 --- a/packages/db/src/schema.ts +++ b/packages/db/src/schema.ts @@ -101,7 +101,7 @@ export type DegreeWorksProgram = DegreeWorksProgramId & { * to fulfill the requirements of the program. */ specs: string[]; - requiresSpecialization: boolean; + specializationRequired: boolean; }; /** @@ -675,7 +675,7 @@ export const major = pgTable( .notNull(), code: varchar("code").notNull(), name: varchar("name").notNull(), - requireSpec: boolean("require_spec").notNull(), + specializationRequired: boolean("specialization_required").notNull(), collegeRequirement: uuid("college_requirement").references(() => collegeRequirement.id), requirements: json("requirements").$type().notNull(), }, From b203d332897b83b73e8426cb60b02167138c2b5f Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Sat, 21 Feb 2026 13:58:39 -0800 Subject: [PATCH 38/91] set specializationRequired to false if the program doesn't have any specs --- .../degreeworks-scraper/src/components/Scraper.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts index 18c2cc70..c252de5f 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts @@ -382,6 +382,11 @@ export class Scraper { } } + // After we match specializations to majors, we insure that majors without any specs don't have a specializationRequirement + for (const [, [, major]] of this.parsedPrograms) { + major.specializationRequired = major.specs.length > 0 ? major.specializationRequired : false; + } + this.degreesAwarded = new Map( Array.from( new Set(this.parsedPrograms.entries().map(([, [_s, program]]) => program.degreeType ?? "")), From 6155d8ad06751c58c3c8abaa3a36ec9aea8dfacb Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Sat, 21 Feb 2026 14:05:59 -0800 Subject: [PATCH 39/91] renamed function in Audit parser --- .../degreeworks-scraper/src/components/AuditParser.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts b/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts index f4541efc..01b6da48 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts @@ -26,7 +26,7 @@ export class AuditParser { requirements: await this.ruleArrayToRequirements(block.ruleArray), // populate later; we cannot determine specializations on the spot specs: [], - specializationRequired: await this.specializationRequired(block.ruleArray), + specializationRequired: await this.checkSpecializationIsRequired(block.ruleArray), }); lexOrd = new Intl.Collator().compare; @@ -160,7 +160,7 @@ export class AuditParser { return filteredClasses; } - async specializationRequired(ruleArray: Rule[]) { + async checkSpecializationIsRequired(ruleArray: Rule[]) { for (const rule of ruleArray) { if ( rule.ifElsePart === "ElsePart" && From 47adb63965edd977323ec46c95c426bf5276b6c6 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Sat, 21 Feb 2026 14:17:22 -0800 Subject: [PATCH 40/91] cleaned code in checking for required specs --- .../degreeworks-scraper/src/components/AuditParser.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts b/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts index 01b6da48..a9da4c40 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts @@ -161,15 +161,12 @@ export class AuditParser { } async checkSpecializationIsRequired(ruleArray: Rule[]) { - for (const rule of ruleArray) { - if ( + return ruleArray.some((rule) => { + return ( rule.ifElsePart === "ElsePart" && rule.proxyAdvice?.textList.some((x) => AuditParser.specializationMatcher.test(x)) - ) { - return true; - } - } - return false; + ); + }); } async ruleArrayToRequirements(ruleArray: Rule[]) { From 3c23a2529c7d4d98e139cd22e0f8c33600fafc0c Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Sat, 21 Feb 2026 14:18:54 -0800 Subject: [PATCH 41/91] cleaned code for filtering out 0 spec programs with specializationRequired = true --- .../degreeworks-scraper/src/components/Scraper.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts index c252de5f..20310c2f 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts @@ -382,9 +382,12 @@ export class Scraper { } } - // After we match specializations to majors, we insure that majors without any specs don't have a specializationRequirement + // After we match specializations to a major + // we insure that majors with 0 specs don't require a specialization for (const [, [, major]] of this.parsedPrograms) { - major.specializationRequired = major.specs.length > 0 ? major.specializationRequired : false; + if (major.specs.length === 0) { + major.specializationRequired = false; + } } this.degreesAwarded = new Map( From 88ef8cf2e963c8e544006233b057dc77a327e55c Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Sat, 21 Feb 2026 14:26:36 -0800 Subject: [PATCH 42/91] updated comment in schema --- packages/db/src/schema.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/db/src/schema.ts b/packages/db/src/schema.ts index b0cd434c..ff2c86eb 100644 --- a/packages/db/src/schema.ts +++ b/packages/db/src/schema.ts @@ -97,8 +97,6 @@ export type DegreeWorksProgram = DegreeWorksProgramId & { requirements: DegreeWorksRequirement[]; /** * The set of specializations (if any) that this program has. - * If this array is not empty, then exactly one specialization must be selected - * to fulfill the requirements of the program. */ specs: string[]; specializationRequired: boolean; From 587cba207b550e9e0283b50ab9954676d68f7ac0 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Sat, 21 Feb 2026 14:26:36 -0800 Subject: [PATCH 43/91] updated comment in schema --- .../data-pipeline/degreeworks-scraper/src/components/Scraper.ts | 2 ++ packages/db/src/schema.ts | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts index 20310c2f..8f18b944 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts @@ -384,8 +384,10 @@ export class Scraper { // After we match specializations to a major // we insure that majors with 0 specs don't require a specialization + // this isn't going to work... for (const [, [, major]] of this.parsedPrograms) { if (major.specs.length === 0) { + console.log(`***major ${major.name} has no specs`); major.specializationRequired = false; } } diff --git a/packages/db/src/schema.ts b/packages/db/src/schema.ts index b0cd434c..ff2c86eb 100644 --- a/packages/db/src/schema.ts +++ b/packages/db/src/schema.ts @@ -97,8 +97,6 @@ export type DegreeWorksProgram = DegreeWorksProgramId & { requirements: DegreeWorksRequirement[]; /** * The set of specializations (if any) that this program has. - * If this array is not empty, then exactly one specialization must be selected - * to fulfill the requirements of the program. */ specs: string[]; specializationRequired: boolean; From d7b193d2eef26177b0905fdb5ddd8534d54cd135 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Sat, 21 Feb 2026 17:15:43 -0800 Subject: [PATCH 44/91] fixed bug in pushing to specs from spec-cache --- .../degreeworks-scraper/src/components/Scraper.ts | 9 ++++++++- apps/data-pipeline/degreeworks-scraper/src/types.ts | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts index 8f18b944..9ac67222 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts @@ -306,7 +306,14 @@ export class Scraper { if (got !== null) { specBlock = got.block; - foundMajor = got.parent; + const majorProgram = this.parsedPrograms.get(got.parent.name); + if (majorProgram) { + foundMajor = majorProgram[1]; + } else { + console.log( + `warning: ${specName} (spec code = ${specCode}) is related to ${got.parent.name} in spec cache but no such major exists`, + ); + } } } diff --git a/apps/data-pipeline/degreeworks-scraper/src/types.ts b/apps/data-pipeline/degreeworks-scraper/src/types.ts index a9449b0b..da328e7d 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/types.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/types.ts @@ -1,4 +1,4 @@ -import type { DegreeWorksProgramId } from "@packages/db/schema"; +import type { DegreeWorksProgram } from "@packages/db/schema"; /** * The base type for all `Rule` objects. @@ -127,6 +127,6 @@ export type DWMappingResponse = { // this is the data we cache on a specialization, if it is valid export type SpecializationCache = { - parent: DegreeWorksProgramId; + parent: DegreeWorksProgram; block: Block; }; From b3cc6e0ed0037c9cc64bc8867e57b7f7a77e8b23 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Sat, 21 Feb 2026 17:24:02 -0800 Subject: [PATCH 45/91] refactored spec-cache type to store major as a programRequirement instead of an id in order to get the name member --- .../data-pipeline/degreeworks-scraper/src/components/Scraper.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts index 255c211b..52149334 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts @@ -352,8 +352,6 @@ export class Scraper { foundMajorAssured.specs.push(specCode); this.specializationCache.set(specCode, { - // we are storing the entire program even though we only need the DegreeWorksProgramId supertype - // however, this is fine because we never read the other fields (we couldn't because of the type system) parent: foundMajorAssured, block: specBlock, }); From 6f593b3920981650354c4f84e971ccb56c8907e1 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Sat, 21 Feb 2026 19:07:55 -0800 Subject: [PATCH 46/91] update comments --- .../degreeworks-scraper/src/components/AuditParser.ts | 4 +++- .../degreeworks-scraper/src/components/Scraper.ts | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts b/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts index a9da4c40..5a811ed4 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts @@ -161,6 +161,9 @@ export class AuditParser { } async checkSpecializationIsRequired(ruleArray: Rule[]) { + // Heuristics for matching whether a specialization is required: + // majors with a required specialization has a rule with "ifElsePart":"ElsePart" + // and the words specialization, concentration, emphasis, area, track, or major in its textList return ruleArray.some((rule) => { return ( rule.ifElsePart === "ElsePart" && @@ -172,7 +175,6 @@ export class AuditParser { async ruleArrayToRequirements(ruleArray: Rule[]) { const ret: DegreeWorksRequirement[] = []; for (const rule of ruleArray) { - // heuristic for matching a specialization requirement switch (rule.ruleType) { case "Block": case "Noncourse": diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts index 52149334..75e30fba 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts @@ -389,7 +389,6 @@ export class Scraper { // After we match specializations to a major // we insure that majors with 0 specs don't require a specialization - // this isn't going to work... for (const [, [, major]] of this.parsedPrograms) { if (major.specs.length === 0) { major.specializationRequired = false; From e83d798ff8d3cce3d7195ff8c4e9ec6b0a9267aa Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Sat, 21 Feb 2026 19:07:55 -0800 Subject: [PATCH 47/91] update comments --- .../degreeworks-scraper/src/components/AuditParser.ts | 2 +- .../data-pipeline/degreeworks-scraper/src/components/Scraper.ts | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts b/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts index a9da4c40..7c05c177 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts @@ -161,6 +161,7 @@ export class AuditParser { } async checkSpecializationIsRequired(ruleArray: Rule[]) { + // Heuristics to determines if a major requires a specialization return ruleArray.some((rule) => { return ( rule.ifElsePart === "ElsePart" && @@ -172,7 +173,6 @@ export class AuditParser { async ruleArrayToRequirements(ruleArray: Rule[]) { const ret: DegreeWorksRequirement[] = []; for (const rule of ruleArray) { - // heuristic for matching a specialization requirement switch (rule.ruleType) { case "Block": case "Noncourse": diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts index 52149334..75e30fba 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts @@ -389,7 +389,6 @@ export class Scraper { // After we match specializations to a major // we insure that majors with 0 specs don't require a specialization - // this isn't going to work... for (const [, [, major]] of this.parsedPrograms) { if (major.specs.length === 0) { major.specializationRequired = false; From 2f07907bee208ce7a724d6ffa84b1989b5bf94cf Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Sat, 21 Feb 2026 21:54:54 -0800 Subject: [PATCH 48/91] removed redundant parsing of programs in post-proccessing step --- .../degreeworks-scraper/src/components/Scraper.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts index 75e30fba..43a71dea 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts @@ -311,7 +311,7 @@ export class Scraper { foundMajor = majorProgram[1]; } else { console.log( - `warning: ${specName} (spec code = ${specCode}) is related to ${got.parent.name} in spec cache but no such major exists`, + `warning: ${specName} has cached relation to non-existant major, ${got.parent.name} (spec code = ${specCode})`, ); } } @@ -388,7 +388,7 @@ export class Scraper { } // After we match specializations to a major - // we insure that majors with 0 specs don't require a specialization + // we ensure that majors with 0 specs don't require a specialization for (const [, [, major]] of this.parsedPrograms) { if (major.specs.length === 0) { major.specializationRequired = false; @@ -408,9 +408,9 @@ export class Scraper { // cleaner way to address this, but this is such an insanely niche case // that it's probably not worth the effort to write a general solution. - const x = this.parsedPrograms.get("Major in Art History") as MajorProgram; - const y = this.parsedSpecializations.get("AHGEO")?.[2] as DegreeWorksProgram; - const z = this.parsedSpecializations.get("AHPER")?.[2] as DegreeWorksProgram; + const x = this.parsedPrograms.get("Major in Art History"); + const y = this.parsedSpecializations.get("AHGEO")?.[2]; + const z = this.parsedSpecializations.get("AHPER")?.[2]; if (x && y && z) { x[1].specs = []; x[1].specializationRequired = false; @@ -422,7 +422,7 @@ export class Scraper { // Chemical Engineering is falsely marked as requiring a specialization (pr#295) - const chemE = this.parsedPrograms.get("Major in Chemical Engineering") as MajorProgram; + const chemE = this.parsedPrograms.get("Major in Chemical Engineering"); if (chemE) { chemE[1].specializationRequired = false; From 063f3a2f568a52a9d387801979c886f78f8ee873 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Sun, 22 Feb 2026 22:45:18 -0800 Subject: [PATCH 49/91] still push specs into programs --- .../data-pipeline/degreeworks-scraper/src/components/Scraper.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts index 4f08dd25..58a3009b 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts @@ -351,6 +351,8 @@ export class Scraper { `(majorCode = ${foundMajorAssured.code}, degree = ${foundMajorAssured.degreeType})`, ); + foundMajorAssured.specs.push(specCode); + foundMajorSpecPairs.push([ [ foundMajorAssured.degreeType?.startsWith("B") ? "U" : "G", From 43c6aa6aae22a22ee49f15088ea30d153a132a3d Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Sun, 22 Feb 2026 23:02:31 -0800 Subject: [PATCH 50/91] moved specCodes into MajorProgram type --- .../src/components/Scraper.ts | 5 +- .../degreeworks-scraper/src/index.ts | 64 +- .../db/migrations/0026_polymorphic majors.sql | 35 + .../db/migrations/meta/0026_snapshot.json | 4631 +++++++++++++++++ packages/db/migrations/meta/_journal.json | 7 + packages/db/src/schema.ts | 4 +- 6 files changed, 4712 insertions(+), 34 deletions(-) create mode 100644 packages/db/migrations/0026_polymorphic majors.sql create mode 100644 packages/db/migrations/meta/0026_snapshot.json diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts index 58a3009b..f1033cb3 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts @@ -163,14 +163,14 @@ export class Scraper { ); continue; } - if (ret.has([majorAudit.title, specCode].join(";"))) { + if (ret.has(majorAudit.title)) { console.log( `Requirements block already exists for "${majorAudit.title}" ${specCode ? `with spec: '${specCode}'` : ""} (majorCode = ${majorCode}, degree = ${degreeCode})`, ); continue; } - ret.set([majorAudit.title, specCode].join(";"), [ + ret.set(majorAudit.title, [ audit?.college ? await this.ap.parseBlock( `${schoolCode}-COLLEGE-${majorCode}-${degreeCode}`, @@ -178,6 +178,7 @@ export class Scraper { ) : undefined, await this.ap.parseBlock(`${schoolCode}-MAJOR-${majorCode}-${degreeCode}`, majorAudit), + specCode, ]); console.log( diff --git a/apps/data-pipeline/degreeworks-scraper/src/index.ts b/apps/data-pipeline/degreeworks-scraper/src/index.ts index 9c70d278..0a3cc5c2 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/index.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/index.ts @@ -48,39 +48,43 @@ async function main() { const majorSpecData = parsedPrograms .entries() - .map(([k, [college, { name, degreeType, code, requirements, specializationRequired }]]) => { - const specCode = k.split(";")[1] !== "" ? `${degreeType}-${k.split(";")[1]}` : undefined; - let collegeBlockIndex: number | undefined; - if (college?.requirements) { - const wouldInsert = { name: college.name, requirements: college.requirements }; - const existing = collegeBlocks.findIndex((schoolExisting) => { - try { - assert.deepStrictEqual(schoolExisting, wouldInsert); - return true; - } catch { - return false; + .map( + ([ + k, + [college, { name, degreeType, code, requirements, specializationRequired }, specCode], + ]) => { + let collegeBlockIndex: number | undefined; + if (college?.requirements) { + const wouldInsert = { name: college.name, requirements: college.requirements }; + const existing = collegeBlocks.findIndex((schoolExisting) => { + try { + assert.deepStrictEqual(schoolExisting, wouldInsert); + return true; + } catch { + return false; + } + }); + + if (existing === -1) { + collegeBlocks.push(wouldInsert); + collegeBlockIndex = collegeBlocks.length - 1; + } else { + collegeBlockIndex = existing; } - }); - - if (existing === -1) { - collegeBlocks.push(wouldInsert); - collegeBlockIndex = collegeBlocks.length - 1; - } else { - collegeBlockIndex = existing; } - } - return { - id: `${degreeType}-${code}`, - degreeId: degreeType ?? "", - code, - ...(specCode !== undefined ? { specCode } : {}), - name, - specializationRequired, - requirements, - ...(collegeBlockIndex !== undefined ? { collegeBlockIndex } : {}), - }; - }) + return { + id: `${degreeType}-${code}`, + degreeId: degreeType ?? "", + code, + ...(specCode !== undefined ? { specCode } : {}), + name, + specializationRequired, + requirements, + ...(collegeBlockIndex !== undefined ? { collegeBlockIndex } : {}), + }; + }, + ) .toArray(); const majorRequirementBlocks = [] as (typeof majorRequirement.$inferInsert)[]; diff --git a/packages/db/migrations/0026_polymorphic majors.sql b/packages/db/migrations/0026_polymorphic majors.sql new file mode 100644 index 00000000..d1ffead3 --- /dev/null +++ b/packages/db/migrations/0026_polymorphic majors.sql @@ -0,0 +1,35 @@ +CREATE TABLE IF NOT EXISTS "major_requirement" ( + "requirements" jsonb NOT NULL, + "id" bigint PRIMARY KEY GENERATED ALWAYS AS (jsonb_hash_extended(requirements, 0)) STORED NOT NULL +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "major_spec_pair_to_requirement" ( + "id" varchar PRIMARY KEY GENERATED ALWAYS AS ( + CASE WHEN "major_spec_pair_to_requirement"."spec_id" IS NOT NULL + THEN "major_spec_pair_to_requirement"."major_id" || '+' || "major_spec_pair_to_requirement"."spec_id" + ELSE "major_spec_pair_to_requirement"."major_id" + END) STORED NOT NULL, + "major_id" varchar NOT NULL, + "spec_id" varchar, + "requirement_id" bigint +); +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "major_spec_pair_to_requirement" ADD CONSTRAINT "major_spec_pair_to_requirement_major_id_major_id_fk" FOREIGN KEY ("major_id") REFERENCES "public"."major"("id") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "major_spec_pair_to_requirement" ADD CONSTRAINT "major_spec_pair_to_requirement_spec_id_specialization_id_fk" FOREIGN KEY ("spec_id") REFERENCES "public"."specialization"("id") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "major_spec_pair_to_requirement" ADD CONSTRAINT "major_spec_pair_to_requirement_requirement_id_major_requirement_id_fk" FOREIGN KEY ("requirement_id") REFERENCES "public"."major_requirement"("id") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +ALTER TABLE "major" DROP COLUMN IF EXISTS "requirements"; \ No newline at end of file diff --git a/packages/db/migrations/meta/0026_snapshot.json b/packages/db/migrations/meta/0026_snapshot.json new file mode 100644 index 00000000..9c5918d8 --- /dev/null +++ b/packages/db/migrations/meta/0026_snapshot.json @@ -0,0 +1,4631 @@ +{ + "id": "f2837065-5b85-4d2b-a7cf-72dab3302f45", + "prevId": "b6f5eff6-d4a4-413e-841b-efecba276bb7", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.ap_exam": { + "name": "ap_exam", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "catalogue_name": { + "name": "catalogue_name", + "type": "varchar", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.ap_exam_reward": { + "name": "ap_exam_reward", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "units_granted": { + "name": "units_granted", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "elective_units_granted": { + "name": "elective_units_granted", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "ge_1a_courses_granted": { + "name": "ge_1a_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_1b_courses_granted": { + "name": "ge_1b_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_2_courses_granted": { + "name": "ge_2_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_3_courses_granted": { + "name": "ge_3_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_4_courses_granted": { + "name": "ge_4_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_5a_courses_granted": { + "name": "ge_5a_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_5b_courses_granted": { + "name": "ge_5b_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_6_courses_granted": { + "name": "ge_6_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_7_courses_granted": { + "name": "ge_7_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_8_courses_granted": { + "name": "ge_8_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "courses_granted": { + "name": "courses_granted", + "type": "json", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.ap_exam_to_reward": { + "name": "ap_exam_to_reward", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "exam_id": { + "name": "exam_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "score": { + "name": "score", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "reward": { + "name": "reward", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "ap_exam_to_reward_exam_id_score_index": { + "name": "ap_exam_to_reward_exam_id_score_index", + "columns": [ + { + "expression": "exam_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "score", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "ap_exam_to_reward_exam_id_ap_exam_id_fk": { + "name": "ap_exam_to_reward_exam_id_ap_exam_id_fk", + "tableFrom": "ap_exam_to_reward", + "tableTo": "ap_exam", + "columnsFrom": ["exam_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "ap_exam_to_reward_reward_ap_exam_reward_id_fk": { + "name": "ap_exam_to_reward_reward_ap_exam_reward_id_fk", + "tableFrom": "ap_exam_to_reward", + "tableTo": "ap_exam_reward", + "columnsFrom": ["reward"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.calendar_term": { + "name": "calendar_term", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true, + "generated": { + "as": "\"calendar_term\".\"year\" || ' ' || CASE WHEN \"calendar_term\".\"quarter\" = 'Fall' THEN 'Fall' WHEN \"calendar_term\".\"quarter\" = 'Winter' THEN 'Winter' WHEN \"calendar_term\".\"quarter\" = 'Spring' THEN 'Spring' WHEN \"calendar_term\".\"quarter\" = 'Summer1' THEN 'Summer1' WHEN \"calendar_term\".\"quarter\" = 'Summer10wk' THEN 'Summer10wk' WHEN \"calendar_term\".\"quarter\" = 'Summer2' THEN 'Summer2' ELSE '' END", + "type": "stored" + } + }, + "year": { + "name": "year", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "quarter": { + "name": "quarter", + "type": "term", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "instruction_start": { + "name": "instruction_start", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "instruction_end": { + "name": "instruction_end", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "finals_start": { + "name": "finals_start", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "finals_end": { + "name": "finals_end", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "soc_available": { + "name": "soc_available", + "type": "date", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.catalogue_program": { + "name": "catalogue_program", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "program_name": { + "name": "program_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.college_requirement": { + "name": "college_requirement", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "requirements": { + "name": "requirements", + "type": "jsonb", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "college_requirement_requirements_unique": { + "name": "college_requirement_requirements_unique", + "nullsNotDistinct": false, + "columns": ["requirements"] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.course": { + "name": "course", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "department": { + "name": "department", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "shortened_dept": { + "name": "shortened_dept", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "REPLACE(\"course\".\"department\", ' ', '')", + "type": "stored" + } + }, + "department_alias": { + "name": "department_alias", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "course_number": { + "name": "course_number", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_numeric": { + "name": "course_numeric", + "type": "integer", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "CASE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g') WHEN '' THEN 0 ELSE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g')::INTEGER END", + "type": "stored" + } + }, + "school": { + "name": "school", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_level": { + "name": "course_level", + "type": "course_level", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "min_units": { + "name": "min_units", + "type": "numeric(4, 2)", + "primaryKey": false, + "notNull": true + }, + "max_units": { + "name": "max_units", + "type": "numeric(4, 2)", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "department_name": { + "name": "department_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "prerequisite_tree": { + "name": "prerequisite_tree", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "prerequisite_text": { + "name": "prerequisite_text", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "repeatability": { + "name": "repeatability", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "grading_option": { + "name": "grading_option", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "concurrent": { + "name": "concurrent", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "same_as": { + "name": "same_as", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "restriction": { + "name": "restriction", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "overlap": { + "name": "overlap", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "corequisites": { + "name": "corequisites", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "is_ge_1a": { + "name": "is_ge_1a", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_1b": { + "name": "is_ge_1b", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_2": { + "name": "is_ge_2", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_3": { + "name": "is_ge_3", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_4": { + "name": "is_ge_4", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_5a": { + "name": "is_ge_5a", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_5b": { + "name": "is_ge_5b", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_6": { + "name": "is_ge_6", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_7": { + "name": "is_ge_7", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_8": { + "name": "is_ge_8", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "ge_text": { + "name": "ge_text", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "course_search_index": { + "name": "course_search_index", + "columns": [ + { + "expression": "(\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"id\", '')), 'A') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"department\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"department_alias\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"shortened_dept\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"course_number\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"course_numeric\"::TEXT, '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"title\", '')), 'C') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"description\", '')), 'D')\n)", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "gin", + "with": {} + }, + "shortened_dept": { + "name": "shortened_dept", + "columns": [ + { + "expression": "shortened_dept", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.degree": { + "name": "degree", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "division": { + "name": "division", + "type": "division", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.dining_diet_restriction": { + "name": "dining_diet_restriction", + "schema": "", + "columns": { + "dish_id": { + "name": "dish_id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "contains_eggs": { + "name": "contains_eggs", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "contains_fish": { + "name": "contains_fish", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "contains_milk": { + "name": "contains_milk", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "contains_peanuts": { + "name": "contains_peanuts", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "contains_sesame": { + "name": "contains_sesame", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "contains_shellfish": { + "name": "contains_shellfish", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "contains_soy": { + "name": "contains_soy", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "contains_tree_nuts": { + "name": "contains_tree_nuts", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "contains_wheat": { + "name": "contains_wheat", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_gluten_free": { + "name": "is_gluten_free", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_halal": { + "name": "is_halal", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_kosher": { + "name": "is_kosher", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_locally_grown": { + "name": "is_locally_grown", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_organic": { + "name": "is_organic", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_vegan": { + "name": "is_vegan", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_vegetarian": { + "name": "is_vegetarian", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "dining_diet_restriction_dish_id_dining_dish_id_fk": { + "name": "dining_diet_restriction_dish_id_dining_dish_id_fk", + "tableFrom": "dining_diet_restriction", + "tableTo": "dining_dish", + "columnsFrom": ["dish_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.dining_dish": { + "name": "dining_dish", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "station_id": { + "name": "station_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "ingredients": { + "name": "ingredients", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "category": { + "name": "category", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "image_url": { + "name": "image_url", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "dining_dish_station_id_index": { + "name": "dining_dish_station_id_index", + "columns": [ + { + "expression": "station_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "dining_dish_station_id_dining_station_id_fk": { + "name": "dining_dish_station_id_dining_station_id_fk", + "tableFrom": "dining_dish", + "tableTo": "dining_station", + "columnsFrom": ["station_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.dining_dish_to_period": { + "name": "dining_dish_to_period", + "schema": "", + "columns": { + "period_id": { + "name": "period_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "dish_id": { + "name": "dish_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "dining_dish_to_period_period_id_dining_period_id_fk": { + "name": "dining_dish_to_period_period_id_dining_period_id_fk", + "tableFrom": "dining_dish_to_period", + "tableTo": "dining_period", + "columnsFrom": ["period_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "dining_dish_to_period_dish_id_dining_dish_id_fk": { + "name": "dining_dish_to_period_dish_id_dining_dish_id_fk", + "tableFrom": "dining_dish_to_period", + "tableTo": "dining_dish", + "columnsFrom": ["dish_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.dining_event": { + "name": "dining_event", + "schema": "", + "columns": { + "title": { + "name": "title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "image": { + "name": "image", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "restaurant_id": { + "name": "restaurant_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "start": { + "name": "start", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "end": { + "name": "end", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "dining_event_restaurant_id_dining_restaurant_id_fk": { + "name": "dining_event_restaurant_id_dining_restaurant_id_fk", + "tableFrom": "dining_event", + "tableTo": "dining_restaurant", + "columnsFrom": ["restaurant_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "dining_event_pk": { + "name": "dining_event_pk", + "columns": ["title", "restaurant_id", "start"] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.dining_nutrition_info": { + "name": "dining_nutrition_info", + "schema": "", + "columns": { + "dish_id": { + "name": "dish_id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "serving_size": { + "name": "serving_size", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "serving_unit": { + "name": "serving_unit", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "calories": { + "name": "calories", + "type": "numeric(10, 2)", + "primaryKey": false, + "notNull": false + }, + "total_fat_g": { + "name": "total_fat_g", + "type": "numeric(10, 2)", + "primaryKey": false, + "notNull": false + }, + "trans_fat_g": { + "name": "trans_fat_g", + "type": "numeric(10, 2)", + "primaryKey": false, + "notNull": false + }, + "saturated_fat_g": { + "name": "saturated_fat_g", + "type": "numeric(10, 2)", + "primaryKey": false, + "notNull": false + }, + "cholesterol_mg": { + "name": "cholesterol_mg", + "type": "numeric(10, 2)", + "primaryKey": false, + "notNull": false + }, + "sodium_mg": { + "name": "sodium_mg", + "type": "numeric(10, 2)", + "primaryKey": false, + "notNull": false + }, + "total_carbs_g": { + "name": "total_carbs_g", + "type": "numeric(10, 2)", + "primaryKey": false, + "notNull": false + }, + "dietary_fiber_g": { + "name": "dietary_fiber_g", + "type": "numeric(10, 2)", + "primaryKey": false, + "notNull": false + }, + "sugars_g": { + "name": "sugars_g", + "type": "numeric(10, 2)", + "primaryKey": false, + "notNull": false + }, + "protein_g": { + "name": "protein_g", + "type": "numeric(10, 2)", + "primaryKey": false, + "notNull": false + }, + "calcium": { + "name": "calcium", + "type": "numeric(10, 2)", + "primaryKey": false, + "notNull": false + }, + "iron": { + "name": "iron", + "type": "numeric(10, 2)", + "primaryKey": false, + "notNull": false + }, + "vitamin_a": { + "name": "vitamin_a", + "type": "numeric(10, 2)", + "primaryKey": false, + "notNull": false + }, + "vitamin_c": { + "name": "vitamin_c", + "type": "numeric(10, 2)", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "dining_nutrition_info_dish_id_dining_dish_id_fk": { + "name": "dining_nutrition_info_dish_id_dining_dish_id_fk", + "tableFrom": "dining_nutrition_info", + "tableTo": "dining_dish", + "columnsFrom": ["dish_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.dining_period": { + "name": "dining_period", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "adobe_id": { + "name": "adobe_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "date": { + "name": "date", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "restaurant_id": { + "name": "restaurant_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "start_time": { + "name": "start_time", + "type": "time", + "primaryKey": false, + "notNull": true + }, + "end_time": { + "name": "end_time", + "type": "time", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "dining_period_adobe_id_date_restaurant_id_index": { + "name": "dining_period_adobe_id_date_restaurant_id_index", + "columns": [ + { + "expression": "adobe_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "date", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "restaurant_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "dining_period_date_index": { + "name": "dining_period_date_index", + "columns": [ + { + "expression": "date", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "dining_period_restaurant_id_index": { + "name": "dining_period_restaurant_id_index", + "columns": [ + { + "expression": "restaurant_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "dining_period_restaurant_id_dining_restaurant_id_fk": { + "name": "dining_period_restaurant_id_dining_restaurant_id_fk", + "tableFrom": "dining_period", + "tableTo": "dining_restaurant", + "columnsFrom": ["restaurant_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.dining_restaurant": { + "name": "dining_restaurant", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.dining_station": { + "name": "dining_station", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "restaurant_id": { + "name": "restaurant_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "dining_station_restaurant_id_index": { + "name": "dining_station_restaurant_id_index", + "columns": [ + { + "expression": "restaurant_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "dining_station_restaurant_id_dining_restaurant_id_fk": { + "name": "dining_station_restaurant_id_dining_restaurant_id_fk", + "tableFrom": "dining_station", + "tableTo": "dining_restaurant", + "columnsFrom": ["restaurant_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.instructor": { + "name": "instructor", + "schema": "", + "columns": { + "ucinetid": { + "name": "ucinetid", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "email": { + "name": "email", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "department": { + "name": "department", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "instructor_search_index": { + "name": "instructor_search_index", + "columns": [ + { + "expression": "(\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"ucinetid\", '')), 'A') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"name\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"title\", '')), 'B')\n)", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "gin", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.instructor_to_websoc_instructor": { + "name": "instructor_to_websoc_instructor", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "instructor_ucinetid": { + "name": "instructor_ucinetid", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "websoc_instructor_name": { + "name": "websoc_instructor_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "instructor_to_websoc_instructor_instructor_ucinetid_index": { + "name": "instructor_to_websoc_instructor_instructor_ucinetid_index", + "columns": [ + { + "expression": "instructor_ucinetid", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "instructor_to_websoc_instructor_websoc_instructor_name_index": { + "name": "instructor_to_websoc_instructor_websoc_instructor_name_index", + "columns": [ + { + "expression": "websoc_instructor_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "instructor_to_websoc_instructor_instructor_ucinetid_websoc_instructor_name_index": { + "name": "instructor_to_websoc_instructor_instructor_ucinetid_websoc_instructor_name_index", + "columns": [ + { + "expression": "instructor_ucinetid", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "websoc_instructor_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "instructor_to_websoc_instructor_instructor_ucinetid_instructor_ucinetid_fk": { + "name": "instructor_to_websoc_instructor_instructor_ucinetid_instructor_ucinetid_fk", + "tableFrom": "instructor_to_websoc_instructor", + "tableTo": "instructor", + "columnsFrom": ["instructor_ucinetid"], + "columnsTo": ["ucinetid"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "instructor_to_websoc_instructor_websoc_instructor_name_websoc_instructor_name_fk": { + "name": "instructor_to_websoc_instructor_websoc_instructor_name_websoc_instructor_name_fk", + "tableFrom": "instructor_to_websoc_instructor", + "tableTo": "websoc_instructor", + "columnsFrom": ["websoc_instructor_name"], + "columnsTo": ["name"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.larc_section": { + "name": "larc_section", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "course_id": { + "name": "course_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "days_string": { + "name": "days_string", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "time_string": { + "name": "time_string", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "start_time": { + "name": "start_time", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "end_time": { + "name": "end_time", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "instructor": { + "name": "instructor", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "building": { + "name": "building", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "meets_monday": { + "name": "meets_monday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_tuesday": { + "name": "meets_tuesday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_wednesday": { + "name": "meets_wednesday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_thursday": { + "name": "meets_thursday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_friday": { + "name": "meets_friday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_saturday": { + "name": "meets_saturday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_sunday": { + "name": "meets_sunday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": { + "larc_section_course_id_index": { + "name": "larc_section_course_id_index", + "columns": [ + { + "expression": "course_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "larc_section_course_id_websoc_course_id_fk": { + "name": "larc_section_course_id_websoc_course_id_fk", + "tableFrom": "larc_section", + "tableTo": "websoc_course", + "columnsFrom": ["course_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.library_traffic": { + "name": "library_traffic", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true + }, + "library_name": { + "name": "library_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "location_name": { + "name": "location_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "traffic_count": { + "name": "traffic_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "traffic_percentage": { + "name": "traffic_percentage", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "timestamp": { + "name": "timestamp", + "type": "timestamp", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "library_traffic_library_name_index": { + "name": "library_traffic_library_name_index", + "columns": [ + { + "expression": "library_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "library_traffic_location_name_index": { + "name": "library_traffic_location_name_index", + "columns": [ + { + "expression": "location_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.library_traffic_history": { + "name": "library_traffic_history", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "location_id": { + "name": "location_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "traffic_count": { + "name": "traffic_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "traffic_percentage": { + "name": "traffic_percentage", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "timestamp": { + "name": "timestamp", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "library_traffic_history_location_id_timestamp_index": { + "name": "library_traffic_history_location_id_timestamp_index", + "columns": [ + { + "expression": "location_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "timestamp", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "library_traffic_history_location_id_library_traffic_id_fk": { + "name": "library_traffic_history_location_id_library_traffic_id_fk", + "tableFrom": "library_traffic_history", + "tableTo": "library_traffic", + "columnsFrom": ["location_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.major": { + "name": "major", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "degree_id": { + "name": "degree_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "code": { + "name": "code", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "specialization_required": { + "name": "specialization_required", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "college_requirement": { + "name": "college_requirement", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "major_degree_id_index": { + "name": "major_degree_id_index", + "columns": [ + { + "expression": "degree_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "major_college_requirement_index": { + "name": "major_college_requirement_index", + "columns": [ + { + "expression": "college_requirement", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "major_degree_id_degree_id_fk": { + "name": "major_degree_id_degree_id_fk", + "tableFrom": "major", + "tableTo": "degree", + "columnsFrom": ["degree_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "major_college_requirement_college_requirement_id_fk": { + "name": "major_college_requirement_college_requirement_id_fk", + "tableFrom": "major", + "tableTo": "college_requirement", + "columnsFrom": ["college_requirement"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.major_requirement": { + "name": "major_requirement", + "schema": "", + "columns": { + "requirements": { + "name": "requirements", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "id": { + "name": "id", + "type": "bigint", + "primaryKey": true, + "notNull": true, + "generated": { + "as": "jsonb_hash_extended(requirements, 0)", + "type": "stored" + } + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.major_spec_pair_to_requirement": { + "name": "major_spec_pair_to_requirement", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true, + "generated": { + "as": "\n CASE WHEN \"major_spec_pair_to_requirement\".\"spec_id\" IS NOT NULL\n THEN \"major_spec_pair_to_requirement\".\"major_id\" || '+' || \"major_spec_pair_to_requirement\".\"spec_id\"\n ELSE \"major_spec_pair_to_requirement\".\"major_id\"\n END", + "type": "stored" + } + }, + "major_id": { + "name": "major_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "spec_id": { + "name": "spec_id", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "requirement_id": { + "name": "requirement_id", + "type": "bigint", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "major_spec_pair_to_requirement_major_id_major_id_fk": { + "name": "major_spec_pair_to_requirement_major_id_major_id_fk", + "tableFrom": "major_spec_pair_to_requirement", + "tableTo": "major", + "columnsFrom": ["major_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "major_spec_pair_to_requirement_spec_id_specialization_id_fk": { + "name": "major_spec_pair_to_requirement_spec_id_specialization_id_fk", + "tableFrom": "major_spec_pair_to_requirement", + "tableTo": "specialization", + "columnsFrom": ["spec_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "major_spec_pair_to_requirement_requirement_id_major_requirement_id_fk": { + "name": "major_spec_pair_to_requirement_requirement_id_major_requirement_id_fk", + "tableFrom": "major_spec_pair_to_requirement", + "tableTo": "major_requirement", + "columnsFrom": ["requirement_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.minor": { + "name": "minor", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "requirements": { + "name": "requirements", + "type": "json", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.prerequisite": { + "name": "prerequisite", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "dep_dept": { + "name": "dep_dept", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "prerequisite_id": { + "name": "prerequisite_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "dependency_id": { + "name": "dependency_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "prerequisite_dep_dept_index": { + "name": "prerequisite_dep_dept_index", + "columns": [ + { + "expression": "dep_dept", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "prerequisite_prerequisite_id_index": { + "name": "prerequisite_prerequisite_id_index", + "columns": [ + { + "expression": "prerequisite_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "prerequisite_dependency_id_index": { + "name": "prerequisite_dependency_id_index", + "columns": [ + { + "expression": "dependency_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "prerequisite_prerequisite_id_dependency_id_index": { + "name": "prerequisite_prerequisite_id_dependency_id_index", + "columns": [ + { + "expression": "prerequisite_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "dependency_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.sample_program_variation": { + "name": "sample_program_variation", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "program_id": { + "name": "program_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "label": { + "name": "label", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "sample_program": { + "name": "sample_program", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "variation_notes": { + "name": "variation_notes", + "type": "varchar[]", + "primaryKey": false, + "notNull": true, + "default": "ARRAY[]::VARCHAR[]" + } + }, + "indexes": {}, + "foreignKeys": { + "sample_program_variation_program_id_catalogue_program_id_fk": { + "name": "sample_program_variation_program_id_catalogue_program_id_fk", + "tableFrom": "sample_program_variation", + "tableTo": "catalogue_program", + "columnsFrom": ["program_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.school_requirement": { + "name": "school_requirement", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "requirements": { + "name": "requirements", + "type": "json", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.specialization": { + "name": "specialization", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "major_id": { + "name": "major_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "requirements": { + "name": "requirements", + "type": "json", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "specialization_major_id_index": { + "name": "specialization_major_id_index", + "columns": [ + { + "expression": "major_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "specialization_major_id_major_id_fk": { + "name": "specialization_major_id_major_id_fk", + "tableFrom": "specialization", + "tableTo": "major", + "columnsFrom": ["major_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.study_location": { + "name": "study_location", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.study_room": { + "name": "study_room", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "capacity": { + "name": "capacity", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "location": { + "name": "location", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "directions": { + "name": "directions", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "tech_enhanced": { + "name": "tech_enhanced", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "url": { + "name": "url", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "study_location_id": { + "name": "study_location_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "study_room_study_location_id_index": { + "name": "study_room_study_location_id_index", + "columns": [ + { + "expression": "study_location_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "study_room_study_location_id_study_location_id_fk": { + "name": "study_room_study_location_id_study_location_id_fk", + "tableFrom": "study_room", + "tableTo": "study_location", + "columnsFrom": ["study_location_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.study_room_slot": { + "name": "study_room_slot", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "study_room_id": { + "name": "study_room_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "start": { + "name": "start", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "end": { + "name": "end", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "is_available": { + "name": "is_available", + "type": "boolean", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "study_room_slot_study_room_id_index": { + "name": "study_room_slot_study_room_id_index", + "columns": [ + { + "expression": "study_room_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "study_room_slot_study_room_id_start_end_index": { + "name": "study_room_slot_study_room_id_start_end_index", + "columns": [ + { + "expression": "study_room_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "start", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "end", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "study_room_slot_study_room_id_study_room_id_fk": { + "name": "study_room_slot_study_room_id_study_room_id_fk", + "tableFrom": "study_room_slot", + "tableTo": "study_room", + "columnsFrom": ["study_room_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_course": { + "name": "websoc_course", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "department_id": { + "name": "department_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "course_id": { + "name": "course_id", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "REPLACE(\"websoc_course\".\"dept_code\", ' ', '') || \"websoc_course\".\"course_number\"", + "type": "stored" + } + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "year": { + "name": "year", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "quarter": { + "name": "quarter", + "type": "term", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "school_name": { + "name": "school_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "dept_code": { + "name": "dept_code", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_title": { + "name": "course_title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_number": { + "name": "course_number", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_numeric": { + "name": "course_numeric", + "type": "integer", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "CASE REGEXP_REPLACE(\"websoc_course\".\"course_number\", '\\D', '', 'g') WHEN '' THEN 0 ELSE REGEXP_REPLACE(\"websoc_course\".\"course_number\", '\\D', '', 'g')::INTEGER END", + "type": "stored" + } + }, + "course_comment": { + "name": "course_comment", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "prerequisite_link": { + "name": "prerequisite_link", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "is_ge_1a": { + "name": "is_ge_1a", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_1b": { + "name": "is_ge_1b", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_2": { + "name": "is_ge_2", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_3": { + "name": "is_ge_3", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_4": { + "name": "is_ge_4", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_5a": { + "name": "is_ge_5a", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_5b": { + "name": "is_ge_5b", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_6": { + "name": "is_ge_6", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_7": { + "name": "is_ge_7", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_8": { + "name": "is_ge_8", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": { + "websoc_course_department_id_index": { + "name": "websoc_course_department_id_index", + "columns": [ + { + "expression": "department_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_course_id_index": { + "name": "websoc_course_course_id_index", + "columns": [ + { + "expression": "course_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_school_name_dept_code_course_number_course_title_index": { + "name": "websoc_course_year_quarter_school_name_dept_code_course_number_course_title_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "school_name", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "dept_code", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "course_number", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "course_title", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_1a_index": { + "name": "websoc_course_year_quarter_is_ge_1a_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_1a", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_1b_index": { + "name": "websoc_course_year_quarter_is_ge_1b_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_1b", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_2_index": { + "name": "websoc_course_year_quarter_is_ge_2_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_2", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_3_index": { + "name": "websoc_course_year_quarter_is_ge_3_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_3", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_4_index": { + "name": "websoc_course_year_quarter_is_ge_4_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_4", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_5a_index": { + "name": "websoc_course_year_quarter_is_ge_5a_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_5a", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_5b_index": { + "name": "websoc_course_year_quarter_is_ge_5b_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_5b", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_6_index": { + "name": "websoc_course_year_quarter_is_ge_6_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_6", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_7_index": { + "name": "websoc_course_year_quarter_is_ge_7_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_7", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_8_index": { + "name": "websoc_course_year_quarter_is_ge_8_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_8", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_dept_code_index": { + "name": "websoc_course_year_quarter_dept_code_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "dept_code", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_dept_code_course_number_index": { + "name": "websoc_course_year_quarter_dept_code_course_number_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "dept_code", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "course_number", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_course_department_id_websoc_department_id_fk": { + "name": "websoc_course_department_id_websoc_department_id_fk", + "tableFrom": "websoc_course", + "tableTo": "websoc_department", + "columnsFrom": ["department_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_department": { + "name": "websoc_department", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "school_id": { + "name": "school_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "year": { + "name": "year", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "quarter": { + "name": "quarter", + "type": "term", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "dept_code": { + "name": "dept_code", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "dept_name": { + "name": "dept_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "dept_comment": { + "name": "dept_comment", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "section_code_range_comments": { + "name": "section_code_range_comments", + "type": "text[]", + "primaryKey": false, + "notNull": true + }, + "course_number_range_comments": { + "name": "course_number_range_comments", + "type": "text[]", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "websoc_department_school_id_index": { + "name": "websoc_department_school_id_index", + "columns": [ + { + "expression": "school_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_department_year_quarter_school_id_dept_code_index": { + "name": "websoc_department_year_quarter_school_id_dept_code_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "school_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "dept_code", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_department_school_id_websoc_school_id_fk": { + "name": "websoc_department_school_id_websoc_school_id_fk", + "tableFrom": "websoc_department", + "tableTo": "websoc_school", + "columnsFrom": ["school_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_instructor": { + "name": "websoc_instructor", + "schema": "", + "columns": { + "name": { + "name": "name", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_location": { + "name": "websoc_location", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "building": { + "name": "building", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "room": { + "name": "room", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "websoc_location_building_room_index": { + "name": "websoc_location_building_room_index", + "columns": [ + { + "expression": "building", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "room", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_meta": { + "name": "websoc_meta", + "schema": "", + "columns": { + "name": { + "name": "name", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "last_scraped": { + "name": "last_scraped", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "last_dept_scraped": { + "name": "last_dept_scraped", + "type": "varchar", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_school": { + "name": "websoc_school", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "year": { + "name": "year", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "quarter": { + "name": "quarter", + "type": "term", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "school_name": { + "name": "school_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "school_comment": { + "name": "school_comment", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "websoc_school_year_quarter_school_name_index": { + "name": "websoc_school_year_quarter_school_name_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "school_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_section": { + "name": "websoc_section", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "course_id": { + "name": "course_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "year": { + "name": "year", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "quarter": { + "name": "quarter", + "type": "term", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "units": { + "name": "units", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "websoc_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "instructors": { + "name": "instructors", + "type": "text[]", + "primaryKey": false, + "notNull": true + }, + "meetings": { + "name": "meetings", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "final_exam_string": { + "name": "final_exam_string", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "final_exam": { + "name": "final_exam", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "section_num": { + "name": "section_num", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "max_capacity": { + "name": "max_capacity", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "section_code": { + "name": "section_code", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "section_type": { + "name": "section_type", + "type": "websoc_section_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "num_requested": { + "name": "num_requested", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "restriction_string": { + "name": "restriction_string", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "restriction_a": { + "name": "restriction_a", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_b": { + "name": "restriction_b", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_c": { + "name": "restriction_c", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_d": { + "name": "restriction_d", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_e": { + "name": "restriction_e", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_f": { + "name": "restriction_f", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_g": { + "name": "restriction_g", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_h": { + "name": "restriction_h", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_i": { + "name": "restriction_i", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_j": { + "name": "restriction_j", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_k": { + "name": "restriction_k", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_l": { + "name": "restriction_l", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_m": { + "name": "restriction_m", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_n": { + "name": "restriction_n", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_o": { + "name": "restriction_o", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_r": { + "name": "restriction_r", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_s": { + "name": "restriction_s", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_x": { + "name": "restriction_x", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "num_on_waitlist": { + "name": "num_on_waitlist", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_waitlist_cap": { + "name": "num_waitlist_cap", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "section_comment": { + "name": "section_comment", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "num_new_only_reserved": { + "name": "num_new_only_reserved", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_currently_total_enrolled": { + "name": "num_currently_total_enrolled", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_currently_section_enrolled": { + "name": "num_currently_section_enrolled", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "is_cancelled": { + "name": "is_cancelled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "\"websoc_section\".\"section_comment\" LIKE '%*** CANCELLED ***%' OR \"websoc_section\".\"section_comment\" LIKE '%*** CANCELED ***%'", + "type": "stored" + } + }, + "web_url": { + "name": "web_url", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "''" + } + }, + "indexes": { + "websoc_section_course_id_index": { + "name": "websoc_section_course_id_index", + "columns": [ + { + "expression": "course_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_section_year_quarter_section_code_index": { + "name": "websoc_section_year_quarter_section_code_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "section_code", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_section_course_id_websoc_course_id_fk": { + "name": "websoc_section_course_id_websoc_course_id_fk", + "tableFrom": "websoc_section", + "tableTo": "websoc_course", + "columnsFrom": ["course_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_section_enrollment": { + "name": "websoc_section_enrollment", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "section_id": { + "name": "section_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "date", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "year": { + "name": "year", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "quarter": { + "name": "quarter", + "type": "term", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "max_capacity": { + "name": "max_capacity", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "num_currently_total_enrolled": { + "name": "num_currently_total_enrolled", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_on_waitlist": { + "name": "num_on_waitlist", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_waitlist_cap": { + "name": "num_waitlist_cap", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_requested": { + "name": "num_requested", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_new_only_reserved": { + "name": "num_new_only_reserved", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "websoc_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "websoc_section_enrollment_section_id_index": { + "name": "websoc_section_enrollment_section_id_index", + "columns": [ + { + "expression": "section_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_section_enrollment_section_id_created_at_index": { + "name": "websoc_section_enrollment_section_id_created_at_index", + "columns": [ + { + "expression": "section_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_section_enrollment_section_id_websoc_section_id_fk": { + "name": "websoc_section_enrollment_section_id_websoc_section_id_fk", + "tableFrom": "websoc_section_enrollment", + "tableTo": "websoc_section", + "columnsFrom": ["section_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_section_grade": { + "name": "websoc_section_grade", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "section_id": { + "name": "section_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "grade_a_count": { + "name": "grade_a_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_b_count": { + "name": "grade_b_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_c_count": { + "name": "grade_c_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_d_count": { + "name": "grade_d_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_f_count": { + "name": "grade_f_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_p_count": { + "name": "grade_p_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_np_count": { + "name": "grade_np_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_w_count": { + "name": "grade_w_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "average_gpa": { + "name": "average_gpa", + "type": "numeric(3, 2)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "websoc_section_grade_section_id_index": { + "name": "websoc_section_grade_section_id_index", + "columns": [ + { + "expression": "section_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_section_grade_section_id_websoc_section_id_fk": { + "name": "websoc_section_grade_section_id_websoc_section_id_fk", + "tableFrom": "websoc_section_grade", + "tableTo": "websoc_section", + "columnsFrom": ["section_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "websoc_section_grade_section_id_unique": { + "name": "websoc_section_grade_section_id_unique", + "nullsNotDistinct": false, + "columns": ["section_id"] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_section_meeting": { + "name": "websoc_section_meeting", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "section_id": { + "name": "section_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "section_code": { + "name": "section_code", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "meeting_index": { + "name": "meeting_index", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "time_string": { + "name": "time_string", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "time_is_tba": { + "name": "time_is_tba", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "\"websoc_section_meeting\".\"time_string\" LIKE '%TBA%'", + "type": "stored" + } + }, + "start_time": { + "name": "start_time", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "end_time": { + "name": "end_time", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "days_string": { + "name": "days_string", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "meets_monday": { + "name": "meets_monday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_tuesday": { + "name": "meets_tuesday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_wednesday": { + "name": "meets_wednesday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_thursday": { + "name": "meets_thursday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_friday": { + "name": "meets_friday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_saturday": { + "name": "meets_saturday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_sunday": { + "name": "meets_sunday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": { + "websoc_section_meeting_section_id_index": { + "name": "websoc_section_meeting_section_id_index", + "columns": [ + { + "expression": "section_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_section_meeting_section_id_websoc_section_id_fk": { + "name": "websoc_section_meeting_section_id_websoc_section_id_fk", + "tableFrom": "websoc_section_meeting", + "tableTo": "websoc_section", + "columnsFrom": ["section_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_section_meeting_to_location": { + "name": "websoc_section_meeting_to_location", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "meeting_id": { + "name": "meeting_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "location_id": { + "name": "location_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "websoc_section_meeting_to_location_meeting_id_index": { + "name": "websoc_section_meeting_to_location_meeting_id_index", + "columns": [ + { + "expression": "meeting_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_section_meeting_to_location_location_id_index": { + "name": "websoc_section_meeting_to_location_location_id_index", + "columns": [ + { + "expression": "location_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_section_meeting_to_location_meeting_id_location_id_index": { + "name": "websoc_section_meeting_to_location_meeting_id_location_id_index", + "columns": [ + { + "expression": "meeting_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "location_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_section_meeting_to_location_meeting_id_websoc_section_meeting_id_fk": { + "name": "websoc_section_meeting_to_location_meeting_id_websoc_section_meeting_id_fk", + "tableFrom": "websoc_section_meeting_to_location", + "tableTo": "websoc_section_meeting", + "columnsFrom": ["meeting_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "websoc_section_meeting_to_location_location_id_websoc_location_id_fk": { + "name": "websoc_section_meeting_to_location_location_id_websoc_location_id_fk", + "tableFrom": "websoc_section_meeting_to_location", + "tableTo": "websoc_location", + "columnsFrom": ["location_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_section_to_instructor": { + "name": "websoc_section_to_instructor", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "section_id": { + "name": "section_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "instructor_name": { + "name": "instructor_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "websoc_section_to_instructor_section_id_index": { + "name": "websoc_section_to_instructor_section_id_index", + "columns": [ + { + "expression": "section_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_section_to_instructor_instructor_name_index": { + "name": "websoc_section_to_instructor_instructor_name_index", + "columns": [ + { + "expression": "instructor_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_section_to_instructor_section_id_websoc_section_id_fk": { + "name": "websoc_section_to_instructor_section_id_websoc_section_id_fk", + "tableFrom": "websoc_section_to_instructor", + "tableTo": "websoc_section", + "columnsFrom": ["section_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "websoc_section_to_instructor_instructor_name_websoc_instructor_name_fk": { + "name": "websoc_section_to_instructor_instructor_name_websoc_instructor_name_fk", + "tableFrom": "websoc_section_to_instructor", + "tableTo": "websoc_instructor", + "columnsFrom": ["instructor_name"], + "columnsTo": ["name"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": { + "public.course_level": { + "name": "course_level", + "schema": "public", + "values": ["LowerDiv", "UpperDiv", "Graduate"] + }, + "public.division": { + "name": "division", + "schema": "public", + "values": ["Undergraduate", "Graduate"] + }, + "public.term": { + "name": "term", + "schema": "public", + "values": ["Fall", "Winter", "Spring", "Summer1", "Summer10wk", "Summer2"] + }, + "public.websoc_section_type": { + "name": "websoc_section_type", + "schema": "public", + "values": [ + "Act", + "Col", + "Dis", + "Fld", + "Lab", + "Lec", + "Qiz", + "Res", + "Sem", + "Stu", + "Tap", + "Tut" + ] + }, + "public.websoc_status": { + "name": "websoc_status", + "schema": "public", + "values": ["OPEN", "Waitl", "FULL", "NewOnly"] + } + }, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": { + "public.course_view": { + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "department": { + "name": "department", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "shortened_dept": { + "name": "shortened_dept", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "REPLACE(\"course\".\"department\", ' ', '')", + "type": "stored" + } + }, + "department_alias": { + "name": "department_alias", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "course_number": { + "name": "course_number", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_numeric": { + "name": "course_numeric", + "type": "integer", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "CASE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g') WHEN '' THEN 0 ELSE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g')::INTEGER END", + "type": "stored" + } + }, + "school": { + "name": "school", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_level": { + "name": "course_level", + "type": "course_level", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "min_units": { + "name": "min_units", + "type": "numeric(4, 2)", + "primaryKey": false, + "notNull": true + }, + "max_units": { + "name": "max_units", + "type": "numeric(4, 2)", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "department_name": { + "name": "department_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "prerequisite_tree": { + "name": "prerequisite_tree", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "prerequisite_text": { + "name": "prerequisite_text", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "repeatability": { + "name": "repeatability", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "grading_option": { + "name": "grading_option", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "concurrent": { + "name": "concurrent", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "same_as": { + "name": "same_as", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "restriction": { + "name": "restriction", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "overlap": { + "name": "overlap", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "corequisites": { + "name": "corequisites", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "is_ge_1a": { + "name": "is_ge_1a", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_1b": { + "name": "is_ge_1b", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_2": { + "name": "is_ge_2", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_3": { + "name": "is_ge_3", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_4": { + "name": "is_ge_4", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_5a": { + "name": "is_ge_5a", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_5b": { + "name": "is_ge_5b", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_6": { + "name": "is_ge_6", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_7": { + "name": "is_ge_7", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_8": { + "name": "is_ge_8", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "ge_text": { + "name": "ge_text", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "definition": "select \"course\".\"id\", \"course\".\"updated_at\", \"course\".\"department\", \"course\".\"shortened_dept\", \"course\".\"department_alias\", \"course\".\"course_number\", \"course\".\"course_numeric\", \"course\".\"school\", \"course\".\"title\", \"course\".\"course_level\", \"course\".\"min_units\", \"course\".\"max_units\", \"course\".\"description\", \"course\".\"department_name\", \"course\".\"prerequisite_tree\", \"course\".\"prerequisite_text\", \"course\".\"repeatability\", \"course\".\"grading_option\", \"course\".\"concurrent\", \"course\".\"same_as\", \"course\".\"restriction\", \"course\".\"overlap\", \"course\".\"corequisites\", \"course\".\"is_ge_1a\", \"course\".\"is_ge_1b\", \"course\".\"is_ge_2\", \"course\".\"is_ge_3\", \"course\".\"is_ge_4\", \"course\".\"is_ge_5a\", \"course\".\"is_ge_5b\", \"course\".\"is_ge_6\", \"course\".\"is_ge_7\", \"course\".\"is_ge_8\", \"course\".\"ge_text\", \n ARRAY_REMOVE(COALESCE(\n (\n SELECT ARRAY_AGG(\n CASE WHEN \"prerequisite_course\".\"id\" IS NULL THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'id', \"prerequisite_course\".\"id\",\n 'title', \"prerequisite_course\".\"title\",\n 'department', \"prerequisite_course\".\"department\",\n 'courseNumber', \"prerequisite_course\".\"course_number\"\n )\n END\n )\n FROM \"prerequisite\"\n LEFT JOIN \"course\" \"prerequisite_course\" ON \"prerequisite_course\".\"id\" = \"prerequisite\".\"prerequisite_id\"\n WHERE \"prerequisite\".\"dependency_id\" = \"course\".\"id\"\n ),\n ARRAY[]::JSONB[]), NULL)\n as \"prerequisites\", \n ARRAY_REMOVE(COALESCE(\n (\n SELECT ARRAY_AGG(\n CASE WHEN \"dependency_course\".\"id\" IS NULL THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'id', \"dependency_course\".\"id\",\n 'title', \"dependency_course\".\"title\",\n 'department', \"dependency_course\".\"department\",\n 'courseNumber', \"dependency_course\".\"course_number\"\n )\n END\n )\n FROM \"prerequisite\" \"dependency\"\n LEFT JOIN \"course\" \"dependency_course\" ON \"dependency_course\".\"id\" = \"dependency\".\"dependency_id\"\n WHERE \"dependency\".\"prerequisite_id\" = \"course\".\"id\"\n ),\n ARRAY[]::JSONB[]), NULL)\n as \"dependencies\", \n ARRAY_REMOVE(ARRAY_AGG(DISTINCT\n CASE WHEN \"websoc_course\".\"year\" IS NULL THEN NULL\n ELSE CONCAT(\"websoc_course\".\"year\", ' ', \"websoc_course\".\"quarter\")\n END\n ), NULL)\n as \"terms\", \n ARRAY_REMOVE(COALESCE(ARRAY_AGG(DISTINCT\n CASE WHEN \"instructor\".\"ucinetid\" IS NULL THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'ucinetid', \"instructor\".\"ucinetid\",\n 'name', \"instructor\".\"name\",\n 'title', \"instructor\".\"title\",\n 'email', \"instructor\".\"email\",\n 'department', \"instructor\".\"department\",\n 'shortenedNames', ARRAY(\n SELECT \"instructor_to_websoc_instructor\".\"websoc_instructor_name\"\n FROM \"instructor_to_websoc_instructor\"\n WHERE \"instructor_to_websoc_instructor\".\"instructor_ucinetid\" = \"instructor\".\"ucinetid\"\n )\n )\n END\n ), ARRAY[]::JSONB[]), NULL)\n as \"instructors\" from \"course\" left join \"websoc_course\" on \"websoc_course\".\"course_id\" = \"course\".\"id\" left join \"websoc_section\" on \"websoc_section\".\"course_id\" = \"websoc_course\".\"id\" left join \"websoc_section_to_instructor\" on \"websoc_section_to_instructor\".\"section_id\" = \"websoc_section\".\"id\" left join \"websoc_instructor\" on \"websoc_instructor\".\"name\" = \"websoc_section_to_instructor\".\"instructor_name\" left join \"instructor_to_websoc_instructor\" on \"instructor_to_websoc_instructor\".\"websoc_instructor_name\" = \"websoc_instructor\".\"name\" left join \"instructor\" on (\"instructor\".\"ucinetid\" = \"instructor_to_websoc_instructor\".\"instructor_ucinetid\" and \"instructor\".\"ucinetid\" is not null and \"instructor\".\"ucinetid\" <> 'student') group by \"course\".\"id\"", + "name": "course_view", + "schema": "public", + "isExisting": false, + "materialized": true + }, + "public.instructor_view": { + "columns": { + "ucinetid": { + "name": "ucinetid", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "email": { + "name": "email", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "department": { + "name": "department", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "definition": "with \"shortened_names_cte\" as (select \"instructor_ucinetid\", ARRAY_AGG(\"websoc_instructor_name\") as \"shortened_names\" from \"instructor_to_websoc_instructor\" group by \"instructor_to_websoc_instructor\".\"instructor_ucinetid\"), \"courses_cte\" as (with \"terms_cte\" as (select \"course\".\"id\", \"instructor_to_websoc_instructor\".\"instructor_ucinetid\", \n ARRAY_REMOVE(ARRAY_AGG(DISTINCT\n CASE WHEN \"websoc_course\".\"year\" IS NULL THEN NULL\n ELSE CONCAT(\"websoc_course\".\"year\", ' ', \"websoc_course\".\"quarter\")\n END\n ), NULL) as \"terms\" from \"course\" left join \"websoc_course\" on \"websoc_course\".\"course_id\" = \"course\".\"id\" left join \"websoc_section\" on \"websoc_section\".\"course_id\" = \"websoc_course\".\"id\" left join \"websoc_section_to_instructor\" on \"websoc_section_to_instructor\".\"section_id\" = \"websoc_section\".\"id\" left join \"websoc_instructor\" on \"websoc_instructor\".\"name\" = \"websoc_section_to_instructor\".\"instructor_name\" left join \"instructor_to_websoc_instructor\" on \"instructor_to_websoc_instructor\".\"websoc_instructor_name\" = \"websoc_instructor\".\"name\" group by \"course\".\"id\", \"instructor_to_websoc_instructor\".\"instructor_ucinetid\") select \"terms_cte\".\"instructor_ucinetid\", \"course\".\"id\", \n CASE WHEN \"course\".\"id\" IS NULL\n THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'id', \"course\".\"id\",\n 'title', \"course\".\"title\",\n 'department', \"course\".\"department\",\n 'courseNumber', \"course\".\"course_number\",\n 'terms', COALESCE(\"terms\", ARRAY[]::TEXT[])\n )\n END\n as \"course_info\" from \"course\" left join \"terms_cte\" on \"terms_cte\".\"id\" = \"course\".\"id\" group by \"course\".\"id\", \"terms_cte\".\"instructor_ucinetid\", \"terms\") select \"instructor\".\"ucinetid\", \"instructor\".\"name\", \"instructor\".\"title\", \"instructor\".\"email\", \"instructor\".\"department\", COALESCE(\"shortened_names\", ARRAY[]::TEXT[]) as \"shortened_names\", \n ARRAY_REMOVE(ARRAY_AGG(DISTINCT \"course_info\"), NULL)\n as \"courses\" from \"instructor\" left join \"shortened_names_cte\" on \"shortened_names_cte\".\"instructor_ucinetid\" = \"instructor\".\"ucinetid\" left join \"courses_cte\" on \"courses_cte\".\"instructor_ucinetid\" = \"instructor\".\"ucinetid\" where \"instructor\".\"ucinetid\" <> 'student' group by \"instructor\".\"ucinetid\", \"shortened_names\"", + "name": "instructor_view", + "schema": "public", + "isExisting": false, + "materialized": true + } + }, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} diff --git a/packages/db/migrations/meta/_journal.json b/packages/db/migrations/meta/_journal.json index 744e6e7d..57d9568d 100644 --- a/packages/db/migrations/meta/_journal.json +++ b/packages/db/migrations/meta/_journal.json @@ -183,6 +183,13 @@ "when": 1771706013738, "tag": "0025_major_specialization_required", "breakpoints": true + }, + { + "idx": 26, + "version": "7", + "when": 1771828829229, + "tag": "0026_polymorphic majors", + "breakpoints": true } ] } diff --git a/packages/db/src/schema.ts b/packages/db/src/schema.ts index 7f2bb345..5b72c627 100644 --- a/packages/db/src/schema.ts +++ b/packages/db/src/schema.ts @@ -104,10 +104,10 @@ export type DegreeWorksProgram = DegreeWorksProgramId & { }; /** - * (school, major) pair, because school requirements can vary by major + * (school requirement, major requirement, spec code) triplet, because school requirements can vary by major * eventually, we may want degree type; e.g. MFA provides some requirements */ -export type MajorProgram = [DegreeWorksProgram | undefined, DegreeWorksProgram]; +export type MajorProgram = [DegreeWorksProgram | undefined, DegreeWorksProgram, string | undefined]; export type DegreeWorksCourseRequirement = { requirementType: "Course"; From 517606ca575c79247b92d6ca1ff20f7c835397ef Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Sun, 22 Feb 2026 23:17:53 -0800 Subject: [PATCH 51/91] Revert "still push specs into programs" This reverts commit 063f3a2f568a52a9d387801979c886f78f8ee873. --- .../data-pipeline/degreeworks-scraper/src/components/Scraper.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts index f1033cb3..bb90207e 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts @@ -352,8 +352,6 @@ export class Scraper { `(majorCode = ${foundMajorAssured.code}, degree = ${foundMajorAssured.degreeType})`, ); - foundMajorAssured.specs.push(specCode); - foundMajorSpecPairs.push([ [ foundMajorAssured.degreeType?.startsWith("B") ? "U" : "G", From 7ad24f3b2c4235616ec44440ba6ee4c5501f1bf8 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Sun, 22 Feb 2026 23:19:14 -0800 Subject: [PATCH 52/91] Revert "moved specCodes into MajorProgram type" This reverts commit 43c6aa6aae22a22ee49f15088ea30d153a132a3d. --- .../src/components/Scraper.ts | 5 +- .../degreeworks-scraper/src/index.ts | 64 +- .../db/migrations/0026_polymorphic majors.sql | 35 - .../db/migrations/meta/0026_snapshot.json | 4631 ----------------- packages/db/migrations/meta/_journal.json | 7 - packages/db/src/schema.ts | 4 +- 6 files changed, 34 insertions(+), 4712 deletions(-) delete mode 100644 packages/db/migrations/0026_polymorphic majors.sql delete mode 100644 packages/db/migrations/meta/0026_snapshot.json diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts index bb90207e..4f08dd25 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts @@ -163,14 +163,14 @@ export class Scraper { ); continue; } - if (ret.has(majorAudit.title)) { + if (ret.has([majorAudit.title, specCode].join(";"))) { console.log( `Requirements block already exists for "${majorAudit.title}" ${specCode ? `with spec: '${specCode}'` : ""} (majorCode = ${majorCode}, degree = ${degreeCode})`, ); continue; } - ret.set(majorAudit.title, [ + ret.set([majorAudit.title, specCode].join(";"), [ audit?.college ? await this.ap.parseBlock( `${schoolCode}-COLLEGE-${majorCode}-${degreeCode}`, @@ -178,7 +178,6 @@ export class Scraper { ) : undefined, await this.ap.parseBlock(`${schoolCode}-MAJOR-${majorCode}-${degreeCode}`, majorAudit), - specCode, ]); console.log( diff --git a/apps/data-pipeline/degreeworks-scraper/src/index.ts b/apps/data-pipeline/degreeworks-scraper/src/index.ts index 0a3cc5c2..9c70d278 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/index.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/index.ts @@ -48,43 +48,39 @@ async function main() { const majorSpecData = parsedPrograms .entries() - .map( - ([ - k, - [college, { name, degreeType, code, requirements, specializationRequired }, specCode], - ]) => { - let collegeBlockIndex: number | undefined; - if (college?.requirements) { - const wouldInsert = { name: college.name, requirements: college.requirements }; - const existing = collegeBlocks.findIndex((schoolExisting) => { - try { - assert.deepStrictEqual(schoolExisting, wouldInsert); - return true; - } catch { - return false; - } - }); - - if (existing === -1) { - collegeBlocks.push(wouldInsert); - collegeBlockIndex = collegeBlocks.length - 1; - } else { - collegeBlockIndex = existing; + .map(([k, [college, { name, degreeType, code, requirements, specializationRequired }]]) => { + const specCode = k.split(";")[1] !== "" ? `${degreeType}-${k.split(";")[1]}` : undefined; + let collegeBlockIndex: number | undefined; + if (college?.requirements) { + const wouldInsert = { name: college.name, requirements: college.requirements }; + const existing = collegeBlocks.findIndex((schoolExisting) => { + try { + assert.deepStrictEqual(schoolExisting, wouldInsert); + return true; + } catch { + return false; } + }); + + if (existing === -1) { + collegeBlocks.push(wouldInsert); + collegeBlockIndex = collegeBlocks.length - 1; + } else { + collegeBlockIndex = existing; } + } - return { - id: `${degreeType}-${code}`, - degreeId: degreeType ?? "", - code, - ...(specCode !== undefined ? { specCode } : {}), - name, - specializationRequired, - requirements, - ...(collegeBlockIndex !== undefined ? { collegeBlockIndex } : {}), - }; - }, - ) + return { + id: `${degreeType}-${code}`, + degreeId: degreeType ?? "", + code, + ...(specCode !== undefined ? { specCode } : {}), + name, + specializationRequired, + requirements, + ...(collegeBlockIndex !== undefined ? { collegeBlockIndex } : {}), + }; + }) .toArray(); const majorRequirementBlocks = [] as (typeof majorRequirement.$inferInsert)[]; diff --git a/packages/db/migrations/0026_polymorphic majors.sql b/packages/db/migrations/0026_polymorphic majors.sql deleted file mode 100644 index d1ffead3..00000000 --- a/packages/db/migrations/0026_polymorphic majors.sql +++ /dev/null @@ -1,35 +0,0 @@ -CREATE TABLE IF NOT EXISTS "major_requirement" ( - "requirements" jsonb NOT NULL, - "id" bigint PRIMARY KEY GENERATED ALWAYS AS (jsonb_hash_extended(requirements, 0)) STORED NOT NULL -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "major_spec_pair_to_requirement" ( - "id" varchar PRIMARY KEY GENERATED ALWAYS AS ( - CASE WHEN "major_spec_pair_to_requirement"."spec_id" IS NOT NULL - THEN "major_spec_pair_to_requirement"."major_id" || '+' || "major_spec_pair_to_requirement"."spec_id" - ELSE "major_spec_pair_to_requirement"."major_id" - END) STORED NOT NULL, - "major_id" varchar NOT NULL, - "spec_id" varchar, - "requirement_id" bigint -); ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "major_spec_pair_to_requirement" ADD CONSTRAINT "major_spec_pair_to_requirement_major_id_major_id_fk" FOREIGN KEY ("major_id") REFERENCES "public"."major"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "major_spec_pair_to_requirement" ADD CONSTRAINT "major_spec_pair_to_requirement_spec_id_specialization_id_fk" FOREIGN KEY ("spec_id") REFERENCES "public"."specialization"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "major_spec_pair_to_requirement" ADD CONSTRAINT "major_spec_pair_to_requirement_requirement_id_major_requirement_id_fk" FOREIGN KEY ("requirement_id") REFERENCES "public"."major_requirement"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -ALTER TABLE "major" DROP COLUMN IF EXISTS "requirements"; \ No newline at end of file diff --git a/packages/db/migrations/meta/0026_snapshot.json b/packages/db/migrations/meta/0026_snapshot.json deleted file mode 100644 index 9c5918d8..00000000 --- a/packages/db/migrations/meta/0026_snapshot.json +++ /dev/null @@ -1,4631 +0,0 @@ -{ - "id": "f2837065-5b85-4d2b-a7cf-72dab3302f45", - "prevId": "b6f5eff6-d4a4-413e-841b-efecba276bb7", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.ap_exam": { - "name": "ap_exam", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "catalogue_name": { - "name": "catalogue_name", - "type": "varchar", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.ap_exam_reward": { - "name": "ap_exam_reward", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "units_granted": { - "name": "units_granted", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "elective_units_granted": { - "name": "elective_units_granted", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "ge_1a_courses_granted": { - "name": "ge_1a_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_1b_courses_granted": { - "name": "ge_1b_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_2_courses_granted": { - "name": "ge_2_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_3_courses_granted": { - "name": "ge_3_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_4_courses_granted": { - "name": "ge_4_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_5a_courses_granted": { - "name": "ge_5a_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_5b_courses_granted": { - "name": "ge_5b_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_6_courses_granted": { - "name": "ge_6_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_7_courses_granted": { - "name": "ge_7_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_8_courses_granted": { - "name": "ge_8_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "courses_granted": { - "name": "courses_granted", - "type": "json", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.ap_exam_to_reward": { - "name": "ap_exam_to_reward", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "exam_id": { - "name": "exam_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "score": { - "name": "score", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "reward": { - "name": "reward", - "type": "uuid", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "ap_exam_to_reward_exam_id_score_index": { - "name": "ap_exam_to_reward_exam_id_score_index", - "columns": [ - { - "expression": "exam_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "score", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "ap_exam_to_reward_exam_id_ap_exam_id_fk": { - "name": "ap_exam_to_reward_exam_id_ap_exam_id_fk", - "tableFrom": "ap_exam_to_reward", - "tableTo": "ap_exam", - "columnsFrom": ["exam_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "ap_exam_to_reward_reward_ap_exam_reward_id_fk": { - "name": "ap_exam_to_reward_reward_ap_exam_reward_id_fk", - "tableFrom": "ap_exam_to_reward", - "tableTo": "ap_exam_reward", - "columnsFrom": ["reward"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.calendar_term": { - "name": "calendar_term", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true, - "generated": { - "as": "\"calendar_term\".\"year\" || ' ' || CASE WHEN \"calendar_term\".\"quarter\" = 'Fall' THEN 'Fall' WHEN \"calendar_term\".\"quarter\" = 'Winter' THEN 'Winter' WHEN \"calendar_term\".\"quarter\" = 'Spring' THEN 'Spring' WHEN \"calendar_term\".\"quarter\" = 'Summer1' THEN 'Summer1' WHEN \"calendar_term\".\"quarter\" = 'Summer10wk' THEN 'Summer10wk' WHEN \"calendar_term\".\"quarter\" = 'Summer2' THEN 'Summer2' ELSE '' END", - "type": "stored" - } - }, - "year": { - "name": "year", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "quarter": { - "name": "quarter", - "type": "term", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "instruction_start": { - "name": "instruction_start", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "instruction_end": { - "name": "instruction_end", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "finals_start": { - "name": "finals_start", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "finals_end": { - "name": "finals_end", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "soc_available": { - "name": "soc_available", - "type": "date", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.catalogue_program": { - "name": "catalogue_program", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "program_name": { - "name": "program_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.college_requirement": { - "name": "college_requirement", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "requirements": { - "name": "requirements", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "college_requirement_requirements_unique": { - "name": "college_requirement_requirements_unique", - "nullsNotDistinct": false, - "columns": ["requirements"] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.course": { - "name": "course", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "department": { - "name": "department", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "shortened_dept": { - "name": "shortened_dept", - "type": "varchar", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "REPLACE(\"course\".\"department\", ' ', '')", - "type": "stored" - } - }, - "department_alias": { - "name": "department_alias", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "course_number": { - "name": "course_number", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "course_numeric": { - "name": "course_numeric", - "type": "integer", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "CASE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g') WHEN '' THEN 0 ELSE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g')::INTEGER END", - "type": "stored" - } - }, - "school": { - "name": "school", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "course_level": { - "name": "course_level", - "type": "course_level", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "min_units": { - "name": "min_units", - "type": "numeric(4, 2)", - "primaryKey": false, - "notNull": true - }, - "max_units": { - "name": "max_units", - "type": "numeric(4, 2)", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "department_name": { - "name": "department_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "prerequisite_tree": { - "name": "prerequisite_tree", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "prerequisite_text": { - "name": "prerequisite_text", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "repeatability": { - "name": "repeatability", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "grading_option": { - "name": "grading_option", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "concurrent": { - "name": "concurrent", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "same_as": { - "name": "same_as", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "restriction": { - "name": "restriction", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "overlap": { - "name": "overlap", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "corequisites": { - "name": "corequisites", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "is_ge_1a": { - "name": "is_ge_1a", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_1b": { - "name": "is_ge_1b", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_2": { - "name": "is_ge_2", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_3": { - "name": "is_ge_3", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_4": { - "name": "is_ge_4", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_5a": { - "name": "is_ge_5a", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_5b": { - "name": "is_ge_5b", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_6": { - "name": "is_ge_6", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_7": { - "name": "is_ge_7", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_8": { - "name": "is_ge_8", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "ge_text": { - "name": "ge_text", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "course_search_index": { - "name": "course_search_index", - "columns": [ - { - "expression": "(\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"id\", '')), 'A') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"department\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"department_alias\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"shortened_dept\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"course_number\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"course_numeric\"::TEXT, '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"title\", '')), 'C') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"description\", '')), 'D')\n)", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "shortened_dept": { - "name": "shortened_dept", - "columns": [ - { - "expression": "shortened_dept", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.degree": { - "name": "degree", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "division": { - "name": "division", - "type": "division", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.dining_diet_restriction": { - "name": "dining_diet_restriction", - "schema": "", - "columns": { - "dish_id": { - "name": "dish_id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "contains_eggs": { - "name": "contains_eggs", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "contains_fish": { - "name": "contains_fish", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "contains_milk": { - "name": "contains_milk", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "contains_peanuts": { - "name": "contains_peanuts", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "contains_sesame": { - "name": "contains_sesame", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "contains_shellfish": { - "name": "contains_shellfish", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "contains_soy": { - "name": "contains_soy", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "contains_tree_nuts": { - "name": "contains_tree_nuts", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "contains_wheat": { - "name": "contains_wheat", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_gluten_free": { - "name": "is_gluten_free", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_halal": { - "name": "is_halal", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_kosher": { - "name": "is_kosher", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_locally_grown": { - "name": "is_locally_grown", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_organic": { - "name": "is_organic", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_vegan": { - "name": "is_vegan", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_vegetarian": { - "name": "is_vegetarian", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "dining_diet_restriction_dish_id_dining_dish_id_fk": { - "name": "dining_diet_restriction_dish_id_dining_dish_id_fk", - "tableFrom": "dining_diet_restriction", - "tableTo": "dining_dish", - "columnsFrom": ["dish_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.dining_dish": { - "name": "dining_dish", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "station_id": { - "name": "station_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "ingredients": { - "name": "ingredients", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "category": { - "name": "category", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "image_url": { - "name": "image_url", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "dining_dish_station_id_index": { - "name": "dining_dish_station_id_index", - "columns": [ - { - "expression": "station_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "dining_dish_station_id_dining_station_id_fk": { - "name": "dining_dish_station_id_dining_station_id_fk", - "tableFrom": "dining_dish", - "tableTo": "dining_station", - "columnsFrom": ["station_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.dining_dish_to_period": { - "name": "dining_dish_to_period", - "schema": "", - "columns": { - "period_id": { - "name": "period_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "dish_id": { - "name": "dish_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "dining_dish_to_period_period_id_dining_period_id_fk": { - "name": "dining_dish_to_period_period_id_dining_period_id_fk", - "tableFrom": "dining_dish_to_period", - "tableTo": "dining_period", - "columnsFrom": ["period_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - }, - "dining_dish_to_period_dish_id_dining_dish_id_fk": { - "name": "dining_dish_to_period_dish_id_dining_dish_id_fk", - "tableFrom": "dining_dish_to_period", - "tableTo": "dining_dish", - "columnsFrom": ["dish_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.dining_event": { - "name": "dining_event", - "schema": "", - "columns": { - "title": { - "name": "title", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "restaurant_id": { - "name": "restaurant_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "start": { - "name": "start", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "end": { - "name": "end", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "dining_event_restaurant_id_dining_restaurant_id_fk": { - "name": "dining_event_restaurant_id_dining_restaurant_id_fk", - "tableFrom": "dining_event", - "tableTo": "dining_restaurant", - "columnsFrom": ["restaurant_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "dining_event_pk": { - "name": "dining_event_pk", - "columns": ["title", "restaurant_id", "start"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.dining_nutrition_info": { - "name": "dining_nutrition_info", - "schema": "", - "columns": { - "dish_id": { - "name": "dish_id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "serving_size": { - "name": "serving_size", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "serving_unit": { - "name": "serving_unit", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "calories": { - "name": "calories", - "type": "numeric(10, 2)", - "primaryKey": false, - "notNull": false - }, - "total_fat_g": { - "name": "total_fat_g", - "type": "numeric(10, 2)", - "primaryKey": false, - "notNull": false - }, - "trans_fat_g": { - "name": "trans_fat_g", - "type": "numeric(10, 2)", - "primaryKey": false, - "notNull": false - }, - "saturated_fat_g": { - "name": "saturated_fat_g", - "type": "numeric(10, 2)", - "primaryKey": false, - "notNull": false - }, - "cholesterol_mg": { - "name": "cholesterol_mg", - "type": "numeric(10, 2)", - "primaryKey": false, - "notNull": false - }, - "sodium_mg": { - "name": "sodium_mg", - "type": "numeric(10, 2)", - "primaryKey": false, - "notNull": false - }, - "total_carbs_g": { - "name": "total_carbs_g", - "type": "numeric(10, 2)", - "primaryKey": false, - "notNull": false - }, - "dietary_fiber_g": { - "name": "dietary_fiber_g", - "type": "numeric(10, 2)", - "primaryKey": false, - "notNull": false - }, - "sugars_g": { - "name": "sugars_g", - "type": "numeric(10, 2)", - "primaryKey": false, - "notNull": false - }, - "protein_g": { - "name": "protein_g", - "type": "numeric(10, 2)", - "primaryKey": false, - "notNull": false - }, - "calcium": { - "name": "calcium", - "type": "numeric(10, 2)", - "primaryKey": false, - "notNull": false - }, - "iron": { - "name": "iron", - "type": "numeric(10, 2)", - "primaryKey": false, - "notNull": false - }, - "vitamin_a": { - "name": "vitamin_a", - "type": "numeric(10, 2)", - "primaryKey": false, - "notNull": false - }, - "vitamin_c": { - "name": "vitamin_c", - "type": "numeric(10, 2)", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "dining_nutrition_info_dish_id_dining_dish_id_fk": { - "name": "dining_nutrition_info_dish_id_dining_dish_id_fk", - "tableFrom": "dining_nutrition_info", - "tableTo": "dining_dish", - "columnsFrom": ["dish_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.dining_period": { - "name": "dining_period", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "adobe_id": { - "name": "adobe_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "date": { - "name": "date", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "restaurant_id": { - "name": "restaurant_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "start_time": { - "name": "start_time", - "type": "time", - "primaryKey": false, - "notNull": true - }, - "end_time": { - "name": "end_time", - "type": "time", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "dining_period_adobe_id_date_restaurant_id_index": { - "name": "dining_period_adobe_id_date_restaurant_id_index", - "columns": [ - { - "expression": "adobe_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "date", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "restaurant_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "dining_period_date_index": { - "name": "dining_period_date_index", - "columns": [ - { - "expression": "date", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "dining_period_restaurant_id_index": { - "name": "dining_period_restaurant_id_index", - "columns": [ - { - "expression": "restaurant_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "dining_period_restaurant_id_dining_restaurant_id_fk": { - "name": "dining_period_restaurant_id_dining_restaurant_id_fk", - "tableFrom": "dining_period", - "tableTo": "dining_restaurant", - "columnsFrom": ["restaurant_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.dining_restaurant": { - "name": "dining_restaurant", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.dining_station": { - "name": "dining_station", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "restaurant_id": { - "name": "restaurant_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "dining_station_restaurant_id_index": { - "name": "dining_station_restaurant_id_index", - "columns": [ - { - "expression": "restaurant_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "dining_station_restaurant_id_dining_restaurant_id_fk": { - "name": "dining_station_restaurant_id_dining_restaurant_id_fk", - "tableFrom": "dining_station", - "tableTo": "dining_restaurant", - "columnsFrom": ["restaurant_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.instructor": { - "name": "instructor", - "schema": "", - "columns": { - "ucinetid": { - "name": "ucinetid", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "department": { - "name": "department", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "instructor_search_index": { - "name": "instructor_search_index", - "columns": [ - { - "expression": "(\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"ucinetid\", '')), 'A') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"name\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"title\", '')), 'B')\n)", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.instructor_to_websoc_instructor": { - "name": "instructor_to_websoc_instructor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "instructor_ucinetid": { - "name": "instructor_ucinetid", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "websoc_instructor_name": { - "name": "websoc_instructor_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "instructor_to_websoc_instructor_instructor_ucinetid_index": { - "name": "instructor_to_websoc_instructor_instructor_ucinetid_index", - "columns": [ - { - "expression": "instructor_ucinetid", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "instructor_to_websoc_instructor_websoc_instructor_name_index": { - "name": "instructor_to_websoc_instructor_websoc_instructor_name_index", - "columns": [ - { - "expression": "websoc_instructor_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "instructor_to_websoc_instructor_instructor_ucinetid_websoc_instructor_name_index": { - "name": "instructor_to_websoc_instructor_instructor_ucinetid_websoc_instructor_name_index", - "columns": [ - { - "expression": "instructor_ucinetid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "websoc_instructor_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "instructor_to_websoc_instructor_instructor_ucinetid_instructor_ucinetid_fk": { - "name": "instructor_to_websoc_instructor_instructor_ucinetid_instructor_ucinetid_fk", - "tableFrom": "instructor_to_websoc_instructor", - "tableTo": "instructor", - "columnsFrom": ["instructor_ucinetid"], - "columnsTo": ["ucinetid"], - "onDelete": "no action", - "onUpdate": "no action" - }, - "instructor_to_websoc_instructor_websoc_instructor_name_websoc_instructor_name_fk": { - "name": "instructor_to_websoc_instructor_websoc_instructor_name_websoc_instructor_name_fk", - "tableFrom": "instructor_to_websoc_instructor", - "tableTo": "websoc_instructor", - "columnsFrom": ["websoc_instructor_name"], - "columnsTo": ["name"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.larc_section": { - "name": "larc_section", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "course_id": { - "name": "course_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "days_string": { - "name": "days_string", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "time_string": { - "name": "time_string", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "start_time": { - "name": "start_time", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "end_time": { - "name": "end_time", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "instructor": { - "name": "instructor", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "building": { - "name": "building", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "meets_monday": { - "name": "meets_monday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_tuesday": { - "name": "meets_tuesday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_wednesday": { - "name": "meets_wednesday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_thursday": { - "name": "meets_thursday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_friday": { - "name": "meets_friday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_saturday": { - "name": "meets_saturday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_sunday": { - "name": "meets_sunday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "larc_section_course_id_index": { - "name": "larc_section_course_id_index", - "columns": [ - { - "expression": "course_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "larc_section_course_id_websoc_course_id_fk": { - "name": "larc_section_course_id_websoc_course_id_fk", - "tableFrom": "larc_section", - "tableTo": "websoc_course", - "columnsFrom": ["course_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.library_traffic": { - "name": "library_traffic", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "library_name": { - "name": "library_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "location_name": { - "name": "location_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "traffic_count": { - "name": "traffic_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "traffic_percentage": { - "name": "traffic_percentage", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "timestamp": { - "name": "timestamp", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "library_traffic_library_name_index": { - "name": "library_traffic_library_name_index", - "columns": [ - { - "expression": "library_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "library_traffic_location_name_index": { - "name": "library_traffic_location_name_index", - "columns": [ - { - "expression": "location_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.library_traffic_history": { - "name": "library_traffic_history", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "location_id": { - "name": "location_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "traffic_count": { - "name": "traffic_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "traffic_percentage": { - "name": "traffic_percentage", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "timestamp": { - "name": "timestamp", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "library_traffic_history_location_id_timestamp_index": { - "name": "library_traffic_history_location_id_timestamp_index", - "columns": [ - { - "expression": "location_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "timestamp", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "library_traffic_history_location_id_library_traffic_id_fk": { - "name": "library_traffic_history_location_id_library_traffic_id_fk", - "tableFrom": "library_traffic_history", - "tableTo": "library_traffic", - "columnsFrom": ["location_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.major": { - "name": "major", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "degree_id": { - "name": "degree_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "code": { - "name": "code", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "specialization_required": { - "name": "specialization_required", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "college_requirement": { - "name": "college_requirement", - "type": "uuid", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "major_degree_id_index": { - "name": "major_degree_id_index", - "columns": [ - { - "expression": "degree_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "major_college_requirement_index": { - "name": "major_college_requirement_index", - "columns": [ - { - "expression": "college_requirement", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "major_degree_id_degree_id_fk": { - "name": "major_degree_id_degree_id_fk", - "tableFrom": "major", - "tableTo": "degree", - "columnsFrom": ["degree_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - }, - "major_college_requirement_college_requirement_id_fk": { - "name": "major_college_requirement_college_requirement_id_fk", - "tableFrom": "major", - "tableTo": "college_requirement", - "columnsFrom": ["college_requirement"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.major_requirement": { - "name": "major_requirement", - "schema": "", - "columns": { - "requirements": { - "name": "requirements", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "id": { - "name": "id", - "type": "bigint", - "primaryKey": true, - "notNull": true, - "generated": { - "as": "jsonb_hash_extended(requirements, 0)", - "type": "stored" - } - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.major_spec_pair_to_requirement": { - "name": "major_spec_pair_to_requirement", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true, - "generated": { - "as": "\n CASE WHEN \"major_spec_pair_to_requirement\".\"spec_id\" IS NOT NULL\n THEN \"major_spec_pair_to_requirement\".\"major_id\" || '+' || \"major_spec_pair_to_requirement\".\"spec_id\"\n ELSE \"major_spec_pair_to_requirement\".\"major_id\"\n END", - "type": "stored" - } - }, - "major_id": { - "name": "major_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "spec_id": { - "name": "spec_id", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "requirement_id": { - "name": "requirement_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "major_spec_pair_to_requirement_major_id_major_id_fk": { - "name": "major_spec_pair_to_requirement_major_id_major_id_fk", - "tableFrom": "major_spec_pair_to_requirement", - "tableTo": "major", - "columnsFrom": ["major_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - }, - "major_spec_pair_to_requirement_spec_id_specialization_id_fk": { - "name": "major_spec_pair_to_requirement_spec_id_specialization_id_fk", - "tableFrom": "major_spec_pair_to_requirement", - "tableTo": "specialization", - "columnsFrom": ["spec_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - }, - "major_spec_pair_to_requirement_requirement_id_major_requirement_id_fk": { - "name": "major_spec_pair_to_requirement_requirement_id_major_requirement_id_fk", - "tableFrom": "major_spec_pair_to_requirement", - "tableTo": "major_requirement", - "columnsFrom": ["requirement_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.minor": { - "name": "minor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "requirements": { - "name": "requirements", - "type": "json", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.prerequisite": { - "name": "prerequisite", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "dep_dept": { - "name": "dep_dept", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "prerequisite_id": { - "name": "prerequisite_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "dependency_id": { - "name": "dependency_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "prerequisite_dep_dept_index": { - "name": "prerequisite_dep_dept_index", - "columns": [ - { - "expression": "dep_dept", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "prerequisite_prerequisite_id_index": { - "name": "prerequisite_prerequisite_id_index", - "columns": [ - { - "expression": "prerequisite_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "prerequisite_dependency_id_index": { - "name": "prerequisite_dependency_id_index", - "columns": [ - { - "expression": "dependency_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "prerequisite_prerequisite_id_dependency_id_index": { - "name": "prerequisite_prerequisite_id_dependency_id_index", - "columns": [ - { - "expression": "prerequisite_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dependency_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.sample_program_variation": { - "name": "sample_program_variation", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "program_id": { - "name": "program_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "label": { - "name": "label", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "sample_program": { - "name": "sample_program", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "variation_notes": { - "name": "variation_notes", - "type": "varchar[]", - "primaryKey": false, - "notNull": true, - "default": "ARRAY[]::VARCHAR[]" - } - }, - "indexes": {}, - "foreignKeys": { - "sample_program_variation_program_id_catalogue_program_id_fk": { - "name": "sample_program_variation_program_id_catalogue_program_id_fk", - "tableFrom": "sample_program_variation", - "tableTo": "catalogue_program", - "columnsFrom": ["program_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.school_requirement": { - "name": "school_requirement", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "requirements": { - "name": "requirements", - "type": "json", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.specialization": { - "name": "specialization", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "major_id": { - "name": "major_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "requirements": { - "name": "requirements", - "type": "json", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "specialization_major_id_index": { - "name": "specialization_major_id_index", - "columns": [ - { - "expression": "major_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "specialization_major_id_major_id_fk": { - "name": "specialization_major_id_major_id_fk", - "tableFrom": "specialization", - "tableTo": "major", - "columnsFrom": ["major_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.study_location": { - "name": "study_location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.study_room": { - "name": "study_room", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "capacity": { - "name": "capacity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "location": { - "name": "location", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "directions": { - "name": "directions", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "tech_enhanced": { - "name": "tech_enhanced", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "url": { - "name": "url", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "study_location_id": { - "name": "study_location_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "study_room_study_location_id_index": { - "name": "study_room_study_location_id_index", - "columns": [ - { - "expression": "study_location_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "study_room_study_location_id_study_location_id_fk": { - "name": "study_room_study_location_id_study_location_id_fk", - "tableFrom": "study_room", - "tableTo": "study_location", - "columnsFrom": ["study_location_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.study_room_slot": { - "name": "study_room_slot", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "study_room_id": { - "name": "study_room_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "start": { - "name": "start", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "end": { - "name": "end", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "is_available": { - "name": "is_available", - "type": "boolean", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "study_room_slot_study_room_id_index": { - "name": "study_room_slot_study_room_id_index", - "columns": [ - { - "expression": "study_room_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "study_room_slot_study_room_id_start_end_index": { - "name": "study_room_slot_study_room_id_start_end_index", - "columns": [ - { - "expression": "study_room_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "start", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "end", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "study_room_slot_study_room_id_study_room_id_fk": { - "name": "study_room_slot_study_room_id_study_room_id_fk", - "tableFrom": "study_room_slot", - "tableTo": "study_room", - "columnsFrom": ["study_room_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_course": { - "name": "websoc_course", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "department_id": { - "name": "department_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "course_id": { - "name": "course_id", - "type": "varchar", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "REPLACE(\"websoc_course\".\"dept_code\", ' ', '') || \"websoc_course\".\"course_number\"", - "type": "stored" - } - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "year": { - "name": "year", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "quarter": { - "name": "quarter", - "type": "term", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "school_name": { - "name": "school_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "dept_code": { - "name": "dept_code", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "course_title": { - "name": "course_title", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "course_number": { - "name": "course_number", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "course_numeric": { - "name": "course_numeric", - "type": "integer", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "CASE REGEXP_REPLACE(\"websoc_course\".\"course_number\", '\\D', '', 'g') WHEN '' THEN 0 ELSE REGEXP_REPLACE(\"websoc_course\".\"course_number\", '\\D', '', 'g')::INTEGER END", - "type": "stored" - } - }, - "course_comment": { - "name": "course_comment", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "prerequisite_link": { - "name": "prerequisite_link", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "is_ge_1a": { - "name": "is_ge_1a", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_1b": { - "name": "is_ge_1b", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_2": { - "name": "is_ge_2", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_3": { - "name": "is_ge_3", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_4": { - "name": "is_ge_4", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_5a": { - "name": "is_ge_5a", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_5b": { - "name": "is_ge_5b", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_6": { - "name": "is_ge_6", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_7": { - "name": "is_ge_7", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_8": { - "name": "is_ge_8", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "websoc_course_department_id_index": { - "name": "websoc_course_department_id_index", - "columns": [ - { - "expression": "department_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_course_id_index": { - "name": "websoc_course_course_id_index", - "columns": [ - { - "expression": "course_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_school_name_dept_code_course_number_course_title_index": { - "name": "websoc_course_year_quarter_school_name_dept_code_course_number_course_title_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "school_name", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dept_code", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "course_number", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "course_title", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_1a_index": { - "name": "websoc_course_year_quarter_is_ge_1a_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_1a", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_1b_index": { - "name": "websoc_course_year_quarter_is_ge_1b_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_1b", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_2_index": { - "name": "websoc_course_year_quarter_is_ge_2_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_2", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_3_index": { - "name": "websoc_course_year_quarter_is_ge_3_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_3", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_4_index": { - "name": "websoc_course_year_quarter_is_ge_4_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_4", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_5a_index": { - "name": "websoc_course_year_quarter_is_ge_5a_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_5a", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_5b_index": { - "name": "websoc_course_year_quarter_is_ge_5b_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_5b", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_6_index": { - "name": "websoc_course_year_quarter_is_ge_6_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_6", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_7_index": { - "name": "websoc_course_year_quarter_is_ge_7_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_7", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_8_index": { - "name": "websoc_course_year_quarter_is_ge_8_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_8", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_dept_code_index": { - "name": "websoc_course_year_quarter_dept_code_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dept_code", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_dept_code_course_number_index": { - "name": "websoc_course_year_quarter_dept_code_course_number_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dept_code", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "course_number", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_course_department_id_websoc_department_id_fk": { - "name": "websoc_course_department_id_websoc_department_id_fk", - "tableFrom": "websoc_course", - "tableTo": "websoc_department", - "columnsFrom": ["department_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_department": { - "name": "websoc_department", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "school_id": { - "name": "school_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "year": { - "name": "year", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "quarter": { - "name": "quarter", - "type": "term", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "dept_code": { - "name": "dept_code", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "dept_name": { - "name": "dept_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "dept_comment": { - "name": "dept_comment", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "section_code_range_comments": { - "name": "section_code_range_comments", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "course_number_range_comments": { - "name": "course_number_range_comments", - "type": "text[]", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "websoc_department_school_id_index": { - "name": "websoc_department_school_id_index", - "columns": [ - { - "expression": "school_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_department_year_quarter_school_id_dept_code_index": { - "name": "websoc_department_year_quarter_school_id_dept_code_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "school_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dept_code", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_department_school_id_websoc_school_id_fk": { - "name": "websoc_department_school_id_websoc_school_id_fk", - "tableFrom": "websoc_department", - "tableTo": "websoc_school", - "columnsFrom": ["school_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_instructor": { - "name": "websoc_instructor", - "schema": "", - "columns": { - "name": { - "name": "name", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_location": { - "name": "websoc_location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "building": { - "name": "building", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "room": { - "name": "room", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "websoc_location_building_room_index": { - "name": "websoc_location_building_room_index", - "columns": [ - { - "expression": "building", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "room", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_meta": { - "name": "websoc_meta", - "schema": "", - "columns": { - "name": { - "name": "name", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "last_scraped": { - "name": "last_scraped", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_dept_scraped": { - "name": "last_dept_scraped", - "type": "varchar", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_school": { - "name": "websoc_school", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "year": { - "name": "year", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "quarter": { - "name": "quarter", - "type": "term", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "school_name": { - "name": "school_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "school_comment": { - "name": "school_comment", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "websoc_school_year_quarter_school_name_index": { - "name": "websoc_school_year_quarter_school_name_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "school_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_section": { - "name": "websoc_section", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "course_id": { - "name": "course_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "year": { - "name": "year", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "quarter": { - "name": "quarter", - "type": "term", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "units": { - "name": "units", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "websoc_status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "instructors": { - "name": "instructors", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "meetings": { - "name": "meetings", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "final_exam_string": { - "name": "final_exam_string", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "final_exam": { - "name": "final_exam", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "section_num": { - "name": "section_num", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "max_capacity": { - "name": "max_capacity", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "section_code": { - "name": "section_code", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "section_type": { - "name": "section_type", - "type": "websoc_section_type", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "num_requested": { - "name": "num_requested", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "restriction_string": { - "name": "restriction_string", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "restriction_a": { - "name": "restriction_a", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_b": { - "name": "restriction_b", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_c": { - "name": "restriction_c", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_d": { - "name": "restriction_d", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_e": { - "name": "restriction_e", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_f": { - "name": "restriction_f", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_g": { - "name": "restriction_g", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_h": { - "name": "restriction_h", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_i": { - "name": "restriction_i", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_j": { - "name": "restriction_j", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_k": { - "name": "restriction_k", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_l": { - "name": "restriction_l", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_m": { - "name": "restriction_m", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_n": { - "name": "restriction_n", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_o": { - "name": "restriction_o", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_r": { - "name": "restriction_r", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_s": { - "name": "restriction_s", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_x": { - "name": "restriction_x", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "num_on_waitlist": { - "name": "num_on_waitlist", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "num_waitlist_cap": { - "name": "num_waitlist_cap", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "section_comment": { - "name": "section_comment", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "num_new_only_reserved": { - "name": "num_new_only_reserved", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "num_currently_total_enrolled": { - "name": "num_currently_total_enrolled", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "num_currently_section_enrolled": { - "name": "num_currently_section_enrolled", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "is_cancelled": { - "name": "is_cancelled", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "\"websoc_section\".\"section_comment\" LIKE '%*** CANCELLED ***%' OR \"websoc_section\".\"section_comment\" LIKE '%*** CANCELED ***%'", - "type": "stored" - } - }, - "web_url": { - "name": "web_url", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "websoc_section_course_id_index": { - "name": "websoc_section_course_id_index", - "columns": [ - { - "expression": "course_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_section_year_quarter_section_code_index": { - "name": "websoc_section_year_quarter_section_code_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "section_code", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_section_course_id_websoc_course_id_fk": { - "name": "websoc_section_course_id_websoc_course_id_fk", - "tableFrom": "websoc_section", - "tableTo": "websoc_course", - "columnsFrom": ["course_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_section_enrollment": { - "name": "websoc_section_enrollment", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "section_id": { - "name": "section_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "date", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "year": { - "name": "year", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "quarter": { - "name": "quarter", - "type": "term", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "max_capacity": { - "name": "max_capacity", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "num_currently_total_enrolled": { - "name": "num_currently_total_enrolled", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "num_on_waitlist": { - "name": "num_on_waitlist", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "num_waitlist_cap": { - "name": "num_waitlist_cap", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "num_requested": { - "name": "num_requested", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "num_new_only_reserved": { - "name": "num_new_only_reserved", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "websoc_status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "websoc_section_enrollment_section_id_index": { - "name": "websoc_section_enrollment_section_id_index", - "columns": [ - { - "expression": "section_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_section_enrollment_section_id_created_at_index": { - "name": "websoc_section_enrollment_section_id_created_at_index", - "columns": [ - { - "expression": "section_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_section_enrollment_section_id_websoc_section_id_fk": { - "name": "websoc_section_enrollment_section_id_websoc_section_id_fk", - "tableFrom": "websoc_section_enrollment", - "tableTo": "websoc_section", - "columnsFrom": ["section_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_section_grade": { - "name": "websoc_section_grade", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "section_id": { - "name": "section_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "grade_a_count": { - "name": "grade_a_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "grade_b_count": { - "name": "grade_b_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "grade_c_count": { - "name": "grade_c_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "grade_d_count": { - "name": "grade_d_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "grade_f_count": { - "name": "grade_f_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "grade_p_count": { - "name": "grade_p_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "grade_np_count": { - "name": "grade_np_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "grade_w_count": { - "name": "grade_w_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "average_gpa": { - "name": "average_gpa", - "type": "numeric(3, 2)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "websoc_section_grade_section_id_index": { - "name": "websoc_section_grade_section_id_index", - "columns": [ - { - "expression": "section_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_section_grade_section_id_websoc_section_id_fk": { - "name": "websoc_section_grade_section_id_websoc_section_id_fk", - "tableFrom": "websoc_section_grade", - "tableTo": "websoc_section", - "columnsFrom": ["section_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "websoc_section_grade_section_id_unique": { - "name": "websoc_section_grade_section_id_unique", - "nullsNotDistinct": false, - "columns": ["section_id"] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_section_meeting": { - "name": "websoc_section_meeting", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "section_id": { - "name": "section_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "section_code": { - "name": "section_code", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "meeting_index": { - "name": "meeting_index", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "time_string": { - "name": "time_string", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "time_is_tba": { - "name": "time_is_tba", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "\"websoc_section_meeting\".\"time_string\" LIKE '%TBA%'", - "type": "stored" - } - }, - "start_time": { - "name": "start_time", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "end_time": { - "name": "end_time", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "days_string": { - "name": "days_string", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "meets_monday": { - "name": "meets_monday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_tuesday": { - "name": "meets_tuesday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_wednesday": { - "name": "meets_wednesday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_thursday": { - "name": "meets_thursday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_friday": { - "name": "meets_friday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_saturday": { - "name": "meets_saturday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_sunday": { - "name": "meets_sunday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "websoc_section_meeting_section_id_index": { - "name": "websoc_section_meeting_section_id_index", - "columns": [ - { - "expression": "section_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_section_meeting_section_id_websoc_section_id_fk": { - "name": "websoc_section_meeting_section_id_websoc_section_id_fk", - "tableFrom": "websoc_section_meeting", - "tableTo": "websoc_section", - "columnsFrom": ["section_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_section_meeting_to_location": { - "name": "websoc_section_meeting_to_location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "meeting_id": { - "name": "meeting_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "location_id": { - "name": "location_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "websoc_section_meeting_to_location_meeting_id_index": { - "name": "websoc_section_meeting_to_location_meeting_id_index", - "columns": [ - { - "expression": "meeting_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_section_meeting_to_location_location_id_index": { - "name": "websoc_section_meeting_to_location_location_id_index", - "columns": [ - { - "expression": "location_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_section_meeting_to_location_meeting_id_location_id_index": { - "name": "websoc_section_meeting_to_location_meeting_id_location_id_index", - "columns": [ - { - "expression": "meeting_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "location_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_section_meeting_to_location_meeting_id_websoc_section_meeting_id_fk": { - "name": "websoc_section_meeting_to_location_meeting_id_websoc_section_meeting_id_fk", - "tableFrom": "websoc_section_meeting_to_location", - "tableTo": "websoc_section_meeting", - "columnsFrom": ["meeting_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "websoc_section_meeting_to_location_location_id_websoc_location_id_fk": { - "name": "websoc_section_meeting_to_location_location_id_websoc_location_id_fk", - "tableFrom": "websoc_section_meeting_to_location", - "tableTo": "websoc_location", - "columnsFrom": ["location_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_section_to_instructor": { - "name": "websoc_section_to_instructor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "section_id": { - "name": "section_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "instructor_name": { - "name": "instructor_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "websoc_section_to_instructor_section_id_index": { - "name": "websoc_section_to_instructor_section_id_index", - "columns": [ - { - "expression": "section_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_section_to_instructor_instructor_name_index": { - "name": "websoc_section_to_instructor_instructor_name_index", - "columns": [ - { - "expression": "instructor_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_section_to_instructor_section_id_websoc_section_id_fk": { - "name": "websoc_section_to_instructor_section_id_websoc_section_id_fk", - "tableFrom": "websoc_section_to_instructor", - "tableTo": "websoc_section", - "columnsFrom": ["section_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - }, - "websoc_section_to_instructor_instructor_name_websoc_instructor_name_fk": { - "name": "websoc_section_to_instructor_instructor_name_websoc_instructor_name_fk", - "tableFrom": "websoc_section_to_instructor", - "tableTo": "websoc_instructor", - "columnsFrom": ["instructor_name"], - "columnsTo": ["name"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.course_level": { - "name": "course_level", - "schema": "public", - "values": ["LowerDiv", "UpperDiv", "Graduate"] - }, - "public.division": { - "name": "division", - "schema": "public", - "values": ["Undergraduate", "Graduate"] - }, - "public.term": { - "name": "term", - "schema": "public", - "values": ["Fall", "Winter", "Spring", "Summer1", "Summer10wk", "Summer2"] - }, - "public.websoc_section_type": { - "name": "websoc_section_type", - "schema": "public", - "values": [ - "Act", - "Col", - "Dis", - "Fld", - "Lab", - "Lec", - "Qiz", - "Res", - "Sem", - "Stu", - "Tap", - "Tut" - ] - }, - "public.websoc_status": { - "name": "websoc_status", - "schema": "public", - "values": ["OPEN", "Waitl", "FULL", "NewOnly"] - } - }, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": { - "public.course_view": { - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "department": { - "name": "department", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "shortened_dept": { - "name": "shortened_dept", - "type": "varchar", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "REPLACE(\"course\".\"department\", ' ', '')", - "type": "stored" - } - }, - "department_alias": { - "name": "department_alias", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "course_number": { - "name": "course_number", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "course_numeric": { - "name": "course_numeric", - "type": "integer", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "CASE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g') WHEN '' THEN 0 ELSE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g')::INTEGER END", - "type": "stored" - } - }, - "school": { - "name": "school", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "course_level": { - "name": "course_level", - "type": "course_level", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "min_units": { - "name": "min_units", - "type": "numeric(4, 2)", - "primaryKey": false, - "notNull": true - }, - "max_units": { - "name": "max_units", - "type": "numeric(4, 2)", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "department_name": { - "name": "department_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "prerequisite_tree": { - "name": "prerequisite_tree", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "prerequisite_text": { - "name": "prerequisite_text", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "repeatability": { - "name": "repeatability", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "grading_option": { - "name": "grading_option", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "concurrent": { - "name": "concurrent", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "same_as": { - "name": "same_as", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "restriction": { - "name": "restriction", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "overlap": { - "name": "overlap", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "corequisites": { - "name": "corequisites", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "is_ge_1a": { - "name": "is_ge_1a", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_1b": { - "name": "is_ge_1b", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_2": { - "name": "is_ge_2", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_3": { - "name": "is_ge_3", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_4": { - "name": "is_ge_4", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_5a": { - "name": "is_ge_5a", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_5b": { - "name": "is_ge_5b", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_6": { - "name": "is_ge_6", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_7": { - "name": "is_ge_7", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_8": { - "name": "is_ge_8", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "ge_text": { - "name": "ge_text", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "definition": "select \"course\".\"id\", \"course\".\"updated_at\", \"course\".\"department\", \"course\".\"shortened_dept\", \"course\".\"department_alias\", \"course\".\"course_number\", \"course\".\"course_numeric\", \"course\".\"school\", \"course\".\"title\", \"course\".\"course_level\", \"course\".\"min_units\", \"course\".\"max_units\", \"course\".\"description\", \"course\".\"department_name\", \"course\".\"prerequisite_tree\", \"course\".\"prerequisite_text\", \"course\".\"repeatability\", \"course\".\"grading_option\", \"course\".\"concurrent\", \"course\".\"same_as\", \"course\".\"restriction\", \"course\".\"overlap\", \"course\".\"corequisites\", \"course\".\"is_ge_1a\", \"course\".\"is_ge_1b\", \"course\".\"is_ge_2\", \"course\".\"is_ge_3\", \"course\".\"is_ge_4\", \"course\".\"is_ge_5a\", \"course\".\"is_ge_5b\", \"course\".\"is_ge_6\", \"course\".\"is_ge_7\", \"course\".\"is_ge_8\", \"course\".\"ge_text\", \n ARRAY_REMOVE(COALESCE(\n (\n SELECT ARRAY_AGG(\n CASE WHEN \"prerequisite_course\".\"id\" IS NULL THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'id', \"prerequisite_course\".\"id\",\n 'title', \"prerequisite_course\".\"title\",\n 'department', \"prerequisite_course\".\"department\",\n 'courseNumber', \"prerequisite_course\".\"course_number\"\n )\n END\n )\n FROM \"prerequisite\"\n LEFT JOIN \"course\" \"prerequisite_course\" ON \"prerequisite_course\".\"id\" = \"prerequisite\".\"prerequisite_id\"\n WHERE \"prerequisite\".\"dependency_id\" = \"course\".\"id\"\n ),\n ARRAY[]::JSONB[]), NULL)\n as \"prerequisites\", \n ARRAY_REMOVE(COALESCE(\n (\n SELECT ARRAY_AGG(\n CASE WHEN \"dependency_course\".\"id\" IS NULL THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'id', \"dependency_course\".\"id\",\n 'title', \"dependency_course\".\"title\",\n 'department', \"dependency_course\".\"department\",\n 'courseNumber', \"dependency_course\".\"course_number\"\n )\n END\n )\n FROM \"prerequisite\" \"dependency\"\n LEFT JOIN \"course\" \"dependency_course\" ON \"dependency_course\".\"id\" = \"dependency\".\"dependency_id\"\n WHERE \"dependency\".\"prerequisite_id\" = \"course\".\"id\"\n ),\n ARRAY[]::JSONB[]), NULL)\n as \"dependencies\", \n ARRAY_REMOVE(ARRAY_AGG(DISTINCT\n CASE WHEN \"websoc_course\".\"year\" IS NULL THEN NULL\n ELSE CONCAT(\"websoc_course\".\"year\", ' ', \"websoc_course\".\"quarter\")\n END\n ), NULL)\n as \"terms\", \n ARRAY_REMOVE(COALESCE(ARRAY_AGG(DISTINCT\n CASE WHEN \"instructor\".\"ucinetid\" IS NULL THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'ucinetid', \"instructor\".\"ucinetid\",\n 'name', \"instructor\".\"name\",\n 'title', \"instructor\".\"title\",\n 'email', \"instructor\".\"email\",\n 'department', \"instructor\".\"department\",\n 'shortenedNames', ARRAY(\n SELECT \"instructor_to_websoc_instructor\".\"websoc_instructor_name\"\n FROM \"instructor_to_websoc_instructor\"\n WHERE \"instructor_to_websoc_instructor\".\"instructor_ucinetid\" = \"instructor\".\"ucinetid\"\n )\n )\n END\n ), ARRAY[]::JSONB[]), NULL)\n as \"instructors\" from \"course\" left join \"websoc_course\" on \"websoc_course\".\"course_id\" = \"course\".\"id\" left join \"websoc_section\" on \"websoc_section\".\"course_id\" = \"websoc_course\".\"id\" left join \"websoc_section_to_instructor\" on \"websoc_section_to_instructor\".\"section_id\" = \"websoc_section\".\"id\" left join \"websoc_instructor\" on \"websoc_instructor\".\"name\" = \"websoc_section_to_instructor\".\"instructor_name\" left join \"instructor_to_websoc_instructor\" on \"instructor_to_websoc_instructor\".\"websoc_instructor_name\" = \"websoc_instructor\".\"name\" left join \"instructor\" on (\"instructor\".\"ucinetid\" = \"instructor_to_websoc_instructor\".\"instructor_ucinetid\" and \"instructor\".\"ucinetid\" is not null and \"instructor\".\"ucinetid\" <> 'student') group by \"course\".\"id\"", - "name": "course_view", - "schema": "public", - "isExisting": false, - "materialized": true - }, - "public.instructor_view": { - "columns": { - "ucinetid": { - "name": "ucinetid", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "department": { - "name": "department", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "definition": "with \"shortened_names_cte\" as (select \"instructor_ucinetid\", ARRAY_AGG(\"websoc_instructor_name\") as \"shortened_names\" from \"instructor_to_websoc_instructor\" group by \"instructor_to_websoc_instructor\".\"instructor_ucinetid\"), \"courses_cte\" as (with \"terms_cte\" as (select \"course\".\"id\", \"instructor_to_websoc_instructor\".\"instructor_ucinetid\", \n ARRAY_REMOVE(ARRAY_AGG(DISTINCT\n CASE WHEN \"websoc_course\".\"year\" IS NULL THEN NULL\n ELSE CONCAT(\"websoc_course\".\"year\", ' ', \"websoc_course\".\"quarter\")\n END\n ), NULL) as \"terms\" from \"course\" left join \"websoc_course\" on \"websoc_course\".\"course_id\" = \"course\".\"id\" left join \"websoc_section\" on \"websoc_section\".\"course_id\" = \"websoc_course\".\"id\" left join \"websoc_section_to_instructor\" on \"websoc_section_to_instructor\".\"section_id\" = \"websoc_section\".\"id\" left join \"websoc_instructor\" on \"websoc_instructor\".\"name\" = \"websoc_section_to_instructor\".\"instructor_name\" left join \"instructor_to_websoc_instructor\" on \"instructor_to_websoc_instructor\".\"websoc_instructor_name\" = \"websoc_instructor\".\"name\" group by \"course\".\"id\", \"instructor_to_websoc_instructor\".\"instructor_ucinetid\") select \"terms_cte\".\"instructor_ucinetid\", \"course\".\"id\", \n CASE WHEN \"course\".\"id\" IS NULL\n THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'id', \"course\".\"id\",\n 'title', \"course\".\"title\",\n 'department', \"course\".\"department\",\n 'courseNumber', \"course\".\"course_number\",\n 'terms', COALESCE(\"terms\", ARRAY[]::TEXT[])\n )\n END\n as \"course_info\" from \"course\" left join \"terms_cte\" on \"terms_cte\".\"id\" = \"course\".\"id\" group by \"course\".\"id\", \"terms_cte\".\"instructor_ucinetid\", \"terms\") select \"instructor\".\"ucinetid\", \"instructor\".\"name\", \"instructor\".\"title\", \"instructor\".\"email\", \"instructor\".\"department\", COALESCE(\"shortened_names\", ARRAY[]::TEXT[]) as \"shortened_names\", \n ARRAY_REMOVE(ARRAY_AGG(DISTINCT \"course_info\"), NULL)\n as \"courses\" from \"instructor\" left join \"shortened_names_cte\" on \"shortened_names_cte\".\"instructor_ucinetid\" = \"instructor\".\"ucinetid\" left join \"courses_cte\" on \"courses_cte\".\"instructor_ucinetid\" = \"instructor\".\"ucinetid\" where \"instructor\".\"ucinetid\" <> 'student' group by \"instructor\".\"ucinetid\", \"shortened_names\"", - "name": "instructor_view", - "schema": "public", - "isExisting": false, - "materialized": true - } - }, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} diff --git a/packages/db/migrations/meta/_journal.json b/packages/db/migrations/meta/_journal.json index 57d9568d..744e6e7d 100644 --- a/packages/db/migrations/meta/_journal.json +++ b/packages/db/migrations/meta/_journal.json @@ -183,13 +183,6 @@ "when": 1771706013738, "tag": "0025_major_specialization_required", "breakpoints": true - }, - { - "idx": 26, - "version": "7", - "when": 1771828829229, - "tag": "0026_polymorphic majors", - "breakpoints": true } ] } diff --git a/packages/db/src/schema.ts b/packages/db/src/schema.ts index 5b72c627..7f2bb345 100644 --- a/packages/db/src/schema.ts +++ b/packages/db/src/schema.ts @@ -104,10 +104,10 @@ export type DegreeWorksProgram = DegreeWorksProgramId & { }; /** - * (school requirement, major requirement, spec code) triplet, because school requirements can vary by major + * (school, major) pair, because school requirements can vary by major * eventually, we may want degree type; e.g. MFA provides some requirements */ -export type MajorProgram = [DegreeWorksProgram | undefined, DegreeWorksProgram, string | undefined]; +export type MajorProgram = [DegreeWorksProgram | undefined, DegreeWorksProgram]; export type DegreeWorksCourseRequirement = { requirementType: "Course"; From f3ff2d24f9413819147cacd98719e8293923e0a9 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Sun, 22 Feb 2026 23:19:29 -0800 Subject: [PATCH 53/91] Revert "Revert "still push specs into programs"" This reverts commit 517606ca575c79247b92d6ca1ff20f7c835397ef. --- .../data-pipeline/degreeworks-scraper/src/components/Scraper.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts index 4f08dd25..58a3009b 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts @@ -351,6 +351,8 @@ export class Scraper { `(majorCode = ${foundMajorAssured.code}, degree = ${foundMajorAssured.degreeType})`, ); + foundMajorAssured.specs.push(specCode); + foundMajorSpecPairs.push([ [ foundMajorAssured.degreeType?.startsWith("B") ? "U" : "G", From 38d60a861daa0cee465af9e1f8943a6d9c783787 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Mon, 23 Feb 2026 11:31:52 -0800 Subject: [PATCH 54/91] converted programTriplets into programQuadruplets by adding spec code --- .../src/components/Scraper.ts | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts index 58a3009b..2b37e824 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts @@ -20,8 +20,8 @@ import { const JWT_HEADER_PREFIX_LENGTH = 7; -// (school code, major code, degree code) -type ProgramTriplet = [string, string, string]; +// (school code, major code, degree code, spec code) +type ProgramQuadruplet = [string, string, string, string?]; export class Scraper { private ap!: AuditParser; @@ -82,7 +82,7 @@ export class Scraper { * * However, we operate under the assumption that every valid triplet is among the ones returned by this method. * @private */ - private async discoverValidDegrees(): Promise { + private async discoverValidDegrees(): Promise { const [awardTypes, reports] = await Promise.all([ fetch("https://www.reg.uci.edu/mdsd/api/lookups/awardTypes").then((r) => r.json()), fetch("https://www.reg.uci.edu/mdsd/api/reports", { @@ -131,7 +131,7 @@ export class Scraper { .flatMap((ent) => { const withMatchedDegree = this.findDwNameFor(awardTypesMap, ent) .map((dwName) => [ent.school.schoolCode, ent.major.majorCode, dwName]) - .toArray() as ProgramTriplet[]; + .toArray() as ProgramQuadruplet[]; if (withMatchedDegree.length === 0) { console.log( @@ -143,9 +143,9 @@ export class Scraper { }); } - private async scrapePrograms(degrees: Iterable<[ProgramTriplet, string?]>) { + private async scrapePrograms(degrees: Iterable) { const ret = new Map(); - for (const [[schoolCode, majorCode, degreeCode], specCode] of degrees) { + for (const [schoolCode, majorCode, degreeCode, specCode] of degrees) { const audit = await this.dw.getMajorAudit( degreeCode, // bachelor's degrees probably get an abbreviation starting with B @@ -279,7 +279,7 @@ export class Scraper { } console.log("Scraping undergraduate and graduate program requirements"); - this.parsedPrograms = await this.scrapePrograms(validDegrees.map((d) => [d, undefined])); + this.parsedPrograms = await this.scrapePrograms(validDegrees); this.parsedSpecializations = new Map(); console.log("Scraping all specialization requirements"); @@ -294,7 +294,7 @@ export class Scraper { console.log(`loading ${this.specializationCache.size} cached specializations`); this.knownSpecializations = await this.dw.getMapping("specializations"); - const foundMajorSpecPairs: [ProgramTriplet, string][] = []; + const foundMajorSpecPairs: ProgramQuadruplet[] = []; for (const [specCode, specName] of this.knownSpecializations.entries()) { let specBlock: Block | undefined; @@ -308,7 +308,7 @@ export class Scraper { if (got !== null) { specBlock = got.block; - const majorProgram = this.parsedPrograms.get(got.parent.name); + const majorProgram = this.parsedPrograms.get(`${got.parent.name};`); if (majorProgram) { foundMajor = majorProgram[1]; } else { @@ -354,13 +354,11 @@ export class Scraper { foundMajorAssured.specs.push(specCode); foundMajorSpecPairs.push([ - [ - foundMajorAssured.degreeType?.startsWith("B") ? "U" : "G", - foundMajorAssured.code, - foundMajorAssured.degreeType, - ] as ProgramTriplet, + foundMajorAssured.degreeType?.startsWith("B") ? "U" : "G", + foundMajorAssured.code, + foundMajorAssured.degreeType, specCode, - ]); + ] as ProgramQuadruplet); this.specializationCache.set(specCode, { parent: foundMajorAssured, From 1fc8bb63fc2f3df2fee29e63c29a5425be60f7d2 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Mon, 23 Feb 2026 11:51:13 -0800 Subject: [PATCH 55/91] refacotred MajorProgram type to be an object with added specId property --- .../src/components/Scraper.ts | 32 +++++---- .../degreeworks-scraper/src/index.ts | 69 +++++++++++-------- packages/db/src/schema.ts | 9 ++- 3 files changed, 64 insertions(+), 46 deletions(-) diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts index 2b37e824..8510d5c7 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts @@ -170,15 +170,19 @@ export class Scraper { continue; } - ret.set([majorAudit.title, specCode].join(";"), [ - audit?.college + ret.set([majorAudit.title, specCode].join(";"), { + school: audit?.college ? await this.ap.parseBlock( `${schoolCode}-COLLEGE-${majorCode}-${degreeCode}`, audit?.college, ) : undefined, - await this.ap.parseBlock(`${schoolCode}-MAJOR-${majorCode}-${degreeCode}`, majorAudit), - ]); + major: await this.ap.parseBlock( + `${schoolCode}-MAJOR-${majorCode}-${degreeCode}`, + majorAudit, + ), + specId: undefined, + }); console.log( `Requirements block found and parsed for "${majorAudit.title}" ${specCode ? `with spec: ${specCode}` : ""} (majorCode = ${majorCode}, degree = ${degreeCode})`, @@ -198,7 +202,7 @@ export class Scraper { if (specCode === "OACSC") { // "optional american chemical society certification" const inMap = this.parsedPrograms.get("Major in Chemistry") as MajorProgram; - return inMap ? [inMap[1]] : []; + return inMap ? [inMap.major] : []; } // there seems to be a soft convention that specializations are their major code followed by uppercase letters @@ -210,8 +214,8 @@ export class Scraper { const [, maybeMajorCode] = asSuffixedMajorCode; return this.parsedPrograms .entries() - .filter(([_k, [_school, major]]) => major.code === maybeMajorCode) - .map(([_k, [_school, major]]) => major) + .filter(([_k, { major }]) => major.code === maybeMajorCode) + .map(([_k, { major }]) => major) .toArray(); } @@ -310,7 +314,7 @@ export class Scraper { specBlock = got.block; const majorProgram = this.parsedPrograms.get(`${got.parent.name};`); if (majorProgram) { - foundMajor = majorProgram[1]; + foundMajor = majorProgram.major; } else { console.log( `warning: ${specName} has cached relation to non-existant major, ${got.parent.name} (spec code = ${specCode})`, @@ -404,7 +408,7 @@ export class Scraper { // After we match specializations to a major // we ensure that majors with 0 specs don't require a specialization - for (const [, [, major]] of this.parsedPrograms) { + for (const [, { major }] of this.parsedPrograms) { if (major.specs.length === 0) { major.specializationRequired = false; } @@ -412,7 +416,7 @@ export class Scraper { this.degreesAwarded = new Map( Array.from( - new Set(this.parsedPrograms.entries().map(([, [_s, program]]) => program.degreeType ?? "")), + new Set(this.parsedPrograms.entries().map(([, { major }]) => major.degreeType ?? "")), ).map((x): [string, string] => [x, this.degrees?.get(x) ?? ""]), ); // Check that this doesn't break! @@ -427,9 +431,9 @@ export class Scraper { const y = this.parsedSpecializations.get("AHGEO")?.[2]; const z = this.parsedSpecializations.get("AHPER")?.[2]; if (x && y && z) { - x[1].specs = []; - x[1].specializationRequired = false; - x[1].requirements = [...x[1].requirements, ...y.requirements, ...z.requirements]; + x.major.specs = []; + x.major.specializationRequired = false; + x.major.requirements = [...x.major.requirements, ...y.requirements, ...z.requirements]; this.parsedSpecializations.delete("AHGEO"); this.parsedSpecializations.delete("AHPER"); this.parsedPrograms.set("Major in Art History", x); @@ -440,7 +444,7 @@ export class Scraper { const chemE = this.parsedPrograms.get("Major in Chemical Engineering"); if (chemE) { - chemE[1].specializationRequired = false; + chemE.major.specializationRequired = false; } this.done = true; diff --git a/apps/data-pipeline/degreeworks-scraper/src/index.ts b/apps/data-pipeline/degreeworks-scraper/src/index.ts index 9c70d278..dafa6bcc 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/index.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/index.ts @@ -48,39 +48,48 @@ async function main() { const majorSpecData = parsedPrograms .entries() - .map(([k, [college, { name, degreeType, code, requirements, specializationRequired }]]) => { - const specCode = k.split(";")[1] !== "" ? `${degreeType}-${k.split(";")[1]}` : undefined; - let collegeBlockIndex: number | undefined; - if (college?.requirements) { - const wouldInsert = { name: college.name, requirements: college.requirements }; - const existing = collegeBlocks.findIndex((schoolExisting) => { - try { - assert.deepStrictEqual(schoolExisting, wouldInsert); - return true; - } catch { - return false; + .map( + ([ + k, + { + school: college, + major: { name, degreeType, code, requirements, specializationRequired }, + specId, + }, + ]) => { + const specCode = specId?.code; + let collegeBlockIndex: number | undefined; + if (college?.requirements) { + const wouldInsert = { name: college.name, requirements: college.requirements }; + const existing = collegeBlocks.findIndex((schoolExisting) => { + try { + assert.deepStrictEqual(schoolExisting, wouldInsert); + return true; + } catch { + return false; + } + }); + + if (existing === -1) { + collegeBlocks.push(wouldInsert); + collegeBlockIndex = collegeBlocks.length - 1; + } else { + collegeBlockIndex = existing; } - }); - - if (existing === -1) { - collegeBlocks.push(wouldInsert); - collegeBlockIndex = collegeBlocks.length - 1; - } else { - collegeBlockIndex = existing; } - } - return { - id: `${degreeType}-${code}`, - degreeId: degreeType ?? "", - code, - ...(specCode !== undefined ? { specCode } : {}), - name, - specializationRequired, - requirements, - ...(collegeBlockIndex !== undefined ? { collegeBlockIndex } : {}), - }; - }) + return { + id: `${degreeType}-${code}`, + degreeId: degreeType ?? "", + code, + ...(specCode !== undefined ? { specCode } : {}), + name, + specializationRequired, + requirements, + ...(collegeBlockIndex !== undefined ? { collegeBlockIndex } : {}), + }; + }, + ) .toArray(); const majorRequirementBlocks = [] as (typeof majorRequirement.$inferInsert)[]; diff --git a/packages/db/src/schema.ts b/packages/db/src/schema.ts index 7f2bb345..a3d3895d 100644 --- a/packages/db/src/schema.ts +++ b/packages/db/src/schema.ts @@ -104,10 +104,15 @@ export type DegreeWorksProgram = DegreeWorksProgramId & { }; /** - * (school, major) pair, because school requirements can vary by major + * (school, major, spec) tuple, because school requirements can vary by major and major can vary by specialization * eventually, we may want degree type; e.g. MFA provides some requirements */ -export type MajorProgram = [DegreeWorksProgram | undefined, DegreeWorksProgram]; +// export type MajorProgram = [DegreeWorksProgram | undefined, DegreeWorksProgram, DegreeWorksProgramId | undefined]; +export type MajorProgram = { + school: DegreeWorksProgram | undefined; + major: DegreeWorksProgram; + specId: DegreeWorksProgramId | undefined; +}; export type DegreeWorksCourseRequirement = { requirementType: "Course"; From edc450e0da03ebe72195811143e398d5a6a022de Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Mon, 23 Feb 2026 12:27:44 -0800 Subject: [PATCH 56/91] added specId to MajorProgram --- .../src/components/Scraper.ts | 12 ++++++---- .../degreeworks-scraper/src/index.ts | 24 ++++++++----------- packages/db/src/schema.ts | 2 +- 3 files changed, 18 insertions(+), 20 deletions(-) diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts index 8510d5c7..851cc549 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts @@ -181,7 +181,7 @@ export class Scraper { `${schoolCode}-MAJOR-${majorCode}-${degreeCode}`, majorAudit, ), - specId: undefined, + specCode: specCode, }); console.log( @@ -201,7 +201,7 @@ export class Scraper { // as of this commit, this spec is seemingly valid with any major but that's not really true if (specCode === "OACSC") { // "optional american chemical society certification" - const inMap = this.parsedPrograms.get("Major in Chemistry") as MajorProgram; + const inMap = this.parsedPrograms.get("Major in Chemistry;") as MajorProgram; return inMap ? [inMap.major] : []; } @@ -427,7 +427,7 @@ export class Scraper { // cleaner way to address this, but this is such an insanely niche case // that it's probably not worth the effort to write a general solution. - const x = this.parsedPrograms.get("Major in Art History"); + const x = this.parsedPrograms.get("Major in Art History;"); const y = this.parsedSpecializations.get("AHGEO")?.[2]; const z = this.parsedSpecializations.get("AHPER")?.[2]; if (x && y && z) { @@ -436,12 +436,14 @@ export class Scraper { x.major.requirements = [...x.major.requirements, ...y.requirements, ...z.requirements]; this.parsedSpecializations.delete("AHGEO"); this.parsedSpecializations.delete("AHPER"); - this.parsedPrograms.set("Major in Art History", x); + this.parsedPrograms.delete("Major in Art History;AHPER"); + this.parsedPrograms.delete("Major in Art History;AHGEO"); + this.parsedPrograms.set("Major in Art History;", x); } // Chemical Engineering is falsely marked as requiring a specialization (pr#295) - const chemE = this.parsedPrograms.get("Major in Chemical Engineering"); + const chemE = this.parsedPrograms.get("Major in Chemical Engineering;"); if (chemE) { chemE.major.specializationRequired = false; diff --git a/apps/data-pipeline/degreeworks-scraper/src/index.ts b/apps/data-pipeline/degreeworks-scraper/src/index.ts index dafa6bcc..0eb7be05 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/index.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/index.ts @@ -47,17 +47,13 @@ async function main() { const collegeBlocks = [] as (typeof collegeRequirement.$inferInsert)[]; const majorSpecData = parsedPrograms - .entries() + .values() .map( - ([ - k, - { - school: college, - major: { name, degreeType, code, requirements, specializationRequired }, - specId, - }, - ]) => { - const specCode = specId?.code; + ({ + school: college, + major: { name, degreeType, code, requirements, specializationRequired }, + specCode, + }) => { let collegeBlockIndex: number | undefined; if (college?.requirements) { const wouldInsert = { name: college.name, requirements: college.requirements }; @@ -82,7 +78,7 @@ async function main() { id: `${degreeType}-${code}`, degreeId: degreeType ?? "", code, - ...(specCode !== undefined ? { specCode } : {}), + ...(specCode !== undefined ? { specId: `${degreeType}-${specCode}` } : {}), name, specializationRequired, requirements, @@ -93,7 +89,7 @@ async function main() { .toArray(); const majorRequirementBlocks = [] as (typeof majorRequirement.$inferInsert)[]; - const majorSpecToRequirementData = majorSpecData.map(({ id, specCode, requirements }) => { + const majorSpecToRequirementData = majorSpecData.map(({ id, specId, requirements }) => { const wouldInsert = { requirements }; let majorRequirementBlockIndex: number | undefined = undefined; const existing = majorRequirementBlocks.findIndex((req) => { @@ -112,12 +108,12 @@ async function main() { } return { majorId: id, - specId: specCode, + specId, majorRequirementBlockIndex, }; }); - const majorData = majorSpecData.filter(({ specCode }) => specCode === undefined); + const majorData = majorSpecData.filter(({ specId }) => specId === undefined); const minorData = parsedMinorPrograms .values() diff --git a/packages/db/src/schema.ts b/packages/db/src/schema.ts index a3d3895d..fadcda45 100644 --- a/packages/db/src/schema.ts +++ b/packages/db/src/schema.ts @@ -111,7 +111,7 @@ export type DegreeWorksProgram = DegreeWorksProgramId & { export type MajorProgram = { school: DegreeWorksProgram | undefined; major: DegreeWorksProgram; - specId: DegreeWorksProgramId | undefined; + specCode: string | undefined; }; export type DegreeWorksCourseRequirement = { From 00ef310553babe72c81dc649144da7a956a80eb8 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Mon, 23 Feb 2026 12:39:11 -0800 Subject: [PATCH 57/91] moved hard coding of chemE optional spec into audit parser instead of at the end of scrape --- .../degreeworks-scraper/src/components/AuditParser.ts | 9 ++++++++- .../degreeworks-scraper/src/components/Scraper.ts | 8 ++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts b/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts index 7c05c177..16875b0c 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts @@ -162,10 +162,17 @@ export class AuditParser { async checkSpecializationIsRequired(ruleArray: Rule[]) { // Heuristics to determines if a major requires a specialization + + // chemE has false positive because of text list wording and must be excepted + const chemETextList = [ + "16 units of approved technical electives or", + "contact advisor to select a specialization.", + ]; return ruleArray.some((rule) => { return ( rule.ifElsePart === "ElsePart" && - rule.proxyAdvice?.textList.some((x) => AuditParser.specializationMatcher.test(x)) + rule.proxyAdvice?.textList.some((x) => AuditParser.specializationMatcher.test(x)) && + !rule.proxyAdvice?.textList.every((x, i) => x === chemETextList[i]) ); }); } diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts index 851cc549..1de1a8bc 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts @@ -443,11 +443,11 @@ export class Scraper { // Chemical Engineering is falsely marked as requiring a specialization (pr#295) - const chemE = this.parsedPrograms.get("Major in Chemical Engineering;"); + // const chemE = this.parsedPrograms.get("Major in Chemical Engineering;"); - if (chemE) { - chemE.major.specializationRequired = false; - } + // if (chemE) { + // chemE.major.specializationRequired = false; + // } this.done = true; } From 9cc6e460c25eb54ea691bf0357114da6f37ba4fc Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Mon, 23 Feb 2026 15:26:52 -0800 Subject: [PATCH 58/91] added specialization id parameter to rest endpoint for major req --- apps/api/src/schema/programs.ts | 5 +++++ apps/api/src/services/programs.ts | 15 +++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/apps/api/src/schema/programs.ts b/apps/api/src/schema/programs.ts index a584d899..f9b29a1c 100644 --- a/apps/api/src/schema/programs.ts +++ b/apps/api/src/schema/programs.ts @@ -30,6 +30,11 @@ export const majorRequirementsQuerySchema = z.object({ description: "A major ID to query requirements for", example: "BS-201", }), + specId: programIdBase.openapi({ + description: + "fetch major requirement when taking associated specialization with this ID, if provided, ", + example: "BS-201A", + }), }); export const minorRequirementsQuerySchema = z.object({ diff --git a/apps/api/src/services/programs.ts b/apps/api/src/services/programs.ts index 3aaa40e0..b716db76 100644 --- a/apps/api/src/services/programs.ts +++ b/apps/api/src/services/programs.ts @@ -9,12 +9,14 @@ import type { ugradRequirementsQuerySchema, } from "$schema"; import type { database } from "@packages/db"; -import { eq, sql } from "@packages/db/drizzle"; +import { and, eq, sql } from "@packages/db/drizzle"; import { catalogProgram, collegeRequirement, degree, major, + majorRequirement, + majorSpecPairToRequirement, minor, sampleProgramVariation, schoolRequirement, @@ -108,24 +110,29 @@ export class ProgramsService { specialization, }[programType]; - const [got] = await (programType !== "major" + const [got] = await (programType === "major" ? this.db .select({ id: table.id, name: table.name, requirements: table.requirements }) .from(table) + .where(eq(table.id, query.programId)) : this.db .select({ id: major.id, name: major.name, - requirements: major.requirements, + requirements: majorRequirement.requirements, schoolRequirements: { name: collegeRequirement.name, requirements: collegeRequirement.requirements, }, }) .from(major) + .where( + and(eq(major.id, query.programId), eq(majorSpecPairToRequirement.specId, query.specId)), + ) .leftJoin(collegeRequirement, eq(major.collegeRequirement, collegeRequirement.id)) + .leftJoin(majorSpecPairToRequirement, eq(major.id, majorSpecPairToRequirement.majorId)) ) - .where(eq(table.id, query.programId)) + .leftJoin(majorRequirement, eq(majorSpecPairToRequirement.requirementId, majorRequirement.id)) .limit(1); return orNull(got); From 5dfa44a4ff538a125cad9a3902be8ddc1cee45f1 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Mon, 23 Feb 2026 15:45:49 -0800 Subject: [PATCH 59/91] refactored service to not cause compile error --- apps/api/src/services/programs.ts | 57 +++++++++++++++---------------- 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/apps/api/src/services/programs.ts b/apps/api/src/services/programs.ts index b716db76..12a9446f 100644 --- a/apps/api/src/services/programs.ts +++ b/apps/api/src/services/programs.ts @@ -104,37 +104,36 @@ export class ProgramsService { programType: "specialization"; query: z.infer; }) { - const table = { - major, - minor, - specialization, - }[programType]; - - const [got] = await (programType === "major" - ? this.db - .select({ id: table.id, name: table.name, requirements: table.requirements }) - .from(table) - .where(eq(table.id, query.programId)) - : this.db - .select({ - id: major.id, - name: major.name, - requirements: majorRequirement.requirements, - schoolRequirements: { - name: collegeRequirement.name, - requirements: collegeRequirement.requirements, - }, - }) - .from(major) - .where( - and(eq(major.id, query.programId), eq(majorSpecPairToRequirement.specId, query.specId)), - ) - .leftJoin(collegeRequirement, eq(major.collegeRequirement, collegeRequirement.id)) - .leftJoin(majorSpecPairToRequirement, eq(major.id, majorSpecPairToRequirement.majorId)) - ) + if (programType !== "major") { + const table = { + minor, + specialization, + }[programType]; + const [got] = await this.db + .select({ id: table.id, name: table.name, requirements: table.requirements }) + .from(table) + .where(eq(table.id, query.programId)) + .limit(1); + return orNull(got); + } + const [got] = await this.db + .select({ + id: major.id, + name: major.name, + requirements: majorRequirement.requirements, + schoolRequirement: { + name: collegeRequirement.name, + requirements: collegeRequirement.requirements, + }, + }) + .from(major) + .where( + and(eq(major.id, query.programId), eq(majorSpecPairToRequirement.specId, query.specId)), + ) + .leftJoin(collegeRequirement, eq(major.collegeRequirement, collegeRequirement.id)) + .leftJoin(majorSpecPairToRequirement, eq(major.id, majorSpecPairToRequirement.majorId)) .leftJoin(majorRequirement, eq(majorSpecPairToRequirement.requirementId, majorRequirement.id)) .limit(1); - return orNull(got); } From fa724385efc404cbd2ac607e31f20575d89644bf Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Mon, 23 Feb 2026 20:44:39 -0800 Subject: [PATCH 60/91] implemented graphql endpoints --- apps/api/src/graphql/resolvers/programs.ts | 9 ++++++--- apps/api/src/graphql/schema/programs.ts | 7 ++++++- apps/api/src/schema/programs.ts | 2 +- apps/api/src/services/programs.ts | 4 ++-- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/apps/api/src/graphql/resolvers/programs.ts b/apps/api/src/graphql/resolvers/programs.ts index 2b799e11..023a09de 100644 --- a/apps/api/src/graphql/resolvers/programs.ts +++ b/apps/api/src/graphql/resolvers/programs.ts @@ -20,9 +20,12 @@ export const programResolvers = { const service = new ProgramsService(db); const res = await service.getMajorRequirements(parsedArgs); if (!res) - throw new GraphQLError(`Major ${parsedArgs.programId} not found`, { - extensions: { code: "NOT_FOUND" }, - }); + throw new GraphQLError( + `Major ${parsedArgs.programId} with Specialization ${parsedArgs.specializationId} not found`, + { + extensions: { code: "NOT_FOUND" }, + }, + ); return res; }, minor: async (_: unknown, args: { query?: unknown }, { db }: GraphQLContext) => { diff --git a/apps/api/src/graphql/schema/programs.ts b/apps/api/src/graphql/schema/programs.ts index 6a430e6d..9ece29e1 100644 --- a/apps/api/src/graphql/schema/programs.ts +++ b/apps/api/src/graphql/schema/programs.ts @@ -101,6 +101,11 @@ type UgradRequirements @cacheControl(maxAge: 86400) { requirements: [ProgramRequirement!]!, } +input MajorRequirementsQuery { + programId: String! + specializationId: String +} + input ProgramRequirementsQuery { programId: String! } @@ -125,7 +130,7 @@ extend type Query { majors(query: MajorsQuery): [MajorPreview!]! minors(query: MinorsQuery): [MinorPreview!]! specializations(query: SpecializationsQuery): [SpecializationPreview!]! - major(query: ProgramRequirementsQuery!): Major! + major(query: MajorRequirementsQuery!): Major! minor(query: ProgramRequirementsQuery!): Minor! specialization(query: ProgramRequirementsQuery!): Specialization! ugradRequirements(query: UgradRequrementsQuery!): UgradRequirements! diff --git a/apps/api/src/schema/programs.ts b/apps/api/src/schema/programs.ts index f9b29a1c..374ceadf 100644 --- a/apps/api/src/schema/programs.ts +++ b/apps/api/src/schema/programs.ts @@ -30,7 +30,7 @@ export const majorRequirementsQuerySchema = z.object({ description: "A major ID to query requirements for", example: "BS-201", }), - specId: programIdBase.openapi({ + specializationId: programIdBase.nullable().openapi({ description: "fetch major requirement when taking associated specialization with this ID, if provided, ", example: "BS-201A", diff --git a/apps/api/src/services/programs.ts b/apps/api/src/services/programs.ts index 12a9446f..d3a9619c 100644 --- a/apps/api/src/services/programs.ts +++ b/apps/api/src/services/programs.ts @@ -9,7 +9,7 @@ import type { ugradRequirementsQuerySchema, } from "$schema"; import type { database } from "@packages/db"; -import { and, eq, sql } from "@packages/db/drizzle"; +import { eq, sql } from "@packages/db/drizzle"; import { catalogProgram, collegeRequirement, @@ -128,7 +128,7 @@ export class ProgramsService { }) .from(major) .where( - and(eq(major.id, query.programId), eq(majorSpecPairToRequirement.specId, query.specId)), + sql`major.id = ${query.programId} AND (${query.specializationId === null} OR major_spec_pair_to_requirement.spec_id = ${query.specializationId})`, ) .leftJoin(collegeRequirement, eq(major.collegeRequirement, collegeRequirement.id)) .leftJoin(majorSpecPairToRequirement, eq(major.id, majorSpecPairToRequirement.majorId)) From df9425ca9c0bb7a09951618abdb56841070094c9 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Mon, 23 Feb 2026 21:22:55 -0800 Subject: [PATCH 61/91] clearer description for specializationID parameter --- apps/api/src/schema/programs.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/api/src/schema/programs.ts b/apps/api/src/schema/programs.ts index 374ceadf..dec1a9e7 100644 --- a/apps/api/src/schema/programs.ts +++ b/apps/api/src/schema/programs.ts @@ -31,8 +31,7 @@ export const majorRequirementsQuerySchema = z.object({ example: "BS-201", }), specializationId: programIdBase.nullable().openapi({ - description: - "fetch major requirement when taking associated specialization with this ID, if provided, ", + description: "fetch major requirement when taking specialization with this ID, if provided, ", example: "BS-201A", }), }); From 1dc6b07521441b6de32ef8ea83a00b1dfe2cbf78 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Mon, 23 Feb 2026 21:25:02 -0800 Subject: [PATCH 62/91] reorganized conditional structure of services --- apps/api/src/services/programs.ts | 52 +++++++++++++++++-------------- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/apps/api/src/services/programs.ts b/apps/api/src/services/programs.ts index d3a9619c..e92f9ddf 100644 --- a/apps/api/src/services/programs.ts +++ b/apps/api/src/services/programs.ts @@ -104,35 +104,39 @@ export class ProgramsService { programType: "specialization"; query: z.infer; }) { - if (programType !== "major") { - const table = { - minor, - specialization, - }[programType]; + if (programType === "major") { const [got] = await this.db - .select({ id: table.id, name: table.name, requirements: table.requirements }) - .from(table) - .where(eq(table.id, query.programId)) + .select({ + id: major.id, + name: major.name, + requirements: majorRequirement.requirements, + schoolRequirement: { + name: collegeRequirement.name, + requirements: collegeRequirement.requirements, + }, + }) + .from(major) + .where( + sql`major.id = ${query.programId} AND (${query.specializationId === null} OR major_spec_pair_to_requirement.spec_id = ${query.specializationId})`, + ) + .leftJoin(collegeRequirement, eq(major.collegeRequirement, collegeRequirement.id)) + .leftJoin(majorSpecPairToRequirement, eq(major.id, majorSpecPairToRequirement.majorId)) + .leftJoin( + majorRequirement, + eq(majorSpecPairToRequirement.requirementId, majorRequirement.id), + ) .limit(1); return orNull(got); } + + const table = { + minor, + specialization, + }[programType]; const [got] = await this.db - .select({ - id: major.id, - name: major.name, - requirements: majorRequirement.requirements, - schoolRequirement: { - name: collegeRequirement.name, - requirements: collegeRequirement.requirements, - }, - }) - .from(major) - .where( - sql`major.id = ${query.programId} AND (${query.specializationId === null} OR major_spec_pair_to_requirement.spec_id = ${query.specializationId})`, - ) - .leftJoin(collegeRequirement, eq(major.collegeRequirement, collegeRequirement.id)) - .leftJoin(majorSpecPairToRequirement, eq(major.id, majorSpecPairToRequirement.majorId)) - .leftJoin(majorRequirement, eq(majorSpecPairToRequirement.requirementId, majorRequirement.id)) + .select({ id: table.id, name: table.name, requirements: table.requirements }) + .from(table) + .where(eq(table.id, query.programId)) .limit(1); return orNull(got); } From 1d6dd56b30f32b3901f7d2419a6fdd0318b5d109 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Tue, 24 Feb 2026 12:07:01 -0800 Subject: [PATCH 63/91] reset delay on DW client to 1000 --- .../degreeworks-scraper/src/components/DegreeworksClient.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/DegreeworksClient.ts b/apps/data-pipeline/degreeworks-scraper/src/components/DegreeworksClient.ts index 60cd3f68..d7693958 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/DegreeworksClient.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/DegreeworksClient.ts @@ -15,7 +15,7 @@ export class DegreeworksClient { static async new( studentId: string, headers: HeadersInit, - delay = 700, + delay = 1000, ): Promise { const dw = new DegreeworksClient(studentId, headers, delay); /** From fbd2fe42e5e744f42dfa240a89febe1fe86a14ef Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Tue, 24 Feb 2026 12:11:48 -0800 Subject: [PATCH 64/91] removed debugging comments from dw index --- apps/data-pipeline/degreeworks-scraper/src/index.ts | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/apps/data-pipeline/degreeworks-scraper/src/index.ts b/apps/data-pipeline/degreeworks-scraper/src/index.ts index 0eb7be05..d7e0ff3f 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/index.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/index.ts @@ -149,7 +149,6 @@ async function main() { set: conflictUpdateSetAllCols(schoolRequirement), }); } - console.log("Updated GE and UC req"); if (honorsFourRequirementData) { await tx @@ -165,13 +164,11 @@ async function main() { set: conflictUpdateSetAllCols(schoolRequirement), }); } - console.log("Updated School Req"); await tx .insert(degree) .values(degreeData) .onConflictDoUpdate({ target: degree.id, set: conflictUpdateSetAllCols(degree) }); - console.log("Updated Degree Data"); // we need to determine the db ID of school blocks and update major objects accordingly first const collegeBlockIds = await tx @@ -183,7 +180,6 @@ async function main() { }) .returning({ id: collegeRequirement.id }) .then((rows) => rows.map(({ id }) => id)); - console.log("Updated college requirements"); const majorRequirementBlockIds = await tx .insert(majorRequirement) @@ -194,7 +190,6 @@ async function main() { }) .returning({ id: majorRequirement.id }) .then((rows) => rows.map(({ id }) => id)); - console.log("Update Major Requirements"); for (const majorObj of majorData) { if (majorObj.collegeBlockIndex !== undefined) { @@ -202,7 +197,6 @@ async function main() { collegeBlockIds[majorObj.collegeBlockIndex]; } } - console.log("Set college Req on majorData"); for (const majorSpecObj of majorSpecToRequirementData) { if (majorSpecObj.majorRequirementBlockIndex !== undefined) { @@ -210,17 +204,14 @@ async function main() { majorRequirementBlockIds[majorSpecObj.majorRequirementBlockIndex]; } } - console.log("Set majorRequirement Id on majorSpecToRequirementData"); await tx .insert(major) .values(majorData) .onConflictDoUpdate({ target: major.id, set: conflictUpdateSetAllCols(major) }); - console.log("Updated Major"); await tx .insert(minor) .values(minorData) .onConflictDoUpdate({ target: minor.id, set: conflictUpdateSetAllCols(minor) }); - console.log("Updated Minors"); await tx .insert(specialization) .values(specData) @@ -228,7 +219,6 @@ async function main() { target: specialization.id, set: conflictUpdateSetAllCols(specialization), }); - console.log("Updated Specs"); await tx .insert(majorSpecPairToRequirement) @@ -237,7 +227,6 @@ async function main() { target: majorSpecPairToRequirement.id, set: conflictUpdateSetAllCols(majorSpecPairToRequirement), }); - console.log("Updated Major Spec pair to Requirements table"); }); exit(0); } From eff2c3d172ff52943cf081ed952bf00c72cde1cd Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Tue, 24 Feb 2026 12:12:07 -0800 Subject: [PATCH 65/91] changed 'spec' into 'specCode' --- .../degreeworks-scraper/src/components/DegreeworksClient.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/DegreeworksClient.ts b/apps/data-pipeline/degreeworks-scraper/src/components/DegreeworksClient.ts index d7693958..dd8c1ae8 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/DegreeworksClient.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/DegreeworksClient.ts @@ -95,7 +95,7 @@ export class DegreeworksClient { school: string, majorCode: string, college?: string, - spec?: string, + specCode?: string, ): Promise< | { college?: Block; @@ -114,7 +114,7 @@ export class DegreeworksClient { goals: [ { code: "MAJOR", value: majorCode }, ...(college ? [{ code: "COLLEGE", value: college }] : []), - ...(spec ? [{ code: "SPEC", value: spec }] : []), + ...(specCode ? [{ code: "SPEC", value: specCode }] : []), ], }), headers: this.headers, From 046230d516d8d2df4a56efdd88afbba0201f3d80 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Tue, 24 Feb 2026 12:18:07 -0800 Subject: [PATCH 66/91] updated comments in scraper --- .../degreeworks-scraper/src/components/Scraper.ts | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts index 1de1a8bc..663c54ad 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts @@ -36,8 +36,7 @@ export class Scraper { private done = false; private parsedUgradRequirements = new Map(); private parsedMinorPrograms = new Map(); - // both undergrad majors and grad programs; tuple of (school, program) - // both undergrad majors and grad programs; key is tuple of (majorName, specID?), value is tuple of (school, program) + // both undergrad majors and grad programs; key of 'majorName;specCode?' maps to tuple of (school, program) private parsedPrograms = new Map(); // (parent major, name, program object) private parsedSpecializations = new Map< @@ -400,7 +399,6 @@ export class Scraper { } } - // These two blocks might conflict! this.parsedPrograms = new Map([ ...this.parsedPrograms, ...(await this.scrapePrograms(foundMajorSpecPairs)), @@ -419,7 +417,6 @@ export class Scraper { new Set(this.parsedPrograms.entries().map(([, { major }]) => major.degreeType ?? "")), ).map((x): [string, string] => [x, this.degrees?.get(x) ?? ""]), ); - // Check that this doesn't break! // Post-processing steps. // As of this commit, the only program which seems to require both of @@ -441,14 +438,6 @@ export class Scraper { this.parsedPrograms.set("Major in Art History;", x); } - // Chemical Engineering is falsely marked as requiring a specialization (pr#295) - - // const chemE = this.parsedPrograms.get("Major in Chemical Engineering;"); - - // if (chemE) { - // chemE.major.specializationRequired = false; - // } - this.done = true; } get() { From 34c0db817ddb7fe669b5f0d447c433ccb98de1f9 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Tue, 24 Feb 2026 12:23:50 -0800 Subject: [PATCH 67/91] moved chemE optional specialization special case handling into AP --- .../src/components/AuditParser.ts | 12 ++++++++++-- .../degreeworks-scraper/src/components/Scraper.ts | 8 -------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts b/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts index 7c05c177..320299aa 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts @@ -161,11 +161,19 @@ export class AuditParser { } async checkSpecializationIsRequired(ruleArray: Rule[]) { - // Heuristics to determines if a major requires a specialization + // We infer whether a major requires a specialization by searching for a + // conditional rule that matches specific specialization related words. + + // chemE has false positive because of text list wording and must be handled + const chemETextList = [ + "16 units of approved technical electives or", + "contact advisor to select a specialization.", + ]; return ruleArray.some((rule) => { return ( rule.ifElsePart === "ElsePart" && - rule.proxyAdvice?.textList.some((x) => AuditParser.specializationMatcher.test(x)) + rule.proxyAdvice?.textList.some((x) => AuditParser.specializationMatcher.test(x)) && + !rule.proxyAdvice?.textList.every((x, i) => x === chemETextList[i]) ); }); } diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts index 43a71dea..5084fd74 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts @@ -420,14 +420,6 @@ export class Scraper { this.parsedPrograms.set("Major in Art History", x); } - // Chemical Engineering is falsely marked as requiring a specialization (pr#295) - - const chemE = this.parsedPrograms.get("Major in Chemical Engineering"); - - if (chemE) { - chemE[1].specializationRequired = false; - } - this.done = true; } get() { From 9f56859703356c711b2c9b976d8bc609e47e85c9 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Tue, 24 Feb 2026 12:36:38 -0800 Subject: [PATCH 68/91] renamed regex into screaming snake case --- .../src/components/AuditParser.ts | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts b/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts index 320299aa..18c23fa1 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts @@ -9,12 +9,12 @@ import type { import { course } from "@packages/db/schema"; export class AuditParser { - private static readonly specOrOtherMatcher = /"type":"(?:SPEC|OTHER)","value":"\w+"/g; - private static readonly specializationMatcher = + private static readonly SPEC_OR_OTHER_REGEX = /"type":"(?:SPEC|OTHER)","value":"\w+"/g; + private static readonly SPECIALIZATION_ADJACENT_REGEX = /specialization|concentration|emphasis|area|track|major/i; - private static readonly electiveMatcher = /ELECTIVE @+/; - private static readonly wildcardMatcher = /\w@/; - private static readonly rangeMatcher = /-\w+/; + private static readonly ELECTIVE_REGEX = /ELECTIVE @+/; + private static readonly WILDCARD_REGEX = /\w@/; + private static readonly RANGE_REGEX = /-\w+/; constructor(private readonly db: ReturnType) { console.log("[AuditParser.new] AuditParser initialized"); @@ -58,13 +58,13 @@ export class AuditParser { async normalizeCourseId(courseIdLike: string) { // "ELECTIVE @" is typically used as a pseudo-course and can be safely ignored. - if (courseIdLike.match(AuditParser.electiveMatcher)) return []; + if (courseIdLike.match(AuditParser.ELECTIVE_REGEX)) return []; const [department, courseNumber] = courseIdLike.split(" "); if (courseNumber === "@") { // Department-wide wildcards. return this.db.select().from(course).where(eq(course.shortenedDept, department)); } - if (courseNumber.match(AuditParser.wildcardMatcher)) { + if (courseNumber.match(AuditParser.WILDCARD_REGEX)) { // Wildcard course numbers. return await this.db .select() @@ -79,7 +79,7 @@ export class AuditParser { ), ); } - if (courseNumber.match(AuditParser.rangeMatcher)) { + if (courseNumber.match(AuditParser.RANGE_REGEX)) { // Course number ranges. const [minCourseNumber, maxCourseNumber] = courseNumber.split("-"); return await this.db @@ -162,9 +162,9 @@ export class AuditParser { async checkSpecializationIsRequired(ruleArray: Rule[]) { // We infer whether a major requires a specialization by searching for a - // conditional rule that matches specific specialization related words. + // conditional rule with text that matches 'specialization' adjacent words. - // chemE has false positive because of text list wording and must be handled + // False positive on B.S. ChemE must be hardcoded out. const chemETextList = [ "16 units of approved technical electives or", "contact advisor to select a specialization.", @@ -172,7 +172,7 @@ export class AuditParser { return ruleArray.some((rule) => { return ( rule.ifElsePart === "ElsePart" && - rule.proxyAdvice?.textList.some((x) => AuditParser.specializationMatcher.test(x)) && + rule.proxyAdvice?.textList.some((x) => AuditParser.SPECIALIZATION_ADJACENT_REGEX.test(x)) && !rule.proxyAdvice?.textList.every((x, i) => x === chemETextList[i]) ); }); From 7a292e6156b11fba729e9582860b003e9ad332b8 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Tue, 24 Feb 2026 12:36:51 -0800 Subject: [PATCH 69/91] fixed typo --- .../data-pipeline/degreeworks-scraper/src/components/Scraper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts index 5084fd74..f310c74f 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts @@ -311,7 +311,7 @@ export class Scraper { foundMajor = majorProgram[1]; } else { console.log( - `warning: ${specName} has cached relation to non-existant major, ${got.parent.name} (spec code = ${specCode})`, + `warning: ${specName} has cached relation to non-existent major, ${got.parent.name} (spec code = ${specCode})`, ); } } From 8077783890da7b54f6f3a44b0f63e03330b18508 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Fri, 27 Feb 2026 11:24:48 -0800 Subject: [PATCH 70/91] migration --- .../0026_polymorphic_major_requirements.sql | 35 + .../db/migrations/meta/0026_snapshot.json | 4631 +++++++++++++++++ packages/db/migrations/meta/_journal.json | 7 + 3 files changed, 4673 insertions(+) create mode 100644 packages/db/migrations/0026_polymorphic_major_requirements.sql create mode 100644 packages/db/migrations/meta/0026_snapshot.json diff --git a/packages/db/migrations/0026_polymorphic_major_requirements.sql b/packages/db/migrations/0026_polymorphic_major_requirements.sql new file mode 100644 index 00000000..d1ffead3 --- /dev/null +++ b/packages/db/migrations/0026_polymorphic_major_requirements.sql @@ -0,0 +1,35 @@ +CREATE TABLE IF NOT EXISTS "major_requirement" ( + "requirements" jsonb NOT NULL, + "id" bigint PRIMARY KEY GENERATED ALWAYS AS (jsonb_hash_extended(requirements, 0)) STORED NOT NULL +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "major_spec_pair_to_requirement" ( + "id" varchar PRIMARY KEY GENERATED ALWAYS AS ( + CASE WHEN "major_spec_pair_to_requirement"."spec_id" IS NOT NULL + THEN "major_spec_pair_to_requirement"."major_id" || '+' || "major_spec_pair_to_requirement"."spec_id" + ELSE "major_spec_pair_to_requirement"."major_id" + END) STORED NOT NULL, + "major_id" varchar NOT NULL, + "spec_id" varchar, + "requirement_id" bigint +); +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "major_spec_pair_to_requirement" ADD CONSTRAINT "major_spec_pair_to_requirement_major_id_major_id_fk" FOREIGN KEY ("major_id") REFERENCES "public"."major"("id") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "major_spec_pair_to_requirement" ADD CONSTRAINT "major_spec_pair_to_requirement_spec_id_specialization_id_fk" FOREIGN KEY ("spec_id") REFERENCES "public"."specialization"("id") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "major_spec_pair_to_requirement" ADD CONSTRAINT "major_spec_pair_to_requirement_requirement_id_major_requirement_id_fk" FOREIGN KEY ("requirement_id") REFERENCES "public"."major_requirement"("id") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +ALTER TABLE "major" DROP COLUMN IF EXISTS "requirements"; \ No newline at end of file diff --git a/packages/db/migrations/meta/0026_snapshot.json b/packages/db/migrations/meta/0026_snapshot.json new file mode 100644 index 00000000..ff89c46e --- /dev/null +++ b/packages/db/migrations/meta/0026_snapshot.json @@ -0,0 +1,4631 @@ +{ + "id": "b2562c8f-ca46-4e16-9bc2-859c42858f4d", + "prevId": "b6f5eff6-d4a4-413e-841b-efecba276bb7", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.ap_exam": { + "name": "ap_exam", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "catalogue_name": { + "name": "catalogue_name", + "type": "varchar", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.ap_exam_reward": { + "name": "ap_exam_reward", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "units_granted": { + "name": "units_granted", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "elective_units_granted": { + "name": "elective_units_granted", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "ge_1a_courses_granted": { + "name": "ge_1a_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_1b_courses_granted": { + "name": "ge_1b_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_2_courses_granted": { + "name": "ge_2_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_3_courses_granted": { + "name": "ge_3_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_4_courses_granted": { + "name": "ge_4_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_5a_courses_granted": { + "name": "ge_5a_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_5b_courses_granted": { + "name": "ge_5b_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_6_courses_granted": { + "name": "ge_6_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_7_courses_granted": { + "name": "ge_7_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_8_courses_granted": { + "name": "ge_8_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "courses_granted": { + "name": "courses_granted", + "type": "json", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.ap_exam_to_reward": { + "name": "ap_exam_to_reward", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "exam_id": { + "name": "exam_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "score": { + "name": "score", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "reward": { + "name": "reward", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "ap_exam_to_reward_exam_id_score_index": { + "name": "ap_exam_to_reward_exam_id_score_index", + "columns": [ + { + "expression": "exam_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "score", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "ap_exam_to_reward_exam_id_ap_exam_id_fk": { + "name": "ap_exam_to_reward_exam_id_ap_exam_id_fk", + "tableFrom": "ap_exam_to_reward", + "tableTo": "ap_exam", + "columnsFrom": ["exam_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "ap_exam_to_reward_reward_ap_exam_reward_id_fk": { + "name": "ap_exam_to_reward_reward_ap_exam_reward_id_fk", + "tableFrom": "ap_exam_to_reward", + "tableTo": "ap_exam_reward", + "columnsFrom": ["reward"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.calendar_term": { + "name": "calendar_term", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true, + "generated": { + "as": "\"calendar_term\".\"year\" || ' ' || CASE WHEN \"calendar_term\".\"quarter\" = 'Fall' THEN 'Fall' WHEN \"calendar_term\".\"quarter\" = 'Winter' THEN 'Winter' WHEN \"calendar_term\".\"quarter\" = 'Spring' THEN 'Spring' WHEN \"calendar_term\".\"quarter\" = 'Summer1' THEN 'Summer1' WHEN \"calendar_term\".\"quarter\" = 'Summer10wk' THEN 'Summer10wk' WHEN \"calendar_term\".\"quarter\" = 'Summer2' THEN 'Summer2' ELSE '' END", + "type": "stored" + } + }, + "year": { + "name": "year", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "quarter": { + "name": "quarter", + "type": "term", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "instruction_start": { + "name": "instruction_start", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "instruction_end": { + "name": "instruction_end", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "finals_start": { + "name": "finals_start", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "finals_end": { + "name": "finals_end", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "soc_available": { + "name": "soc_available", + "type": "date", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.catalogue_program": { + "name": "catalogue_program", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "program_name": { + "name": "program_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.college_requirement": { + "name": "college_requirement", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "requirements": { + "name": "requirements", + "type": "jsonb", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "college_requirement_requirements_unique": { + "name": "college_requirement_requirements_unique", + "nullsNotDistinct": false, + "columns": ["requirements"] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.course": { + "name": "course", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "department": { + "name": "department", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "shortened_dept": { + "name": "shortened_dept", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "REPLACE(\"course\".\"department\", ' ', '')", + "type": "stored" + } + }, + "department_alias": { + "name": "department_alias", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "course_number": { + "name": "course_number", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_numeric": { + "name": "course_numeric", + "type": "integer", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "CASE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g') WHEN '' THEN 0 ELSE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g')::INTEGER END", + "type": "stored" + } + }, + "school": { + "name": "school", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_level": { + "name": "course_level", + "type": "course_level", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "min_units": { + "name": "min_units", + "type": "numeric(4, 2)", + "primaryKey": false, + "notNull": true + }, + "max_units": { + "name": "max_units", + "type": "numeric(4, 2)", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "department_name": { + "name": "department_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "prerequisite_tree": { + "name": "prerequisite_tree", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "prerequisite_text": { + "name": "prerequisite_text", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "repeatability": { + "name": "repeatability", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "grading_option": { + "name": "grading_option", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "concurrent": { + "name": "concurrent", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "same_as": { + "name": "same_as", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "restriction": { + "name": "restriction", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "overlap": { + "name": "overlap", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "corequisites": { + "name": "corequisites", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "is_ge_1a": { + "name": "is_ge_1a", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_1b": { + "name": "is_ge_1b", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_2": { + "name": "is_ge_2", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_3": { + "name": "is_ge_3", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_4": { + "name": "is_ge_4", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_5a": { + "name": "is_ge_5a", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_5b": { + "name": "is_ge_5b", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_6": { + "name": "is_ge_6", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_7": { + "name": "is_ge_7", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_8": { + "name": "is_ge_8", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "ge_text": { + "name": "ge_text", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "course_search_index": { + "name": "course_search_index", + "columns": [ + { + "expression": "(\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"id\", '')), 'A') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"department\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"department_alias\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"shortened_dept\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"course_number\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"course_numeric\"::TEXT, '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"title\", '')), 'C') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"description\", '')), 'D')\n)", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "gin", + "with": {} + }, + "shortened_dept": { + "name": "shortened_dept", + "columns": [ + { + "expression": "shortened_dept", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.degree": { + "name": "degree", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "division": { + "name": "division", + "type": "division", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.dining_diet_restriction": { + "name": "dining_diet_restriction", + "schema": "", + "columns": { + "dish_id": { + "name": "dish_id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "contains_eggs": { + "name": "contains_eggs", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "contains_fish": { + "name": "contains_fish", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "contains_milk": { + "name": "contains_milk", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "contains_peanuts": { + "name": "contains_peanuts", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "contains_sesame": { + "name": "contains_sesame", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "contains_shellfish": { + "name": "contains_shellfish", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "contains_soy": { + "name": "contains_soy", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "contains_tree_nuts": { + "name": "contains_tree_nuts", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "contains_wheat": { + "name": "contains_wheat", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_gluten_free": { + "name": "is_gluten_free", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_halal": { + "name": "is_halal", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_kosher": { + "name": "is_kosher", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_locally_grown": { + "name": "is_locally_grown", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_organic": { + "name": "is_organic", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_vegan": { + "name": "is_vegan", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_vegetarian": { + "name": "is_vegetarian", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "dining_diet_restriction_dish_id_dining_dish_id_fk": { + "name": "dining_diet_restriction_dish_id_dining_dish_id_fk", + "tableFrom": "dining_diet_restriction", + "tableTo": "dining_dish", + "columnsFrom": ["dish_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.dining_dish": { + "name": "dining_dish", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "station_id": { + "name": "station_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "ingredients": { + "name": "ingredients", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "category": { + "name": "category", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "image_url": { + "name": "image_url", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "dining_dish_station_id_index": { + "name": "dining_dish_station_id_index", + "columns": [ + { + "expression": "station_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "dining_dish_station_id_dining_station_id_fk": { + "name": "dining_dish_station_id_dining_station_id_fk", + "tableFrom": "dining_dish", + "tableTo": "dining_station", + "columnsFrom": ["station_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.dining_dish_to_period": { + "name": "dining_dish_to_period", + "schema": "", + "columns": { + "period_id": { + "name": "period_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "dish_id": { + "name": "dish_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "dining_dish_to_period_period_id_dining_period_id_fk": { + "name": "dining_dish_to_period_period_id_dining_period_id_fk", + "tableFrom": "dining_dish_to_period", + "tableTo": "dining_period", + "columnsFrom": ["period_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "dining_dish_to_period_dish_id_dining_dish_id_fk": { + "name": "dining_dish_to_period_dish_id_dining_dish_id_fk", + "tableFrom": "dining_dish_to_period", + "tableTo": "dining_dish", + "columnsFrom": ["dish_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.dining_event": { + "name": "dining_event", + "schema": "", + "columns": { + "title": { + "name": "title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "image": { + "name": "image", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "restaurant_id": { + "name": "restaurant_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "start": { + "name": "start", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "end": { + "name": "end", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "dining_event_restaurant_id_dining_restaurant_id_fk": { + "name": "dining_event_restaurant_id_dining_restaurant_id_fk", + "tableFrom": "dining_event", + "tableTo": "dining_restaurant", + "columnsFrom": ["restaurant_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "dining_event_pk": { + "name": "dining_event_pk", + "columns": ["title", "restaurant_id", "start"] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.dining_nutrition_info": { + "name": "dining_nutrition_info", + "schema": "", + "columns": { + "dish_id": { + "name": "dish_id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "serving_size": { + "name": "serving_size", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "serving_unit": { + "name": "serving_unit", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "calories": { + "name": "calories", + "type": "numeric(10, 2)", + "primaryKey": false, + "notNull": false + }, + "total_fat_g": { + "name": "total_fat_g", + "type": "numeric(10, 2)", + "primaryKey": false, + "notNull": false + }, + "trans_fat_g": { + "name": "trans_fat_g", + "type": "numeric(10, 2)", + "primaryKey": false, + "notNull": false + }, + "saturated_fat_g": { + "name": "saturated_fat_g", + "type": "numeric(10, 2)", + "primaryKey": false, + "notNull": false + }, + "cholesterol_mg": { + "name": "cholesterol_mg", + "type": "numeric(10, 2)", + "primaryKey": false, + "notNull": false + }, + "sodium_mg": { + "name": "sodium_mg", + "type": "numeric(10, 2)", + "primaryKey": false, + "notNull": false + }, + "total_carbs_g": { + "name": "total_carbs_g", + "type": "numeric(10, 2)", + "primaryKey": false, + "notNull": false + }, + "dietary_fiber_g": { + "name": "dietary_fiber_g", + "type": "numeric(10, 2)", + "primaryKey": false, + "notNull": false + }, + "sugars_g": { + "name": "sugars_g", + "type": "numeric(10, 2)", + "primaryKey": false, + "notNull": false + }, + "protein_g": { + "name": "protein_g", + "type": "numeric(10, 2)", + "primaryKey": false, + "notNull": false + }, + "calcium": { + "name": "calcium", + "type": "numeric(10, 2)", + "primaryKey": false, + "notNull": false + }, + "iron": { + "name": "iron", + "type": "numeric(10, 2)", + "primaryKey": false, + "notNull": false + }, + "vitamin_a": { + "name": "vitamin_a", + "type": "numeric(10, 2)", + "primaryKey": false, + "notNull": false + }, + "vitamin_c": { + "name": "vitamin_c", + "type": "numeric(10, 2)", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "dining_nutrition_info_dish_id_dining_dish_id_fk": { + "name": "dining_nutrition_info_dish_id_dining_dish_id_fk", + "tableFrom": "dining_nutrition_info", + "tableTo": "dining_dish", + "columnsFrom": ["dish_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.dining_period": { + "name": "dining_period", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "adobe_id": { + "name": "adobe_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "date": { + "name": "date", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "restaurant_id": { + "name": "restaurant_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "start_time": { + "name": "start_time", + "type": "time", + "primaryKey": false, + "notNull": true + }, + "end_time": { + "name": "end_time", + "type": "time", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "dining_period_adobe_id_date_restaurant_id_index": { + "name": "dining_period_adobe_id_date_restaurant_id_index", + "columns": [ + { + "expression": "adobe_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "date", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "restaurant_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "dining_period_date_index": { + "name": "dining_period_date_index", + "columns": [ + { + "expression": "date", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "dining_period_restaurant_id_index": { + "name": "dining_period_restaurant_id_index", + "columns": [ + { + "expression": "restaurant_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "dining_period_restaurant_id_dining_restaurant_id_fk": { + "name": "dining_period_restaurant_id_dining_restaurant_id_fk", + "tableFrom": "dining_period", + "tableTo": "dining_restaurant", + "columnsFrom": ["restaurant_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.dining_restaurant": { + "name": "dining_restaurant", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.dining_station": { + "name": "dining_station", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "restaurant_id": { + "name": "restaurant_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "dining_station_restaurant_id_index": { + "name": "dining_station_restaurant_id_index", + "columns": [ + { + "expression": "restaurant_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "dining_station_restaurant_id_dining_restaurant_id_fk": { + "name": "dining_station_restaurant_id_dining_restaurant_id_fk", + "tableFrom": "dining_station", + "tableTo": "dining_restaurant", + "columnsFrom": ["restaurant_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.instructor": { + "name": "instructor", + "schema": "", + "columns": { + "ucinetid": { + "name": "ucinetid", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "email": { + "name": "email", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "department": { + "name": "department", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "instructor_search_index": { + "name": "instructor_search_index", + "columns": [ + { + "expression": "(\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"ucinetid\", '')), 'A') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"name\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"title\", '')), 'B')\n)", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "gin", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.instructor_to_websoc_instructor": { + "name": "instructor_to_websoc_instructor", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "instructor_ucinetid": { + "name": "instructor_ucinetid", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "websoc_instructor_name": { + "name": "websoc_instructor_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "instructor_to_websoc_instructor_instructor_ucinetid_index": { + "name": "instructor_to_websoc_instructor_instructor_ucinetid_index", + "columns": [ + { + "expression": "instructor_ucinetid", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "instructor_to_websoc_instructor_websoc_instructor_name_index": { + "name": "instructor_to_websoc_instructor_websoc_instructor_name_index", + "columns": [ + { + "expression": "websoc_instructor_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "instructor_to_websoc_instructor_instructor_ucinetid_websoc_instructor_name_index": { + "name": "instructor_to_websoc_instructor_instructor_ucinetid_websoc_instructor_name_index", + "columns": [ + { + "expression": "instructor_ucinetid", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "websoc_instructor_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "instructor_to_websoc_instructor_instructor_ucinetid_instructor_ucinetid_fk": { + "name": "instructor_to_websoc_instructor_instructor_ucinetid_instructor_ucinetid_fk", + "tableFrom": "instructor_to_websoc_instructor", + "tableTo": "instructor", + "columnsFrom": ["instructor_ucinetid"], + "columnsTo": ["ucinetid"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "instructor_to_websoc_instructor_websoc_instructor_name_websoc_instructor_name_fk": { + "name": "instructor_to_websoc_instructor_websoc_instructor_name_websoc_instructor_name_fk", + "tableFrom": "instructor_to_websoc_instructor", + "tableTo": "websoc_instructor", + "columnsFrom": ["websoc_instructor_name"], + "columnsTo": ["name"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.larc_section": { + "name": "larc_section", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "course_id": { + "name": "course_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "days_string": { + "name": "days_string", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "time_string": { + "name": "time_string", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "start_time": { + "name": "start_time", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "end_time": { + "name": "end_time", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "instructor": { + "name": "instructor", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "building": { + "name": "building", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "meets_monday": { + "name": "meets_monday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_tuesday": { + "name": "meets_tuesday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_wednesday": { + "name": "meets_wednesday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_thursday": { + "name": "meets_thursday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_friday": { + "name": "meets_friday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_saturday": { + "name": "meets_saturday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_sunday": { + "name": "meets_sunday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": { + "larc_section_course_id_index": { + "name": "larc_section_course_id_index", + "columns": [ + { + "expression": "course_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "larc_section_course_id_websoc_course_id_fk": { + "name": "larc_section_course_id_websoc_course_id_fk", + "tableFrom": "larc_section", + "tableTo": "websoc_course", + "columnsFrom": ["course_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.library_traffic": { + "name": "library_traffic", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true + }, + "library_name": { + "name": "library_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "location_name": { + "name": "location_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "traffic_count": { + "name": "traffic_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "traffic_percentage": { + "name": "traffic_percentage", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "timestamp": { + "name": "timestamp", + "type": "timestamp", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "library_traffic_library_name_index": { + "name": "library_traffic_library_name_index", + "columns": [ + { + "expression": "library_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "library_traffic_location_name_index": { + "name": "library_traffic_location_name_index", + "columns": [ + { + "expression": "location_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.library_traffic_history": { + "name": "library_traffic_history", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "location_id": { + "name": "location_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "traffic_count": { + "name": "traffic_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "traffic_percentage": { + "name": "traffic_percentage", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "timestamp": { + "name": "timestamp", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "library_traffic_history_location_id_timestamp_index": { + "name": "library_traffic_history_location_id_timestamp_index", + "columns": [ + { + "expression": "location_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "timestamp", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "library_traffic_history_location_id_library_traffic_id_fk": { + "name": "library_traffic_history_location_id_library_traffic_id_fk", + "tableFrom": "library_traffic_history", + "tableTo": "library_traffic", + "columnsFrom": ["location_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.major": { + "name": "major", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "degree_id": { + "name": "degree_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "code": { + "name": "code", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "specialization_required": { + "name": "specialization_required", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "college_requirement": { + "name": "college_requirement", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "major_degree_id_index": { + "name": "major_degree_id_index", + "columns": [ + { + "expression": "degree_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "major_college_requirement_index": { + "name": "major_college_requirement_index", + "columns": [ + { + "expression": "college_requirement", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "major_degree_id_degree_id_fk": { + "name": "major_degree_id_degree_id_fk", + "tableFrom": "major", + "tableTo": "degree", + "columnsFrom": ["degree_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "major_college_requirement_college_requirement_id_fk": { + "name": "major_college_requirement_college_requirement_id_fk", + "tableFrom": "major", + "tableTo": "college_requirement", + "columnsFrom": ["college_requirement"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.major_requirement": { + "name": "major_requirement", + "schema": "", + "columns": { + "requirements": { + "name": "requirements", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "id": { + "name": "id", + "type": "bigint", + "primaryKey": true, + "notNull": true, + "generated": { + "as": "jsonb_hash_extended(requirements, 0)", + "type": "stored" + } + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.major_spec_pair_to_requirement": { + "name": "major_spec_pair_to_requirement", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true, + "generated": { + "as": "\n CASE WHEN \"major_spec_pair_to_requirement\".\"spec_id\" IS NOT NULL\n THEN \"major_spec_pair_to_requirement\".\"major_id\" || '+' || \"major_spec_pair_to_requirement\".\"spec_id\"\n ELSE \"major_spec_pair_to_requirement\".\"major_id\"\n END", + "type": "stored" + } + }, + "major_id": { + "name": "major_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "spec_id": { + "name": "spec_id", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "requirement_id": { + "name": "requirement_id", + "type": "bigint", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "major_spec_pair_to_requirement_major_id_major_id_fk": { + "name": "major_spec_pair_to_requirement_major_id_major_id_fk", + "tableFrom": "major_spec_pair_to_requirement", + "tableTo": "major", + "columnsFrom": ["major_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "major_spec_pair_to_requirement_spec_id_specialization_id_fk": { + "name": "major_spec_pair_to_requirement_spec_id_specialization_id_fk", + "tableFrom": "major_spec_pair_to_requirement", + "tableTo": "specialization", + "columnsFrom": ["spec_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "major_spec_pair_to_requirement_requirement_id_major_requirement_id_fk": { + "name": "major_spec_pair_to_requirement_requirement_id_major_requirement_id_fk", + "tableFrom": "major_spec_pair_to_requirement", + "tableTo": "major_requirement", + "columnsFrom": ["requirement_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.minor": { + "name": "minor", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "requirements": { + "name": "requirements", + "type": "json", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.prerequisite": { + "name": "prerequisite", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "dep_dept": { + "name": "dep_dept", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "prerequisite_id": { + "name": "prerequisite_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "dependency_id": { + "name": "dependency_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "prerequisite_dep_dept_index": { + "name": "prerequisite_dep_dept_index", + "columns": [ + { + "expression": "dep_dept", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "prerequisite_prerequisite_id_index": { + "name": "prerequisite_prerequisite_id_index", + "columns": [ + { + "expression": "prerequisite_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "prerequisite_dependency_id_index": { + "name": "prerequisite_dependency_id_index", + "columns": [ + { + "expression": "dependency_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "prerequisite_prerequisite_id_dependency_id_index": { + "name": "prerequisite_prerequisite_id_dependency_id_index", + "columns": [ + { + "expression": "prerequisite_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "dependency_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.sample_program_variation": { + "name": "sample_program_variation", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "program_id": { + "name": "program_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "label": { + "name": "label", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "sample_program": { + "name": "sample_program", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "variation_notes": { + "name": "variation_notes", + "type": "varchar[]", + "primaryKey": false, + "notNull": true, + "default": "ARRAY[]::VARCHAR[]" + } + }, + "indexes": {}, + "foreignKeys": { + "sample_program_variation_program_id_catalogue_program_id_fk": { + "name": "sample_program_variation_program_id_catalogue_program_id_fk", + "tableFrom": "sample_program_variation", + "tableTo": "catalogue_program", + "columnsFrom": ["program_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.school_requirement": { + "name": "school_requirement", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "requirements": { + "name": "requirements", + "type": "json", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.specialization": { + "name": "specialization", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "major_id": { + "name": "major_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "requirements": { + "name": "requirements", + "type": "json", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "specialization_major_id_index": { + "name": "specialization_major_id_index", + "columns": [ + { + "expression": "major_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "specialization_major_id_major_id_fk": { + "name": "specialization_major_id_major_id_fk", + "tableFrom": "specialization", + "tableTo": "major", + "columnsFrom": ["major_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.study_location": { + "name": "study_location", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.study_room": { + "name": "study_room", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "capacity": { + "name": "capacity", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "location": { + "name": "location", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "directions": { + "name": "directions", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "tech_enhanced": { + "name": "tech_enhanced", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "url": { + "name": "url", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "study_location_id": { + "name": "study_location_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "study_room_study_location_id_index": { + "name": "study_room_study_location_id_index", + "columns": [ + { + "expression": "study_location_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "study_room_study_location_id_study_location_id_fk": { + "name": "study_room_study_location_id_study_location_id_fk", + "tableFrom": "study_room", + "tableTo": "study_location", + "columnsFrom": ["study_location_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.study_room_slot": { + "name": "study_room_slot", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "study_room_id": { + "name": "study_room_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "start": { + "name": "start", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "end": { + "name": "end", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "is_available": { + "name": "is_available", + "type": "boolean", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "study_room_slot_study_room_id_index": { + "name": "study_room_slot_study_room_id_index", + "columns": [ + { + "expression": "study_room_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "study_room_slot_study_room_id_start_end_index": { + "name": "study_room_slot_study_room_id_start_end_index", + "columns": [ + { + "expression": "study_room_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "start", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "end", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "study_room_slot_study_room_id_study_room_id_fk": { + "name": "study_room_slot_study_room_id_study_room_id_fk", + "tableFrom": "study_room_slot", + "tableTo": "study_room", + "columnsFrom": ["study_room_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_course": { + "name": "websoc_course", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "department_id": { + "name": "department_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "course_id": { + "name": "course_id", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "REPLACE(\"websoc_course\".\"dept_code\", ' ', '') || \"websoc_course\".\"course_number\"", + "type": "stored" + } + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "year": { + "name": "year", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "quarter": { + "name": "quarter", + "type": "term", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "school_name": { + "name": "school_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "dept_code": { + "name": "dept_code", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_title": { + "name": "course_title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_number": { + "name": "course_number", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_numeric": { + "name": "course_numeric", + "type": "integer", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "CASE REGEXP_REPLACE(\"websoc_course\".\"course_number\", '\\D', '', 'g') WHEN '' THEN 0 ELSE REGEXP_REPLACE(\"websoc_course\".\"course_number\", '\\D', '', 'g')::INTEGER END", + "type": "stored" + } + }, + "course_comment": { + "name": "course_comment", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "prerequisite_link": { + "name": "prerequisite_link", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "is_ge_1a": { + "name": "is_ge_1a", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_1b": { + "name": "is_ge_1b", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_2": { + "name": "is_ge_2", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_3": { + "name": "is_ge_3", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_4": { + "name": "is_ge_4", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_5a": { + "name": "is_ge_5a", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_5b": { + "name": "is_ge_5b", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_6": { + "name": "is_ge_6", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_7": { + "name": "is_ge_7", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_8": { + "name": "is_ge_8", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": { + "websoc_course_department_id_index": { + "name": "websoc_course_department_id_index", + "columns": [ + { + "expression": "department_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_course_id_index": { + "name": "websoc_course_course_id_index", + "columns": [ + { + "expression": "course_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_school_name_dept_code_course_number_course_title_index": { + "name": "websoc_course_year_quarter_school_name_dept_code_course_number_course_title_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "school_name", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "dept_code", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "course_number", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "course_title", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_1a_index": { + "name": "websoc_course_year_quarter_is_ge_1a_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_1a", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_1b_index": { + "name": "websoc_course_year_quarter_is_ge_1b_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_1b", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_2_index": { + "name": "websoc_course_year_quarter_is_ge_2_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_2", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_3_index": { + "name": "websoc_course_year_quarter_is_ge_3_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_3", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_4_index": { + "name": "websoc_course_year_quarter_is_ge_4_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_4", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_5a_index": { + "name": "websoc_course_year_quarter_is_ge_5a_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_5a", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_5b_index": { + "name": "websoc_course_year_quarter_is_ge_5b_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_5b", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_6_index": { + "name": "websoc_course_year_quarter_is_ge_6_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_6", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_7_index": { + "name": "websoc_course_year_quarter_is_ge_7_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_7", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_8_index": { + "name": "websoc_course_year_quarter_is_ge_8_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_8", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_dept_code_index": { + "name": "websoc_course_year_quarter_dept_code_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "dept_code", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_dept_code_course_number_index": { + "name": "websoc_course_year_quarter_dept_code_course_number_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "dept_code", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "course_number", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_course_department_id_websoc_department_id_fk": { + "name": "websoc_course_department_id_websoc_department_id_fk", + "tableFrom": "websoc_course", + "tableTo": "websoc_department", + "columnsFrom": ["department_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_department": { + "name": "websoc_department", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "school_id": { + "name": "school_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "year": { + "name": "year", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "quarter": { + "name": "quarter", + "type": "term", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "dept_code": { + "name": "dept_code", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "dept_name": { + "name": "dept_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "dept_comment": { + "name": "dept_comment", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "section_code_range_comments": { + "name": "section_code_range_comments", + "type": "text[]", + "primaryKey": false, + "notNull": true + }, + "course_number_range_comments": { + "name": "course_number_range_comments", + "type": "text[]", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "websoc_department_school_id_index": { + "name": "websoc_department_school_id_index", + "columns": [ + { + "expression": "school_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_department_year_quarter_school_id_dept_code_index": { + "name": "websoc_department_year_quarter_school_id_dept_code_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "school_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "dept_code", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_department_school_id_websoc_school_id_fk": { + "name": "websoc_department_school_id_websoc_school_id_fk", + "tableFrom": "websoc_department", + "tableTo": "websoc_school", + "columnsFrom": ["school_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_instructor": { + "name": "websoc_instructor", + "schema": "", + "columns": { + "name": { + "name": "name", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_location": { + "name": "websoc_location", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "building": { + "name": "building", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "room": { + "name": "room", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "websoc_location_building_room_index": { + "name": "websoc_location_building_room_index", + "columns": [ + { + "expression": "building", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "room", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_meta": { + "name": "websoc_meta", + "schema": "", + "columns": { + "name": { + "name": "name", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "last_scraped": { + "name": "last_scraped", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "last_dept_scraped": { + "name": "last_dept_scraped", + "type": "varchar", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_school": { + "name": "websoc_school", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "year": { + "name": "year", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "quarter": { + "name": "quarter", + "type": "term", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "school_name": { + "name": "school_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "school_comment": { + "name": "school_comment", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "websoc_school_year_quarter_school_name_index": { + "name": "websoc_school_year_quarter_school_name_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "school_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_section": { + "name": "websoc_section", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "course_id": { + "name": "course_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "year": { + "name": "year", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "quarter": { + "name": "quarter", + "type": "term", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "units": { + "name": "units", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "websoc_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "instructors": { + "name": "instructors", + "type": "text[]", + "primaryKey": false, + "notNull": true + }, + "meetings": { + "name": "meetings", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "final_exam_string": { + "name": "final_exam_string", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "final_exam": { + "name": "final_exam", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "section_num": { + "name": "section_num", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "max_capacity": { + "name": "max_capacity", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "section_code": { + "name": "section_code", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "section_type": { + "name": "section_type", + "type": "websoc_section_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "num_requested": { + "name": "num_requested", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "restriction_string": { + "name": "restriction_string", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "restriction_a": { + "name": "restriction_a", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_b": { + "name": "restriction_b", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_c": { + "name": "restriction_c", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_d": { + "name": "restriction_d", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_e": { + "name": "restriction_e", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_f": { + "name": "restriction_f", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_g": { + "name": "restriction_g", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_h": { + "name": "restriction_h", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_i": { + "name": "restriction_i", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_j": { + "name": "restriction_j", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_k": { + "name": "restriction_k", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_l": { + "name": "restriction_l", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_m": { + "name": "restriction_m", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_n": { + "name": "restriction_n", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_o": { + "name": "restriction_o", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_r": { + "name": "restriction_r", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_s": { + "name": "restriction_s", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_x": { + "name": "restriction_x", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "num_on_waitlist": { + "name": "num_on_waitlist", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_waitlist_cap": { + "name": "num_waitlist_cap", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "section_comment": { + "name": "section_comment", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "num_new_only_reserved": { + "name": "num_new_only_reserved", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_currently_total_enrolled": { + "name": "num_currently_total_enrolled", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_currently_section_enrolled": { + "name": "num_currently_section_enrolled", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "is_cancelled": { + "name": "is_cancelled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "\"websoc_section\".\"section_comment\" LIKE '%*** CANCELLED ***%' OR \"websoc_section\".\"section_comment\" LIKE '%*** CANCELED ***%'", + "type": "stored" + } + }, + "web_url": { + "name": "web_url", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "''" + } + }, + "indexes": { + "websoc_section_course_id_index": { + "name": "websoc_section_course_id_index", + "columns": [ + { + "expression": "course_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_section_year_quarter_section_code_index": { + "name": "websoc_section_year_quarter_section_code_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "section_code", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_section_course_id_websoc_course_id_fk": { + "name": "websoc_section_course_id_websoc_course_id_fk", + "tableFrom": "websoc_section", + "tableTo": "websoc_course", + "columnsFrom": ["course_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_section_enrollment": { + "name": "websoc_section_enrollment", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "section_id": { + "name": "section_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "date", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "year": { + "name": "year", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "quarter": { + "name": "quarter", + "type": "term", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "max_capacity": { + "name": "max_capacity", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "num_currently_total_enrolled": { + "name": "num_currently_total_enrolled", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_on_waitlist": { + "name": "num_on_waitlist", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_waitlist_cap": { + "name": "num_waitlist_cap", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_requested": { + "name": "num_requested", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_new_only_reserved": { + "name": "num_new_only_reserved", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "websoc_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "websoc_section_enrollment_section_id_index": { + "name": "websoc_section_enrollment_section_id_index", + "columns": [ + { + "expression": "section_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_section_enrollment_section_id_created_at_index": { + "name": "websoc_section_enrollment_section_id_created_at_index", + "columns": [ + { + "expression": "section_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_section_enrollment_section_id_websoc_section_id_fk": { + "name": "websoc_section_enrollment_section_id_websoc_section_id_fk", + "tableFrom": "websoc_section_enrollment", + "tableTo": "websoc_section", + "columnsFrom": ["section_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_section_grade": { + "name": "websoc_section_grade", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "section_id": { + "name": "section_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "grade_a_count": { + "name": "grade_a_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_b_count": { + "name": "grade_b_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_c_count": { + "name": "grade_c_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_d_count": { + "name": "grade_d_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_f_count": { + "name": "grade_f_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_p_count": { + "name": "grade_p_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_np_count": { + "name": "grade_np_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_w_count": { + "name": "grade_w_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "average_gpa": { + "name": "average_gpa", + "type": "numeric(3, 2)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "websoc_section_grade_section_id_index": { + "name": "websoc_section_grade_section_id_index", + "columns": [ + { + "expression": "section_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_section_grade_section_id_websoc_section_id_fk": { + "name": "websoc_section_grade_section_id_websoc_section_id_fk", + "tableFrom": "websoc_section_grade", + "tableTo": "websoc_section", + "columnsFrom": ["section_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "websoc_section_grade_section_id_unique": { + "name": "websoc_section_grade_section_id_unique", + "nullsNotDistinct": false, + "columns": ["section_id"] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_section_meeting": { + "name": "websoc_section_meeting", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "section_id": { + "name": "section_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "section_code": { + "name": "section_code", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "meeting_index": { + "name": "meeting_index", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "time_string": { + "name": "time_string", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "time_is_tba": { + "name": "time_is_tba", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "\"websoc_section_meeting\".\"time_string\" LIKE '%TBA%'", + "type": "stored" + } + }, + "start_time": { + "name": "start_time", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "end_time": { + "name": "end_time", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "days_string": { + "name": "days_string", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "meets_monday": { + "name": "meets_monday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_tuesday": { + "name": "meets_tuesday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_wednesday": { + "name": "meets_wednesday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_thursday": { + "name": "meets_thursday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_friday": { + "name": "meets_friday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_saturday": { + "name": "meets_saturday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_sunday": { + "name": "meets_sunday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": { + "websoc_section_meeting_section_id_index": { + "name": "websoc_section_meeting_section_id_index", + "columns": [ + { + "expression": "section_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_section_meeting_section_id_websoc_section_id_fk": { + "name": "websoc_section_meeting_section_id_websoc_section_id_fk", + "tableFrom": "websoc_section_meeting", + "tableTo": "websoc_section", + "columnsFrom": ["section_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_section_meeting_to_location": { + "name": "websoc_section_meeting_to_location", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "meeting_id": { + "name": "meeting_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "location_id": { + "name": "location_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "websoc_section_meeting_to_location_meeting_id_index": { + "name": "websoc_section_meeting_to_location_meeting_id_index", + "columns": [ + { + "expression": "meeting_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_section_meeting_to_location_location_id_index": { + "name": "websoc_section_meeting_to_location_location_id_index", + "columns": [ + { + "expression": "location_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_section_meeting_to_location_meeting_id_location_id_index": { + "name": "websoc_section_meeting_to_location_meeting_id_location_id_index", + "columns": [ + { + "expression": "meeting_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "location_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_section_meeting_to_location_meeting_id_websoc_section_meeting_id_fk": { + "name": "websoc_section_meeting_to_location_meeting_id_websoc_section_meeting_id_fk", + "tableFrom": "websoc_section_meeting_to_location", + "tableTo": "websoc_section_meeting", + "columnsFrom": ["meeting_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "websoc_section_meeting_to_location_location_id_websoc_location_id_fk": { + "name": "websoc_section_meeting_to_location_location_id_websoc_location_id_fk", + "tableFrom": "websoc_section_meeting_to_location", + "tableTo": "websoc_location", + "columnsFrom": ["location_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_section_to_instructor": { + "name": "websoc_section_to_instructor", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "section_id": { + "name": "section_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "instructor_name": { + "name": "instructor_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "websoc_section_to_instructor_section_id_index": { + "name": "websoc_section_to_instructor_section_id_index", + "columns": [ + { + "expression": "section_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_section_to_instructor_instructor_name_index": { + "name": "websoc_section_to_instructor_instructor_name_index", + "columns": [ + { + "expression": "instructor_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_section_to_instructor_section_id_websoc_section_id_fk": { + "name": "websoc_section_to_instructor_section_id_websoc_section_id_fk", + "tableFrom": "websoc_section_to_instructor", + "tableTo": "websoc_section", + "columnsFrom": ["section_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "websoc_section_to_instructor_instructor_name_websoc_instructor_name_fk": { + "name": "websoc_section_to_instructor_instructor_name_websoc_instructor_name_fk", + "tableFrom": "websoc_section_to_instructor", + "tableTo": "websoc_instructor", + "columnsFrom": ["instructor_name"], + "columnsTo": ["name"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": { + "public.course_level": { + "name": "course_level", + "schema": "public", + "values": ["LowerDiv", "UpperDiv", "Graduate"] + }, + "public.division": { + "name": "division", + "schema": "public", + "values": ["Undergraduate", "Graduate"] + }, + "public.term": { + "name": "term", + "schema": "public", + "values": ["Fall", "Winter", "Spring", "Summer1", "Summer10wk", "Summer2"] + }, + "public.websoc_section_type": { + "name": "websoc_section_type", + "schema": "public", + "values": [ + "Act", + "Col", + "Dis", + "Fld", + "Lab", + "Lec", + "Qiz", + "Res", + "Sem", + "Stu", + "Tap", + "Tut" + ] + }, + "public.websoc_status": { + "name": "websoc_status", + "schema": "public", + "values": ["OPEN", "Waitl", "FULL", "NewOnly"] + } + }, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": { + "public.course_view": { + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "department": { + "name": "department", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "shortened_dept": { + "name": "shortened_dept", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "REPLACE(\"course\".\"department\", ' ', '')", + "type": "stored" + } + }, + "department_alias": { + "name": "department_alias", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "course_number": { + "name": "course_number", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_numeric": { + "name": "course_numeric", + "type": "integer", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "CASE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g') WHEN '' THEN 0 ELSE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g')::INTEGER END", + "type": "stored" + } + }, + "school": { + "name": "school", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_level": { + "name": "course_level", + "type": "course_level", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "min_units": { + "name": "min_units", + "type": "numeric(4, 2)", + "primaryKey": false, + "notNull": true + }, + "max_units": { + "name": "max_units", + "type": "numeric(4, 2)", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "department_name": { + "name": "department_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "prerequisite_tree": { + "name": "prerequisite_tree", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "prerequisite_text": { + "name": "prerequisite_text", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "repeatability": { + "name": "repeatability", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "grading_option": { + "name": "grading_option", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "concurrent": { + "name": "concurrent", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "same_as": { + "name": "same_as", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "restriction": { + "name": "restriction", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "overlap": { + "name": "overlap", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "corequisites": { + "name": "corequisites", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "is_ge_1a": { + "name": "is_ge_1a", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_1b": { + "name": "is_ge_1b", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_2": { + "name": "is_ge_2", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_3": { + "name": "is_ge_3", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_4": { + "name": "is_ge_4", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_5a": { + "name": "is_ge_5a", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_5b": { + "name": "is_ge_5b", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_6": { + "name": "is_ge_6", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_7": { + "name": "is_ge_7", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_8": { + "name": "is_ge_8", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "ge_text": { + "name": "ge_text", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "definition": "select \"course\".\"id\", \"course\".\"updated_at\", \"course\".\"department\", \"course\".\"shortened_dept\", \"course\".\"department_alias\", \"course\".\"course_number\", \"course\".\"course_numeric\", \"course\".\"school\", \"course\".\"title\", \"course\".\"course_level\", \"course\".\"min_units\", \"course\".\"max_units\", \"course\".\"description\", \"course\".\"department_name\", \"course\".\"prerequisite_tree\", \"course\".\"prerequisite_text\", \"course\".\"repeatability\", \"course\".\"grading_option\", \"course\".\"concurrent\", \"course\".\"same_as\", \"course\".\"restriction\", \"course\".\"overlap\", \"course\".\"corequisites\", \"course\".\"is_ge_1a\", \"course\".\"is_ge_1b\", \"course\".\"is_ge_2\", \"course\".\"is_ge_3\", \"course\".\"is_ge_4\", \"course\".\"is_ge_5a\", \"course\".\"is_ge_5b\", \"course\".\"is_ge_6\", \"course\".\"is_ge_7\", \"course\".\"is_ge_8\", \"course\".\"ge_text\", \n ARRAY_REMOVE(COALESCE(\n (\n SELECT ARRAY_AGG(\n CASE WHEN \"prerequisite_course\".\"id\" IS NULL THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'id', \"prerequisite_course\".\"id\",\n 'title', \"prerequisite_course\".\"title\",\n 'department', \"prerequisite_course\".\"department\",\n 'courseNumber', \"prerequisite_course\".\"course_number\"\n )\n END\n )\n FROM \"prerequisite\"\n LEFT JOIN \"course\" \"prerequisite_course\" ON \"prerequisite_course\".\"id\" = \"prerequisite\".\"prerequisite_id\"\n WHERE \"prerequisite\".\"dependency_id\" = \"course\".\"id\"\n ),\n ARRAY[]::JSONB[]), NULL)\n as \"prerequisites\", \n ARRAY_REMOVE(COALESCE(\n (\n SELECT ARRAY_AGG(\n CASE WHEN \"dependency_course\".\"id\" IS NULL THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'id', \"dependency_course\".\"id\",\n 'title', \"dependency_course\".\"title\",\n 'department', \"dependency_course\".\"department\",\n 'courseNumber', \"dependency_course\".\"course_number\"\n )\n END\n )\n FROM \"prerequisite\" \"dependency\"\n LEFT JOIN \"course\" \"dependency_course\" ON \"dependency_course\".\"id\" = \"dependency\".\"dependency_id\"\n WHERE \"dependency\".\"prerequisite_id\" = \"course\".\"id\"\n ),\n ARRAY[]::JSONB[]), NULL)\n as \"dependencies\", \n ARRAY_REMOVE(ARRAY_AGG(DISTINCT\n CASE WHEN \"websoc_course\".\"year\" IS NULL THEN NULL\n ELSE CONCAT(\"websoc_course\".\"year\", ' ', \"websoc_course\".\"quarter\")\n END\n ), NULL)\n as \"terms\", \n ARRAY_REMOVE(COALESCE(ARRAY_AGG(DISTINCT\n CASE WHEN \"instructor\".\"ucinetid\" IS NULL THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'ucinetid', \"instructor\".\"ucinetid\",\n 'name', \"instructor\".\"name\",\n 'title', \"instructor\".\"title\",\n 'email', \"instructor\".\"email\",\n 'department', \"instructor\".\"department\",\n 'shortenedNames', ARRAY(\n SELECT \"instructor_to_websoc_instructor\".\"websoc_instructor_name\"\n FROM \"instructor_to_websoc_instructor\"\n WHERE \"instructor_to_websoc_instructor\".\"instructor_ucinetid\" = \"instructor\".\"ucinetid\"\n )\n )\n END\n ), ARRAY[]::JSONB[]), NULL)\n as \"instructors\" from \"course\" left join \"websoc_course\" on \"websoc_course\".\"course_id\" = \"course\".\"id\" left join \"websoc_section\" on \"websoc_section\".\"course_id\" = \"websoc_course\".\"id\" left join \"websoc_section_to_instructor\" on \"websoc_section_to_instructor\".\"section_id\" = \"websoc_section\".\"id\" left join \"websoc_instructor\" on \"websoc_instructor\".\"name\" = \"websoc_section_to_instructor\".\"instructor_name\" left join \"instructor_to_websoc_instructor\" on \"instructor_to_websoc_instructor\".\"websoc_instructor_name\" = \"websoc_instructor\".\"name\" left join \"instructor\" on (\"instructor\".\"ucinetid\" = \"instructor_to_websoc_instructor\".\"instructor_ucinetid\" and \"instructor\".\"ucinetid\" is not null and \"instructor\".\"ucinetid\" <> 'student') group by \"course\".\"id\"", + "name": "course_view", + "schema": "public", + "isExisting": false, + "materialized": true + }, + "public.instructor_view": { + "columns": { + "ucinetid": { + "name": "ucinetid", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "email": { + "name": "email", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "department": { + "name": "department", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "definition": "with \"shortened_names_cte\" as (select \"instructor_ucinetid\", ARRAY_AGG(\"websoc_instructor_name\") as \"shortened_names\" from \"instructor_to_websoc_instructor\" group by \"instructor_to_websoc_instructor\".\"instructor_ucinetid\"), \"courses_cte\" as (with \"terms_cte\" as (select \"course\".\"id\", \"instructor_to_websoc_instructor\".\"instructor_ucinetid\", \n ARRAY_REMOVE(ARRAY_AGG(DISTINCT\n CASE WHEN \"websoc_course\".\"year\" IS NULL THEN NULL\n ELSE CONCAT(\"websoc_course\".\"year\", ' ', \"websoc_course\".\"quarter\")\n END\n ), NULL) as \"terms\" from \"course\" left join \"websoc_course\" on \"websoc_course\".\"course_id\" = \"course\".\"id\" left join \"websoc_section\" on \"websoc_section\".\"course_id\" = \"websoc_course\".\"id\" left join \"websoc_section_to_instructor\" on \"websoc_section_to_instructor\".\"section_id\" = \"websoc_section\".\"id\" left join \"websoc_instructor\" on \"websoc_instructor\".\"name\" = \"websoc_section_to_instructor\".\"instructor_name\" left join \"instructor_to_websoc_instructor\" on \"instructor_to_websoc_instructor\".\"websoc_instructor_name\" = \"websoc_instructor\".\"name\" group by \"course\".\"id\", \"instructor_to_websoc_instructor\".\"instructor_ucinetid\") select \"terms_cte\".\"instructor_ucinetid\", \"course\".\"id\", \n CASE WHEN \"course\".\"id\" IS NULL\n THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'id', \"course\".\"id\",\n 'title', \"course\".\"title\",\n 'department', \"course\".\"department\",\n 'courseNumber', \"course\".\"course_number\",\n 'terms', COALESCE(\"terms\", ARRAY[]::TEXT[])\n )\n END\n as \"course_info\" from \"course\" left join \"terms_cte\" on \"terms_cte\".\"id\" = \"course\".\"id\" group by \"course\".\"id\", \"terms_cte\".\"instructor_ucinetid\", \"terms\") select \"instructor\".\"ucinetid\", \"instructor\".\"name\", \"instructor\".\"title\", \"instructor\".\"email\", \"instructor\".\"department\", COALESCE(\"shortened_names\", ARRAY[]::TEXT[]) as \"shortened_names\", \n ARRAY_REMOVE(ARRAY_AGG(DISTINCT \"course_info\"), NULL)\n as \"courses\" from \"instructor\" left join \"shortened_names_cte\" on \"shortened_names_cte\".\"instructor_ucinetid\" = \"instructor\".\"ucinetid\" left join \"courses_cte\" on \"courses_cte\".\"instructor_ucinetid\" = \"instructor\".\"ucinetid\" where \"instructor\".\"ucinetid\" <> 'student' group by \"instructor\".\"ucinetid\", \"shortened_names\"", + "name": "instructor_view", + "schema": "public", + "isExisting": false, + "materialized": true + } + }, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} diff --git a/packages/db/migrations/meta/_journal.json b/packages/db/migrations/meta/_journal.json index 744e6e7d..73bb7d6b 100644 --- a/packages/db/migrations/meta/_journal.json +++ b/packages/db/migrations/meta/_journal.json @@ -183,6 +183,13 @@ "when": 1771706013738, "tag": "0025_major_specialization_required", "breakpoints": true + }, + { + "idx": 26, + "version": "7", + "when": 1772218836155, + "tag": "0026_polymorphic_major_requirements", + "breakpoints": true } ] } From 10e8e998a0db5aa5898e0ed78c4943b8505208e8 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Sun, 1 Mar 2026 15:36:22 -0800 Subject: [PATCH 71/91] goldylocks --- .../degreeworks-scraper/src/components/AuditParser.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts b/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts index 18c23fa1..19b23c50 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts @@ -162,9 +162,10 @@ export class AuditParser { async checkSpecializationIsRequired(ruleArray: Rule[]) { // We infer whether a major requires a specialization by searching for a - // conditional rule with text that matches 'specialization' adjacent words. + // conditional rule with text that matches 'specialization' like words. - // False positive on B.S. ChemE must be hardcoded out. + // Hard-code out false positive on B.S. ChemE, because the requirement can be fulfilled with 16 units + // instead. const chemETextList = [ "16 units of approved technical electives or", "contact advisor to select a specialization.", From afce1a07265d48abc78a9c312bb074d542504d4e Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Sun, 1 Mar 2026 15:38:18 -0800 Subject: [PATCH 72/91] spellcheck TT --- .../degreeworks-scraper/src/components/AuditParser.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts b/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts index 19b23c50..50ec429e 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/AuditParser.ts @@ -162,10 +162,10 @@ export class AuditParser { async checkSpecializationIsRequired(ruleArray: Rule[]) { // We infer whether a major requires a specialization by searching for a - // conditional rule with text that matches 'specialization' like words. + // conditional rule with text that matches words related to "specialization." - // Hard-code out false positive on B.S. ChemE, because the requirement can be fulfilled with 16 units - // instead. + // Hard-code exclusion for B.S. ChemE, because the requirement can instead be + // fulfilled with 16 units. const chemETextList = [ "16 units of approved technical electives or", "contact advisor to select a specialization.", From 00b64ac65c7a81fb1f0bc2be47472f07906363e9 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Sun, 1 Mar 2026 15:56:23 -0800 Subject: [PATCH 73/91] cleaned up comment in schema for MajorProgram Type --- packages/db/src/schema.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/db/src/schema.ts b/packages/db/src/schema.ts index fadcda45..4444a7a9 100644 --- a/packages/db/src/schema.ts +++ b/packages/db/src/schema.ts @@ -104,10 +104,9 @@ export type DegreeWorksProgram = DegreeWorksProgramId & { }; /** - * (school, major, spec) tuple, because school requirements can vary by major and major can vary by specialization + * school requirements can vary by major and major requirements can vary by specialization * eventually, we may want degree type; e.g. MFA provides some requirements */ -// export type MajorProgram = [DegreeWorksProgram | undefined, DegreeWorksProgram, DegreeWorksProgramId | undefined]; export type MajorProgram = { school: DegreeWorksProgram | undefined; major: DegreeWorksProgram; From f3f4092280eb24bb280b4d3d754a84f1c602b86b Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Sun, 1 Mar 2026 17:44:53 -0800 Subject: [PATCH 74/91] graphql specializationId is optional --- apps/api/src/schema/programs.ts | 2 +- apps/api/src/services/programs.ts | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/apps/api/src/schema/programs.ts b/apps/api/src/schema/programs.ts index dec1a9e7..07652d48 100644 --- a/apps/api/src/schema/programs.ts +++ b/apps/api/src/schema/programs.ts @@ -30,7 +30,7 @@ export const majorRequirementsQuerySchema = z.object({ description: "A major ID to query requirements for", example: "BS-201", }), - specializationId: programIdBase.nullable().openapi({ + specializationId: programIdBase.optional().openapi({ description: "fetch major requirement when taking specialization with this ID, if provided, ", example: "BS-201A", }), diff --git a/apps/api/src/services/programs.ts b/apps/api/src/services/programs.ts index e92f9ddf..a043caf1 100644 --- a/apps/api/src/services/programs.ts +++ b/apps/api/src/services/programs.ts @@ -9,7 +9,7 @@ import type { ugradRequirementsQuerySchema, } from "$schema"; import type { database } from "@packages/db"; -import { eq, sql } from "@packages/db/drizzle"; +import { and, eq, sql } from "@packages/db/drizzle"; import { catalogProgram, collegeRequirement, @@ -117,7 +117,12 @@ export class ProgramsService { }) .from(major) .where( - sql`major.id = ${query.programId} AND (${query.specializationId === null} OR major_spec_pair_to_requirement.spec_id = ${query.specializationId})`, + and( + sql`major.id=${query.programId}`, + query.specializationId + ? sql`major_spec_pair_to_requirement.spec_id = ${query.specializationId}` + : undefined, + ), ) .leftJoin(collegeRequirement, eq(major.collegeRequirement, collegeRequirement.id)) .leftJoin(majorSpecPairToRequirement, eq(major.id, majorSpecPairToRequirement.majorId)) From 493da8f5c5c351cf9eaf723c7b9990b1d804b331 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Mon, 2 Mar 2026 11:50:55 -0800 Subject: [PATCH 75/91] fixed schoolRequirement typo --- apps/api/src/services/programs.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/api/src/services/programs.ts b/apps/api/src/services/programs.ts index a043caf1..0f7eb0f5 100644 --- a/apps/api/src/services/programs.ts +++ b/apps/api/src/services/programs.ts @@ -110,7 +110,7 @@ export class ProgramsService { id: major.id, name: major.name, requirements: majorRequirement.requirements, - schoolRequirement: { + schoolRequirements: { name: collegeRequirement.name, requirements: collegeRequirement.requirements, }, From b2d1778fd91332198c977df07b1f15f2721b0b89 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Mon, 2 Mar 2026 11:57:55 -0800 Subject: [PATCH 76/91] changed response for when a major spec pair is not found --- apps/api/src/rest/routes/programs.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/api/src/rest/routes/programs.ts b/apps/api/src/rest/routes/programs.ts index cccb9b6c..b8829ab5 100644 --- a/apps/api/src/rest/routes/programs.ts +++ b/apps/api/src/rest/routes/programs.ts @@ -277,7 +277,7 @@ programsRouter.openapi(majorRequirements, async (c) => { : c.json( { ok: false, - message: "Couldn't find this major; check your ID?", + message: "Couldn't find this major associated with this specialization; check your ID?", }, 404, ); From 1825709d215c899ad84642aafa307535c82c2486 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Thu, 5 Mar 2026 12:44:10 -0800 Subject: [PATCH 77/91] converted key of parsedPrograms into a template literal type --- .../src/components/Scraper.ts | 29 ++++++++++++------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts index f2c9e53c..65ef406b 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts @@ -22,6 +22,8 @@ const JWT_HEADER_PREFIX_LENGTH = 7; // (school code, major code, degree code, spec code) type ProgramQuadruplet = [string, string, string, string?]; +// 'majorName;specCode'. If no specialization is taken, 'majorName;' +type MajorSpecId = `${string};${string}`; export class Scraper { private ap!: AuditParser; @@ -36,8 +38,7 @@ export class Scraper { private done = false; private parsedUgradRequirements = new Map(); private parsedMinorPrograms = new Map(); - // both undergrad majors and grad programs; key of 'majorName;specCode?' maps to tuple of (school, program) - private parsedPrograms = new Map(); + private parsedPrograms = new Map(); // (parent major, name, program object) private parsedSpecializations = new Map< string, @@ -56,6 +57,10 @@ export class Scraper { ); } + private asMajorSpecId(majorName: string, specCode?: string): MajorSpecId { + return `${majorName};${specCode}`; + } + private findDwNameFor( awardTypesMap: Map>, catalogueDegree: z.infer, @@ -143,7 +148,7 @@ export class Scraper { } private async scrapePrograms(degrees: Iterable) { - const ret = new Map(); + const ret = new Map(); for (const [schoolCode, majorCode, degreeCode, specCode] of degrees) { const audit = await this.dw.getMajorAudit( degreeCode, @@ -162,14 +167,14 @@ export class Scraper { ); continue; } - if (ret.has([majorAudit.title, specCode].join(";"))) { + if (ret.has(this.asMajorSpecId(majorAudit.title, specCode))) { console.log( `Requirements block already exists for "${majorAudit.title}" ${specCode ? `with spec: '${specCode}'` : ""} (majorCode = ${majorCode}, degree = ${degreeCode})`, ); continue; } - - ret.set([majorAudit.title, specCode].join(";"), { + console.log(`setting ret with key ${this.asMajorSpecId(majorAudit.title, specCode)}`); + ret.set(this.asMajorSpecId(majorAudit.title, specCode), { school: audit?.college ? await this.ap.parseBlock( `${schoolCode}-COLLEGE-${majorCode}-${degreeCode}`, @@ -200,7 +205,9 @@ export class Scraper { // as of this commit, this spec is seemingly valid with any major but that's not really true if (specCode === "OACSC") { // "optional american chemical society certification" - const inMap = this.parsedPrograms.get("Major in Chemistry;") as MajorProgram; + const inMap = this.parsedPrograms.get( + this.asMajorSpecId("Major in Chemistry"), + ) as MajorProgram; return inMap ? [inMap.major] : []; } @@ -424,7 +431,7 @@ export class Scraper { // cleaner way to address this, but this is such an insanely niche case // that it's probably not worth the effort to write a general solution. - const x = this.parsedPrograms.get("Major in Art History;"); + const x = this.parsedPrograms.get(this.asMajorSpecId("Major in Art History")); const y = this.parsedSpecializations.get("AHGEO")?.[2]; const z = this.parsedSpecializations.get("AHPER")?.[2]; if (x && y && z) { @@ -433,9 +440,9 @@ export class Scraper { x.major.requirements = [...x.major.requirements, ...y.requirements, ...z.requirements]; this.parsedSpecializations.delete("AHGEO"); this.parsedSpecializations.delete("AHPER"); - this.parsedPrograms.delete("Major in Art History;AHPER"); - this.parsedPrograms.delete("Major in Art History;AHGEO"); - this.parsedPrograms.set("Major in Art History;", x); + this.parsedPrograms.delete(this.asMajorSpecId("Major in Art History", "AHPER")); + this.parsedPrograms.delete(this.asMajorSpecId("Major in Art History", "AHGEO")); + this.parsedPrograms.set(this.asMajorSpecId("Major in Art History"), x); } this.done = true; From 9fd770f7295a7c7e70b4a4ec8ce193af675ae317 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Thu, 5 Mar 2026 12:54:30 -0800 Subject: [PATCH 78/91] refactored programQuadruplet into ProgramCodes type --- .../src/components/Scraper.ts | 39 ++++++++++++------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts index 65ef406b..354f49ef 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts @@ -20,9 +20,13 @@ import { const JWT_HEADER_PREFIX_LENGTH = 7; -// (school code, major code, degree code, spec code) -type ProgramQuadruplet = [string, string, string, string?]; -// 'majorName;specCode'. If no specialization is taken, 'majorName;' +type ProgramCodes = { + schoolCode: string; + degreeCode: string; + majorCode: string; + specCode?: string; +}; +// 'majorName;specCode'. If no specialization is taken, 'majorName;undefined' type MajorSpecId = `${string};${string}`; export class Scraper { @@ -86,7 +90,7 @@ export class Scraper { * * However, we operate under the assumption that every valid triplet is among the ones returned by this method. * @private */ - private async discoverValidDegrees(): Promise { + private async discoverValidDegrees(): Promise { const [awardTypes, reports] = await Promise.all([ fetch("https://www.reg.uci.edu/mdsd/api/lookups/awardTypes").then((r) => r.json()), fetch("https://www.reg.uci.edu/mdsd/api/reports", { @@ -134,8 +138,15 @@ export class Scraper { ) .flatMap((ent) => { const withMatchedDegree = this.findDwNameFor(awardTypesMap, ent) - .map((dwName) => [ent.school.schoolCode, ent.major.majorCode, dwName]) - .toArray() as ProgramQuadruplet[]; + .map( + (dwName) => + ({ + schoolCode: ent.school.schoolCode, + majorCode: ent.major.majorCode, + degreeCode: dwName, + }) as ProgramCodes, + ) + .toArray(); if (withMatchedDegree.length === 0) { console.log( @@ -147,9 +158,9 @@ export class Scraper { }); } - private async scrapePrograms(degrees: Iterable) { + private async scrapePrograms(degrees: Iterable) { const ret = new Map(); - for (const [schoolCode, majorCode, degreeCode, specCode] of degrees) { + for (const { schoolCode, majorCode, degreeCode, specCode } of degrees) { const audit = await this.dw.getMajorAudit( degreeCode, // bachelor's degrees probably get an abbreviation starting with B @@ -304,7 +315,7 @@ export class Scraper { console.log(`loading ${this.specializationCache.size} cached specializations`); this.knownSpecializations = await this.dw.getMapping("specializations"); - const foundMajorSpecPairs: ProgramQuadruplet[] = []; + const foundMajorSpecPairs: ProgramCodes[] = []; for (const [specCode, specName] of this.knownSpecializations.entries()) { let specBlock: Block | undefined; @@ -363,12 +374,12 @@ export class Scraper { foundMajorAssured.specs.push(specCode); - foundMajorSpecPairs.push([ - foundMajorAssured.degreeType?.startsWith("B") ? "U" : "G", - foundMajorAssured.code, - foundMajorAssured.degreeType, + foundMajorSpecPairs.push({ + schoolCode: foundMajorAssured.degreeType?.startsWith("B") ? "U" : "G", + degreeCode: foundMajorAssured.degreeType, + majorCode: foundMajorAssured.code, specCode, - ] as ProgramQuadruplet); + } as ProgramCodes); this.specializationCache.set(specCode, { parent: foundMajorAssured, From 22b77a8a6fa1ae1a6f27472185d5296671fcfaf1 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Thu, 5 Mar 2026 12:58:09 -0800 Subject: [PATCH 79/91] push found programs with spec into existing parsedPrograms list --- .../degreeworks-scraper/src/components/Scraper.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts index 354f49ef..e43bf81f 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts @@ -417,10 +417,9 @@ export class Scraper { } } - this.parsedPrograms = new Map([ - ...this.parsedPrograms, - ...(await this.scrapePrograms(foundMajorSpecPairs)), - ]); + for (const [majorSpecId, majorProgram] of await this.scrapePrograms(foundMajorSpecPairs)) { + this.parsedPrograms.set(majorSpecId, majorProgram); + } // After we match specializations to a major // we ensure that majors with 0 specs don't require a specialization From 0230efd22bed1c460b6e1ef140c61f0d5bb38c7e Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Thu, 5 Mar 2026 13:08:05 -0800 Subject: [PATCH 80/91] made docs for major and major requirement endpoint clearer --- apps/api/src/schema/programs.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/api/src/schema/programs.ts b/apps/api/src/schema/programs.ts index 07652d48..beced3e3 100644 --- a/apps/api/src/schema/programs.ts +++ b/apps/api/src/schema/programs.ts @@ -31,7 +31,8 @@ export const majorRequirementsQuerySchema = z.object({ example: "BS-201", }), specializationId: programIdBase.optional().openapi({ - description: "fetch major requirement when taking specialization with this ID, if provided, ", + description: + "fetch major requirements when taking the specialization with this ID, if provided; providing no specialization when one is required returns the 'base' major requirements", example: "BS-201A", }), }); @@ -192,7 +193,7 @@ export const majorsResponseSchema = z.array( description: "The division in which this major is offered", }), specializationRequired: z.boolean().openapi({ - description: "Whether a specialization must be completed to complete this degree", + description: "Whether a specialization must be completed to complete this major", }), specializations: z.array(z.string()).openapi({ description: From 477130912b99e468f0e95dd4d1a6815c1fceaa6a Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Thu, 5 Mar 2026 13:11:13 -0800 Subject: [PATCH 81/91] make program service more 'drizzle-onic' --- apps/api/src/services/programs.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/api/src/services/programs.ts b/apps/api/src/services/programs.ts index 0f7eb0f5..e3956618 100644 --- a/apps/api/src/services/programs.ts +++ b/apps/api/src/services/programs.ts @@ -118,9 +118,9 @@ export class ProgramsService { .from(major) .where( and( - sql`major.id=${query.programId}`, + eq(major.id, query.programId), query.specializationId - ? sql`major_spec_pair_to_requirement.spec_id = ${query.specializationId}` + ? eq(majorSpecPairToRequirement.specId, query.specializationId) : undefined, ), ) From c92cee7312f2b7791155890ab4ef00f16d719a19 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Thu, 5 Mar 2026 13:42:01 -0800 Subject: [PATCH 82/91] logging stuff --- June Local.session.sql | 172 ++++++++++++++++++ .../src/components/Scraper.ts | 12 +- test.ts | 0 3 files changed, 178 insertions(+), 6 deletions(-) create mode 100644 June Local.session.sql create mode 100644 test.ts diff --git a/June Local.session.sql b/June Local.session.sql new file mode 100644 index 00000000..3b5c6eda --- /dev/null +++ b/June Local.session.sql @@ -0,0 +1,172 @@ +select * from specialization limit 100; + +select ARRAY_AGG(id) from specialization; +select * from specialization; + +select * from degree; +select * from major; +select * from major_spec; + +select COUNT(*) from specialization; + +select m.id as major_id, s.id as spec_id, m.name as major, s.name as spec, degree_id +from major as m +inner join specialization as s +on m.id = s.major_id +Order By degree_id, major; + +select count(*) from specialization +where major_id in ( + 'MFA-231', + 'MFA-579', + 'BA-579', + 'BMUS-582', + 'BA-174', + 'BS-276', + 'BS-284', + 'BS-294', + 'BS-201', + 'BA-163', + 'PHD-0B0', + 'MAT-25B', + 'MS-07T' +); + +select * from specialization +where major_id not in ( + 'MFA-231', + 'MFA-579', + 'BA-579', + 'BMUS-582', + 'BA-174', + 'BS-276', + 'BS-284', + 'BS-294', + 'BS-201', + 'BA-163', + 'PHD-0B0', + 'MAT-25B', + 'MS-07T' +); + +select DISTINCT id, name, specialization_required from major +where id not in ( + 'MFA-231', + 'MFA-579', + 'BA-579', + 'BMUS-582', + 'BA-174', + 'BS-276', + 'BS-284', + 'BS-294', + 'BS-201', + 'BA-163', + 'PHD-0B0', + 'MAT-25B', + 'MS-07T' +) and specialization_required = true; + + +select distinct major from +( + select m.id as major_id, m.degree_id as deg, s.major_id as spec_id, m.name as major, m.specialization_required as specialization_required + from major as m + inner join specialization as s + on m.id = s.major_id + order by deg, major +) +where specialization_required = false; + +select * from minor where id = '120'; + +delete from major_requirement; +delete from specialization; +delete from major; + +select * from specialization +where major_id = 'BS-0K6'; + +select * from minor; + + +select major.id, major.name, mr.requirements, ms.spec_id, ms.requirement_id +from major +left join major_spec_pair_to_requirement as ms +on major.id = ms.major_id +left join major_requirement as mr +on ms.requirement_id = mr.id +where major.id = 'BS-201' and ms.spec_id is NULL; + +select * from instructor_to_websoc_instructor; +select * from degree; +select * from school_requirement; +select * from major_spec_pair_to_requirement; +select * from major_requirement; +select * from major_spec_pair_to_requirement where spec_id = 'BS-201A'; +select * from college_requirement; +select * from specialization; +select * from major +where specialization_required is null; + +select count(*) from major where specialization_required = TRUE; +select * from major where specialization_required = TRUE; + +select DISTINCT m.name from major as m +inner join specialization as s on m.id = s.major_id +where m.specialization_required = FALSE; + +select * from specialization; +select * from major; + + +select r.id, msr.id, m.name, s.name,r.requirements, m.specialization_required from major_spec_pair_to_requirement as msr +full outer join major_requirement as r +on msr.requirement_id = r.id +full outer join major as m +on msr.major_id = m.id +full outer join specialization as s +on msr.spec_id = s.id; + + +delete from websoc_section_meeting; +delete from websoc_section_enrollment; +delete from websoc_section_grade; +delete from websoc_section; +delete from larc_section; +delete from websoc_course; + +select * from course; +select * from websoc_course; +select * from calendar_term; +select * from websoc_school; +select * from websoc_section limit 10; +select * from websoc_course limit 10; +select * from websoc_section_meeting_to_location limit 10; +select * from study_room limit 10; + +alter table major_spec_pair_to_requirement +add constraint unique_major_requirement_id_constraint UNIQUE(requirement_Id); + +alter table major_requirement +add constraint unique_major_requirement Unique(requirements); + +create table test_table( + major_id varchar(50), + spec_id varchar(50), + id varchar(50) generated always as( + case when spec_id is not null then + "major_id" || '+' || "spec_id" + else + "major_id" + end + ) stored +); + +insert into test_table (major_id, spec_id) +values ('BS-201', '201A'), + ('BS-0K6', ''), + ('BA-163', null); + +select * from test_table; + +select * from calendar_term; \ No newline at end of file diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts index e43bf81f..0e3b460a 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts @@ -172,19 +172,19 @@ export class Scraper { const majorAudit = audit?.major; + const specIdentifier = specCode ? `with spec: ${specCode} ` : ""; + const majorIdentifier = `(majorCode = ${majorCode}, degree = ${degreeCode})`; + if (!majorAudit) { - console.log( - `Requirements block not found (majorCode = ${majorCode}, degree = ${degreeCode})`, - ); + console.log(`Requirements block not found ${majorIdentifier}`); continue; } if (ret.has(this.asMajorSpecId(majorAudit.title, specCode))) { console.log( - `Requirements block already exists for "${majorAudit.title}" ${specCode ? `with spec: '${specCode}'` : ""} (majorCode = ${majorCode}, degree = ${degreeCode})`, + `Requirements block already exists for "${majorAudit.title}" ${specIdentifier}${majorIdentifier}`, ); continue; } - console.log(`setting ret with key ${this.asMajorSpecId(majorAudit.title, specCode)}`); ret.set(this.asMajorSpecId(majorAudit.title, specCode), { school: audit?.college ? await this.ap.parseBlock( @@ -200,7 +200,7 @@ export class Scraper { }); console.log( - `Requirements block found and parsed for "${majorAudit.title}" ${specCode ? `with spec: ${specCode}` : ""} (majorCode = ${majorCode}, degree = ${degreeCode})`, + `Requirements block found and parsed for "${majorAudit.title}" ${specIdentifier}${majorIdentifier}`, ); } return ret; diff --git a/test.ts b/test.ts new file mode 100644 index 00000000..e69de29b From 19cb48256dfdb2d8c7af26dcf95800885f023e24 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Thu, 5 Mar 2026 14:22:08 -0800 Subject: [PATCH 83/91] used asmajorSpecId to create parsedProgram keys where originally missed --- .../data-pipeline/degreeworks-scraper/src/components/Scraper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts index 0e3b460a..493bfb49 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts @@ -329,7 +329,7 @@ export class Scraper { if (got !== null) { specBlock = got.block; - const majorProgram = this.parsedPrograms.get(`${got.parent.name};`); + const majorProgram = this.parsedPrograms.get(this.asMajorSpecId(got.parent.name)); if (majorProgram) { foundMajor = majorProgram.major; } else { From ac7051f6d9cadc6e3ba670e4c588a9e8341bffaf Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Mon, 9 Mar 2026 12:12:13 -0700 Subject: [PATCH 84/91] doc changes --- apps/api/src/schema/programs.ts | 5 ++--- .../degreeworks-scraper/src/components/Scraper.ts | 6 +++--- test.ts | 0 3 files changed, 5 insertions(+), 6 deletions(-) delete mode 100644 test.ts diff --git a/apps/api/src/schema/programs.ts b/apps/api/src/schema/programs.ts index 291953b6..547f9264 100644 --- a/apps/api/src/schema/programs.ts +++ b/apps/api/src/schema/programs.ts @@ -32,7 +32,7 @@ export const majorRequirementsQuerySchema = z.object({ }), specializationId: programIdBase.optional().openapi({ description: - "fetch major requirements when taking the specialization with this ID, if provided; providing no specialization when one is required returns the 'base' major requirements", + "fetch major requirements when taking the specialization with this ID, if provided; providing no specialization when one is required results in unspecified behavior and is deprecated", example: "BS-201A", }), }); @@ -196,8 +196,7 @@ export const majorsResponseSchema = z.array( description: "Whether a specialization must be completed to complete this degree", }), specializations: z.array(z.string()).openapi({ - description: - "The ID(s) of specialization(s) associated with this major; if any are present, one is mandatory for this major.", + description: "The ID(s) of specialization(s) associated with this major", example: [ "BS-201A", "BS-201B", diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts index 493bfb49..7cf04463 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts @@ -26,8 +26,8 @@ type ProgramCodes = { majorCode: string; specCode?: string; }; -// 'majorName;specCode'. If no specialization is taken, 'majorName;undefined' -type MajorSpecId = `${string};${string}`; +// 'majorName;specCode'. If no specialization is taken, simply 'majorName' +type MajorSpecId = string | `${string};${string}`; export class Scraper { private ap!: AuditParser; @@ -62,7 +62,7 @@ export class Scraper { } private asMajorSpecId(majorName: string, specCode?: string): MajorSpecId { - return `${majorName};${specCode}`; + return specCode ? `${majorName};${specCode}` : majorName; } private findDwNameFor( diff --git a/test.ts b/test.ts deleted file mode 100644 index e69de29b..00000000 From 730e0098a1ffa461f4cd6c2c442009038d473154 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Mon, 9 Mar 2026 13:22:14 -0700 Subject: [PATCH 85/91] minor doc and cleaning changes --- apps/api/src/rest/routes/programs.ts | 7 +++---- apps/api/src/schema/programs.ts | 2 +- .../src/components/DegreeworksClient.ts | 3 ++- .../degreeworks-scraper/src/components/Scraper.ts | 6 ++---- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/apps/api/src/rest/routes/programs.ts b/apps/api/src/rest/routes/programs.ts index 48827458..1b2d81be 100644 --- a/apps/api/src/rest/routes/programs.ts +++ b/apps/api/src/rest/routes/programs.ts @@ -80,9 +80,7 @@ const majorRequirements = createRoute({ tags: ["Programs"], method: "get", path: "/major", - description: - "Retrieve course requirements for a major in UCI's current catalogue. Note that these are the requirements for the major itself; " + - "if this major has specializations, then one is mandatory and its requirements apply as well.", + description: "Retrieve course requirements for a major in UCI's current catalogue.", request: { query: majorRequirementsQuerySchema }, responses: { 200: response200(majorRequirementsResponseSchema), @@ -190,7 +188,8 @@ programsRouter.openapi(majorRequirements, async (c) => { : c.json( { ok: false, - message: "Couldn't find this major associated with this specialization; check your ID?", + message: + "Couldn't find major requirements associated with taking this major and specialization; check your IDs?", }, 404, ); diff --git a/apps/api/src/schema/programs.ts b/apps/api/src/schema/programs.ts index 547f9264..5396a901 100644 --- a/apps/api/src/schema/programs.ts +++ b/apps/api/src/schema/programs.ts @@ -32,7 +32,7 @@ export const majorRequirementsQuerySchema = z.object({ }), specializationId: programIdBase.optional().openapi({ description: - "fetch major requirements when taking the specialization with this ID, if provided; providing no specialization when one is required results in unspecified behavior and is deprecated", + "if provided, fetch major requirements given this specialization; providing no specialization when one is required has unspecified behavior", example: "BS-201A", }), }); diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/DegreeworksClient.ts b/apps/data-pipeline/degreeworks-scraper/src/components/DegreeworksClient.ts index dd8c1ae8..5ac85fbd 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/DegreeworksClient.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/DegreeworksClient.ts @@ -88,14 +88,15 @@ export class DegreeworksClient { * @param degree a degree code, e.g. "BS" * @param school this corresponds to the UCI notion of division, e.g. "U" or "G" * @param majorCode a major code + * @param specCode a specialization code * @param college this corresponds to the UCI notion of school, e.g. 55 for the school of bio sci */ async getMajorAudit( degree: string, school: string, majorCode: string, - college?: string, specCode?: string, + college?: string, ): Promise< | { college?: Block; diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts index 7cf04463..c9663843 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts @@ -196,7 +196,7 @@ export class Scraper { `${schoolCode}-MAJOR-${majorCode}-${degreeCode}`, majorAudit, ), - specCode: specCode, + specCode, }); console.log( @@ -216,9 +216,7 @@ export class Scraper { // as of this commit, this spec is seemingly valid with any major but that's not really true if (specCode === "OACSC") { // "optional american chemical society certification" - const inMap = this.parsedPrograms.get( - this.asMajorSpecId("Major in Chemistry"), - ) as MajorProgram; + const inMap = this.parsedPrograms.get(this.asMajorSpecId("Major in Chemistry")); return inMap ? [inMap.major] : []; } From 19cc8d401564bcfb7952f8af4b613f90a7abc5e6 Mon Sep 17 00:00:00 2001 From: Hwijung Date: Mon, 9 Mar 2026 14:55:12 -0700 Subject: [PATCH 86/91] Update apps/api/src/rest/routes/programs.ts Co-authored-by: Dante Dam --- apps/api/src/rest/routes/programs.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/api/src/rest/routes/programs.ts b/apps/api/src/rest/routes/programs.ts index 1b2d81be..b1065f5c 100644 --- a/apps/api/src/rest/routes/programs.ts +++ b/apps/api/src/rest/routes/programs.ts @@ -189,7 +189,7 @@ programsRouter.openapi(majorRequirements, async (c) => { { ok: false, message: - "Couldn't find major requirements associated with taking this major and specialization; check your IDs?", + "Couldn't find major requirements associated with this major and specialization; check your IDs?", }, 404, ); From 847e2e35b33b808d529e9cff195409364c4402ea Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Mon, 9 Mar 2026 14:59:56 -0700 Subject: [PATCH 87/91] removed local sql file --- June Local.session.sql | 172 ----------------------------------------- 1 file changed, 172 deletions(-) delete mode 100644 June Local.session.sql diff --git a/June Local.session.sql b/June Local.session.sql deleted file mode 100644 index 3b5c6eda..00000000 --- a/June Local.session.sql +++ /dev/null @@ -1,172 +0,0 @@ -select * from specialization limit 100; - -select ARRAY_AGG(id) from specialization; -select * from specialization; - -select * from degree; -select * from major; -select * from major_spec; - -select COUNT(*) from specialization; - -select m.id as major_id, s.id as spec_id, m.name as major, s.name as spec, degree_id -from major as m -inner join specialization as s -on m.id = s.major_id -Order By degree_id, major; - -select count(*) from specialization -where major_id in ( - 'MFA-231', - 'MFA-579', - 'BA-579', - 'BMUS-582', - 'BA-174', - 'BS-276', - 'BS-284', - 'BS-294', - 'BS-201', - 'BA-163', - 'PHD-0B0', - 'MAT-25B', - 'MS-07T' -); - -select * from specialization -where major_id not in ( - 'MFA-231', - 'MFA-579', - 'BA-579', - 'BMUS-582', - 'BA-174', - 'BS-276', - 'BS-284', - 'BS-294', - 'BS-201', - 'BA-163', - 'PHD-0B0', - 'MAT-25B', - 'MS-07T' -); - -select DISTINCT id, name, specialization_required from major -where id not in ( - 'MFA-231', - 'MFA-579', - 'BA-579', - 'BMUS-582', - 'BA-174', - 'BS-276', - 'BS-284', - 'BS-294', - 'BS-201', - 'BA-163', - 'PHD-0B0', - 'MAT-25B', - 'MS-07T' -) and specialization_required = true; - - -select distinct major from -( - select m.id as major_id, m.degree_id as deg, s.major_id as spec_id, m.name as major, m.specialization_required as specialization_required - from major as m - inner join specialization as s - on m.id = s.major_id - order by deg, major -) -where specialization_required = false; - -select * from minor where id = '120'; - -delete from major_requirement; -delete from specialization; -delete from major; - -select * from specialization -where major_id = 'BS-0K6'; - -select * from minor; - - -select major.id, major.name, mr.requirements, ms.spec_id, ms.requirement_id -from major -left join major_spec_pair_to_requirement as ms -on major.id = ms.major_id -left join major_requirement as mr -on ms.requirement_id = mr.id -where major.id = 'BS-201' and ms.spec_id is NULL; - -select * from instructor_to_websoc_instructor; -select * from degree; -select * from school_requirement; -select * from major_spec_pair_to_requirement; -select * from major_requirement; -select * from major_spec_pair_to_requirement where spec_id = 'BS-201A'; -select * from college_requirement; -select * from specialization; -select * from major -where specialization_required is null; - -select count(*) from major where specialization_required = TRUE; -select * from major where specialization_required = TRUE; - -select DISTINCT m.name from major as m -inner join specialization as s on m.id = s.major_id -where m.specialization_required = FALSE; - -select * from specialization; -select * from major; - - -select r.id, msr.id, m.name, s.name,r.requirements, m.specialization_required from major_spec_pair_to_requirement as msr -full outer join major_requirement as r -on msr.requirement_id = r.id -full outer join major as m -on msr.major_id = m.id -full outer join specialization as s -on msr.spec_id = s.id; - - -delete from websoc_section_meeting; -delete from websoc_section_enrollment; -delete from websoc_section_grade; -delete from websoc_section; -delete from larc_section; -delete from websoc_course; - -select * from course; -select * from websoc_course; -select * from calendar_term; -select * from websoc_school; -select * from websoc_section limit 10; -select * from websoc_course limit 10; -select * from websoc_section_meeting_to_location limit 10; -select * from study_room limit 10; - -alter table major_spec_pair_to_requirement -add constraint unique_major_requirement_id_constraint UNIQUE(requirement_Id); - -alter table major_requirement -add constraint unique_major_requirement Unique(requirements); - -create table test_table( - major_id varchar(50), - spec_id varchar(50), - id varchar(50) generated always as( - case when spec_id is not null then - "major_id" || '+' || "spec_id" - else - "major_id" - end - ) stored -); - -insert into test_table (major_id, spec_id) -values ('BS-201', '201A'), - ('BS-0K6', ''), - ('BA-163', null); - -select * from test_table; - -select * from calendar_term; \ No newline at end of file From 54e5d89c8facae64272a81cd11c1b721dd1a36ba Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Mon, 9 Mar 2026 15:24:58 -0700 Subject: [PATCH 88/91] yet additional doc changes. bless me with english TT --- apps/api/src/graphql/resolvers/programs.ts | 2 +- packages/db/src/schema.ts | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/api/src/graphql/resolvers/programs.ts b/apps/api/src/graphql/resolvers/programs.ts index 023a09de..1a99111e 100644 --- a/apps/api/src/graphql/resolvers/programs.ts +++ b/apps/api/src/graphql/resolvers/programs.ts @@ -21,7 +21,7 @@ export const programResolvers = { const res = await service.getMajorRequirements(parsedArgs); if (!res) throw new GraphQLError( - `Major ${parsedArgs.programId} with Specialization ${parsedArgs.specializationId} not found`, + `No requirements found for major ${parsedArgs.programId}${parsedArgs.specializationId ? ` with specialization ${parsedArgs.specializationId}` : ""}.`, { extensions: { code: "NOT_FOUND" }, }, diff --git a/packages/db/src/schema.ts b/packages/db/src/schema.ts index 4444a7a9..19c0d9fa 100644 --- a/packages/db/src/schema.ts +++ b/packages/db/src/schema.ts @@ -708,7 +708,6 @@ export const major = pgTable( name: varchar("name").notNull(), specializationRequired: boolean("specialization_required").notNull(), collegeRequirement: uuid("college_requirement").references(() => collegeRequirement.id), - // requirements: json("requirements").$type().notNull(), }, (table) => [index().on(table.degreeId), index().on(table.collegeRequirement)], ); From a4bd0ad5c6b4165465d6c1372e2c5db312446407 Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Mon, 16 Mar 2026 11:39:18 -0700 Subject: [PATCH 89/91] better error logs on graphql logs and delete migration to sync with main --- apps/api/src/services/programs.ts | 11 +- .../degreeworks-scraper/src/index.ts | 10 +- .../0026_polymorphic_major_requirements.sql | 35 - .../db/migrations/meta/0026_snapshot.json | 4631 ----------------- packages/db/migrations/meta/_journal.json | 7 - packages/db/src/schema.ts | 8 +- 6 files changed, 16 insertions(+), 4686 deletions(-) delete mode 100644 packages/db/migrations/0026_polymorphic_major_requirements.sql delete mode 100644 packages/db/migrations/meta/0026_snapshot.json diff --git a/apps/api/src/services/programs.ts b/apps/api/src/services/programs.ts index e3956618..99af3e14 100644 --- a/apps/api/src/services/programs.ts +++ b/apps/api/src/services/programs.ts @@ -16,7 +16,7 @@ import { degree, major, majorRequirement, - majorSpecPairToRequirement, + majorSpecializationToRequirement, minor, sampleProgramVariation, schoolRequirement, @@ -120,15 +120,18 @@ export class ProgramsService { and( eq(major.id, query.programId), query.specializationId - ? eq(majorSpecPairToRequirement.specId, query.specializationId) + ? eq(majorSpecializationToRequirement.specId, query.specializationId) : undefined, ), ) .leftJoin(collegeRequirement, eq(major.collegeRequirement, collegeRequirement.id)) - .leftJoin(majorSpecPairToRequirement, eq(major.id, majorSpecPairToRequirement.majorId)) + .leftJoin( + majorSpecializationToRequirement, + eq(major.id, majorSpecializationToRequirement.majorId), + ) .leftJoin( majorRequirement, - eq(majorSpecPairToRequirement.requirementId, majorRequirement.id), + eq(majorSpecializationToRequirement.requirementId, majorRequirement.id), ) .limit(1); return orNull(got); diff --git a/apps/data-pipeline/degreeworks-scraper/src/index.ts b/apps/data-pipeline/degreeworks-scraper/src/index.ts index d7e0ff3f..cf3e9b3e 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/index.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/index.ts @@ -7,7 +7,7 @@ import { degree, major, majorRequirement, - majorSpecPairToRequirement, + majorSpecializationToRequirement, minor, schoolRequirement, specialization, @@ -200,7 +200,7 @@ async function main() { for (const majorSpecObj of majorSpecToRequirementData) { if (majorSpecObj.majorRequirementBlockIndex !== undefined) { - (majorSpecObj as typeof majorSpecPairToRequirement.$inferInsert).requirementId = + (majorSpecObj as typeof majorSpecializationToRequirement.$inferInsert).requirementId = majorRequirementBlockIds[majorSpecObj.majorRequirementBlockIndex]; } } @@ -221,11 +221,11 @@ async function main() { }); await tx - .insert(majorSpecPairToRequirement) + .insert(majorSpecializationToRequirement) .values(majorSpecToRequirementData) .onConflictDoUpdate({ - target: majorSpecPairToRequirement.id, - set: conflictUpdateSetAllCols(majorSpecPairToRequirement), + target: majorSpecializationToRequirement.id, + set: conflictUpdateSetAllCols(majorSpecializationToRequirement), }); }); exit(0); diff --git a/packages/db/migrations/0026_polymorphic_major_requirements.sql b/packages/db/migrations/0026_polymorphic_major_requirements.sql deleted file mode 100644 index d1ffead3..00000000 --- a/packages/db/migrations/0026_polymorphic_major_requirements.sql +++ /dev/null @@ -1,35 +0,0 @@ -CREATE TABLE IF NOT EXISTS "major_requirement" ( - "requirements" jsonb NOT NULL, - "id" bigint PRIMARY KEY GENERATED ALWAYS AS (jsonb_hash_extended(requirements, 0)) STORED NOT NULL -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "major_spec_pair_to_requirement" ( - "id" varchar PRIMARY KEY GENERATED ALWAYS AS ( - CASE WHEN "major_spec_pair_to_requirement"."spec_id" IS NOT NULL - THEN "major_spec_pair_to_requirement"."major_id" || '+' || "major_spec_pair_to_requirement"."spec_id" - ELSE "major_spec_pair_to_requirement"."major_id" - END) STORED NOT NULL, - "major_id" varchar NOT NULL, - "spec_id" varchar, - "requirement_id" bigint -); ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "major_spec_pair_to_requirement" ADD CONSTRAINT "major_spec_pair_to_requirement_major_id_major_id_fk" FOREIGN KEY ("major_id") REFERENCES "public"."major"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "major_spec_pair_to_requirement" ADD CONSTRAINT "major_spec_pair_to_requirement_spec_id_specialization_id_fk" FOREIGN KEY ("spec_id") REFERENCES "public"."specialization"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "major_spec_pair_to_requirement" ADD CONSTRAINT "major_spec_pair_to_requirement_requirement_id_major_requirement_id_fk" FOREIGN KEY ("requirement_id") REFERENCES "public"."major_requirement"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -ALTER TABLE "major" DROP COLUMN IF EXISTS "requirements"; \ No newline at end of file diff --git a/packages/db/migrations/meta/0026_snapshot.json b/packages/db/migrations/meta/0026_snapshot.json deleted file mode 100644 index ff89c46e..00000000 --- a/packages/db/migrations/meta/0026_snapshot.json +++ /dev/null @@ -1,4631 +0,0 @@ -{ - "id": "b2562c8f-ca46-4e16-9bc2-859c42858f4d", - "prevId": "b6f5eff6-d4a4-413e-841b-efecba276bb7", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.ap_exam": { - "name": "ap_exam", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "catalogue_name": { - "name": "catalogue_name", - "type": "varchar", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.ap_exam_reward": { - "name": "ap_exam_reward", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "units_granted": { - "name": "units_granted", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "elective_units_granted": { - "name": "elective_units_granted", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "ge_1a_courses_granted": { - "name": "ge_1a_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_1b_courses_granted": { - "name": "ge_1b_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_2_courses_granted": { - "name": "ge_2_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_3_courses_granted": { - "name": "ge_3_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_4_courses_granted": { - "name": "ge_4_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_5a_courses_granted": { - "name": "ge_5a_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_5b_courses_granted": { - "name": "ge_5b_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_6_courses_granted": { - "name": "ge_6_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_7_courses_granted": { - "name": "ge_7_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "ge_8_courses_granted": { - "name": "ge_8_courses_granted", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "courses_granted": { - "name": "courses_granted", - "type": "json", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.ap_exam_to_reward": { - "name": "ap_exam_to_reward", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "exam_id": { - "name": "exam_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "score": { - "name": "score", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "reward": { - "name": "reward", - "type": "uuid", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "ap_exam_to_reward_exam_id_score_index": { - "name": "ap_exam_to_reward_exam_id_score_index", - "columns": [ - { - "expression": "exam_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "score", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "ap_exam_to_reward_exam_id_ap_exam_id_fk": { - "name": "ap_exam_to_reward_exam_id_ap_exam_id_fk", - "tableFrom": "ap_exam_to_reward", - "tableTo": "ap_exam", - "columnsFrom": ["exam_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "ap_exam_to_reward_reward_ap_exam_reward_id_fk": { - "name": "ap_exam_to_reward_reward_ap_exam_reward_id_fk", - "tableFrom": "ap_exam_to_reward", - "tableTo": "ap_exam_reward", - "columnsFrom": ["reward"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.calendar_term": { - "name": "calendar_term", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true, - "generated": { - "as": "\"calendar_term\".\"year\" || ' ' || CASE WHEN \"calendar_term\".\"quarter\" = 'Fall' THEN 'Fall' WHEN \"calendar_term\".\"quarter\" = 'Winter' THEN 'Winter' WHEN \"calendar_term\".\"quarter\" = 'Spring' THEN 'Spring' WHEN \"calendar_term\".\"quarter\" = 'Summer1' THEN 'Summer1' WHEN \"calendar_term\".\"quarter\" = 'Summer10wk' THEN 'Summer10wk' WHEN \"calendar_term\".\"quarter\" = 'Summer2' THEN 'Summer2' ELSE '' END", - "type": "stored" - } - }, - "year": { - "name": "year", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "quarter": { - "name": "quarter", - "type": "term", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "instruction_start": { - "name": "instruction_start", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "instruction_end": { - "name": "instruction_end", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "finals_start": { - "name": "finals_start", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "finals_end": { - "name": "finals_end", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "soc_available": { - "name": "soc_available", - "type": "date", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.catalogue_program": { - "name": "catalogue_program", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "program_name": { - "name": "program_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.college_requirement": { - "name": "college_requirement", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "requirements": { - "name": "requirements", - "type": "jsonb", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "college_requirement_requirements_unique": { - "name": "college_requirement_requirements_unique", - "nullsNotDistinct": false, - "columns": ["requirements"] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.course": { - "name": "course", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "department": { - "name": "department", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "shortened_dept": { - "name": "shortened_dept", - "type": "varchar", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "REPLACE(\"course\".\"department\", ' ', '')", - "type": "stored" - } - }, - "department_alias": { - "name": "department_alias", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "course_number": { - "name": "course_number", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "course_numeric": { - "name": "course_numeric", - "type": "integer", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "CASE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g') WHEN '' THEN 0 ELSE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g')::INTEGER END", - "type": "stored" - } - }, - "school": { - "name": "school", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "course_level": { - "name": "course_level", - "type": "course_level", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "min_units": { - "name": "min_units", - "type": "numeric(4, 2)", - "primaryKey": false, - "notNull": true - }, - "max_units": { - "name": "max_units", - "type": "numeric(4, 2)", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "department_name": { - "name": "department_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "prerequisite_tree": { - "name": "prerequisite_tree", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "prerequisite_text": { - "name": "prerequisite_text", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "repeatability": { - "name": "repeatability", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "grading_option": { - "name": "grading_option", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "concurrent": { - "name": "concurrent", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "same_as": { - "name": "same_as", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "restriction": { - "name": "restriction", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "overlap": { - "name": "overlap", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "corequisites": { - "name": "corequisites", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "is_ge_1a": { - "name": "is_ge_1a", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_1b": { - "name": "is_ge_1b", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_2": { - "name": "is_ge_2", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_3": { - "name": "is_ge_3", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_4": { - "name": "is_ge_4", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_5a": { - "name": "is_ge_5a", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_5b": { - "name": "is_ge_5b", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_6": { - "name": "is_ge_6", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_7": { - "name": "is_ge_7", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_8": { - "name": "is_ge_8", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "ge_text": { - "name": "ge_text", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "course_search_index": { - "name": "course_search_index", - "columns": [ - { - "expression": "(\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"id\", '')), 'A') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"department\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"department_alias\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"shortened_dept\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"course_number\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"course_numeric\"::TEXT, '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"title\", '')), 'C') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"description\", '')), 'D')\n)", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - }, - "shortened_dept": { - "name": "shortened_dept", - "columns": [ - { - "expression": "shortened_dept", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.degree": { - "name": "degree", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "division": { - "name": "division", - "type": "division", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.dining_diet_restriction": { - "name": "dining_diet_restriction", - "schema": "", - "columns": { - "dish_id": { - "name": "dish_id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "contains_eggs": { - "name": "contains_eggs", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "contains_fish": { - "name": "contains_fish", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "contains_milk": { - "name": "contains_milk", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "contains_peanuts": { - "name": "contains_peanuts", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "contains_sesame": { - "name": "contains_sesame", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "contains_shellfish": { - "name": "contains_shellfish", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "contains_soy": { - "name": "contains_soy", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "contains_tree_nuts": { - "name": "contains_tree_nuts", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "contains_wheat": { - "name": "contains_wheat", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_gluten_free": { - "name": "is_gluten_free", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_halal": { - "name": "is_halal", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_kosher": { - "name": "is_kosher", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_locally_grown": { - "name": "is_locally_grown", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_organic": { - "name": "is_organic", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_vegan": { - "name": "is_vegan", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_vegetarian": { - "name": "is_vegetarian", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "dining_diet_restriction_dish_id_dining_dish_id_fk": { - "name": "dining_diet_restriction_dish_id_dining_dish_id_fk", - "tableFrom": "dining_diet_restriction", - "tableTo": "dining_dish", - "columnsFrom": ["dish_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.dining_dish": { - "name": "dining_dish", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "station_id": { - "name": "station_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "ingredients": { - "name": "ingredients", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "category": { - "name": "category", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "image_url": { - "name": "image_url", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "dining_dish_station_id_index": { - "name": "dining_dish_station_id_index", - "columns": [ - { - "expression": "station_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "dining_dish_station_id_dining_station_id_fk": { - "name": "dining_dish_station_id_dining_station_id_fk", - "tableFrom": "dining_dish", - "tableTo": "dining_station", - "columnsFrom": ["station_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.dining_dish_to_period": { - "name": "dining_dish_to_period", - "schema": "", - "columns": { - "period_id": { - "name": "period_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "dish_id": { - "name": "dish_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "dining_dish_to_period_period_id_dining_period_id_fk": { - "name": "dining_dish_to_period_period_id_dining_period_id_fk", - "tableFrom": "dining_dish_to_period", - "tableTo": "dining_period", - "columnsFrom": ["period_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - }, - "dining_dish_to_period_dish_id_dining_dish_id_fk": { - "name": "dining_dish_to_period_dish_id_dining_dish_id_fk", - "tableFrom": "dining_dish_to_period", - "tableTo": "dining_dish", - "columnsFrom": ["dish_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.dining_event": { - "name": "dining_event", - "schema": "", - "columns": { - "title": { - "name": "title", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "restaurant_id": { - "name": "restaurant_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "start": { - "name": "start", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "end": { - "name": "end", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "dining_event_restaurant_id_dining_restaurant_id_fk": { - "name": "dining_event_restaurant_id_dining_restaurant_id_fk", - "tableFrom": "dining_event", - "tableTo": "dining_restaurant", - "columnsFrom": ["restaurant_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "dining_event_pk": { - "name": "dining_event_pk", - "columns": ["title", "restaurant_id", "start"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.dining_nutrition_info": { - "name": "dining_nutrition_info", - "schema": "", - "columns": { - "dish_id": { - "name": "dish_id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "serving_size": { - "name": "serving_size", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "serving_unit": { - "name": "serving_unit", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "calories": { - "name": "calories", - "type": "numeric(10, 2)", - "primaryKey": false, - "notNull": false - }, - "total_fat_g": { - "name": "total_fat_g", - "type": "numeric(10, 2)", - "primaryKey": false, - "notNull": false - }, - "trans_fat_g": { - "name": "trans_fat_g", - "type": "numeric(10, 2)", - "primaryKey": false, - "notNull": false - }, - "saturated_fat_g": { - "name": "saturated_fat_g", - "type": "numeric(10, 2)", - "primaryKey": false, - "notNull": false - }, - "cholesterol_mg": { - "name": "cholesterol_mg", - "type": "numeric(10, 2)", - "primaryKey": false, - "notNull": false - }, - "sodium_mg": { - "name": "sodium_mg", - "type": "numeric(10, 2)", - "primaryKey": false, - "notNull": false - }, - "total_carbs_g": { - "name": "total_carbs_g", - "type": "numeric(10, 2)", - "primaryKey": false, - "notNull": false - }, - "dietary_fiber_g": { - "name": "dietary_fiber_g", - "type": "numeric(10, 2)", - "primaryKey": false, - "notNull": false - }, - "sugars_g": { - "name": "sugars_g", - "type": "numeric(10, 2)", - "primaryKey": false, - "notNull": false - }, - "protein_g": { - "name": "protein_g", - "type": "numeric(10, 2)", - "primaryKey": false, - "notNull": false - }, - "calcium": { - "name": "calcium", - "type": "numeric(10, 2)", - "primaryKey": false, - "notNull": false - }, - "iron": { - "name": "iron", - "type": "numeric(10, 2)", - "primaryKey": false, - "notNull": false - }, - "vitamin_a": { - "name": "vitamin_a", - "type": "numeric(10, 2)", - "primaryKey": false, - "notNull": false - }, - "vitamin_c": { - "name": "vitamin_c", - "type": "numeric(10, 2)", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "dining_nutrition_info_dish_id_dining_dish_id_fk": { - "name": "dining_nutrition_info_dish_id_dining_dish_id_fk", - "tableFrom": "dining_nutrition_info", - "tableTo": "dining_dish", - "columnsFrom": ["dish_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.dining_period": { - "name": "dining_period", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "adobe_id": { - "name": "adobe_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "date": { - "name": "date", - "type": "date", - "primaryKey": false, - "notNull": true - }, - "restaurant_id": { - "name": "restaurant_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "start_time": { - "name": "start_time", - "type": "time", - "primaryKey": false, - "notNull": true - }, - "end_time": { - "name": "end_time", - "type": "time", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "dining_period_adobe_id_date_restaurant_id_index": { - "name": "dining_period_adobe_id_date_restaurant_id_index", - "columns": [ - { - "expression": "adobe_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "date", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "restaurant_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "dining_period_date_index": { - "name": "dining_period_date_index", - "columns": [ - { - "expression": "date", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "dining_period_restaurant_id_index": { - "name": "dining_period_restaurant_id_index", - "columns": [ - { - "expression": "restaurant_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "dining_period_restaurant_id_dining_restaurant_id_fk": { - "name": "dining_period_restaurant_id_dining_restaurant_id_fk", - "tableFrom": "dining_period", - "tableTo": "dining_restaurant", - "columnsFrom": ["restaurant_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.dining_restaurant": { - "name": "dining_restaurant", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.dining_station": { - "name": "dining_station", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "restaurant_id": { - "name": "restaurant_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "dining_station_restaurant_id_index": { - "name": "dining_station_restaurant_id_index", - "columns": [ - { - "expression": "restaurant_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "dining_station_restaurant_id_dining_restaurant_id_fk": { - "name": "dining_station_restaurant_id_dining_restaurant_id_fk", - "tableFrom": "dining_station", - "tableTo": "dining_restaurant", - "columnsFrom": ["restaurant_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.instructor": { - "name": "instructor", - "schema": "", - "columns": { - "ucinetid": { - "name": "ucinetid", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "department": { - "name": "department", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "instructor_search_index": { - "name": "instructor_search_index", - "columns": [ - { - "expression": "(\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"ucinetid\", '')), 'A') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"name\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"title\", '')), 'B')\n)", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.instructor_to_websoc_instructor": { - "name": "instructor_to_websoc_instructor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "instructor_ucinetid": { - "name": "instructor_ucinetid", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "websoc_instructor_name": { - "name": "websoc_instructor_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "instructor_to_websoc_instructor_instructor_ucinetid_index": { - "name": "instructor_to_websoc_instructor_instructor_ucinetid_index", - "columns": [ - { - "expression": "instructor_ucinetid", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "instructor_to_websoc_instructor_websoc_instructor_name_index": { - "name": "instructor_to_websoc_instructor_websoc_instructor_name_index", - "columns": [ - { - "expression": "websoc_instructor_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "instructor_to_websoc_instructor_instructor_ucinetid_websoc_instructor_name_index": { - "name": "instructor_to_websoc_instructor_instructor_ucinetid_websoc_instructor_name_index", - "columns": [ - { - "expression": "instructor_ucinetid", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "websoc_instructor_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "instructor_to_websoc_instructor_instructor_ucinetid_instructor_ucinetid_fk": { - "name": "instructor_to_websoc_instructor_instructor_ucinetid_instructor_ucinetid_fk", - "tableFrom": "instructor_to_websoc_instructor", - "tableTo": "instructor", - "columnsFrom": ["instructor_ucinetid"], - "columnsTo": ["ucinetid"], - "onDelete": "no action", - "onUpdate": "no action" - }, - "instructor_to_websoc_instructor_websoc_instructor_name_websoc_instructor_name_fk": { - "name": "instructor_to_websoc_instructor_websoc_instructor_name_websoc_instructor_name_fk", - "tableFrom": "instructor_to_websoc_instructor", - "tableTo": "websoc_instructor", - "columnsFrom": ["websoc_instructor_name"], - "columnsTo": ["name"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.larc_section": { - "name": "larc_section", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "course_id": { - "name": "course_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "days_string": { - "name": "days_string", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "time_string": { - "name": "time_string", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "start_time": { - "name": "start_time", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "end_time": { - "name": "end_time", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "instructor": { - "name": "instructor", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "building": { - "name": "building", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "meets_monday": { - "name": "meets_monday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_tuesday": { - "name": "meets_tuesday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_wednesday": { - "name": "meets_wednesday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_thursday": { - "name": "meets_thursday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_friday": { - "name": "meets_friday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_saturday": { - "name": "meets_saturday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_sunday": { - "name": "meets_sunday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "larc_section_course_id_index": { - "name": "larc_section_course_id_index", - "columns": [ - { - "expression": "course_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "larc_section_course_id_websoc_course_id_fk": { - "name": "larc_section_course_id_websoc_course_id_fk", - "tableFrom": "larc_section", - "tableTo": "websoc_course", - "columnsFrom": ["course_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.library_traffic": { - "name": "library_traffic", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "library_name": { - "name": "library_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "location_name": { - "name": "location_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "traffic_count": { - "name": "traffic_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "traffic_percentage": { - "name": "traffic_percentage", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "timestamp": { - "name": "timestamp", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "library_traffic_library_name_index": { - "name": "library_traffic_library_name_index", - "columns": [ - { - "expression": "library_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "library_traffic_location_name_index": { - "name": "library_traffic_location_name_index", - "columns": [ - { - "expression": "location_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.library_traffic_history": { - "name": "library_traffic_history", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "location_id": { - "name": "location_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "traffic_count": { - "name": "traffic_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "traffic_percentage": { - "name": "traffic_percentage", - "type": "real", - "primaryKey": false, - "notNull": true - }, - "timestamp": { - "name": "timestamp", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "library_traffic_history_location_id_timestamp_index": { - "name": "library_traffic_history_location_id_timestamp_index", - "columns": [ - { - "expression": "location_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "timestamp", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "library_traffic_history_location_id_library_traffic_id_fk": { - "name": "library_traffic_history_location_id_library_traffic_id_fk", - "tableFrom": "library_traffic_history", - "tableTo": "library_traffic", - "columnsFrom": ["location_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.major": { - "name": "major", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "degree_id": { - "name": "degree_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "code": { - "name": "code", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "specialization_required": { - "name": "specialization_required", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "college_requirement": { - "name": "college_requirement", - "type": "uuid", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "major_degree_id_index": { - "name": "major_degree_id_index", - "columns": [ - { - "expression": "degree_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "major_college_requirement_index": { - "name": "major_college_requirement_index", - "columns": [ - { - "expression": "college_requirement", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "major_degree_id_degree_id_fk": { - "name": "major_degree_id_degree_id_fk", - "tableFrom": "major", - "tableTo": "degree", - "columnsFrom": ["degree_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - }, - "major_college_requirement_college_requirement_id_fk": { - "name": "major_college_requirement_college_requirement_id_fk", - "tableFrom": "major", - "tableTo": "college_requirement", - "columnsFrom": ["college_requirement"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.major_requirement": { - "name": "major_requirement", - "schema": "", - "columns": { - "requirements": { - "name": "requirements", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "id": { - "name": "id", - "type": "bigint", - "primaryKey": true, - "notNull": true, - "generated": { - "as": "jsonb_hash_extended(requirements, 0)", - "type": "stored" - } - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.major_spec_pair_to_requirement": { - "name": "major_spec_pair_to_requirement", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true, - "generated": { - "as": "\n CASE WHEN \"major_spec_pair_to_requirement\".\"spec_id\" IS NOT NULL\n THEN \"major_spec_pair_to_requirement\".\"major_id\" || '+' || \"major_spec_pair_to_requirement\".\"spec_id\"\n ELSE \"major_spec_pair_to_requirement\".\"major_id\"\n END", - "type": "stored" - } - }, - "major_id": { - "name": "major_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "spec_id": { - "name": "spec_id", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "requirement_id": { - "name": "requirement_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "major_spec_pair_to_requirement_major_id_major_id_fk": { - "name": "major_spec_pair_to_requirement_major_id_major_id_fk", - "tableFrom": "major_spec_pair_to_requirement", - "tableTo": "major", - "columnsFrom": ["major_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - }, - "major_spec_pair_to_requirement_spec_id_specialization_id_fk": { - "name": "major_spec_pair_to_requirement_spec_id_specialization_id_fk", - "tableFrom": "major_spec_pair_to_requirement", - "tableTo": "specialization", - "columnsFrom": ["spec_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - }, - "major_spec_pair_to_requirement_requirement_id_major_requirement_id_fk": { - "name": "major_spec_pair_to_requirement_requirement_id_major_requirement_id_fk", - "tableFrom": "major_spec_pair_to_requirement", - "tableTo": "major_requirement", - "columnsFrom": ["requirement_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.minor": { - "name": "minor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "requirements": { - "name": "requirements", - "type": "json", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.prerequisite": { - "name": "prerequisite", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "dep_dept": { - "name": "dep_dept", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "prerequisite_id": { - "name": "prerequisite_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "dependency_id": { - "name": "dependency_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "prerequisite_dep_dept_index": { - "name": "prerequisite_dep_dept_index", - "columns": [ - { - "expression": "dep_dept", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "prerequisite_prerequisite_id_index": { - "name": "prerequisite_prerequisite_id_index", - "columns": [ - { - "expression": "prerequisite_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "prerequisite_dependency_id_index": { - "name": "prerequisite_dependency_id_index", - "columns": [ - { - "expression": "dependency_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "prerequisite_prerequisite_id_dependency_id_index": { - "name": "prerequisite_prerequisite_id_dependency_id_index", - "columns": [ - { - "expression": "prerequisite_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dependency_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.sample_program_variation": { - "name": "sample_program_variation", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "program_id": { - "name": "program_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "label": { - "name": "label", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "sample_program": { - "name": "sample_program", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "variation_notes": { - "name": "variation_notes", - "type": "varchar[]", - "primaryKey": false, - "notNull": true, - "default": "ARRAY[]::VARCHAR[]" - } - }, - "indexes": {}, - "foreignKeys": { - "sample_program_variation_program_id_catalogue_program_id_fk": { - "name": "sample_program_variation_program_id_catalogue_program_id_fk", - "tableFrom": "sample_program_variation", - "tableTo": "catalogue_program", - "columnsFrom": ["program_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.school_requirement": { - "name": "school_requirement", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "requirements": { - "name": "requirements", - "type": "json", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.specialization": { - "name": "specialization", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "major_id": { - "name": "major_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "requirements": { - "name": "requirements", - "type": "json", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "specialization_major_id_index": { - "name": "specialization_major_id_index", - "columns": [ - { - "expression": "major_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "specialization_major_id_major_id_fk": { - "name": "specialization_major_id_major_id_fk", - "tableFrom": "specialization", - "tableTo": "major", - "columnsFrom": ["major_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.study_location": { - "name": "study_location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.study_room": { - "name": "study_room", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "capacity": { - "name": "capacity", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "location": { - "name": "location", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "directions": { - "name": "directions", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "tech_enhanced": { - "name": "tech_enhanced", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "url": { - "name": "url", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "study_location_id": { - "name": "study_location_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "study_room_study_location_id_index": { - "name": "study_room_study_location_id_index", - "columns": [ - { - "expression": "study_location_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "study_room_study_location_id_study_location_id_fk": { - "name": "study_room_study_location_id_study_location_id_fk", - "tableFrom": "study_room", - "tableTo": "study_location", - "columnsFrom": ["study_location_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.study_room_slot": { - "name": "study_room_slot", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "study_room_id": { - "name": "study_room_id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "start": { - "name": "start", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "end": { - "name": "end", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "is_available": { - "name": "is_available", - "type": "boolean", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "study_room_slot_study_room_id_index": { - "name": "study_room_slot_study_room_id_index", - "columns": [ - { - "expression": "study_room_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "study_room_slot_study_room_id_start_end_index": { - "name": "study_room_slot_study_room_id_start_end_index", - "columns": [ - { - "expression": "study_room_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "start", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "end", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "study_room_slot_study_room_id_study_room_id_fk": { - "name": "study_room_slot_study_room_id_study_room_id_fk", - "tableFrom": "study_room_slot", - "tableTo": "study_room", - "columnsFrom": ["study_room_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_course": { - "name": "websoc_course", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "department_id": { - "name": "department_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "course_id": { - "name": "course_id", - "type": "varchar", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "REPLACE(\"websoc_course\".\"dept_code\", ' ', '') || \"websoc_course\".\"course_number\"", - "type": "stored" - } - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "year": { - "name": "year", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "quarter": { - "name": "quarter", - "type": "term", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "school_name": { - "name": "school_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "dept_code": { - "name": "dept_code", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "course_title": { - "name": "course_title", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "course_number": { - "name": "course_number", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "course_numeric": { - "name": "course_numeric", - "type": "integer", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "CASE REGEXP_REPLACE(\"websoc_course\".\"course_number\", '\\D', '', 'g') WHEN '' THEN 0 ELSE REGEXP_REPLACE(\"websoc_course\".\"course_number\", '\\D', '', 'g')::INTEGER END", - "type": "stored" - } - }, - "course_comment": { - "name": "course_comment", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "prerequisite_link": { - "name": "prerequisite_link", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "is_ge_1a": { - "name": "is_ge_1a", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_1b": { - "name": "is_ge_1b", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_2": { - "name": "is_ge_2", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_3": { - "name": "is_ge_3", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_4": { - "name": "is_ge_4", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_5a": { - "name": "is_ge_5a", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_5b": { - "name": "is_ge_5b", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_6": { - "name": "is_ge_6", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_7": { - "name": "is_ge_7", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "is_ge_8": { - "name": "is_ge_8", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "websoc_course_department_id_index": { - "name": "websoc_course_department_id_index", - "columns": [ - { - "expression": "department_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_course_id_index": { - "name": "websoc_course_course_id_index", - "columns": [ - { - "expression": "course_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_school_name_dept_code_course_number_course_title_index": { - "name": "websoc_course_year_quarter_school_name_dept_code_course_number_course_title_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "school_name", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dept_code", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "course_number", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "course_title", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_1a_index": { - "name": "websoc_course_year_quarter_is_ge_1a_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_1a", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_1b_index": { - "name": "websoc_course_year_quarter_is_ge_1b_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_1b", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_2_index": { - "name": "websoc_course_year_quarter_is_ge_2_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_2", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_3_index": { - "name": "websoc_course_year_quarter_is_ge_3_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_3", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_4_index": { - "name": "websoc_course_year_quarter_is_ge_4_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_4", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_5a_index": { - "name": "websoc_course_year_quarter_is_ge_5a_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_5a", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_5b_index": { - "name": "websoc_course_year_quarter_is_ge_5b_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_5b", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_6_index": { - "name": "websoc_course_year_quarter_is_ge_6_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_6", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_7_index": { - "name": "websoc_course_year_quarter_is_ge_7_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_7", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_is_ge_8_index": { - "name": "websoc_course_year_quarter_is_ge_8_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "is_ge_8", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_dept_code_index": { - "name": "websoc_course_year_quarter_dept_code_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dept_code", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_course_year_quarter_dept_code_course_number_index": { - "name": "websoc_course_year_quarter_dept_code_course_number_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dept_code", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "course_number", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_course_department_id_websoc_department_id_fk": { - "name": "websoc_course_department_id_websoc_department_id_fk", - "tableFrom": "websoc_course", - "tableTo": "websoc_department", - "columnsFrom": ["department_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_department": { - "name": "websoc_department", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "school_id": { - "name": "school_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "year": { - "name": "year", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "quarter": { - "name": "quarter", - "type": "term", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "dept_code": { - "name": "dept_code", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "dept_name": { - "name": "dept_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "dept_comment": { - "name": "dept_comment", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "section_code_range_comments": { - "name": "section_code_range_comments", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "course_number_range_comments": { - "name": "course_number_range_comments", - "type": "text[]", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "websoc_department_school_id_index": { - "name": "websoc_department_school_id_index", - "columns": [ - { - "expression": "school_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_department_year_quarter_school_id_dept_code_index": { - "name": "websoc_department_year_quarter_school_id_dept_code_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "school_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "dept_code", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_department_school_id_websoc_school_id_fk": { - "name": "websoc_department_school_id_websoc_school_id_fk", - "tableFrom": "websoc_department", - "tableTo": "websoc_school", - "columnsFrom": ["school_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_instructor": { - "name": "websoc_instructor", - "schema": "", - "columns": { - "name": { - "name": "name", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_location": { - "name": "websoc_location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "building": { - "name": "building", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "room": { - "name": "room", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "websoc_location_building_room_index": { - "name": "websoc_location_building_room_index", - "columns": [ - { - "expression": "building", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "room", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_meta": { - "name": "websoc_meta", - "schema": "", - "columns": { - "name": { - "name": "name", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "last_scraped": { - "name": "last_scraped", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "last_dept_scraped": { - "name": "last_dept_scraped", - "type": "varchar", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_school": { - "name": "websoc_school", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "year": { - "name": "year", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "quarter": { - "name": "quarter", - "type": "term", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "school_name": { - "name": "school_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "school_comment": { - "name": "school_comment", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "websoc_school_year_quarter_school_name_index": { - "name": "websoc_school_year_quarter_school_name_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "school_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_section": { - "name": "websoc_section", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "course_id": { - "name": "course_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "year": { - "name": "year", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "quarter": { - "name": "quarter", - "type": "term", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "units": { - "name": "units", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "websoc_status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "instructors": { - "name": "instructors", - "type": "text[]", - "primaryKey": false, - "notNull": true - }, - "meetings": { - "name": "meetings", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "final_exam_string": { - "name": "final_exam_string", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "final_exam": { - "name": "final_exam", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "section_num": { - "name": "section_num", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "max_capacity": { - "name": "max_capacity", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "section_code": { - "name": "section_code", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "section_type": { - "name": "section_type", - "type": "websoc_section_type", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "num_requested": { - "name": "num_requested", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "restriction_string": { - "name": "restriction_string", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "restriction_a": { - "name": "restriction_a", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_b": { - "name": "restriction_b", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_c": { - "name": "restriction_c", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_d": { - "name": "restriction_d", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_e": { - "name": "restriction_e", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_f": { - "name": "restriction_f", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_g": { - "name": "restriction_g", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_h": { - "name": "restriction_h", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_i": { - "name": "restriction_i", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_j": { - "name": "restriction_j", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_k": { - "name": "restriction_k", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_l": { - "name": "restriction_l", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_m": { - "name": "restriction_m", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_n": { - "name": "restriction_n", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_o": { - "name": "restriction_o", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_r": { - "name": "restriction_r", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_s": { - "name": "restriction_s", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "restriction_x": { - "name": "restriction_x", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "num_on_waitlist": { - "name": "num_on_waitlist", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "num_waitlist_cap": { - "name": "num_waitlist_cap", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "section_comment": { - "name": "section_comment", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "num_new_only_reserved": { - "name": "num_new_only_reserved", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "num_currently_total_enrolled": { - "name": "num_currently_total_enrolled", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "num_currently_section_enrolled": { - "name": "num_currently_section_enrolled", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "is_cancelled": { - "name": "is_cancelled", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "\"websoc_section\".\"section_comment\" LIKE '%*** CANCELLED ***%' OR \"websoc_section\".\"section_comment\" LIKE '%*** CANCELED ***%'", - "type": "stored" - } - }, - "web_url": { - "name": "web_url", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": { - "websoc_section_course_id_index": { - "name": "websoc_section_course_id_index", - "columns": [ - { - "expression": "course_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_section_year_quarter_section_code_index": { - "name": "websoc_section_year_quarter_section_code_index", - "columns": [ - { - "expression": "year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "quarter", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "section_code", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_section_course_id_websoc_course_id_fk": { - "name": "websoc_section_course_id_websoc_course_id_fk", - "tableFrom": "websoc_section", - "tableTo": "websoc_course", - "columnsFrom": ["course_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_section_enrollment": { - "name": "websoc_section_enrollment", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "section_id": { - "name": "section_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "date", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "year": { - "name": "year", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "quarter": { - "name": "quarter", - "type": "term", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "max_capacity": { - "name": "max_capacity", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "num_currently_total_enrolled": { - "name": "num_currently_total_enrolled", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "num_on_waitlist": { - "name": "num_on_waitlist", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "num_waitlist_cap": { - "name": "num_waitlist_cap", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "num_requested": { - "name": "num_requested", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "num_new_only_reserved": { - "name": "num_new_only_reserved", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "websoc_status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "websoc_section_enrollment_section_id_index": { - "name": "websoc_section_enrollment_section_id_index", - "columns": [ - { - "expression": "section_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_section_enrollment_section_id_created_at_index": { - "name": "websoc_section_enrollment_section_id_created_at_index", - "columns": [ - { - "expression": "section_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_section_enrollment_section_id_websoc_section_id_fk": { - "name": "websoc_section_enrollment_section_id_websoc_section_id_fk", - "tableFrom": "websoc_section_enrollment", - "tableTo": "websoc_section", - "columnsFrom": ["section_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_section_grade": { - "name": "websoc_section_grade", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "section_id": { - "name": "section_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "grade_a_count": { - "name": "grade_a_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "grade_b_count": { - "name": "grade_b_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "grade_c_count": { - "name": "grade_c_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "grade_d_count": { - "name": "grade_d_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "grade_f_count": { - "name": "grade_f_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "grade_p_count": { - "name": "grade_p_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "grade_np_count": { - "name": "grade_np_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "grade_w_count": { - "name": "grade_w_count", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "average_gpa": { - "name": "average_gpa", - "type": "numeric(3, 2)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "websoc_section_grade_section_id_index": { - "name": "websoc_section_grade_section_id_index", - "columns": [ - { - "expression": "section_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_section_grade_section_id_websoc_section_id_fk": { - "name": "websoc_section_grade_section_id_websoc_section_id_fk", - "tableFrom": "websoc_section_grade", - "tableTo": "websoc_section", - "columnsFrom": ["section_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "websoc_section_grade_section_id_unique": { - "name": "websoc_section_grade_section_id_unique", - "nullsNotDistinct": false, - "columns": ["section_id"] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_section_meeting": { - "name": "websoc_section_meeting", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "section_id": { - "name": "section_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "section_code": { - "name": "section_code", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "meeting_index": { - "name": "meeting_index", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "time_string": { - "name": "time_string", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "time_is_tba": { - "name": "time_is_tba", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "\"websoc_section_meeting\".\"time_string\" LIKE '%TBA%'", - "type": "stored" - } - }, - "start_time": { - "name": "start_time", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "end_time": { - "name": "end_time", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "days_string": { - "name": "days_string", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "meets_monday": { - "name": "meets_monday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_tuesday": { - "name": "meets_tuesday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_wednesday": { - "name": "meets_wednesday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_thursday": { - "name": "meets_thursday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_friday": { - "name": "meets_friday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_saturday": { - "name": "meets_saturday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "meets_sunday": { - "name": "meets_sunday", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "websoc_section_meeting_section_id_index": { - "name": "websoc_section_meeting_section_id_index", - "columns": [ - { - "expression": "section_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_section_meeting_section_id_websoc_section_id_fk": { - "name": "websoc_section_meeting_section_id_websoc_section_id_fk", - "tableFrom": "websoc_section_meeting", - "tableTo": "websoc_section", - "columnsFrom": ["section_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_section_meeting_to_location": { - "name": "websoc_section_meeting_to_location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "meeting_id": { - "name": "meeting_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "location_id": { - "name": "location_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "websoc_section_meeting_to_location_meeting_id_index": { - "name": "websoc_section_meeting_to_location_meeting_id_index", - "columns": [ - { - "expression": "meeting_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_section_meeting_to_location_location_id_index": { - "name": "websoc_section_meeting_to_location_location_id_index", - "columns": [ - { - "expression": "location_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_section_meeting_to_location_meeting_id_location_id_index": { - "name": "websoc_section_meeting_to_location_meeting_id_location_id_index", - "columns": [ - { - "expression": "meeting_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "location_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_section_meeting_to_location_meeting_id_websoc_section_meeting_id_fk": { - "name": "websoc_section_meeting_to_location_meeting_id_websoc_section_meeting_id_fk", - "tableFrom": "websoc_section_meeting_to_location", - "tableTo": "websoc_section_meeting", - "columnsFrom": ["meeting_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "websoc_section_meeting_to_location_location_id_websoc_location_id_fk": { - "name": "websoc_section_meeting_to_location_location_id_websoc_location_id_fk", - "tableFrom": "websoc_section_meeting_to_location", - "tableTo": "websoc_location", - "columnsFrom": ["location_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.websoc_section_to_instructor": { - "name": "websoc_section_to_instructor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "section_id": { - "name": "section_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "instructor_name": { - "name": "instructor_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "websoc_section_to_instructor_section_id_index": { - "name": "websoc_section_to_instructor_section_id_index", - "columns": [ - { - "expression": "section_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "websoc_section_to_instructor_instructor_name_index": { - "name": "websoc_section_to_instructor_instructor_name_index", - "columns": [ - { - "expression": "instructor_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "websoc_section_to_instructor_section_id_websoc_section_id_fk": { - "name": "websoc_section_to_instructor_section_id_websoc_section_id_fk", - "tableFrom": "websoc_section_to_instructor", - "tableTo": "websoc_section", - "columnsFrom": ["section_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - }, - "websoc_section_to_instructor_instructor_name_websoc_instructor_name_fk": { - "name": "websoc_section_to_instructor_instructor_name_websoc_instructor_name_fk", - "tableFrom": "websoc_section_to_instructor", - "tableTo": "websoc_instructor", - "columnsFrom": ["instructor_name"], - "columnsTo": ["name"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.course_level": { - "name": "course_level", - "schema": "public", - "values": ["LowerDiv", "UpperDiv", "Graduate"] - }, - "public.division": { - "name": "division", - "schema": "public", - "values": ["Undergraduate", "Graduate"] - }, - "public.term": { - "name": "term", - "schema": "public", - "values": ["Fall", "Winter", "Spring", "Summer1", "Summer10wk", "Summer2"] - }, - "public.websoc_section_type": { - "name": "websoc_section_type", - "schema": "public", - "values": [ - "Act", - "Col", - "Dis", - "Fld", - "Lab", - "Lec", - "Qiz", - "Res", - "Sem", - "Stu", - "Tap", - "Tut" - ] - }, - "public.websoc_status": { - "name": "websoc_status", - "schema": "public", - "values": ["OPEN", "Waitl", "FULL", "NewOnly"] - } - }, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": { - "public.course_view": { - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "department": { - "name": "department", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "shortened_dept": { - "name": "shortened_dept", - "type": "varchar", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "REPLACE(\"course\".\"department\", ' ', '')", - "type": "stored" - } - }, - "department_alias": { - "name": "department_alias", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "course_number": { - "name": "course_number", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "course_numeric": { - "name": "course_numeric", - "type": "integer", - "primaryKey": false, - "notNull": true, - "generated": { - "as": "CASE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g') WHEN '' THEN 0 ELSE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g')::INTEGER END", - "type": "stored" - } - }, - "school": { - "name": "school", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "course_level": { - "name": "course_level", - "type": "course_level", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "min_units": { - "name": "min_units", - "type": "numeric(4, 2)", - "primaryKey": false, - "notNull": true - }, - "max_units": { - "name": "max_units", - "type": "numeric(4, 2)", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "department_name": { - "name": "department_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "prerequisite_tree": { - "name": "prerequisite_tree", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "prerequisite_text": { - "name": "prerequisite_text", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "repeatability": { - "name": "repeatability", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "grading_option": { - "name": "grading_option", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "concurrent": { - "name": "concurrent", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "same_as": { - "name": "same_as", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "restriction": { - "name": "restriction", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "overlap": { - "name": "overlap", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "corequisites": { - "name": "corequisites", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "is_ge_1a": { - "name": "is_ge_1a", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_1b": { - "name": "is_ge_1b", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_2": { - "name": "is_ge_2", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_3": { - "name": "is_ge_3", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_4": { - "name": "is_ge_4", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_5a": { - "name": "is_ge_5a", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_5b": { - "name": "is_ge_5b", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_6": { - "name": "is_ge_6", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_7": { - "name": "is_ge_7", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "is_ge_8": { - "name": "is_ge_8", - "type": "boolean", - "primaryKey": false, - "notNull": true - }, - "ge_text": { - "name": "ge_text", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "definition": "select \"course\".\"id\", \"course\".\"updated_at\", \"course\".\"department\", \"course\".\"shortened_dept\", \"course\".\"department_alias\", \"course\".\"course_number\", \"course\".\"course_numeric\", \"course\".\"school\", \"course\".\"title\", \"course\".\"course_level\", \"course\".\"min_units\", \"course\".\"max_units\", \"course\".\"description\", \"course\".\"department_name\", \"course\".\"prerequisite_tree\", \"course\".\"prerequisite_text\", \"course\".\"repeatability\", \"course\".\"grading_option\", \"course\".\"concurrent\", \"course\".\"same_as\", \"course\".\"restriction\", \"course\".\"overlap\", \"course\".\"corequisites\", \"course\".\"is_ge_1a\", \"course\".\"is_ge_1b\", \"course\".\"is_ge_2\", \"course\".\"is_ge_3\", \"course\".\"is_ge_4\", \"course\".\"is_ge_5a\", \"course\".\"is_ge_5b\", \"course\".\"is_ge_6\", \"course\".\"is_ge_7\", \"course\".\"is_ge_8\", \"course\".\"ge_text\", \n ARRAY_REMOVE(COALESCE(\n (\n SELECT ARRAY_AGG(\n CASE WHEN \"prerequisite_course\".\"id\" IS NULL THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'id', \"prerequisite_course\".\"id\",\n 'title', \"prerequisite_course\".\"title\",\n 'department', \"prerequisite_course\".\"department\",\n 'courseNumber', \"prerequisite_course\".\"course_number\"\n )\n END\n )\n FROM \"prerequisite\"\n LEFT JOIN \"course\" \"prerequisite_course\" ON \"prerequisite_course\".\"id\" = \"prerequisite\".\"prerequisite_id\"\n WHERE \"prerequisite\".\"dependency_id\" = \"course\".\"id\"\n ),\n ARRAY[]::JSONB[]), NULL)\n as \"prerequisites\", \n ARRAY_REMOVE(COALESCE(\n (\n SELECT ARRAY_AGG(\n CASE WHEN \"dependency_course\".\"id\" IS NULL THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'id', \"dependency_course\".\"id\",\n 'title', \"dependency_course\".\"title\",\n 'department', \"dependency_course\".\"department\",\n 'courseNumber', \"dependency_course\".\"course_number\"\n )\n END\n )\n FROM \"prerequisite\" \"dependency\"\n LEFT JOIN \"course\" \"dependency_course\" ON \"dependency_course\".\"id\" = \"dependency\".\"dependency_id\"\n WHERE \"dependency\".\"prerequisite_id\" = \"course\".\"id\"\n ),\n ARRAY[]::JSONB[]), NULL)\n as \"dependencies\", \n ARRAY_REMOVE(ARRAY_AGG(DISTINCT\n CASE WHEN \"websoc_course\".\"year\" IS NULL THEN NULL\n ELSE CONCAT(\"websoc_course\".\"year\", ' ', \"websoc_course\".\"quarter\")\n END\n ), NULL)\n as \"terms\", \n ARRAY_REMOVE(COALESCE(ARRAY_AGG(DISTINCT\n CASE WHEN \"instructor\".\"ucinetid\" IS NULL THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'ucinetid', \"instructor\".\"ucinetid\",\n 'name', \"instructor\".\"name\",\n 'title', \"instructor\".\"title\",\n 'email', \"instructor\".\"email\",\n 'department', \"instructor\".\"department\",\n 'shortenedNames', ARRAY(\n SELECT \"instructor_to_websoc_instructor\".\"websoc_instructor_name\"\n FROM \"instructor_to_websoc_instructor\"\n WHERE \"instructor_to_websoc_instructor\".\"instructor_ucinetid\" = \"instructor\".\"ucinetid\"\n )\n )\n END\n ), ARRAY[]::JSONB[]), NULL)\n as \"instructors\" from \"course\" left join \"websoc_course\" on \"websoc_course\".\"course_id\" = \"course\".\"id\" left join \"websoc_section\" on \"websoc_section\".\"course_id\" = \"websoc_course\".\"id\" left join \"websoc_section_to_instructor\" on \"websoc_section_to_instructor\".\"section_id\" = \"websoc_section\".\"id\" left join \"websoc_instructor\" on \"websoc_instructor\".\"name\" = \"websoc_section_to_instructor\".\"instructor_name\" left join \"instructor_to_websoc_instructor\" on \"instructor_to_websoc_instructor\".\"websoc_instructor_name\" = \"websoc_instructor\".\"name\" left join \"instructor\" on (\"instructor\".\"ucinetid\" = \"instructor_to_websoc_instructor\".\"instructor_ucinetid\" and \"instructor\".\"ucinetid\" is not null and \"instructor\".\"ucinetid\" <> 'student') group by \"course\".\"id\"", - "name": "course_view", - "schema": "public", - "isExisting": false, - "materialized": true - }, - "public.instructor_view": { - "columns": { - "ucinetid": { - "name": "ucinetid", - "type": "varchar", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "department": { - "name": "department", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "definition": "with \"shortened_names_cte\" as (select \"instructor_ucinetid\", ARRAY_AGG(\"websoc_instructor_name\") as \"shortened_names\" from \"instructor_to_websoc_instructor\" group by \"instructor_to_websoc_instructor\".\"instructor_ucinetid\"), \"courses_cte\" as (with \"terms_cte\" as (select \"course\".\"id\", \"instructor_to_websoc_instructor\".\"instructor_ucinetid\", \n ARRAY_REMOVE(ARRAY_AGG(DISTINCT\n CASE WHEN \"websoc_course\".\"year\" IS NULL THEN NULL\n ELSE CONCAT(\"websoc_course\".\"year\", ' ', \"websoc_course\".\"quarter\")\n END\n ), NULL) as \"terms\" from \"course\" left join \"websoc_course\" on \"websoc_course\".\"course_id\" = \"course\".\"id\" left join \"websoc_section\" on \"websoc_section\".\"course_id\" = \"websoc_course\".\"id\" left join \"websoc_section_to_instructor\" on \"websoc_section_to_instructor\".\"section_id\" = \"websoc_section\".\"id\" left join \"websoc_instructor\" on \"websoc_instructor\".\"name\" = \"websoc_section_to_instructor\".\"instructor_name\" left join \"instructor_to_websoc_instructor\" on \"instructor_to_websoc_instructor\".\"websoc_instructor_name\" = \"websoc_instructor\".\"name\" group by \"course\".\"id\", \"instructor_to_websoc_instructor\".\"instructor_ucinetid\") select \"terms_cte\".\"instructor_ucinetid\", \"course\".\"id\", \n CASE WHEN \"course\".\"id\" IS NULL\n THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'id', \"course\".\"id\",\n 'title', \"course\".\"title\",\n 'department', \"course\".\"department\",\n 'courseNumber', \"course\".\"course_number\",\n 'terms', COALESCE(\"terms\", ARRAY[]::TEXT[])\n )\n END\n as \"course_info\" from \"course\" left join \"terms_cte\" on \"terms_cte\".\"id\" = \"course\".\"id\" group by \"course\".\"id\", \"terms_cte\".\"instructor_ucinetid\", \"terms\") select \"instructor\".\"ucinetid\", \"instructor\".\"name\", \"instructor\".\"title\", \"instructor\".\"email\", \"instructor\".\"department\", COALESCE(\"shortened_names\", ARRAY[]::TEXT[]) as \"shortened_names\", \n ARRAY_REMOVE(ARRAY_AGG(DISTINCT \"course_info\"), NULL)\n as \"courses\" from \"instructor\" left join \"shortened_names_cte\" on \"shortened_names_cte\".\"instructor_ucinetid\" = \"instructor\".\"ucinetid\" left join \"courses_cte\" on \"courses_cte\".\"instructor_ucinetid\" = \"instructor\".\"ucinetid\" where \"instructor\".\"ucinetid\" <> 'student' group by \"instructor\".\"ucinetid\", \"shortened_names\"", - "name": "instructor_view", - "schema": "public", - "isExisting": false, - "materialized": true - } - }, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} diff --git a/packages/db/migrations/meta/_journal.json b/packages/db/migrations/meta/_journal.json index ca631e2a..dedf6a65 100644 --- a/packages/db/migrations/meta/_journal.json +++ b/packages/db/migrations/meta/_journal.json @@ -183,13 +183,6 @@ "when": 1772871872701, "tag": "0025_major_specialization_required", "breakpoints": true - }, - { - "idx": 26, - "version": "7", - "when": 1772218836155, - "tag": "0026_polymorphic_major_requirements", - "breakpoints": true } ] } diff --git a/packages/db/src/schema.ts b/packages/db/src/schema.ts index 19c0d9fa..9ebfb0bc 100644 --- a/packages/db/src/schema.ts +++ b/packages/db/src/schema.ts @@ -669,14 +669,14 @@ export const collegeRequirement = pgTable("college_requirement", { requirements: jsonb("requirements").$type().unique().notNull(), }); -export const majorSpecPairToRequirement = pgTable("major_spec_pair_to_requirement", { +export const majorSpecializationToRequirement = pgTable("major_specialization_to_requirement", { id: varchar("id") .primaryKey() .generatedAlwaysAs((): SQL => { return sql` - CASE WHEN ${majorSpecPairToRequirement.specId} IS NOT NULL - THEN ${majorSpecPairToRequirement.majorId} || '+' || ${majorSpecPairToRequirement.specId} - ELSE ${majorSpecPairToRequirement.majorId} + CASE WHEN ${majorSpecializationToRequirement.specId} IS NOT NULL + THEN ${majorSpecializationToRequirement.majorId} || '+' || ${majorSpecializationToRequirement.specId} + ELSE ${majorSpecializationToRequirement.majorId} END`; }), majorId: varchar("major_id") From e1c9ddbbf7fc4f9fff3ec6bcddd78fedcf04996b Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Sun, 22 Mar 2026 11:47:23 -0700 Subject: [PATCH 90/91] remigrate and fix dwClient majorAudit bug --- .../src/components/Scraper.ts | 17 +- .../0027_polymorphic_major_requirements.sql | 35 + .../db/migrations/meta/0027_snapshot.json | 4641 +++++++++++++++++ packages/db/migrations/meta/_journal.json | 7 + 4 files changed, 4689 insertions(+), 11 deletions(-) create mode 100644 packages/db/migrations/0027_polymorphic_major_requirements.sql create mode 100644 packages/db/migrations/meta/0027_snapshot.json diff --git a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts index 1abf7eb3..e9dcbd59 100644 --- a/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts +++ b/apps/data-pipeline/degreeworks-scraper/src/components/Scraper.ts @@ -166,23 +166,20 @@ export class Scraper { // bachelor's degrees probably get an abbreviation starting with B degreeCode.startsWith("B") ? "U" : "G", majorCode, - schoolCode, specCode, + schoolCode, ); - const majorAudit = audit?.major; - const specIdentifier = specCode ? `with spec: ${specCode} ` : ""; - const majorIdentifier = `(majorCode = ${majorCode}, degree = ${degreeCode})`; + const specLogInfo = specCode ? ` specCode = ${specCode}` : ""; + const majorLogInfo = `(majorCode = ${majorCode}, degree = ${degreeCode}${specLogInfo})`; if (!majorAudit) { - console.log(`Requirements block not found ${majorIdentifier}`); + console.log(`Requirements block not found ${majorLogInfo}`); continue; } if (ret.has(this.asMajorSpecId(majorAudit.title, specCode))) { - console.log( - `Requirements block already exists for "${majorAudit.title}" ${specIdentifier}${majorIdentifier}`, - ); + console.log(`Requirements block already exists for "${majorAudit.title}" ${majorLogInfo}`); continue; } ret.set(this.asMajorSpecId(majorAudit.title, specCode), { @@ -199,9 +196,7 @@ export class Scraper { specCode, }); - console.log( - `Requirements block found and parsed for "${majorAudit.title}" ${specIdentifier}${majorIdentifier}`, - ); + console.log(`Requirements block found and parsed for "${majorAudit.title}" ${majorLogInfo}`); } return ret; } diff --git a/packages/db/migrations/0027_polymorphic_major_requirements.sql b/packages/db/migrations/0027_polymorphic_major_requirements.sql new file mode 100644 index 00000000..ae32b86e --- /dev/null +++ b/packages/db/migrations/0027_polymorphic_major_requirements.sql @@ -0,0 +1,35 @@ +CREATE TABLE IF NOT EXISTS "major_requirement" ( + "requirements" jsonb NOT NULL, + "id" bigint PRIMARY KEY GENERATED ALWAYS AS (jsonb_hash_extended(requirements, 0)) STORED NOT NULL +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "major_specialization_to_requirement" ( + "id" varchar PRIMARY KEY GENERATED ALWAYS AS ( + CASE WHEN "major_specialization_to_requirement"."spec_id" IS NOT NULL + THEN "major_specialization_to_requirement"."major_id" || '+' || "major_specialization_to_requirement"."spec_id" + ELSE "major_specialization_to_requirement"."major_id" + END) STORED NOT NULL, + "major_id" varchar NOT NULL, + "spec_id" varchar, + "requirement_id" bigint +); +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "major_specialization_to_requirement" ADD CONSTRAINT "major_specialization_to_requirement_major_id_major_id_fk" FOREIGN KEY ("major_id") REFERENCES "public"."major"("id") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "major_specialization_to_requirement" ADD CONSTRAINT "major_specialization_to_requirement_spec_id_specialization_id_fk" FOREIGN KEY ("spec_id") REFERENCES "public"."specialization"("id") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "major_specialization_to_requirement" ADD CONSTRAINT "major_specialization_to_requirement_requirement_id_major_requirement_id_fk" FOREIGN KEY ("requirement_id") REFERENCES "public"."major_requirement"("id") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +ALTER TABLE "major" DROP COLUMN IF EXISTS "requirements"; \ No newline at end of file diff --git a/packages/db/migrations/meta/0027_snapshot.json b/packages/db/migrations/meta/0027_snapshot.json new file mode 100644 index 00000000..6632c722 --- /dev/null +++ b/packages/db/migrations/meta/0027_snapshot.json @@ -0,0 +1,4641 @@ +{ + "id": "ccc196dc-0591-4a1d-ab1d-968b95b909e7", + "prevId": "c0f62b68-af2c-4377-bf84-83a14454c844", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.ap_exam": { + "name": "ap_exam", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "catalogue_name": { + "name": "catalogue_name", + "type": "varchar", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.ap_exam_reward": { + "name": "ap_exam_reward", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "units_granted": { + "name": "units_granted", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "elective_units_granted": { + "name": "elective_units_granted", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "ge_1a_courses_granted": { + "name": "ge_1a_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_1b_courses_granted": { + "name": "ge_1b_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_2_courses_granted": { + "name": "ge_2_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_3_courses_granted": { + "name": "ge_3_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_4_courses_granted": { + "name": "ge_4_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_5a_courses_granted": { + "name": "ge_5a_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_5b_courses_granted": { + "name": "ge_5b_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_6_courses_granted": { + "name": "ge_6_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_7_courses_granted": { + "name": "ge_7_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "ge_8_courses_granted": { + "name": "ge_8_courses_granted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "courses_granted": { + "name": "courses_granted", + "type": "json", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.ap_exam_to_reward": { + "name": "ap_exam_to_reward", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "exam_id": { + "name": "exam_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "score": { + "name": "score", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "reward": { + "name": "reward", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "ap_exam_to_reward_exam_id_score_index": { + "name": "ap_exam_to_reward_exam_id_score_index", + "columns": [ + { + "expression": "exam_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "score", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "ap_exam_to_reward_exam_id_ap_exam_id_fk": { + "name": "ap_exam_to_reward_exam_id_ap_exam_id_fk", + "tableFrom": "ap_exam_to_reward", + "tableTo": "ap_exam", + "columnsFrom": ["exam_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "ap_exam_to_reward_reward_ap_exam_reward_id_fk": { + "name": "ap_exam_to_reward_reward_ap_exam_reward_id_fk", + "tableFrom": "ap_exam_to_reward", + "tableTo": "ap_exam_reward", + "columnsFrom": ["reward"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.calendar_term": { + "name": "calendar_term", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true, + "generated": { + "as": "\"calendar_term\".\"year\" || ' ' || CASE WHEN \"calendar_term\".\"quarter\" = 'Fall' THEN 'Fall' WHEN \"calendar_term\".\"quarter\" = 'Winter' THEN 'Winter' WHEN \"calendar_term\".\"quarter\" = 'Spring' THEN 'Spring' WHEN \"calendar_term\".\"quarter\" = 'Summer1' THEN 'Summer1' WHEN \"calendar_term\".\"quarter\" = 'Summer10wk' THEN 'Summer10wk' WHEN \"calendar_term\".\"quarter\" = 'Summer2' THEN 'Summer2' ELSE '' END", + "type": "stored" + } + }, + "year": { + "name": "year", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "quarter": { + "name": "quarter", + "type": "term", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "instruction_start": { + "name": "instruction_start", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "instruction_end": { + "name": "instruction_end", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "finals_start": { + "name": "finals_start", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "finals_end": { + "name": "finals_end", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "soc_available": { + "name": "soc_available", + "type": "date", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.catalogue_program": { + "name": "catalogue_program", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "program_name": { + "name": "program_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.college_requirement": { + "name": "college_requirement", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "requirements": { + "name": "requirements", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "requirements_hash": { + "name": "requirements_hash", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "generated": { + "as": "jsonb_hash_extended(requirements, 0)", + "type": "stored" + } + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "college_requirement_requirements_hash_unique": { + "name": "college_requirement_requirements_hash_unique", + "nullsNotDistinct": false, + "columns": ["requirements_hash"] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.course": { + "name": "course", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "department": { + "name": "department", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "shortened_dept": { + "name": "shortened_dept", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "REPLACE(\"course\".\"department\", ' ', '')", + "type": "stored" + } + }, + "department_alias": { + "name": "department_alias", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "course_number": { + "name": "course_number", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_numeric": { + "name": "course_numeric", + "type": "integer", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "CASE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g') WHEN '' THEN 0 ELSE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g')::INTEGER END", + "type": "stored" + } + }, + "school": { + "name": "school", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_level": { + "name": "course_level", + "type": "course_level", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "min_units": { + "name": "min_units", + "type": "numeric(4, 2)", + "primaryKey": false, + "notNull": true + }, + "max_units": { + "name": "max_units", + "type": "numeric(4, 2)", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "department_name": { + "name": "department_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "prerequisite_tree": { + "name": "prerequisite_tree", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "prerequisite_text": { + "name": "prerequisite_text", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "repeatability": { + "name": "repeatability", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "grading_option": { + "name": "grading_option", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "concurrent": { + "name": "concurrent", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "same_as": { + "name": "same_as", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "restriction": { + "name": "restriction", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "overlap": { + "name": "overlap", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "corequisites": { + "name": "corequisites", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "is_ge_1a": { + "name": "is_ge_1a", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_1b": { + "name": "is_ge_1b", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_2": { + "name": "is_ge_2", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_3": { + "name": "is_ge_3", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_4": { + "name": "is_ge_4", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_5a": { + "name": "is_ge_5a", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_5b": { + "name": "is_ge_5b", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_6": { + "name": "is_ge_6", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_7": { + "name": "is_ge_7", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_8": { + "name": "is_ge_8", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "ge_text": { + "name": "ge_text", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "course_search_index": { + "name": "course_search_index", + "columns": [ + { + "expression": "(\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"id\", '')), 'A') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"department\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"department_alias\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"shortened_dept\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"course_number\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"course_numeric\"::TEXT, '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"title\", '')), 'C') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"description\", '')), 'D')\n)", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "gin", + "with": {} + }, + "shortened_dept": { + "name": "shortened_dept", + "columns": [ + { + "expression": "shortened_dept", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.degree": { + "name": "degree", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "division": { + "name": "division", + "type": "division", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.dining_diet_restriction": { + "name": "dining_diet_restriction", + "schema": "", + "columns": { + "dish_id": { + "name": "dish_id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "contains_eggs": { + "name": "contains_eggs", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "contains_fish": { + "name": "contains_fish", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "contains_milk": { + "name": "contains_milk", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "contains_peanuts": { + "name": "contains_peanuts", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "contains_sesame": { + "name": "contains_sesame", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "contains_shellfish": { + "name": "contains_shellfish", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "contains_soy": { + "name": "contains_soy", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "contains_tree_nuts": { + "name": "contains_tree_nuts", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "contains_wheat": { + "name": "contains_wheat", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_gluten_free": { + "name": "is_gluten_free", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_halal": { + "name": "is_halal", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_kosher": { + "name": "is_kosher", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_locally_grown": { + "name": "is_locally_grown", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_organic": { + "name": "is_organic", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_vegan": { + "name": "is_vegan", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_vegetarian": { + "name": "is_vegetarian", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "dining_diet_restriction_dish_id_dining_dish_id_fk": { + "name": "dining_diet_restriction_dish_id_dining_dish_id_fk", + "tableFrom": "dining_diet_restriction", + "tableTo": "dining_dish", + "columnsFrom": ["dish_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.dining_dish": { + "name": "dining_dish", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "station_id": { + "name": "station_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "ingredients": { + "name": "ingredients", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "category": { + "name": "category", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "image_url": { + "name": "image_url", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "dining_dish_station_id_index": { + "name": "dining_dish_station_id_index", + "columns": [ + { + "expression": "station_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "dining_dish_station_id_dining_station_id_fk": { + "name": "dining_dish_station_id_dining_station_id_fk", + "tableFrom": "dining_dish", + "tableTo": "dining_station", + "columnsFrom": ["station_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.dining_dish_to_period": { + "name": "dining_dish_to_period", + "schema": "", + "columns": { + "period_id": { + "name": "period_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "dish_id": { + "name": "dish_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "dining_dish_to_period_period_id_dining_period_id_fk": { + "name": "dining_dish_to_period_period_id_dining_period_id_fk", + "tableFrom": "dining_dish_to_period", + "tableTo": "dining_period", + "columnsFrom": ["period_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "dining_dish_to_period_dish_id_dining_dish_id_fk": { + "name": "dining_dish_to_period_dish_id_dining_dish_id_fk", + "tableFrom": "dining_dish_to_period", + "tableTo": "dining_dish", + "columnsFrom": ["dish_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.dining_event": { + "name": "dining_event", + "schema": "", + "columns": { + "title": { + "name": "title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "image": { + "name": "image", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "restaurant_id": { + "name": "restaurant_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "start": { + "name": "start", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "end": { + "name": "end", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "dining_event_restaurant_id_dining_restaurant_id_fk": { + "name": "dining_event_restaurant_id_dining_restaurant_id_fk", + "tableFrom": "dining_event", + "tableTo": "dining_restaurant", + "columnsFrom": ["restaurant_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "dining_event_pk": { + "name": "dining_event_pk", + "columns": ["title", "restaurant_id", "start"] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.dining_nutrition_info": { + "name": "dining_nutrition_info", + "schema": "", + "columns": { + "dish_id": { + "name": "dish_id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "serving_size": { + "name": "serving_size", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "serving_unit": { + "name": "serving_unit", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "calories": { + "name": "calories", + "type": "numeric(10, 2)", + "primaryKey": false, + "notNull": false + }, + "total_fat_g": { + "name": "total_fat_g", + "type": "numeric(10, 2)", + "primaryKey": false, + "notNull": false + }, + "trans_fat_g": { + "name": "trans_fat_g", + "type": "numeric(10, 2)", + "primaryKey": false, + "notNull": false + }, + "saturated_fat_g": { + "name": "saturated_fat_g", + "type": "numeric(10, 2)", + "primaryKey": false, + "notNull": false + }, + "cholesterol_mg": { + "name": "cholesterol_mg", + "type": "numeric(10, 2)", + "primaryKey": false, + "notNull": false + }, + "sodium_mg": { + "name": "sodium_mg", + "type": "numeric(10, 2)", + "primaryKey": false, + "notNull": false + }, + "total_carbs_g": { + "name": "total_carbs_g", + "type": "numeric(10, 2)", + "primaryKey": false, + "notNull": false + }, + "dietary_fiber_g": { + "name": "dietary_fiber_g", + "type": "numeric(10, 2)", + "primaryKey": false, + "notNull": false + }, + "sugars_g": { + "name": "sugars_g", + "type": "numeric(10, 2)", + "primaryKey": false, + "notNull": false + }, + "protein_g": { + "name": "protein_g", + "type": "numeric(10, 2)", + "primaryKey": false, + "notNull": false + }, + "calcium": { + "name": "calcium", + "type": "numeric(10, 2)", + "primaryKey": false, + "notNull": false + }, + "iron": { + "name": "iron", + "type": "numeric(10, 2)", + "primaryKey": false, + "notNull": false + }, + "vitamin_a": { + "name": "vitamin_a", + "type": "numeric(10, 2)", + "primaryKey": false, + "notNull": false + }, + "vitamin_c": { + "name": "vitamin_c", + "type": "numeric(10, 2)", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "dining_nutrition_info_dish_id_dining_dish_id_fk": { + "name": "dining_nutrition_info_dish_id_dining_dish_id_fk", + "tableFrom": "dining_nutrition_info", + "tableTo": "dining_dish", + "columnsFrom": ["dish_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.dining_period": { + "name": "dining_period", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "adobe_id": { + "name": "adobe_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "date": { + "name": "date", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "restaurant_id": { + "name": "restaurant_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "start_time": { + "name": "start_time", + "type": "time", + "primaryKey": false, + "notNull": true + }, + "end_time": { + "name": "end_time", + "type": "time", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "dining_period_adobe_id_date_restaurant_id_index": { + "name": "dining_period_adobe_id_date_restaurant_id_index", + "columns": [ + { + "expression": "adobe_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "date", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "restaurant_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "dining_period_date_index": { + "name": "dining_period_date_index", + "columns": [ + { + "expression": "date", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "dining_period_restaurant_id_index": { + "name": "dining_period_restaurant_id_index", + "columns": [ + { + "expression": "restaurant_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "dining_period_restaurant_id_dining_restaurant_id_fk": { + "name": "dining_period_restaurant_id_dining_restaurant_id_fk", + "tableFrom": "dining_period", + "tableTo": "dining_restaurant", + "columnsFrom": ["restaurant_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.dining_restaurant": { + "name": "dining_restaurant", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.dining_station": { + "name": "dining_station", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "restaurant_id": { + "name": "restaurant_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "dining_station_restaurant_id_index": { + "name": "dining_station_restaurant_id_index", + "columns": [ + { + "expression": "restaurant_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "dining_station_restaurant_id_dining_restaurant_id_fk": { + "name": "dining_station_restaurant_id_dining_restaurant_id_fk", + "tableFrom": "dining_station", + "tableTo": "dining_restaurant", + "columnsFrom": ["restaurant_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.instructor": { + "name": "instructor", + "schema": "", + "columns": { + "ucinetid": { + "name": "ucinetid", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "email": { + "name": "email", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "department": { + "name": "department", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "instructor_search_index": { + "name": "instructor_search_index", + "columns": [ + { + "expression": "(\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"ucinetid\", '')), 'A') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"name\", '')), 'B') ||\n SETWEIGHT(TO_TSVECTOR('english', COALESCE(\"title\", '')), 'B')\n)", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "gin", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.instructor_to_websoc_instructor": { + "name": "instructor_to_websoc_instructor", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "instructor_ucinetid": { + "name": "instructor_ucinetid", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "websoc_instructor_name": { + "name": "websoc_instructor_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "instructor_to_websoc_instructor_instructor_ucinetid_index": { + "name": "instructor_to_websoc_instructor_instructor_ucinetid_index", + "columns": [ + { + "expression": "instructor_ucinetid", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "instructor_to_websoc_instructor_websoc_instructor_name_index": { + "name": "instructor_to_websoc_instructor_websoc_instructor_name_index", + "columns": [ + { + "expression": "websoc_instructor_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "instructor_to_websoc_instructor_instructor_ucinetid_websoc_instructor_name_index": { + "name": "instructor_to_websoc_instructor_instructor_ucinetid_websoc_instructor_name_index", + "columns": [ + { + "expression": "instructor_ucinetid", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "websoc_instructor_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "instructor_to_websoc_instructor_instructor_ucinetid_instructor_ucinetid_fk": { + "name": "instructor_to_websoc_instructor_instructor_ucinetid_instructor_ucinetid_fk", + "tableFrom": "instructor_to_websoc_instructor", + "tableTo": "instructor", + "columnsFrom": ["instructor_ucinetid"], + "columnsTo": ["ucinetid"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "instructor_to_websoc_instructor_websoc_instructor_name_websoc_instructor_name_fk": { + "name": "instructor_to_websoc_instructor_websoc_instructor_name_websoc_instructor_name_fk", + "tableFrom": "instructor_to_websoc_instructor", + "tableTo": "websoc_instructor", + "columnsFrom": ["websoc_instructor_name"], + "columnsTo": ["name"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.larc_section": { + "name": "larc_section", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "course_id": { + "name": "course_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "days_string": { + "name": "days_string", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "time_string": { + "name": "time_string", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "start_time": { + "name": "start_time", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "end_time": { + "name": "end_time", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "instructor": { + "name": "instructor", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "building": { + "name": "building", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "meets_monday": { + "name": "meets_monday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_tuesday": { + "name": "meets_tuesday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_wednesday": { + "name": "meets_wednesday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_thursday": { + "name": "meets_thursday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_friday": { + "name": "meets_friday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_saturday": { + "name": "meets_saturday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_sunday": { + "name": "meets_sunday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": { + "larc_section_course_id_index": { + "name": "larc_section_course_id_index", + "columns": [ + { + "expression": "course_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "larc_section_course_id_websoc_course_id_fk": { + "name": "larc_section_course_id_websoc_course_id_fk", + "tableFrom": "larc_section", + "tableTo": "websoc_course", + "columnsFrom": ["course_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.library_traffic": { + "name": "library_traffic", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true + }, + "library_name": { + "name": "library_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "location_name": { + "name": "location_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "traffic_count": { + "name": "traffic_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "traffic_percentage": { + "name": "traffic_percentage", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "timestamp": { + "name": "timestamp", + "type": "timestamp", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "library_traffic_library_name_index": { + "name": "library_traffic_library_name_index", + "columns": [ + { + "expression": "library_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "library_traffic_location_name_index": { + "name": "library_traffic_location_name_index", + "columns": [ + { + "expression": "location_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.library_traffic_history": { + "name": "library_traffic_history", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "location_id": { + "name": "location_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "traffic_count": { + "name": "traffic_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "traffic_percentage": { + "name": "traffic_percentage", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "timestamp": { + "name": "timestamp", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "library_traffic_history_location_id_timestamp_index": { + "name": "library_traffic_history_location_id_timestamp_index", + "columns": [ + { + "expression": "location_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "timestamp", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "library_traffic_history_location_id_library_traffic_id_fk": { + "name": "library_traffic_history_location_id_library_traffic_id_fk", + "tableFrom": "library_traffic_history", + "tableTo": "library_traffic", + "columnsFrom": ["location_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.major": { + "name": "major", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "degree_id": { + "name": "degree_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "code": { + "name": "code", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "specialization_required": { + "name": "specialization_required", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "college_requirement": { + "name": "college_requirement", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "major_degree_id_index": { + "name": "major_degree_id_index", + "columns": [ + { + "expression": "degree_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "major_college_requirement_index": { + "name": "major_college_requirement_index", + "columns": [ + { + "expression": "college_requirement", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "major_degree_id_degree_id_fk": { + "name": "major_degree_id_degree_id_fk", + "tableFrom": "major", + "tableTo": "degree", + "columnsFrom": ["degree_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "major_college_requirement_college_requirement_id_fk": { + "name": "major_college_requirement_college_requirement_id_fk", + "tableFrom": "major", + "tableTo": "college_requirement", + "columnsFrom": ["college_requirement"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.major_requirement": { + "name": "major_requirement", + "schema": "", + "columns": { + "requirements": { + "name": "requirements", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "id": { + "name": "id", + "type": "bigint", + "primaryKey": true, + "notNull": true, + "generated": { + "as": "jsonb_hash_extended(requirements, 0)", + "type": "stored" + } + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.major_specialization_to_requirement": { + "name": "major_specialization_to_requirement", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true, + "generated": { + "as": "\n CASE WHEN \"major_specialization_to_requirement\".\"spec_id\" IS NOT NULL\n THEN \"major_specialization_to_requirement\".\"major_id\" || '+' || \"major_specialization_to_requirement\".\"spec_id\"\n ELSE \"major_specialization_to_requirement\".\"major_id\"\n END", + "type": "stored" + } + }, + "major_id": { + "name": "major_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "spec_id": { + "name": "spec_id", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "requirement_id": { + "name": "requirement_id", + "type": "bigint", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "major_specialization_to_requirement_major_id_major_id_fk": { + "name": "major_specialization_to_requirement_major_id_major_id_fk", + "tableFrom": "major_specialization_to_requirement", + "tableTo": "major", + "columnsFrom": ["major_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "major_specialization_to_requirement_spec_id_specialization_id_fk": { + "name": "major_specialization_to_requirement_spec_id_specialization_id_fk", + "tableFrom": "major_specialization_to_requirement", + "tableTo": "specialization", + "columnsFrom": ["spec_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "major_specialization_to_requirement_requirement_id_major_requirement_id_fk": { + "name": "major_specialization_to_requirement_requirement_id_major_requirement_id_fk", + "tableFrom": "major_specialization_to_requirement", + "tableTo": "major_requirement", + "columnsFrom": ["requirement_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.minor": { + "name": "minor", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "requirements": { + "name": "requirements", + "type": "json", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.prerequisite": { + "name": "prerequisite", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "dep_dept": { + "name": "dep_dept", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "prerequisite_id": { + "name": "prerequisite_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "dependency_id": { + "name": "dependency_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "prerequisite_dep_dept_index": { + "name": "prerequisite_dep_dept_index", + "columns": [ + { + "expression": "dep_dept", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "prerequisite_prerequisite_id_index": { + "name": "prerequisite_prerequisite_id_index", + "columns": [ + { + "expression": "prerequisite_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "prerequisite_dependency_id_index": { + "name": "prerequisite_dependency_id_index", + "columns": [ + { + "expression": "dependency_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "prerequisite_prerequisite_id_dependency_id_index": { + "name": "prerequisite_prerequisite_id_dependency_id_index", + "columns": [ + { + "expression": "prerequisite_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "dependency_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.sample_program_variation": { + "name": "sample_program_variation", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "program_id": { + "name": "program_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "label": { + "name": "label", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "sample_program": { + "name": "sample_program", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "variation_notes": { + "name": "variation_notes", + "type": "varchar[]", + "primaryKey": false, + "notNull": true, + "default": "ARRAY[]::VARCHAR[]" + } + }, + "indexes": {}, + "foreignKeys": { + "sample_program_variation_program_id_catalogue_program_id_fk": { + "name": "sample_program_variation_program_id_catalogue_program_id_fk", + "tableFrom": "sample_program_variation", + "tableTo": "catalogue_program", + "columnsFrom": ["program_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.school_requirement": { + "name": "school_requirement", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "requirements": { + "name": "requirements", + "type": "json", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.specialization": { + "name": "specialization", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "major_id": { + "name": "major_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "requirements": { + "name": "requirements", + "type": "json", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "specialization_major_id_index": { + "name": "specialization_major_id_index", + "columns": [ + { + "expression": "major_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "specialization_major_id_major_id_fk": { + "name": "specialization_major_id_major_id_fk", + "tableFrom": "specialization", + "tableTo": "major", + "columnsFrom": ["major_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.study_location": { + "name": "study_location", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.study_room": { + "name": "study_room", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "capacity": { + "name": "capacity", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "location": { + "name": "location", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "directions": { + "name": "directions", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "tech_enhanced": { + "name": "tech_enhanced", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "url": { + "name": "url", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "study_location_id": { + "name": "study_location_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "study_room_study_location_id_index": { + "name": "study_room_study_location_id_index", + "columns": [ + { + "expression": "study_location_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "study_room_study_location_id_study_location_id_fk": { + "name": "study_room_study_location_id_study_location_id_fk", + "tableFrom": "study_room", + "tableTo": "study_location", + "columnsFrom": ["study_location_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.study_room_slot": { + "name": "study_room_slot", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "study_room_id": { + "name": "study_room_id", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "start": { + "name": "start", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "end": { + "name": "end", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "is_available": { + "name": "is_available", + "type": "boolean", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "study_room_slot_study_room_id_index": { + "name": "study_room_slot_study_room_id_index", + "columns": [ + { + "expression": "study_room_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "study_room_slot_study_room_id_start_end_index": { + "name": "study_room_slot_study_room_id_start_end_index", + "columns": [ + { + "expression": "study_room_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "start", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "end", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "study_room_slot_study_room_id_study_room_id_fk": { + "name": "study_room_slot_study_room_id_study_room_id_fk", + "tableFrom": "study_room_slot", + "tableTo": "study_room", + "columnsFrom": ["study_room_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_course": { + "name": "websoc_course", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "department_id": { + "name": "department_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "course_id": { + "name": "course_id", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "REPLACE(\"websoc_course\".\"dept_code\", ' ', '') || \"websoc_course\".\"course_number\"", + "type": "stored" + } + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "year": { + "name": "year", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "quarter": { + "name": "quarter", + "type": "term", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "school_name": { + "name": "school_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "dept_code": { + "name": "dept_code", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_title": { + "name": "course_title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_number": { + "name": "course_number", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_numeric": { + "name": "course_numeric", + "type": "integer", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "CASE REGEXP_REPLACE(\"websoc_course\".\"course_number\", '\\D', '', 'g') WHEN '' THEN 0 ELSE REGEXP_REPLACE(\"websoc_course\".\"course_number\", '\\D', '', 'g')::INTEGER END", + "type": "stored" + } + }, + "course_comment": { + "name": "course_comment", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "prerequisite_link": { + "name": "prerequisite_link", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "is_ge_1a": { + "name": "is_ge_1a", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_1b": { + "name": "is_ge_1b", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_2": { + "name": "is_ge_2", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_3": { + "name": "is_ge_3", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_4": { + "name": "is_ge_4", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_5a": { + "name": "is_ge_5a", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_5b": { + "name": "is_ge_5b", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_6": { + "name": "is_ge_6", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_7": { + "name": "is_ge_7", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_ge_8": { + "name": "is_ge_8", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": { + "websoc_course_department_id_index": { + "name": "websoc_course_department_id_index", + "columns": [ + { + "expression": "department_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_course_id_index": { + "name": "websoc_course_course_id_index", + "columns": [ + { + "expression": "course_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_school_name_dept_code_course_number_course_title_index": { + "name": "websoc_course_year_quarter_school_name_dept_code_course_number_course_title_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "school_name", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "dept_code", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "course_number", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "course_title", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_1a_index": { + "name": "websoc_course_year_quarter_is_ge_1a_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_1a", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_1b_index": { + "name": "websoc_course_year_quarter_is_ge_1b_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_1b", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_2_index": { + "name": "websoc_course_year_quarter_is_ge_2_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_2", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_3_index": { + "name": "websoc_course_year_quarter_is_ge_3_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_3", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_4_index": { + "name": "websoc_course_year_quarter_is_ge_4_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_4", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_5a_index": { + "name": "websoc_course_year_quarter_is_ge_5a_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_5a", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_5b_index": { + "name": "websoc_course_year_quarter_is_ge_5b_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_5b", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_6_index": { + "name": "websoc_course_year_quarter_is_ge_6_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_6", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_7_index": { + "name": "websoc_course_year_quarter_is_ge_7_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_7", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_is_ge_8_index": { + "name": "websoc_course_year_quarter_is_ge_8_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_ge_8", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_dept_code_index": { + "name": "websoc_course_year_quarter_dept_code_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "dept_code", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_course_year_quarter_dept_code_course_number_index": { + "name": "websoc_course_year_quarter_dept_code_course_number_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "dept_code", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "course_number", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_course_department_id_websoc_department_id_fk": { + "name": "websoc_course_department_id_websoc_department_id_fk", + "tableFrom": "websoc_course", + "tableTo": "websoc_department", + "columnsFrom": ["department_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_department": { + "name": "websoc_department", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "school_id": { + "name": "school_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "year": { + "name": "year", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "quarter": { + "name": "quarter", + "type": "term", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "dept_code": { + "name": "dept_code", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "dept_name": { + "name": "dept_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "dept_comment": { + "name": "dept_comment", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "section_code_range_comments": { + "name": "section_code_range_comments", + "type": "text[]", + "primaryKey": false, + "notNull": true + }, + "course_number_range_comments": { + "name": "course_number_range_comments", + "type": "text[]", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "websoc_department_school_id_index": { + "name": "websoc_department_school_id_index", + "columns": [ + { + "expression": "school_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_department_year_quarter_school_id_dept_code_index": { + "name": "websoc_department_year_quarter_school_id_dept_code_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "school_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "dept_code", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_department_school_id_websoc_school_id_fk": { + "name": "websoc_department_school_id_websoc_school_id_fk", + "tableFrom": "websoc_department", + "tableTo": "websoc_school", + "columnsFrom": ["school_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_instructor": { + "name": "websoc_instructor", + "schema": "", + "columns": { + "name": { + "name": "name", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_location": { + "name": "websoc_location", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "building": { + "name": "building", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "room": { + "name": "room", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "websoc_location_building_room_index": { + "name": "websoc_location_building_room_index", + "columns": [ + { + "expression": "building", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "room", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_meta": { + "name": "websoc_meta", + "schema": "", + "columns": { + "name": { + "name": "name", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "last_scraped": { + "name": "last_scraped", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "last_dept_scraped": { + "name": "last_dept_scraped", + "type": "varchar", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_school": { + "name": "websoc_school", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "year": { + "name": "year", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "quarter": { + "name": "quarter", + "type": "term", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "school_name": { + "name": "school_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "school_comment": { + "name": "school_comment", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "websoc_school_year_quarter_school_name_index": { + "name": "websoc_school_year_quarter_school_name_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "school_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_section": { + "name": "websoc_section", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "course_id": { + "name": "course_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "year": { + "name": "year", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "quarter": { + "name": "quarter", + "type": "term", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "units": { + "name": "units", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "websoc_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "instructors": { + "name": "instructors", + "type": "text[]", + "primaryKey": false, + "notNull": true + }, + "meetings": { + "name": "meetings", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "final_exam_string": { + "name": "final_exam_string", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "final_exam": { + "name": "final_exam", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "section_num": { + "name": "section_num", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "max_capacity": { + "name": "max_capacity", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "section_code": { + "name": "section_code", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "section_type": { + "name": "section_type", + "type": "websoc_section_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "num_requested": { + "name": "num_requested", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "restriction_string": { + "name": "restriction_string", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "restriction_a": { + "name": "restriction_a", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_b": { + "name": "restriction_b", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_c": { + "name": "restriction_c", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_d": { + "name": "restriction_d", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_e": { + "name": "restriction_e", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_f": { + "name": "restriction_f", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_g": { + "name": "restriction_g", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_h": { + "name": "restriction_h", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_i": { + "name": "restriction_i", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_j": { + "name": "restriction_j", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_k": { + "name": "restriction_k", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_l": { + "name": "restriction_l", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_m": { + "name": "restriction_m", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_n": { + "name": "restriction_n", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_o": { + "name": "restriction_o", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_r": { + "name": "restriction_r", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_s": { + "name": "restriction_s", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "restriction_x": { + "name": "restriction_x", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "num_on_waitlist": { + "name": "num_on_waitlist", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_waitlist_cap": { + "name": "num_waitlist_cap", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "section_comment": { + "name": "section_comment", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "num_new_only_reserved": { + "name": "num_new_only_reserved", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_currently_total_enrolled": { + "name": "num_currently_total_enrolled", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_currently_section_enrolled": { + "name": "num_currently_section_enrolled", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "is_cancelled": { + "name": "is_cancelled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "\"websoc_section\".\"section_comment\" LIKE '%*** CANCELLED ***%' OR \"websoc_section\".\"section_comment\" LIKE '%*** CANCELED ***%'", + "type": "stored" + } + }, + "web_url": { + "name": "web_url", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "''" + } + }, + "indexes": { + "websoc_section_course_id_index": { + "name": "websoc_section_course_id_index", + "columns": [ + { + "expression": "course_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_section_year_quarter_section_code_index": { + "name": "websoc_section_year_quarter_section_code_index", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "section_code", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_section_course_id_websoc_course_id_fk": { + "name": "websoc_section_course_id_websoc_course_id_fk", + "tableFrom": "websoc_section", + "tableTo": "websoc_course", + "columnsFrom": ["course_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_section_enrollment": { + "name": "websoc_section_enrollment", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "section_id": { + "name": "section_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "date", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "year": { + "name": "year", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "quarter": { + "name": "quarter", + "type": "term", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "max_capacity": { + "name": "max_capacity", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "num_currently_total_enrolled": { + "name": "num_currently_total_enrolled", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_on_waitlist": { + "name": "num_on_waitlist", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_waitlist_cap": { + "name": "num_waitlist_cap", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_requested": { + "name": "num_requested", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "num_new_only_reserved": { + "name": "num_new_only_reserved", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "websoc_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "websoc_section_enrollment_section_id_index": { + "name": "websoc_section_enrollment_section_id_index", + "columns": [ + { + "expression": "section_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_section_enrollment_section_id_created_at_index": { + "name": "websoc_section_enrollment_section_id_created_at_index", + "columns": [ + { + "expression": "section_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_section_enrollment_section_id_websoc_section_id_fk": { + "name": "websoc_section_enrollment_section_id_websoc_section_id_fk", + "tableFrom": "websoc_section_enrollment", + "tableTo": "websoc_section", + "columnsFrom": ["section_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_section_grade": { + "name": "websoc_section_grade", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "section_id": { + "name": "section_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "grade_a_count": { + "name": "grade_a_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_b_count": { + "name": "grade_b_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_c_count": { + "name": "grade_c_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_d_count": { + "name": "grade_d_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_f_count": { + "name": "grade_f_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_p_count": { + "name": "grade_p_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_np_count": { + "name": "grade_np_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "grade_w_count": { + "name": "grade_w_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "average_gpa": { + "name": "average_gpa", + "type": "numeric(3, 2)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "websoc_section_grade_section_id_index": { + "name": "websoc_section_grade_section_id_index", + "columns": [ + { + "expression": "section_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_section_grade_section_id_websoc_section_id_fk": { + "name": "websoc_section_grade_section_id_websoc_section_id_fk", + "tableFrom": "websoc_section_grade", + "tableTo": "websoc_section", + "columnsFrom": ["section_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "websoc_section_grade_section_id_unique": { + "name": "websoc_section_grade_section_id_unique", + "nullsNotDistinct": false, + "columns": ["section_id"] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_section_meeting": { + "name": "websoc_section_meeting", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "section_id": { + "name": "section_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "section_code": { + "name": "section_code", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "meeting_index": { + "name": "meeting_index", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "time_string": { + "name": "time_string", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "time_is_tba": { + "name": "time_is_tba", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "\"websoc_section_meeting\".\"time_string\" LIKE '%TBA%'", + "type": "stored" + } + }, + "start_time": { + "name": "start_time", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "end_time": { + "name": "end_time", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "days_string": { + "name": "days_string", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "meets_monday": { + "name": "meets_monday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_tuesday": { + "name": "meets_tuesday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_wednesday": { + "name": "meets_wednesday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_thursday": { + "name": "meets_thursday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_friday": { + "name": "meets_friday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_saturday": { + "name": "meets_saturday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "meets_sunday": { + "name": "meets_sunday", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": { + "websoc_section_meeting_section_id_index": { + "name": "websoc_section_meeting_section_id_index", + "columns": [ + { + "expression": "section_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_section_meeting_section_id_websoc_section_id_fk": { + "name": "websoc_section_meeting_section_id_websoc_section_id_fk", + "tableFrom": "websoc_section_meeting", + "tableTo": "websoc_section", + "columnsFrom": ["section_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_section_meeting_to_location": { + "name": "websoc_section_meeting_to_location", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "meeting_id": { + "name": "meeting_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "location_id": { + "name": "location_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "websoc_section_meeting_to_location_meeting_id_index": { + "name": "websoc_section_meeting_to_location_meeting_id_index", + "columns": [ + { + "expression": "meeting_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_section_meeting_to_location_location_id_index": { + "name": "websoc_section_meeting_to_location_location_id_index", + "columns": [ + { + "expression": "location_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_section_meeting_to_location_meeting_id_location_id_index": { + "name": "websoc_section_meeting_to_location_meeting_id_location_id_index", + "columns": [ + { + "expression": "meeting_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "location_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_section_meeting_to_location_meeting_id_websoc_section_meeting_id_fk": { + "name": "websoc_section_meeting_to_location_meeting_id_websoc_section_meeting_id_fk", + "tableFrom": "websoc_section_meeting_to_location", + "tableTo": "websoc_section_meeting", + "columnsFrom": ["meeting_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "websoc_section_meeting_to_location_location_id_websoc_location_id_fk": { + "name": "websoc_section_meeting_to_location_location_id_websoc_location_id_fk", + "tableFrom": "websoc_section_meeting_to_location", + "tableTo": "websoc_location", + "columnsFrom": ["location_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.websoc_section_to_instructor": { + "name": "websoc_section_to_instructor", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "section_id": { + "name": "section_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "instructor_name": { + "name": "instructor_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "websoc_section_to_instructor_section_id_index": { + "name": "websoc_section_to_instructor_section_id_index", + "columns": [ + { + "expression": "section_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "websoc_section_to_instructor_instructor_name_index": { + "name": "websoc_section_to_instructor_instructor_name_index", + "columns": [ + { + "expression": "instructor_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "websoc_section_to_instructor_section_id_websoc_section_id_fk": { + "name": "websoc_section_to_instructor_section_id_websoc_section_id_fk", + "tableFrom": "websoc_section_to_instructor", + "tableTo": "websoc_section", + "columnsFrom": ["section_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "websoc_section_to_instructor_instructor_name_websoc_instructor_name_fk": { + "name": "websoc_section_to_instructor_instructor_name_websoc_instructor_name_fk", + "tableFrom": "websoc_section_to_instructor", + "tableTo": "websoc_instructor", + "columnsFrom": ["instructor_name"], + "columnsTo": ["name"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": { + "public.course_level": { + "name": "course_level", + "schema": "public", + "values": ["LowerDiv", "UpperDiv", "Graduate"] + }, + "public.division": { + "name": "division", + "schema": "public", + "values": ["Undergraduate", "Graduate"] + }, + "public.term": { + "name": "term", + "schema": "public", + "values": ["Fall", "Winter", "Spring", "Summer1", "Summer10wk", "Summer2"] + }, + "public.websoc_section_type": { + "name": "websoc_section_type", + "schema": "public", + "values": [ + "Act", + "Col", + "Dis", + "Fld", + "Lab", + "Lec", + "Qiz", + "Res", + "Sem", + "Stu", + "Tap", + "Tut" + ] + }, + "public.websoc_status": { + "name": "websoc_status", + "schema": "public", + "values": ["OPEN", "Waitl", "FULL", "NewOnly"] + } + }, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": { + "public.course_view": { + "columns": { + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "department": { + "name": "department", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "shortened_dept": { + "name": "shortened_dept", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "REPLACE(\"course\".\"department\", ' ', '')", + "type": "stored" + } + }, + "department_alias": { + "name": "department_alias", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "course_number": { + "name": "course_number", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_numeric": { + "name": "course_numeric", + "type": "integer", + "primaryKey": false, + "notNull": true, + "generated": { + "as": "CASE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g') WHEN '' THEN 0 ELSE REGEXP_REPLACE(\"course\".\"course_number\", '\\D', '', 'g')::INTEGER END", + "type": "stored" + } + }, + "school": { + "name": "school", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "course_level": { + "name": "course_level", + "type": "course_level", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "min_units": { + "name": "min_units", + "type": "numeric(4, 2)", + "primaryKey": false, + "notNull": true + }, + "max_units": { + "name": "max_units", + "type": "numeric(4, 2)", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "department_name": { + "name": "department_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "prerequisite_tree": { + "name": "prerequisite_tree", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "prerequisite_text": { + "name": "prerequisite_text", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "repeatability": { + "name": "repeatability", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "grading_option": { + "name": "grading_option", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "concurrent": { + "name": "concurrent", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "same_as": { + "name": "same_as", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "restriction": { + "name": "restriction", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "overlap": { + "name": "overlap", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "corequisites": { + "name": "corequisites", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "is_ge_1a": { + "name": "is_ge_1a", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_1b": { + "name": "is_ge_1b", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_2": { + "name": "is_ge_2", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_3": { + "name": "is_ge_3", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_4": { + "name": "is_ge_4", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_5a": { + "name": "is_ge_5a", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_5b": { + "name": "is_ge_5b", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_6": { + "name": "is_ge_6", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_7": { + "name": "is_ge_7", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_ge_8": { + "name": "is_ge_8", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "ge_text": { + "name": "ge_text", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "definition": "select \"course\".\"id\", \"course\".\"updated_at\", \"course\".\"department\", \"course\".\"shortened_dept\", \"course\".\"department_alias\", \"course\".\"course_number\", \"course\".\"course_numeric\", \"course\".\"school\", \"course\".\"title\", \"course\".\"course_level\", \"course\".\"min_units\", \"course\".\"max_units\", \"course\".\"description\", \"course\".\"department_name\", \"course\".\"prerequisite_tree\", \"course\".\"prerequisite_text\", \"course\".\"repeatability\", \"course\".\"grading_option\", \"course\".\"concurrent\", \"course\".\"same_as\", \"course\".\"restriction\", \"course\".\"overlap\", \"course\".\"corequisites\", \"course\".\"is_ge_1a\", \"course\".\"is_ge_1b\", \"course\".\"is_ge_2\", \"course\".\"is_ge_3\", \"course\".\"is_ge_4\", \"course\".\"is_ge_5a\", \"course\".\"is_ge_5b\", \"course\".\"is_ge_6\", \"course\".\"is_ge_7\", \"course\".\"is_ge_8\", \"course\".\"ge_text\", \n ARRAY_REMOVE(COALESCE(\n (\n SELECT ARRAY_AGG(\n CASE WHEN \"prerequisite_course\".\"id\" IS NULL THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'id', \"prerequisite_course\".\"id\",\n 'title', \"prerequisite_course\".\"title\",\n 'department', \"prerequisite_course\".\"department\",\n 'courseNumber', \"prerequisite_course\".\"course_number\"\n )\n END\n )\n FROM \"prerequisite\"\n LEFT JOIN \"course\" \"prerequisite_course\" ON \"prerequisite_course\".\"id\" = \"prerequisite\".\"prerequisite_id\"\n WHERE \"prerequisite\".\"dependency_id\" = \"course\".\"id\"\n ),\n ARRAY[]::JSONB[]), NULL)\n as \"prerequisites\", \n ARRAY_REMOVE(COALESCE(\n (\n SELECT ARRAY_AGG(\n CASE WHEN \"dependency_course\".\"id\" IS NULL THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'id', \"dependency_course\".\"id\",\n 'title', \"dependency_course\".\"title\",\n 'department', \"dependency_course\".\"department\",\n 'courseNumber', \"dependency_course\".\"course_number\"\n )\n END\n )\n FROM \"prerequisite\" \"dependency\"\n LEFT JOIN \"course\" \"dependency_course\" ON \"dependency_course\".\"id\" = \"dependency\".\"dependency_id\"\n WHERE \"dependency\".\"prerequisite_id\" = \"course\".\"id\"\n ),\n ARRAY[]::JSONB[]), NULL)\n as \"dependencies\", \n ARRAY_REMOVE(ARRAY_AGG(DISTINCT\n CASE WHEN \"websoc_course\".\"year\" IS NULL THEN NULL\n ELSE CONCAT(\"websoc_course\".\"year\", ' ', \"websoc_course\".\"quarter\")\n END\n ), NULL)\n as \"terms\", \n ARRAY_REMOVE(COALESCE(ARRAY_AGG(DISTINCT\n CASE WHEN \"instructor\".\"ucinetid\" IS NULL THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'ucinetid', \"instructor\".\"ucinetid\",\n 'name', \"instructor\".\"name\",\n 'title', \"instructor\".\"title\",\n 'email', \"instructor\".\"email\",\n 'department', \"instructor\".\"department\",\n 'shortenedNames', ARRAY(\n SELECT \"instructor_to_websoc_instructor\".\"websoc_instructor_name\"\n FROM \"instructor_to_websoc_instructor\"\n WHERE \"instructor_to_websoc_instructor\".\"instructor_ucinetid\" = \"instructor\".\"ucinetid\"\n )\n )\n END\n ), ARRAY[]::JSONB[]), NULL)\n as \"instructors\" from \"course\" left join \"websoc_course\" on \"websoc_course\".\"course_id\" = \"course\".\"id\" left join \"websoc_section\" on \"websoc_section\".\"course_id\" = \"websoc_course\".\"id\" left join \"websoc_section_to_instructor\" on \"websoc_section_to_instructor\".\"section_id\" = \"websoc_section\".\"id\" left join \"websoc_instructor\" on \"websoc_instructor\".\"name\" = \"websoc_section_to_instructor\".\"instructor_name\" left join \"instructor_to_websoc_instructor\" on \"instructor_to_websoc_instructor\".\"websoc_instructor_name\" = \"websoc_instructor\".\"name\" left join \"instructor\" on (\"instructor\".\"ucinetid\" = \"instructor_to_websoc_instructor\".\"instructor_ucinetid\" and \"instructor\".\"ucinetid\" is not null and \"instructor\".\"ucinetid\" <> 'student') group by \"course\".\"id\"", + "name": "course_view", + "schema": "public", + "isExisting": false, + "materialized": true + }, + "public.instructor_view": { + "columns": { + "ucinetid": { + "name": "ucinetid", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "email": { + "name": "email", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "department": { + "name": "department", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "definition": "with \"shortened_names_cte\" as (select \"instructor_ucinetid\", ARRAY_AGG(\"websoc_instructor_name\") as \"shortened_names\" from \"instructor_to_websoc_instructor\" group by \"instructor_to_websoc_instructor\".\"instructor_ucinetid\"), \"courses_cte\" as (with \"terms_cte\" as (select \"course\".\"id\", \"instructor_to_websoc_instructor\".\"instructor_ucinetid\", \n ARRAY_REMOVE(ARRAY_AGG(DISTINCT\n CASE WHEN \"websoc_course\".\"year\" IS NULL THEN NULL\n ELSE CONCAT(\"websoc_course\".\"year\", ' ', \"websoc_course\".\"quarter\")\n END\n ), NULL) as \"terms\" from \"course\" left join \"websoc_course\" on \"websoc_course\".\"course_id\" = \"course\".\"id\" left join \"websoc_section\" on \"websoc_section\".\"course_id\" = \"websoc_course\".\"id\" left join \"websoc_section_to_instructor\" on \"websoc_section_to_instructor\".\"section_id\" = \"websoc_section\".\"id\" left join \"websoc_instructor\" on \"websoc_instructor\".\"name\" = \"websoc_section_to_instructor\".\"instructor_name\" left join \"instructor_to_websoc_instructor\" on \"instructor_to_websoc_instructor\".\"websoc_instructor_name\" = \"websoc_instructor\".\"name\" group by \"course\".\"id\", \"instructor_to_websoc_instructor\".\"instructor_ucinetid\") select \"terms_cte\".\"instructor_ucinetid\", \"course\".\"id\", \n CASE WHEN \"course\".\"id\" IS NULL\n THEN NULL\n ELSE JSONB_BUILD_OBJECT(\n 'id', \"course\".\"id\",\n 'title', \"course\".\"title\",\n 'department', \"course\".\"department\",\n 'courseNumber', \"course\".\"course_number\",\n 'terms', COALESCE(\"terms\", ARRAY[]::TEXT[])\n )\n END\n as \"course_info\" from \"course\" left join \"terms_cte\" on \"terms_cte\".\"id\" = \"course\".\"id\" group by \"course\".\"id\", \"terms_cte\".\"instructor_ucinetid\", \"terms\") select \"instructor\".\"ucinetid\", \"instructor\".\"name\", \"instructor\".\"title\", \"instructor\".\"email\", \"instructor\".\"department\", COALESCE(\"shortened_names\", ARRAY[]::TEXT[]) as \"shortened_names\", \n ARRAY_REMOVE(ARRAY_AGG(DISTINCT \"course_info\"), NULL)\n as \"courses\" from \"instructor\" left join \"shortened_names_cte\" on \"shortened_names_cte\".\"instructor_ucinetid\" = \"instructor\".\"ucinetid\" left join \"courses_cte\" on \"courses_cte\".\"instructor_ucinetid\" = \"instructor\".\"ucinetid\" where \"instructor\".\"ucinetid\" <> 'student' group by \"instructor\".\"ucinetid\", \"shortened_names\"", + "name": "instructor_view", + "schema": "public", + "isExisting": false, + "materialized": true + } + }, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} diff --git a/packages/db/migrations/meta/_journal.json b/packages/db/migrations/meta/_journal.json index 731a8542..1154fab3 100644 --- a/packages/db/migrations/meta/_journal.json +++ b/packages/db/migrations/meta/_journal.json @@ -190,6 +190,13 @@ "when": 1773306141597, "tag": "0026_requirements_id", "breakpoints": true + }, + { + "idx": 27, + "version": "7", + "when": 1773686494314, + "tag": "0027_polymorphic_major_requirements", + "breakpoints": true } ] } From bd215209294373de07976c4a58ef51058b4574cc Mon Sep 17 00:00:00 2001 From: Hwijung Kim Date: Sun, 22 Mar 2026 12:38:17 -0700 Subject: [PATCH 91/91] final i hope --- packages/db/migrations/0025_major_specialization_required.sql | 2 +- packages/db/src/schema.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/db/migrations/0025_major_specialization_required.sql b/packages/db/migrations/0025_major_specialization_required.sql index b87608e9..db59f871 100644 --- a/packages/db/migrations/0025_major_specialization_required.sql +++ b/packages/db/migrations/0025_major_specialization_required.sql @@ -1 +1 @@ -ALTER TABLE "major" ADD COLUMN "specialization_required" boolean DEFAULT false NOT NULL; +ALTER TABLE "major" ADD COLUMN "specialization_required" boolean DEFAULT false NOT NULL; \ No newline at end of file diff --git a/packages/db/src/schema.ts b/packages/db/src/schema.ts index 5702a269..7dfb450b 100644 --- a/packages/db/src/schema.ts +++ b/packages/db/src/schema.ts @@ -103,7 +103,7 @@ export type DegreeWorksProgram = DegreeWorksProgramId & { }; /** - * school requirements can vary by major and major requirements can vary by specialization + * Complete major requirements are the concatenation between school requirements that may vary by major and major requirements that may vary by specialization * eventually, we may want degree type; e.g. MFA provides some requirements */ export type MajorProgram = {