Current database scheme:
Entities:
User and Tag — users and course tags. Study Items — all objects related to educational materials: Course, Course Version, Section, Lesson, Task.
Table Study Items Relations stores all relations among Study Items and these relations look like tree below. Root is Course vertex. All subtree store course version for different plugin versions.
Tree update: A Task was created in the plugin with version n, then:
- If an update was made in the plugin with version n + 1 and version of some
Study Itemis changed to new, then add new child to the root(vertexCourse) and go down this subtree, saving references to unchangedTasks,Sections,Lessonsand creating new ones for the changed. - If an update was made in the plugin with version n + 1 and version of some
Study Itemisn't changed to new, then go down the tree and change old versions ofTasks,SectionsandLessonsby new ones, saving references to old in fieldParent Study Item ID.

