<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
This weekend, I discussed the requested change at length with Mike. I think before moving forward, we need a better understanding of what is trying to be achieved.
<div class=""><br class="">
</div>
<div class="">Request: Add the ability to verify migrations are completed prior to contract.</div>
<div class=""><br class="">
</div>
<div class="">As discussed here previously, I worked out a setup using the .info dict of the Column’s that are to be removed or Migrated. But came across and issue that is more concerning.</div>
<div class=""><br class="">
</div>
<div class="">In order to contract the DB, the columns need to be removed from the Model Classes. We can do this just prior to scanning the Model Classes to determine schema migrations, but the columns would still exist in the Model Class for all other loading
 of the model, i.e. at ORM query’s and such.</div>
<div class=""><br class="">
</div>
<div class="">After discussing this with Mike, there looks to be 3 options:</div>
<div class=""><br class="">
</div>
<div class="">
<ol class="MailOutline">
<li class="">Remove the columns at contract time and also build a mechanism to scan for the same .info entry at Query time to prevent it from being used.</li><li class="">Remove the columns at contract time and create a mechanism that on load of data models once the migration is complete would remove the columns (forced restart of service once migration is done will allow the ORM queries to no longer see the column)</li><li class="">Build the controls into our process with a way of storing the current release cycle information to only allow contract’s to occur at a set major release and maintain the column in the model till it is ready to be removed major release + 1 since
 the migration was added.</li></ol>
<div class=""><br class="">
</div>
</div>
<div class="">Personally, for ease of development and functionality, I think the best option is the 3rd as it will not require reinventing the wheel around data loading and handling of already loaded data models that could affect ORM queries.</div>
<div class=""><br class="">
</div>
<div class="">-Ph</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
<div>
<blockquote type="cite" class="">
<div class="">On Jun 10, 2015, at 5:16 PM, Dan Smith <<a href="mailto:dms@danplanet.com" class="">dms@danplanet.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<blockquote type="cite" class="">Well as long as you want to be able to load data and perform updates on<br class="">
Instance.name using normal ORM patterns, you'd still have that column<br class="">
mapped, if you want to put extra things into it to signal your migration<br class="">
tool, there is an .info dictionary available on the Column that you can<br class="">
use to do that.  A function like "removed_field()" can certainly wrap<br class="">
around a normal column mapping and populate a hint into the .info<br class="">
dictionary that online migrations will pick up on.<br class="">
</blockquote>
<br class="">
I intentionally didn't (try to) define RemovedField because I figured it<br class="">
might contain some nasty proxy bits to make it continue to work.<br class="">
However, glad to hear that there is already a provision here that we can<br class="">
use -- that sounds perfect.<br class="">
<br class="">
--Dan<br class="">
<br class="">
__________________________________________________________________________<br class="">
OpenStack Development Mailing List (not for usage questions)<br class="">
Unsubscribe: <a href="mailto:OpenStack-dev-request@lists.openstack.org" class="">
OpenStack-dev-request@lists.openstack.org</a>?subject:unsubscribe<br class="">
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" class="">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>