-
Notifications
You must be signed in to change notification settings - Fork 4k
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
feat: Legacy Libraries Migration (WIP) #36083
base: master
Are you sure you want to change the base?
feat: Legacy Libraries Migration (WIP) #36083
Conversation
Sandbox deployment failed 💥 |
Sandbox deployment failed 💥 |
2d66c67
to
0a239e6
Compare
@ormsbee , as we've discussed, authors will be able to:
I'm thinking about how to encode both of these kinds of migrations. Here are three ideas, none of which I love. (In each idea, there is a 1. No data model for copy-migrateclass LegacyLibraryForwardedMigration(Model):
source_key = LearningContextKeyField(unique=True)
target_library = ForeignKey(ContentLibrary)
target_collection = ForeignKey(Collection, null=True, unique=True)
migrated_by = ...
migrated_at = ...
# Copy-migrate events are not recorded in the DB 2. Shared model for migrate-with-forwarding and copy-migrateclass LegacyLibraryMigration(Model):
source_key = LearningContextKeyField() # should be unique iff `forward==True`
forwarded = BooleanField()
target_library = ForeignKey(ContentLibrary)
target_collection = ForeignKey(Collection, null=True, unique=True)
migrated_by = ...
migrated_at = ... 3. Two different data modelsclass LegacyLibraryForwardedMigration(Model):
source_key = LearningContextKeyField(unique=True)
target_library = ForeignKey(ContentLibrary)
target_collection = ForeignKey(Collection, null=True, unique=True)
migrated_by = ...
migrated_at = ...
class LegacyLibraryCopyMigration(Model):
source_key = LearningContextKeyField()
target_library = ForeignKey(ContentLibrary)
target_collection = ForeignKey(Collection, null=True, unique=True)
migrated_by = ...
migrated_at = ... What I want to do (but don't know how to do in Django)class LegacyLibraryMigration(Model):
source_key = LearningContextKeyField()
target_library = ForeignKey(ContentLibrary)
target_collection = ForeignKey(Collection, null=True, unique=True)
migrated_by = ...
migrated_at = ...
class LegacyLibraryMigrationEnableForwarding(Model):
migration = OneToOneField(LegacyLibraryMigration)
source_key = LearningContextKeyField(unique=True)
class Meta:
ensure_equal("source_key", "migration.source_key") # <-- Fake Django. Is this possible? |
0a239e6
to
093dd01
Compare
^ We talked through this in the latest libraries sync, and ended up deciding to invert the relationship between the two models. That is: there is a LegacyLibraryMigrationSource row for each legacy library, which is pointed to by many LegacyLibraryMigrations, but which points at a single one of them as the authoritative_migration. |
Description
...
Supporting information
This will be the full implementation of:
Currently blocked by:
This is all part of:
Testing instructions
TBD
Deadline
Needs to land by Teak cutoff (Apr 9) at the very very latest.
Other information
TBD
Sandbox env
Link: TBD
UN/PW: openedx / openedx
Settings
Tutor requirements