Skip to content

WIP CSMH Extended Tables/Database - #11441

Closed
jibsheet wants to merge 24 commits into
masterfrom
jibsheet/read-from-multiple-csmh-tables
Closed

WIP CSMH Extended Tables/Database#11441
jibsheet wants to merge 24 commits into
masterfrom
jibsheet/read-from-multiple-csmh-tables

Conversation

@jibsheet

@jibsheet jibsheet commented Feb 5, 2016

Copy link
Copy Markdown
Contributor

No description provided.

@jibsheet
jibsheet force-pushed the jibsheet/read-from-multiple-csmh-tables branch 4 times, most recently from 440256b to d6b7738 Compare February 11, 2016 03:32
@jibsheet

Copy link
Copy Markdown
Contributor Author

jenkins run all

@jibsheet jibsheet closed this Feb 12, 2016
@jibsheet jibsheet reopened this Feb 12, 2016
@jibsheet
jibsheet force-pushed the jibsheet/read-from-multiple-csmh-tables branch from 6eb607d to 449a8eb Compare February 12, 2016 20:06
@jibsheet jibsheet closed this Feb 12, 2016
@jibsheet jibsheet reopened this Feb 12, 2016
@jibsheet
jibsheet force-pushed the jibsheet/read-from-multiple-csmh-tables branch from 449a8eb to 9963cca Compare February 12, 2016 20:45
cpennington and others added 19 commits February 16, 2016 12:05
This is a clone (copy) of CSMH's declaration and methods with an added
id of bigint unsigned.

We should be able to delete the save_history code, but needs testing.
This gives us a gap to backfill as needed.
Since the new table's pk is an unsigned bigint, even for people who don't
consolidate CSMH into CSMHE, the lost rows are unlikely to matter.
We need to use it from cms and lms
This is horrible and just smashes the code into the view and the client.
Handle queries directed to student_module_history vs default and the
extra queries generated by Django 1.8 (SAVEPOINTS, etc).

Additionally, flag testing classes as multi_db so that Django will
flush the non-default database between unit tests.
The original branch split these across database but 1.8 adds a ton of
SAVEPOINT queries as part of the code to rollback the database during
unit tests.
When calling StudentModule().delete() Django will try to delete CSMHE
objects, but naively does so in the database, not by consulting the
database router.

Instead, we disable django cascading deletes and listen for post_delete
signals and clean up CSMHE by hand.
Without this, we would pull settings out of default and into secondary
databases.  Unfortunately, without adding more ENV variables, using this
for anything other than DB_MIGRATION_USER or DB_MIGRATION_PASS will
probably not do what you intend.
This now correctly migrates and dumps files for both databases.
These happen during the bok choy migration script that saves a cached
version of the DB.
@jibsheet
jibsheet force-pushed the jibsheet/read-from-multiple-csmh-tables branch from 9963cca to a6dbdf2 Compare February 16, 2016 17:14
@jibsheet jibsheet closed this Feb 17, 2016
@jibsheet
jibsheet deleted the jibsheet/read-from-multiple-csmh-tables branch February 29, 2016 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants