Commit 8a181113 authored by Silke Meyer's avatar Silke Meyer

Migrations that extend the Dish composite with tags and HTML annotations

parent fa865bce
package systems.dmx.cooking.migrations;
import systems.dmx.core.TopicType;
import systems.dmx.core.model.CompDefModel;
import systems.dmx.core.service.Migration;
public class Migration7 extends Migration {
@Override
public void run() {
/* Add "Annotation" to "Dish" using the HTML field that comes with the notes plugin.
List it before the preparation time of the dish. */
TopicType type = dmx.getTopicType("dmx.cooking.dish");
type.addCompDefBefore(mf.newCompDefModel(
"dmx.cooking.dish", "dmx.cooking.annotation", "dmx.core.many"
), "dmx.cooking.preparation_time");
// Add "Tag" to "Dish"
type.addCompDef(mf.newCompDefModel(
"dmx.cooking.dish", "dmx.tags.tag", "dmx.core.many")
);
}
}
// This migration adds another topic type that shall be part of the composite "Dish":
// The composite is updated in an imperative migration:
// ./dmx-cooking/src/main/java/systems/dmx/cooking/migrations/Migration7.java
{
"topic_types": [
{
"value": "Annotation",
"uri": "dmx.cooking.annotation",
"dataTypeUri": "dmx.core.html"
}
]
}
\ No newline at end of file
dmx.plugin.model_version = 5
dmx.plugin.dependencies = systems.dmx.webclient, systems.dmx.base, systems.dmx.datetime, systems.dmx.bookmarks
\ No newline at end of file
dmx.plugin.model_version = 7
dmx.plugin.dependencies = systems.dmx.webclient, systems.dmx.base, systems.dmx.datetime, systems.dmx.bookmarks, systems.dmx.tags
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment