<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi Jörg,<br>
    thanks for the reply.<br>
    <br>
    Actually I was under the impression I did what you proposed:<br>
     - revert my changes to Migration7<br>
     - deleted my DB<br>
     - run everything again<br>
    I'll double check this and get back again.<br>
    <br>
    Best regards,<br>
    Robert<br>
    <br>
    <br>
    <div class="moz-cite-prefix">On 12.09.2016 19:24, Jörg Richter
      wrote:<br>
    </div>
    <blockquote
      cite="mid:D19E33B9-D1FC-483B-920D-A4C339AB74DB@deepamehta.de"
      type="cite">
      <pre wrap="">
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


</pre>
      <blockquote type="cite">
        <pre wrap="">On 12 Sep 2016, at 9:46, Robert Schuster <a class="moz-txt-link-rfc2396E" href="mailto:robert.schuster.rs01@gmail.com"><robert.schuster.rs01@gmail.com></a> 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
<a class="moz-txt-link-abbreviated" href="mailto:robert.schuster.rs01@gmail.com">robert.schuster.rs01@gmail.com</a>

--
devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:devel@lists.deepamehta.de">devel@lists.deepamehta.de</a>
<a class="moz-txt-link-freetext" href="http://lists.deepamehta.de/mailman/listinfo/devel-lists.deepamehta.de">http://lists.deepamehta.de/mailman/listinfo/devel-lists.deepamehta.de</a>
</pre>
      </blockquote>
      <pre wrap="">
</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Robert Schuster
freiberuflicher Softwareingenieur

RS01 - IT-Systemanalyse und -entwicklung Robert Schuster
Brückenstraße 4 • 12439 Berlin
+49 157 798 00 310
<a class="moz-txt-link-abbreviated" href="mailto:robert.schuster.rs01@gmail.com">robert.schuster.rs01@gmail.com</a>

</pre>
  </body>
</html>