Re: [openstack-dev] [Neutron][db][migration] Neutron db migration by python scripts

2015-11-03 Thread Ihar Hrachyshka

Zhi Chang  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?


I would start by asking *why* you may want to go with manual instead of  
automatic generation. It’s so much easier to do it automatic way, and you  
won’t be bothered by classifying operations into corresponding branches.


Ihar

signature.asc
Description: Message signed with OpenPGP using GPGMail
__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


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

2015-11-03 Thread Zhi Chang
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-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Neutron][db][migration] Neutron db migration by python scripts

2015-11-03 Thread Anna Kamyshnikova
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  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-requ...@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-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev