Commit Graph

6 Commits

Author SHA1 Message Date
Rodolfo Alonso Hernandez d4a85833a7 [sqlalchemy-20] The Session.begin.subtransactions flag is deprecated
Closes-Bug: #2008276
Change-Id: I5472db98c6ae24b8b1e6add2c0d73aeb1ed016ca
2023-03-03 08:04:14 +00:00
Brian Haley c3b83a9ca6 Fix all pep8 E265 errors
Fixed all pep8 E265 errors and changed tox.ini to no longer
ignore them.  Also removed an N536 comment missed from a
previous change.

Change-Id: Ie6db8406c3b884c95b2a54a7598ea83476b8dba1
2018-04-30 16:35:52 -04:00
Brian Haley de243a3513 Fix E402 pep8 errors
Fix E402 (module level import not at top of file) pep8 errors
and no longer ignore new failures.

Trivialfix

Change-Id: If9a202f1f322b5b03966c692e33e94b7c872079b
2018-04-20 18:13:07 +00:00
Cedric Brandily f069f69bd6 Fix generate_records_for_existing in migrations
generate_records_for_existing[2] assumes wrongly that:

 session.execute(...).insert_primary_key

returns a value BUT it returns a list of last inserted primary keys.
This trouble affects at least mysql and postgresql backends but not
pymysql (which silently unwraps the list), it explains why grenade tests
didn't catch this trouble.

This change corrects generate_records_for_existing by extracting last
inserted primary key from insert_primary_key list.

[1] neutron.db.migration.alembic_migrations.versions.mitaka.contract\
     .8a6d8bdae39_migrate_neutron_resources_table

Closes-Bug: #1546762
Change-Id: I607e485ab02f1d98874095b32ce53dfdd9cd1d51
2016-02-23 00:18:59 +01:00
Mike Bayer 0f58db9d64 Run NOT NULL alterations before foreign key adds
The "migrate resources table" migration will fail
for some MariaDB versions if the NOT NULL alteration
is applied after the foreign key constraint has been
added [1].   This patch reverses the order so that
NOT NULL is applied first.

[1] http://paste.openstack.org/show/480820/

Change-Id: Iab2b9fc7d82c739ae458ee48c1830541fb0f9579
2015-12-03 14:24:42 -05:00
Kevin Benton 3c8570f3fc Make Neutron resources reference standard attr table
This adds a new 'standardattributes' table and adds a foreign-key
references from ports, subnets, networks, subnetpools, routers,
securitygroups, and floatingips to this table.

This will make it easy to add new things to the schema like
timestamp fields or anything else that applies to multiple types
of Neutron resources. The new fields would just be added to the
'neutronresources' table instead of being duplicated across each
resource's table. Or, if the the relationship is 1-to-many (e.g. tags),
the new association table would be related to the 'standardattribute'
table.

Related-Bug: #1496802
Change-Id: Iaa3ba81a7e9cae09cea153720b29879d8cc9a080
2015-11-23 07:41:26 -08:00