Ticket #999 (closed Defect: worksforme)

Opened 8 years ago

Last modified 8 years ago

question: how is the syntax to reference an existing topic by uri in a declarative migration

Reported by: Malte Owned by:
Priority: Blocker Milestone: Release 4.8.3
Component: DeepaMehta Standard Distribution Version: 4.8.2
Keywords: Cc: jri, JuergeN
Complexity: 3 Area: Communications
Module:

Description

I could not find the documentation for this so i am posting my questions here:

1: how is the syntax to reference and existing topic by uri in a declarative migration? Wasn't there some special syntax like #ref_uri or so? How is it exactly?

2: and can i reference topics created within the same migrations topics:[ ... ] array? or do i need to create them in two seperate migrations?

Thanks for your help.

Change History

comment:1 in reply to: ↑ description Changed 8 years ago by jri

Replying to Malte:

1: how is the syntax to reference and existing topic by uri in a declarative migration? Wasn't there some special syntax like #ref_uri or so? How is it exactly?

Example:

childs: {
    my.type.uri: "ref_uri:my.topic.uri"
}

BTW: there is also the ref_id: prefix. And for deleting child topics/references there are the del_id: and del_uri: prefixes.

2: and can i reference topics created within the same migrations topics:[ ... ] array? or do i need to create them in two seperate migrations?

Since DM 4.6 you can do it in one migration.

While for each 4-block the creation order is fixed (1. topic_types, 2. assoc_types, 3. topics, 4. assocs, all are optional) you can have more than one of these blocks in a migration, that is an array of 4-blocks. The blocks are executed in order.

Example (creating topics before topic types):

[
    {
        topics: [...]
    },
    {
        topic_types: [...]
    }
]

See ticket:778#comment:3

For questions like this please consider the devel list.
I would love to some traffic there :-)

comment:2 Changed 8 years ago by jri

  • Status changed from new to closed
  • Resolution set to worksforme
Note: See TracTickets for help on using tickets.