Hi Robert,

to my knowledge you've changed Migration7 so that the created topic gets 
"crowd.meet.start_page" as URI and restarted the server with no DB. That's why 
no topic with URI "crowd.omnibus.start_page" is created in the first place and 
your Migration8 fails.

The CROWD bus app 0.6.x releases (as deployed on the production server) rely on 
data model version 7, that is Migration7 has run already. By changing 
Migration7 afterwards you actually put your development DB in an inconsistent 
state. The pre-condition for Migration8 is no longer met.

=> You must never change a migration which is released (and possibly deployed 
on a production server) already.

The solution is to revert your changes in Migration7, delete your development 
database, and then restart. Your Migration8 will perform properly then. Your 
Migration8 code looks fine.

Note: in your development environment you're free to change Migration8 and the 
following ones (e.g. in order to fix them) and force running them again by 
deleting your development DB. You're free to do so as long as your code is not 
released (and not deployed on a production server).

If something remains unclear don't hesitate to ask.

Cheers,
Jörg


> On 12 Sep 2016, at 9:46, Robert Schuster <[email protected]> 
> wrote:
> 
> Hi all,
> I have an issue with the Migration feature. In the CROWD bus app
> Migration7 does this:
> 
>    public void run() {
>        Topic startPage =
> dm4.createTopic(mf.newTopicModel("crowd.omnibus.start_page",
> "dm4.notes.note",
>            mf.newChildTopicsModel()
>                .put("dm4.notes.title", "CROWD Omnibus start page")
>                .put("dm4.notes.text", "<p>Your content here ...</p>")
>        ));
>        wsService.assignToWorkspace(startPage,
> wsService.getWorkspace("crowd.workspace").getId());
>    }
> 
> So, I can assume that a topic with the URI "crowd.omnibus.start_page"
> exists. In Migration8 I want to rename the URI, so I implemented it like
> this:
> 
>    public void run() {
>        Topic startPage = dm4.getTopicByUri("crowd.omnibus.start_page");
>    startPage.setUri("crowd.meet.start_page");
>    }
> 
> This however fails with a NullPointerException because startPage is null.
> 
> Any idea why the topic cannot be found? Wrong workspace or something?
> 
> All the best,
> Robert
> 
> --
> Robert Schuster
> freiberuflicher Softwareingenieur
> 
> RS01 - IT-Systemanalyse und -entwicklung Robert Schuster
> Brückenstraße 4 • 12439 Berlin
> +49 157 798 00 310
> [email protected]
> 
> --
> devel mailing list
> [email protected]
> http://lists.deepamehta.de/mailman/listinfo/devel-lists.deepamehta.de

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

-- 
devel mailing list
[email protected]
http://lists.deepamehta.de/mailman/listinfo/devel-lists.deepamehta.de

Reply via email to