This repository has been archived by the owner on Apr 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add term table, accomodate multiple terms, fix course.sis_id bug (#113,
#117) (#115) * Add term WIP * Modify Canvas course fetch func to use multiple terms * Improve formatting * Update configuration variable * Fix end_at parsing * Update canvas_zoom_meetings to handle multiple terms * Add fix for issue 117: migration changing data type, string type coercion * Fix ADD_COURSE_IDS functionality * Fix comment * Remove unneeded logging * Reformat params; change var name * Make term a dropped table * Remove migrate from comment * Make course.term_id NOT NULL * Tweak term func name * Reorder local imports * Fix mutable default parameter anti-pattern * Add log message to loop
- Loading branch information
Showing
6 changed files
with
163 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# | ||
# file: migrations/0013.add_term_table.py | ||
# | ||
from yoyo import step | ||
|
||
steps = [ | ||
step(''' | ||
CREATE TABLE IF NOT EXISTS term | ||
( | ||
canvas_id INTEGER NOT NULL UNIQUE, | ||
name VARCHAR(100) NOT NULL UNIQUE, | ||
sis_id INTEGER NOT NULL, | ||
start_at DATETIME NOT NULL, | ||
end_at DATETIME NOT NULL, | ||
PRIMARY KEY (canvas_id) | ||
) | ||
ENGINE=InnoDB | ||
CHARACTER SET utf8mb4; | ||
'''), | ||
step(''' | ||
ALTER TABLE course | ||
ADD COLUMN term_id INTEGER NOT NULL AFTER account_id; | ||
'''), | ||
step(''' | ||
ALTER TABLE course | ||
ADD CONSTRAINT fk_term_id | ||
FOREIGN KEY (term_id) | ||
REFERENCES term(canvas_id) | ||
ON UPDATE CASCADE ON DELETE CASCADE; | ||
''') | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# | ||
# file: migrations/0014.change_course_sis_id_data_type.py | ||
# | ||
from yoyo import step | ||
|
||
step(''' | ||
ALTER TABLE course | ||
MODIFY | ||
sis_id VARCHAR(15) NULL; | ||
''') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters