Commit Graph

51 Commits

Author SHA1 Message Date
Rodolfo Alonso Hernandez 8830fed191 Open the 2024.2 (Dalmatian) DB branch
According to the TC resolution [1] and the release identification
document [2], the release number will be used as primary identifier in
the development cycle. Release name will be used in marketing.

[1]https://governance.openstack.org/tc/resolutions/20220524-release-identification-process.html
[2]https://governance.openstack.org/tc/reference/release-naming.html

Change-Id: I6fc7a154fa77a8792f93eb40c9b4497c0e67ae2f
2024-03-20 10:00:19 +00:00
Rodolfo Alonso Hernandez 7e0ba8bcda Open the 2024.1 (Caracal) DB branch
According to the TC resolution [1] and the release identification
document [2], the release number will be used as primary identifier in
the development cycle. Release name will be used in marketing.

[1]https://governance.openstack.org/tc/resolutions/20220524-release-identification-process.html
[2]https://governance.openstack.org/tc/reference/release-naming.html

Change-Id: I1ffd5878489176f33146688de03367101ede2305
2023-09-09 22:13:40 +00:00
Rodolfo Alonso Hernandez 97aa84b69a Open the 2023.2 (Bobcat) DB branch
According to the TC resolution [1] and the release identification
document [2], the release number will be used as primary identifier in
the development cycle. Release name will be used in marketing.

[1]https://governance.openstack.org/tc/resolutions/20220524-release-identification-process.html
[2]https://governance.openstack.org/tc/reference/release-naming.html

Change-Id: I0890b344096d8f8350fedd9c123e27844b671882
2023-03-21 10:14:04 +01:00
Rodolfo Alonso Hernandez 39b65575cd Change the release tag to use the release identification
According to the TC resolution [1] and the release identification
document [2], the release number will be used as primary identifier in
the development cycle. Release name will be used in marketing.

[1]https://governance.openstack.org/tc/resolutions/20220524-release-identification-process.html
[2]https://governance.openstack.org/tc/reference/release-naming.html

Change-Id: Ia3da9bf6d6113edacb0e21de9a51bd60d5e2465b
2023-03-02 00:41:19 +01:00
Rodolfo Alonso Hernandez 1fe4edab80 Open Antelope DB branch
Change-Id: I45da9a285536ddb04d6cb1def2e5fbcb866b4baf
2022-09-23 01:20:41 +02:00
Rodolfo Alonso Hernandez 5a60701f1f Open Zed DB branch
Change-Id: I03a2b5ee881864226bbe5ef78e38707213cbbbfe
2022-03-05 19:27:21 +00:00
Zuul 106fa3e6d3 Merge "Replace "Inspector.from_engine()" with "sqlalchemy.inspect()"" 2021-09-29 14:14:29 +00:00
Rodolfo Alonso Hernandez 42fda206e9 Replace "Inspector.from_engine()" with "sqlalchemy.inspect()"
Since SQLAlchemy 1.4, the method "Inspector.from_engine()" is
deprecated.

Error message:
"The from_engine() method on Inspector is deprecated and will be removed
in a future release.  Please use the sqlalchemy.inspect() function on an
Engine or Connection in order to acquire an Inspector. (deprecated
since: 1.4)"

Minimum version of SQLAlchemy required is bumped to 1.4.23.

Change-Id: I6cf5944ccb3a0532cbf123ddc0d7df6b6de80af1
Closes-Bug: #1943155
2021-09-23 13:41:50 +00:00
Rodolfo Alonso Hernandez 3d7929591c Open Yoga DB branch
Change-Id: If0fa70e8ebab3c704c2350e28953ebfcc3a79fa9
2021-09-20 15:08:07 +00:00
Rodolfo Alonso Hernandez ca8f1a20c5 Open Xena DB branch
Change-Id: I13ba740d245a46c41a969ff198e08ddff896eb1a
2021-03-29 15:28:51 +00:00
Rodolfo Alonso Hernandez 618e8588b3 Open Wallaby DB branch
Change-Id: I50cb2424b55a53f675cb3fa128cbe36b9adbba6d
2020-10-04 14:54:07 +00:00
Slawek Kaplonski 30747a5aac Revert "Squash alchemy Liberty branch"
This reverts commit f0be5f1a83.

We broke with this reverted patch db migration for stadium
projects like neutron-vpnaas, networking-bgpvpn,
networking-bagpipe and all others which have neutron
related db migration scripts from Liberty and older releases.

Change-Id: Ib77cdf6f7cb2e975581aeb2106690d35e798dc7c
2020-09-04 07:40:44 +00:00
Rodolfo Alonso Hernandez f0be5f1a83 Squash alchemy Liberty branch
This patch squashes the DB alchemy migration from Liberty
branch. The contract and expand migration steps are added
to the initial operation files. The unneeded tables or
parameters are not created.

Now the starting migration milestone is Mitaka.

Change-Id: Ia5bd25411149d1c475c142a60814c6daa8566cae
2020-07-21 17:44:30 +00:00
Rodolfo Alonso Hernandez 518b623d7e Open Victoria DB branch
Change-Id: I27d7f393d7ef9383ed3cb0e4338cbb6d767721d9
2020-05-05 07:08:59 +00:00
zhanghao2 da93f09676 Open Ussuri DB branch
Change-Id: I345b960e97b1a95a361375cc9d5c3fc2e4836806
2019-08-15 16:30:52 -04:00
Adit Sarfaty fd388c0d40 Open Train DB branch
Change-Id: Ib1c429fa31a4c77d9810f6b1f8ffa8d6d3cd822e
2019-04-07 08:33:35 +03:00
Kobi Samoray 215498373e Open Stein DB branch
Change-Id: I2219547ad933142d392e64dbce94aba3109892a7
2018-08-08 11:51:45 +03:00
Ann Kamyshnikova d5653e13e2 Add setting server_default in alter_enum(_add_value)
At this moment setting server_default can be lost with using
alter_enum(_add_value) function. This change make it possible to pass
existing server_default for the column.

Change-Id: I187d62aa5fa67487b9f01ebb691d66a318288280
2018-03-13 11:57:06 +00:00
Gary Kotton ec7444c77d Open Rocky DB branch
Change-Id: I409ec57f1d4c489e77d4d6e62c6df87055a585db
2018-02-09 07:16:45 +02:00
Armando Migliaccio 941cb677dc Open Queens DB branch
Change-Id: Ie9462853da6ddfe5bc434072f1d3094d0fae9dac
2017-08-24 14:46:01 +00:00
Jenkins 5d2017efc3 Merge "Hook bandit security linter to pep8 target" 2017-08-24 06:10:40 +00:00
Armando Migliaccio 7e1472888e DB migration checklist task for Pike
Change-Id: I4a51e96800bfac31f7d4e0879f32e81e78afbd85
2017-08-15 12:19:32 -07:00
Armando Migliaccio 85a3e93537 Hook bandit security linter to pep8 target
This helps catch a number of potential issues with the neutron
code in advance. A false positive can be skipped with #nosec
at the offending line, just like #noqa can be added on
offending module imports.

Change-Id: I3e4cbc94539dd2cce61bfa5cd0265e75d7336311
2017-08-09 19:48:05 -07:00
Ihar Hrachyshka 1da78c924e tests: apply latest release milestone alembic scripts first
Before walking through migration scripts that belong to the release
under development, we should first execute all scripts for the latest
official release because it serves a convergence point. Without it, we
can't guarantee that calling --expand will succeed because some of new
scripts may depend on schema state that is defined by contract scripts.

Change-Id: I501b38900fb2f4409839ecd09be4d937cf20c6a9
Related-Bug: #1671634
2017-08-07 10:09:13 -07:00
Ann Kamyshnikova 42fbe0e0b5 Fix alter_enum_add_value
Using alter_enum_add_value for PostgreSQL hit error with running
inside migration.

Update code with operations that can be executed. As this implementation
do not drop columns like alter_enum, it can be used in expand branch
as well.

Change-Id: I56d0731fff317b7be73e8237fa897c1d44331bcd
2017-07-05 18:23:50 +04:00
xiaoli 4e1fd1a62b Modify the execution of alter_enum_add_value SQL
'%' (value) s in the execution SQL statement of alter_enum_add_value
should be decorated with ' '

Ralated commit I4767222ba97d9c35c011adfc187b2977975f981a

Change-Id: I24138e5b4ec8b3c3126ae5ff79e26ecb91a65d69
2017-07-04 17:56:30 +08:00
Ann Taraday 1204e0b24b Add alter_enum_add_value function
PostgreSQL is more sensible with Enums, than MySQL. We have special
function alter_enum to deal with updated Enums.
PostgreSQL ALTER TYPE is expanded now [1], so this change introduce
function for adding new values in Enums that are already created.

[1] - https://www.postgresql.org/docs/9.1/static/sql-altertype.html

Change-Id: I4767222ba97d9c35c011adfc187b2977975f981a
2017-06-07 12:24:00 +04:00
Armando Migliaccio 28c93a4476 Tag the alembic migration revisions for Ocata
Change-Id: Ia7bfa3accb5dbe5a53f4d0da393050bd1edc126b
2017-02-06 20:31:11 +00:00
Ann fc075fa0d8 Manually add pk for alembic_version table
We hit a problem that Neutron migrations cannot be applied
on galera cluster with ENFORCING mode as alembic_version table
missing primary key on the table and it is expected that all tables
will have primary keys.

alembic_version is created and managed by Alembic and fixes for this
on Alembic side are on the review [1]. Anyway here migration is
proposed that will add pk on this table if it is missing, as in
other case we will have inconsistency between new deployments and
old ones.

[1] - https://gerrit.sqlalchemy.org/#/c/279/

Change-Id: I543a1ee286bdf11ae35adb87125d044a351a2648
Closes-bug: #1655610
2017-01-12 14:53:53 +04:00
Henry Gessau d0f1a616b9 Make neutron-db-manage ready for ocata development
Change-Id: I3511782616347a69055d0d3ff9a9fc10b4a07859
2016-09-16 19:42:47 +00:00
Sławek Kapłoński 7a206a942f Add function to remove constraints from database
Function used in alembic database migration script to
remove foreign keys from table doesn't remove unique constraint
created for such fk in table.
Sometimes there is need to remove also such unique constraint during
database upgrade.
Removing unique constraint is little bit different in mysql and
postgresql databases because names of such constraints are different.
This patch introduces function to remove constraints from table
during migration.
It is also used in remove_fks_from_table() function to allow removal
unique constraints when fk is removed.

Change-Id: I7e7732560984b1c1e45230434ddc4be8cf5ab630
Closes-Bug: #1599840
2016-07-12 07:26:18 +00:00
Henry Gessau 28bc1d7936 Check for alembic Add/DropColumn exceptions in migrations
Columns are added/dropped by alembic clauses in migrations, and
checking for them differs from how sqlalchemy clauses are checked.

Closes-Bug: #1589328

Change-Id: Ia0f39697afddec7cd04f870746a4bdd8b9410a32
2016-06-14 12:53:37 -04:00
nick.zhuyj 8d6f3bde1b Postgresql: add do_drop arg in alter_enum function
When postgresql is used as the backend and alter_enum is called.
The old type of enum will be dropped. But there is a case which
the old type is used by more than one column, in different table
eg. Then the drop operation will be failed. Add do_drop,do_rename,
do_create to let developer to decide whether these operations should
be skipped or not.

Change-Id: I708288e2cc507017d9f6512b567e3bfc77dfd761
Closes-Bug: #1568436
2016-04-11 04:45:01 -05:00
Miguel Angel Ajo fbd0a2b5bd Add Newton branch to neutron-db-manage.
neutron-db-manage is updated to handle the new branch.

Change-Id: Ib9f9e99ce276bb1cd1e702b28bc5503341718eb1
2016-03-18 15:36:03 +01:00
Zhengguang 5ca8d0152a Fixes force to set ondelete=CASCADE in create_foreign_keys()
The create_foreign_keys method there forces any foreign keys that
created to have ondelete='CASCADE', no matter whether the
foreign_keys parameter passed to the method had that option set.
if the wrapper method remove_fks_from_table() is used to preserve
the state of foreign keys during a database migration, any foreign
keys on the table "perserved" this way will have cascading delete
added to them.

Change-Id: I04bdc863d67e2228f34a05f588c2e9f562918114
Closes-Bug: #1550027
2016-03-15 13:56:22 +08:00
Akihiro Motoki 2d8632e412 Use _ from neutron._i18n
Partial-Bug: #1520094
Change-Id: I874a4aa1d71d1f7034a1ff0b7450b419ef5c6864
2015-12-06 19:39:04 +09:00
Ihar Hrachyshka 6210d28424 Support new mitaka directory with revisions
Also, don't initialize a new 'per-release' directory with new revisions
that have branch labels because we don't maintain per release labels
anymore.

Change-Id: I3a875e239602147d82d28994788c3409d64d6992
2015-09-30 18:58:52 +02:00
Henry Gessau 52236764a3 Tag the alembic migration revisions for Liberty
Previously when we had one repo with one alembic branch we would
create a milestone revision on that single branch. Now we have
multiple repos and expand/contract branches for each repo.

So from now on we tag the final revision on every branch when we make
a milestone release. Update the cli to support the command:
  neutron-db-manage upgrade <milestone>
where <milestone> becomes an alias for all the revisions for a
milestone.

Partial-Bug: #1499033

Change-Id: I38623986dd574bec01fe147f9c6a747f3f512bb7
2015-09-29 10:48:29 -04:00
Kevin Benton d8a5e23e87 Remove restriction of adding constraints to expand
Adding a constraint to a table shouldn't be restricted
to an expand operation. There can be contraction migrations
required before the constraint can be safely added (e.g. inserting
records into the target table of the constraint).

Change-Id: I1963facaa6ab1916d92c044f90b6c00291f00ab9
2015-09-16 13:26:10 -07:00
Ann Kamyshnikova bbaa4abdd5 Add test to check that correct functions is used in expand/contract
This test will check that expand branch does not contain drop SQLAlchemy
operations and contract branch does not contain create/add SQLAlchemy
operations.

Partially-Implements: blueprint online-schema-migrations

Change-Id: Ifda31c0599651931c1a98f673f3b10e64538f18b
Related-bug: #1490767
2015-09-09 16:13:11 +03:00
Henry Gessau fab2f8eeca Rename args for alembic 0.8.0
Version 0.8.0 of alembic has renamed some arguments in some of its
methods. This generates warnings when running neutron's alembic
migration scripts.

Change-Id: I4f90a66c2465dd1d7f6631f297146754fd5e9cc4
2015-08-18 21:54:08 -04:00
Jakub Libosvar b5f1cc48b8 Drop and recreate FK if adding new PK to routerl3bindings
Since MySQL 5.6 FK columns cannot be altered. As a workaround we can
drop the FK before ALTER COLUMN and then recreate it.

Change-Id: Icd1b3075cf29a6b0c477a4ddea2e6ebee91baef8
Closes-Bug: 1384555
2014-11-05 15:10:04 +01:00
Gary Kotton 7edf58495e Remove @author(s) from copyright statements
We have git to track authorship, so let's not pad source files
with it as well.

A hacking check has been added for this. The value is N322.

Change-Id: Iab0b64d417e0bb41a6b455e2ac377deee64ec3ee
2014-09-15 21:40:09 +09:00
Salvatore 0bbc4a609a Remove logic for conditional migrations
This patch removes the logic for handling conditional migrations
and adjusts all the patches where it was used accordingly.

The alembic environment has been update to not send anymore
the active plugins list to migrations.

This patch also removes the vestigial 'options' parameter which
was sent to every migration but always set to None and never
used by any migration.

Implements blueprint bp/reorganize-migrations

Change-Id: I7285e0276b262a9ea5d22c456a5a8cf34c461a0c
2014-09-12 00:34:59 -04:00
Salvatore Orlando 6bb6718688 Make Juno migrations config independent
This patch amends migrations added after the icehouse release
and before the healing migration.
Migrations are changed in a way that they are not anymore
dependent on configuration parameters but are anyway aware of
the fact that the database has not yet been healed.

To this aim, amended migrations now will need to inspect the
current schema and cannot be anymore be used in offline mode;
this is consistent with the behaviour of the healing migration.

This patch does not remove the logic for generating and
managing configuration-dependent migrations. For this reason
upgrade and downgrade routines still accept the active_plugins
parameter, which will not be used.

Change-Id: I9d55a01c64ef555b7774099f497c9eea596aea6e
Partially-implements: blueprint reorganize-migrations
2014-09-11 23:09:45 -04:00
Ann Kamyshnikova c0fb42182c Fix migration set_length_of_description_field_metering
If PostgreSQL version is less than 9.1.13 migration
set_length_of_description_field_metering fails as there is no
special 'create if not exist' expression. This change add special
function for this case.

Closes-bug: #1348138

Change-Id: Ibe4f370fe400072abd281bd2313261790335eae2
2014-08-19 11:51:23 +04:00
Ann Kamyshnikova 73705174c9 Fix incorrect change of Enum type
In migration 1341ed32cc1e_nvp_netbinding_update Enum type had been
changed incorrectly from ('flat', 'vlan', 'stt', 'gre')
to ('flat', 'vlan', 'stt', 'gre', 'l3_ext') for PostgeSQL.

The same problem is taken place for vlan_type in migrations
38fc1f6789f8_cisco_n1kv_overlay from ('vlan', 'vxlan', 'trunk',
'multi-segment') to ('vlan', 'overlay', 'trunk', 'multi-segment')
and in 46a0efbd8f0_cisco_n1kv_multisegm from ('vlan', 'vxlan') to
('vlan', 'vxlan', 'trunk', 'multi-segment').

In this change request was added separate method for changing Enum
type for PostgreSQL.

Closes-bug: #1301396

Change-Id: I27197fb7405630a55178be8516a4b62bd135e05c
2014-04-21 13:05:32 +04:00
Hareesh Puthalath f23d081b26 Include cisco plugin in migration plugins with ovs
Currently we have many migration files with missing cisco
plugin in migrate_plugin when ovs is included.This
causes missing tables when cisco plugin is enabled
and migration is run. This fix should automatically
include the cisco plugin if ovs is detected in the
migrate_plugins.

Change-Id: I4dedfbafe9b431e85255d5427766e22eed09ee5e
Closes-Bug: #1292114
2014-03-25 21:35:12 +01:00
Akihiro Motoki b481026c0e Remove vim line from db migartion template
This commit also empties __init__.py and removes vim
modelines in the db migration related codes.

Change-Id: I9f83109c5becb6cf7e2e6ad9ad8eb9af3d8e0972
Closes-Bug: #1286991
2014-03-03 16:09:41 +09:00
Oleg Bondarev 47c0d2ebd5 Add support for service plugins to the migration framework
Implements blueprint migrations-for-service-plugins
Fixes bug 1209151

Change-Id: If7fc7a4488352e9b65b6973d8ea631e0d9ed8b68
2013-08-09 14:08:27 +04:00