From ec90cad414dd2a2e17c45ee6b75c569b75b88722 Mon Sep 17 00:00:00 2001 From: Ann Kamyshnikova Date: Fri, 20 Mar 2015 18:30:27 +0300 Subject: [PATCH] Fix usage of 'default' parameter in 1955efc66455 migration 'default' is useless in migration, to provide default value in db should be used server_default instead. Closes-bug: #1434601 Change-Id: If17b48213e03f4b01db08186c272c67709e147f5 --- neutron/db/agents_db.py | 2 +- .../versions/1955efc66455_weight_scheduler.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/neutron/db/agents_db.py b/neutron/db/agents_db.py index 9b01b7463..c9862d131 100644 --- a/neutron/db/agents_db.py +++ b/neutron/db/agents_db.py @@ -89,7 +89,7 @@ class Agent(model_base.BASEV2, models_v2.HasId): # configurations: a json dict string, I think 4095 is enough configurations = sa.Column(sa.String(4095), nullable=False) # load - number of resources hosted by the agent - load = sa.Column(sa.Integer, default=0, nullable=False) + load = sa.Column(sa.Integer, server_default='0', nullable=False) @property def is_active(self): diff --git a/neutron/db/migration/alembic_migrations/versions/1955efc66455_weight_scheduler.py b/neutron/db/migration/alembic_migrations/versions/1955efc66455_weight_scheduler.py index 69a0f3345..63131efa7 100644 --- a/neutron/db/migration/alembic_migrations/versions/1955efc66455_weight_scheduler.py +++ b/neutron/db/migration/alembic_migrations/versions/1955efc66455_weight_scheduler.py @@ -32,7 +32,7 @@ import sqlalchemy as sa def upgrade(): op.add_column('agents', sa.Column('load', sa.Integer(), - default=0, nullable=False)) + server_default='0', nullable=False)) def downgrade(): -- 2.45.2