yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #92445
[Bug 2020050] Re: [sqlalchemy-20] Use a ``TextClause`` object for the empty strings in the DB model definitions
Reviewed: https://review.opendev.org/c/openstack/neutron/+/883421
Committed: https://opendev.org/openstack/neutron/commit/6fa3d8019ffd416ad3eb90e6e9a364d4b6e23e80
Submitter: "Zuul (22348)"
Branch: master
commit 6fa3d8019ffd416ad3eb90e6e9a364d4b6e23e80
Author: Rodolfo Alonso Hernandez <ralonsoh@xxxxxxxxxx>
Date: Wed May 17 19:26:50 2023 +0200
Use ``TextClause`` to define the DB model "server_default"
The alembic comparator needs the same class to compare the
database model with the loaded SQL schema.
Closes-Bug: #2020050
Change-Id: I4feab3e55f2e38a9eca70d4ca755b4c2974346d5
** Changed in: neutron
Status: In Progress => Fix Released
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/2020050
Title:
[sqlalchemy-20] Use a ``TextClause`` object for the empty strings in
the DB model definitions
Status in neutron:
Fix Released
Bug description:
The alembic comparator between the DB models and the loaded metadata in the database, cannot compare an empty string clause with a ``TextClause``. For example:
[( 'modify_default',
None,
'ml2_port_bindings',
'vif_details',
{ 'existing_comment': None,
'existing_nullable': False,
'existing_type': VARCHAR(length=4095)},
DefaultClause(<sqlalchemy.sql.elements.TextClause object at 0x7fbadc92ada0>, for_update=False),
DefaultClause('', for_update=False))],
This is happening because in the DB model definitions we are using an
empty string. For example, from the error presented, the "vif_details"
column definition in the "ml2_port_bindings" table is [1]. The
"server_default" parameter should be a ``TextClause`` object instead.
[1]https://github.com/openstack/neutron/blob/a26e957d346c79ce96680b437460c9a9c4b80447/neutron/plugins/ml2/models.py#L50-L51
To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/2020050/+subscriptions
References