Skip to content

Commit 591a269

Browse files
committed
Small rooms and breakstart/end refactor
1 parent 205e7bd commit 591a269

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

schema/tables/quarters.sql

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,5 @@
1111
CREATE TABLE quarters (
1212
`quarter` SMALLINT(5) UNSIGNED NOT NULL PRIMARY KEY,
1313
`start` DATE NOT NULL,
14-
`end` DATE NOT NULL,
15-
`breakstart` DATE NOT NULL,
16-
`breakend` DATE NOT NULL
14+
`end` DATE NOT NULL
1715
) ENGINE=InnoDb;

schema/tables/times.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ CREATE TABLE times (
1515
`start` SMALLINT(4) UNSIGNED NOT NULL,
1616
`end` SMALLINT(4) UNSIGNED NOT NULL,
1717
`building` VARCHAR(5) NULL DEFAULT NULL,
18-
`room` VARCHAR(4) NULL DEFAULT NULL
18+
`room` VARCHAR(10) NULL DEFAULT NULL
1919
)ENGINE=InnoDB;
2020

2121
-- FOREIGN KEY CONSTRAINTS -------------------------------------------------

tools/processDump.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -457,13 +457,10 @@ function procInstrArray($lineSplit) {
457457
preg_match("/(\d)(\d{3})/", $row['strm'], $match);
458458
$row['strm'] = $match[1] . 0 . $match[2];
459459

460-
// Create a default break value
461-
$break = '0000-00-00';
462-
463460
// Insert the quarter
464461
// TODO: Change schema from quarters to semesters (I doubt they're switching back anytime soon)
465-
$query = "INSERT INTO quarters (quarter, start, end, breakstart, breakend)";
466-
$query .= " VALUES({$row['strm']}, '{$row['start_dt']}', '{$row['end_dt']}', $break, $break)";
462+
$query = "INSERT INTO quarters (`quarter`, `start`, `end`)";
463+
$query .= " VALUES({$row['strm']}, '{$row['start_dt']}', '{$row['end_dt']}')";
467464
$query .= " ON DUPLICATE KEY UPDATE";
468465
$query .= " start='{$row['start_dt']}', end='{$row['end_dt']}'";
469466

0 commit comments

Comments
 (0)