openedx / openedx-learning

GNU Affero General Public License v3.0
5 stars 8 forks source link

refactor: normalize component types with ComponentType #148

Closed ormsbee closed 7 months ago

ormsbee commented 7 months ago

Prior to this commit, Components encoded their namespace + type info as two columns on the Component model itself. This wasted a lot of space on a very common index lookup–many rows of ('xblock.v1', 'video'), ('xblock.v1', 'problem'), and ('xblock.v1', 'text'). But worse, the lack of a separate ComponentType model meant that there was no first class entity to store per-type policy data against. For example, we might want to say "the following types are supported by libraries, while these other types are experimental", or "these types are enabled for these orgs", etc.

Components are required to have a ComponentType. We're rewriting the first migration for the components app here, since this app hasn't been added to edx-platform yet.

ormsbee commented 7 months ago

Supersedes #147