Ticket #778 (closed Enhancement: fixed)
More flexible declarative migrations
Reported by: | jri | Owned by: | jri |
---|---|---|---|
Priority: | Major | Milestone: | Release 4.6 |
Component: | DeepaMehta Standard Distribution | Version: | 4.5 |
Keywords: | Cc: | dgf, Malte | |
Complexity: | 3 | Area: | |
Module: | deepamehta-core |
Description (last modified by jri) (diff)
At the moment a declarative migration (= JSON file) can contain 4 entities which DM creates in a fixed order then:
- Topic Types
- Association Types
- Topics
- Associations
In the course of #341 (Custom Association Types) it becomes a common pattern that Topic Types are defined based on Association Types (namely the "Custom Association Type"). This means the association types must be created first. At the other hand a (composite) Association Type is created on the base of Topic Types, which means the topic types must be created first. So there is no natural order anymore in which the 4 entities must be created. A particular application might require the creation in one order while another application requires it vice versa.
At the moment the only solution is to break the application types into several migrations to force a specific order. However this makes it harder for the developer to keep an overview about the application's data model.
Subject of this ticket is to enhance the declarative migration JSON format in order to
- Create the entities in a specific order
- Allow one entity appear several times in a migration, that is e.g. first create some Association Types, then some Topic Types, then some topics, and finally some Association Types again.