<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Your installed neutron is not current.
When developing new db migrations you should be working with the
master branch. Fast forward your repo and re-run devstack to get
the latest neutron-db-manage.<br>
<br>
On Tue, Nov 03, 2015, Zhi Chang <a class="moz-txt-link-rfc2396E" href="mailto:changzhi@unitedstack.com"><changzhi@unitedstack.com></a>
wrote:<br>
</div>
<blockquote cite="mid:tencent_069EDA0705CA009210181569@qq.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<div>Thanks for your reply.</div>
<div> There is an error when I run migration cmd:</div>
<div><br>
</div>
<div>
<div>stack@devstack:~/neutron/neutron/db/migration$
neutron-db-manage revision -m 'desc' --contract</div>
<div>usage: neutron-db-manage [-h] [--config-dir DIR]
[--config-file PATH]</div>
<div> [--core_plugin CORE_PLUGIN]
[--nosplit_branches]</div>
<div> [--service SERVICE]
[--split_branches]</div>
<div> [--subproject SUBPROJECT]
[--version]</div>
<div> [--database-connection
DATABASE_CONNECTION]</div>
<div> [--database-engine
DATABASE_ENGINE]</div>
<div>
{current,history,branches,check_migration,upgrade,downgrade,stamp,revision}</div>
<div> ...</div>
<div>neutron-db-manage: error: unrecognized arguments:
--contract</div>
</div>
<div><includetail>
<div> </div>
<div> </div>
<div style="font:Verdana normal 14px;color:#000;">
<div style="FONT-SIZE: 12px;FONT-FAMILY: Arial
Narrow;padding:2px 0 2px 0;">------------------ Original ------------------</div>
<div style="FONT-SIZE: 12px;background:#efefef;padding:8px;">
<div id="menu_sender"><b>From: </b> "Anna
Kamyshnikova"<a class="moz-txt-link-rfc2396E" href="mailto:akamyshnikova@mirantis.com"><akamyshnikova@mirantis.com></a>;</div>
<div><b>Date: </b> Tue, Nov 3, 2015 07:03 PM</div>
<div><b>To: </b> "OpenStack Development Mailing List (not
for usage
questions)"<a class="moz-txt-link-rfc2396E" href="mailto:openstack-dev@lists.openstack.org"><openstack-dev@lists.openstack.org></a>; <wbr></div>
<div><b>Subject: </b> Re: [openstack-dev]
[Neutron][db][migration] Neutron db migrationby python
scripts</div>
</div>
<div> </div>
<div dir="ltr">You can create new migration
using "neutron-db-manage revision -m 'desc'
--expand/--contract" depends in what changes do you want
to do in migration expand - add something, contract -
delete or modify.
<div> More information - <a moz-do-not-send="true"
href="http://docs.openstack.org/developer/neutron/devref/alembic_migrations.html">http://docs.openstack.org/developer/neutron/devref/alembic_migrations.html</a></div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Tue, Nov 3, 2015 at 1:52 PM,
Zhi Chang <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:changzhi@unitedstack.com"
target="_blank">changzhi@unitedstack.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>Hi, all</div>
<div> Now, I should make some <span
style="color:rgb(62,67,73);font-family:Arial,sans-serif;font-size:14.4px;line-height:21.6px">database
model definitions</span><span
style="line-height:1.5"> if I want to upgrade db.
And a database migration script will generated
when I run "</span><span style="color:rgb(85,85,85);font-size:1.1em;line-height:1.2em;white-space:pre-wrap">neutron-db-manage revision -m "description of revision" --autogenerate</span><span
style="line-height:1.5">". The database will
upgraded when run "neutron-db-manage upgrade
head". </span></div>
<div><span style="line-height:1.5"> I want to
upgrade db and I plan to write db migration
scripts manually instead of change database model
definitions. Is there some ways to realize it?</span></div>
<div><span style="line-height:1.5"> Does anyone
have some good ideas?</span></div>
<div><span style="line-height:1.5"><br>
</span></div>
<div><span style="line-height:1.5">Thanks</span></div>
<span class="HOEnZb"><font color="#888888">
<div><span style="line-height:1.5">Zhi Chang</span></div>
</font></span><br>
__________________________________________________________________________<br>
OpenStack Development Mailing List (not for usage
questions)<br>
Unsubscribe: <a moz-do-not-send="true"
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 moz-do-not-send="true"
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>
<br>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
<div class="gmail_signature">
<div dir="ltr">Regards,
<div>Ann Kamyshnikova</div>
<div>Mirantis, Inc</div>
</div>
</div>
</div>
</div>
<!--<![endif]--></includetail></div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: <a class="moz-txt-link-abbreviated" href="mailto:OpenStack-dev-request@lists.openstack.org?subject:unsubscribe">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a>
<a class="moz-txt-link-freetext" href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a>
</pre>
</blockquote>
<br>
</body>
</html>