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

Add versioning to database; migrate if version is not current #4099

Merged
merged 4 commits into from
Jul 20, 2015

Conversation

MCGallaspy
Copy link
Contributor

Fixes #4069 and learningequality/ka-lite-installers#96.

Edit: fixes learningequality/ka-lite-installers#96. Gotta trigger those robots.

@benjaoming
Copy link
Contributor

Just making sure... Will it pass this use case?

  1. User installs ka-lite and immediately runs kalite start. This way, a non-interactive setup is run.
  2. There are no assessment items. So user runs kalite manage setup and is prompted to download the assessment items.

try:
assert Settings.get("private_key") and Device.objects.count()
from kalite.version import VERSION

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@MCGallaspy
Copy link
Contributor Author

You're right, setting the database_version should be handled in setup. In both your cases, the database will be created for the first time. The use case I wished to address is when a user upgrades from 0.13 to 0.14 without migrating the database (as happens in Windows).

@benjaoming
Copy link
Contributor

This is looking good. I've merged it into alpha8.

@benjaoming benjaoming mentioned this pull request Jul 15, 2015
8 tasks
@MCGallaspy
Copy link
Contributor Author

Can we merge this in to 0.14.x? Or will it be merged from the alpha branches?

@benjaoming
Copy link
Contributor

No, nothing is supposed to be merged via the alpha PRs... they just show what I included in the Alpha.

@MCGallaspy
Copy link
Contributor Author

Right, then shall I resolve the conflict and merge this?

@benjaoming
Copy link
Contributor

👍

@benjaoming
Copy link
Contributor

Since it was part of alpha8, I have had it tested already a fair bit, no problems occurred.

@benjaoming benjaoming mentioned this pull request Jul 17, 2015
5 tasks
Conflicts:
	kalite/distributed/management/commands/setup.py
# Create *.json and friends database
call_command("syncdb", interactive=False, verbosity=options.get(
"verbosity"), database="assessment_items")
Settings.set("database_version", VERSION)

This comment was marked as spam.

This comment was marked as spam.

MCGallaspy added a commit that referenced this pull request Jul 20, 2015
Add versioning to database; migrate if version is not current
@MCGallaspy MCGallaspy merged commit cc1b46b into learningequality:0.14.x Jul 20, 2015
@MCGallaspy MCGallaspy removed the has PR label Jul 20, 2015
@MCGallaspy MCGallaspy deleted the add-version-to-db branch December 18, 2015 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants