[deepamehta-devel] some newbie dev migrations questions

carolina carolina at sindominio.net
So Feb 9 10:24:49 CET 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello again :)

> 
> You can't add new child types to an existing type with a
> declarative migration (JSON). You would need an imperative
> migration for that (Java, DM Core API). But see note below.

so in declarative migrations, it would only make sense to have
different migration files for defining different types? i.e. define an
event, define a location, etc ..?

> The DM runtime takes care of running migrations in the proper
> order (1, 2, 3, ...) and that each migration is run exactly once.
> This is because a migration expects a well-defined DB state and
> leaves a well-defined DB state. If a migration which e.g. creates a
> type would run twice the 2nd run would fail as the type already
> exists. Declarative DM migrations (JSON) are not idempotent.

 there is no "rollback" with declarative migrations, right?

>> btw is there a way to create again the database from scratch so
>> to be able to run the first migration?
> 
> Indeed, resetting your DB is the most easy solution in your case:
> 1) Stop DM 2) Delete the deepamehta-db folder (in the DM home 
> directory) 3) Start DM This starts DM from scratch and runs your 
> migrations starting from no. 1

:-)) ok after deleting the db and re-starting DM, the changes are
applied :)))) but of course I lost all the previous data that I had
:-D ... so the other question is which is the best way to have 2
instances of DM installed, so one that can be a working copy and the
other a dev copy.

1.- Downloading the code twice and run them in different ports?
2.- Defining 2 DB folders, one for dev and the other working copy?
3.- ....any other.....

> Note: resetting the DB is a pragmatic way while development. In a 
> production environment this is not an option of course. To add new 
> child types to an existing type in a production environment you
> MUST use an imperative migration (Java code, not JSON).

yes, for sure I'll have to move to use imperative migrations.
For developing in Java I was planning to set it up in Emacs, that is
what I use, I've seen

http://www.emacswiki.org/emacs/JavaDevelopmentEnvironment

has anybody used it? or makes more sense to use other IDE, like
netbeans or...?

Anyway first I will play around with json, for sure I will come up
with more questions before getting into the need of imperative
migrations ;-)

Thanks in advance!!

Cheers,

C


- -- 
>> Donde la pinten, salto
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJS90lbAAoJEOQV1Jy26HIvgTEH/As4cKZN8sxpYAGQQ21WwtN4
hg9y+JlPUsIEBKq0D0Pjtaexjiu15tma96RMHwG+CV7wxmmWr3UzG1dz/buf7lmI
gNrw41dTNaH3mHYsGeMW+te3ygOyCLnb/ckZfCTetyhgCPGlcEavnynxGVRPrWDD
BdmLfqL8QlHa1xCQ6m0JK945fZSIkob3Kl0ccPkh7pAxofMeDoE9wtD+b7VEQUGt
2kWMN9IEwO9hZfeuW1t+XicrlJMCo8ymK7HWnBGhxd6gFQUnsPpaAncbKubWoPEl
i7eOZKjl+c+rKQrgUTV1GzL7M01zCiNOrDU/QcDDo/5eZUbdfBSROBA1PXIM9ro=
=yRTB
-----END PGP SIGNATURE-----



Mehr Informationen über die Mailingliste devel