[openstack-dev] [Neutron][db][migration] Neutron db migrationby python scripts

Anna Kamyshnikova akamyshnikova at mirantis.com
Tue Nov 3 11:48:43 UTC 2015


Do you have the lasted code of Neutron? Change [1] that allows this was
merged on the 22d of October.

[1] -
https://github.com/openstack/neutron/commit/9d069c48aed3a087c5c51366c8e70b29f339e794

On Tue, Nov 3, 2015 at 2:10 PM, Zhi Chang <changzhi at unitedstack.com> wrote:

> Thanks for your reply.
>  There is an error when I run migration cmd:
>
> stack at devstack:~/neutron/neutron/db/migration$ neutron-db-manage revision
> -m 'desc' --contract
> usage: neutron-db-manage [-h] [--config-dir DIR] [--config-file PATH]
>                          [--core_plugin CORE_PLUGIN] [--nosplit_branches]
>                          [--service SERVICE] [--split_branches]
>                          [--subproject SUBPROJECT] [--version]
>                          [--database-connection DATABASE_CONNECTION]
>                          [--database-engine DATABASE_ENGINE]
>
>  {current,history,branches,check_migration,upgrade,downgrade,stamp,revision}
>                          ...
> neutron-db-manage: error: unrecognized arguments: --contract
>
>
> ------------------ Original ------------------
> *From: * "Anna Kamyshnikova"<akamyshnikova at mirantis.com>;
> *Date: * Tue, Nov 3, 2015 07:03 PM
> *To: * "OpenStack Development Mailing List (not for usage questions)"<
> openstack-dev at lists.openstack.org>;
> *Subject: * Re: [openstack-dev] [Neutron][db][migration] Neutron db
> migrationby python scripts
>
> 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.
>  More information -
> http://docs.openstack.org/developer/neutron/devref/alembic_migrations.html
>
> On Tue, Nov 3, 2015 at 1:52 PM, Zhi Chang <changzhi at unitedstack.com>
> wrote:
>
>> Hi, all
>>     Now, I should make some database model definitions if I want to
>> upgrade db. And a database migration script will generated when I run "neutron-db-manage
>> revision -m "description of revision" --autogenerate". The database will
>> upgraded when run "neutron-db-manage upgrade head".
>>     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?
>>     Does anyone have some good ideas?
>>
>> Thanks
>> Zhi Chang
>>
>> __________________________________________________________________________
>> OpenStack Development Mailing List (not for usage questions)
>> Unsubscribe:
>> OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>>
>>
>
>
> --
> Regards,
> Ann Kamyshnikova
> Mirantis, Inc
>
> __________________________________________________________________________
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
>


-- 
Regards,
Ann Kamyshnikova
Mirantis, Inc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20151103/9c05ef34/attachment.html>


More information about the OpenStack-dev mailing list