Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP CSMH Extended Tables/Database #11441

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
ac0d5fa
Add error logging when capa failures happen
cpennington Sep 16, 2015
42b8650
Remove erroneous logger configuration
cpennington Sep 21, 2015
832b927
Add a new UnsignedBigInAutoField
cpennington Sep 14, 2015
e2531ce
Create a new CSMHExtended table to hold our new data
jibsheet Jan 27, 2016
b725a0b
Put StudentModuleHistory into its own database
cpennington Sep 14, 2015
8f6c07f
allow_syncdb is going away in 1.9, futureproof
jibsheet Jan 27, 2016
9efeb40
Bump out the primary key on CSMHE
jibsheet Feb 8, 2016
356f0b5
Remove StudentModuleHistory cleaner
cpennington Sep 14, 2015
f55cc20
Rename the router to reflect the new class name
jibsheet Jan 28, 2016
760cc7c
Begin porting relevant settings from lms/envs
jibsheet Feb 1, 2016
09a7cb4
Move router code to openedx/core
jibsheet Feb 1, 2016
4f49b00
WIP to read from two tables
jibsheet Feb 3, 2016
3b8b4ea
Test fixes
jibsheet Feb 5, 2016
bde43f8
Update queries run under 1.8
jibsheet Feb 10, 2016
044fda1
Further decouple the foreignkey relation between csm and csmhe
jibsheet Feb 10, 2016
95820cb
Handle udpates for multiple databases
jibsheet Feb 10, 2016
377b447
Finish updating reset-test-db.sh for bok-choy
jibsheet Feb 11, 2016
64b393a
Update schemas and json files for bok choy's db cache
jibsheet Feb 11, 2016
cf78b38
Handle empty StudentModuleHistory tables
jibsheet Feb 11, 2016
a574294
fixup! Put StudentModuleHistory into its own database
jibsheet Feb 12, 2016
6963133
Run lettuce migrations for both databases
jibsheet Feb 12, 2016
7e9e790
fixup! Handle udpates for multiple databases
jibsheet Feb 16, 2016
14c4505
fixup! Run lettuce migrations for both databases
jibsheet Feb 16, 2016
a6dbdf2
fixup! WIP to read from two tables
jibsheet Feb 16, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions cms/envs/acceptance.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,14 @@ def seed():
'timeout': 30,
},
'ATOMIC_REQUESTS': True,
},
'student_module_history': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': TEST_ROOT / "db" / "test_student_module_history.db",
'TEST_NAME': TEST_ROOT / "db" / "test_student_module_history.db",
'OPTIONS': {
'timeout': 30,
},
}
}

Expand Down
4 changes: 2 additions & 2 deletions cms/envs/aws_migrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@
raise ImproperlyConfigured("No database password was provided for running "
"migrations. This is fatal.")

for override, value in DB_OVERRIDES.iteritems():
DATABASES['default'][override] = value
DATABASES['default'].update(DB_OVERRIDES)
DATABASES['student_module_history'].update(DB_OVERRIDES)
8 changes: 8 additions & 0 deletions cms/envs/bok_choy.auth.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@
"PASSWORD": "",
"PORT": "3306",
"USER": "root"
},
"student_module_history": {
"ENGINE": "django.db.backends.mysql",
"HOST": "localhost",
"NAME": "student_module_history_test",
"PASSWORD": "",
"PORT": "3306",
"USER": "root"
}
},
"DOC_STORE_CONFIG": {
Expand Down
5 changes: 5 additions & 0 deletions cms/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1114,6 +1114,11 @@
}
PROCTORING_SETTINGS = {}

############################ Global Database Configuration #####################

DATABASE_ROUTERS = [
'openedx.core.lib.django_courseware_routers.StudentModuleHistoryExtendedRouter',
]

############################ OAUTH2 Provider ###################################

Expand Down
16 changes: 14 additions & 2 deletions common/lib/xmodule/xmodule/capa_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,23 @@ def handle_ajax(self, dispatch, data):
result = handlers[dispatch](data)

except NotFoundError as err:
_, _, traceback_obj = sys.exc_info()
log.exception(
"Unable to find data when dispatching %s to %s for user %s",
dispatch,
self.scope_ids.usage_id,
self.scope_ids.user_id
)
_, _, traceback_obj = sys.exc_info() # pylint: disable=redefined-outer-name
raise ProcessingError(not_found_error_message), None, traceback_obj

except Exception as err:
_, _, traceback_obj = sys.exc_info()
log.exception(
"Unknown error when dispatching %s to %s for user %s",
dispatch,
self.scope_ids.usage_id,
self.scope_ids.user_id
)
_, _, traceback_obj = sys.exc_info() # pylint: disable=redefined-outer-name
raise ProcessingError(generic_error_message), None, traceback_obj

after = self.get_progress()
Expand Down
2 changes: 2 additions & 0 deletions common/lib/xmodule/xmodule/modulestore/tests/django_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ def setUp(self):
for Django ORM models that will get cleaned up properly.
"""
MODULESTORE = mixed_store_config(mkdtemp_clean(), {}, include_xml=False)
multi_db = True

@classmethod
def setUpClass(cls):
Expand Down Expand Up @@ -392,6 +393,7 @@ class FooTest(ModuleStoreTestCase):
"""

MODULESTORE = mixed_store_config(mkdtemp_clean(), {}, include_xml=False)
multi_db = True

def setUp(self, **kwargs):
"""
Expand Down
1 change: 0 additions & 1 deletion common/test/db_cache/bok_choy_data.json

This file was deleted.

1 change: 1 addition & 0 deletions common/test/db_cache/bok_choy_data_default.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
37 changes: 0 additions & 37 deletions common/test/db_cache/bok_choy_migrations_data.sql

This file was deleted.

Loading