<div dir="ltr">Do you reckon that the process that led to creating a migration like [1] should also be documented in devref?<div>That might be helplful for developers, unless that process is already documented elsewhere.</div><div><br></div><div>Salvatore</div><div><div><div><br></div><div><br></div><div>[1] <a href="https://review.openstack.org/#/c/202013/1">https://review.openstack.org/#/c/202013/1</a></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 15 July 2015 at 15:54, Mike Bayer <span dir="ltr"><<a href="mailto:mbayer@redhat.com" target="_blank">mbayer@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><br>
<br>
On 7/15/15 9:26 AM, Ihar Hrachyshka wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA256<br>
<br>
Hi all,<br>
<br>
since it's a high impact change in the migration tree, I wanted to<br>
drop an email to everyone affected (basically, anyone who wants to<br>
introduce a new migration from now on).<br>
<br>
So there was a proposal to split migration rules into independent<br>
branches, with one 'expand' branch containing only those rules that<br>
are safe to apply while neutron-server is running. Proposal is at:<br>
<br>
<a href="http://specs.openstack.org/openstack/neutron-specs/specs/liberty/online-" rel="noreferrer" target="_blank">http://specs.openstack.org/openstack/neutron-specs/specs/liberty/online-</a><br>
schema-migrations.html<br>
<br>
And the first patch to implement it just landed in neutron:<br>
<br>
<a href="http://git.openstack.org/cgit/openstack/neutron/commit/?id=c7acfbabdc13e" rel="noreferrer" target="_blank">http://git.openstack.org/cgit/openstack/neutron/commit/?id=c7acfbabdc13e</a><br>
d2a73bdbc6275af8063b8c1eb2f<br>
<br>
- From now on,<br>
<br>
- - there are multiple alembic heads for any database state;<br>
- - there is a new file structure under<br>
neutron/db/migration/versions/alembic_versions/{cycle}_{branch};<br>
- - you may need to split your migrations into pieces (for expand and<br>
contract branches, respectively, depending on the character of schema<br>
changes; more details in the spec);<br>
- - 'neutron-db-manage upgrade head' still applies all heads;<br>
- - I'd like to rearrange migration trees for *aas repos in the same<br>
way, though neutron-db-manage still supports the old file layout.<br>
<br>
To get an example of how the split would look like for existing<br>
migration rules in review, I took Kevin's patch for RBAC:<br>
<br>
<a href="https://review.openstack.org/191707" rel="noreferrer" target="_blank">https://review.openstack.org/191707</a><br>
<br>
And transformed it into something that adopts the new file layout:<br>
<br>
<a href="https://review.openstack.org/202013" rel="noreferrer" target="_blank">https://review.openstack.org/202013</a><br>
<br>
Changes I made:<br>
- - split migration script into two pieces;<br>
- - updated HEADS file;<br>
- - made the contract phase script depends_on the expand one;<br>
<br>
Note that 'neutron-db-manage revision --autogenerate' command does not<br>
yet filter operations into corresponding branches, though we would<br>
like to have it in L once new alembic is released.<br>
</blockquote>
<br></div></div>
This API is in master and will be the focus of the 0.8 release. This is a major refactor so I'm still working out backwards-compatibility stuff as well as getting some more pluggability into autogenerate while we're at it.   The documentation for the specific aspect of "filtering operations during autogenerate" is up at <a href="http://alembic.readthedocs.org/en/latest/api/autogenerate.html#customizing-revision-generation" rel="noreferrer" target="_blank">http://alembic.readthedocs.org/en/latest/api/autogenerate.html#customizing-revision-generation</a>.<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Ihar<br>
-----BEGIN PGP SIGNATURE-----<br>
Version: GnuPG v2<br>
<br>
iQEcBAEBCAAGBQJVpl92AAoJEC5aWaUY1u57EHoIALn4Q+k46liBJeto/pVZ+/Yd<br>
PYOJuuAV8jIrC1Xrg+70HDJ2W3TeioYAy+XqNLQ178P7cq2Gbn9xKOlzm8tuojtl<br>
dwc2cmtS443YI1IGe6Vcv9uQdYQ3qtdkuruGoaxGvIb7oRCZ9QF9qLdJELw4hG6z<br>
8B2TSrpJ6aduudmkO+DUw9rcmyG6SNAEuXSdLPEkz9oIaVPvNODHA5D8VSN0xmNY<br>
kHRNFfXcdsLZ3IWqu/xsgIbujLBPcblgdl8Oofw4GaMA271sdGMPUgPl07nAnJqa<br>
WoyOER9VQz8DqnLpXOq36oZpmCrFc+Uk7SVbvyB4nZgB0OMkvQHdtzB/Tw2yCc8=<br>
=3nWE<br>
-----END PGP SIGNATURE-----<br>
<br>
__________________________________________________________________________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" rel="noreferrer" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
</blockquote>
<br>
<br>
__________________________________________________________________________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" rel="noreferrer" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
</div></div></blockquote></div><br></div>