]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Fix missing migration default value
authorSergey Kolekonov <skolekonov@mirantis.com>
Mon, 7 Jul 2014 15:22:25 +0000 (19:22 +0400)
committerenikanorov <enikanorov@mirantis.com>
Tue, 8 Jul 2014 09:52:01 +0000 (09:52 +0000)
Fix 128e042a2b68_ext_gw_mode and 40b0aff0302e_mlnx_initial
migrations by properly using server_default parameter in column
definitions.

Change-Id: I199e206dccc36fcfc2457a17167c76611d69784a
Closes-bug: #1336556

neutron/db/migration/alembic_migrations/versions/128e042a2b68_ext_gw_mode.py
neutron/db/migration/alembic_migrations/versions/40b0aff0302e_mlnx_initial.py

index 59ef4090c2ffa41fc2a8a0d45d763a2b3935b8de..644c5b031964b834a520d96a8dd18439d67457a8 100644 (file)
@@ -57,7 +57,7 @@ def upgrade(active_plugins=None, options=None):
         return
 
     op.add_column('routers', sa.Column('enable_snat', sa.Boolean(),
-                                       nullable=False, default=True))
+                                       nullable=False, server_default="1"))
     # Set enable_snat to True for existing routers
     op.execute("UPDATE routers SET enable_snat=True")
 
index 7da75d927493d464c79570744e86c7598d2263ea..fd815feba51471cfb9c1ffbcfad5904bbad5a322 100644 (file)
@@ -122,7 +122,7 @@ def upgrade(active_plugins=None, options=None):
     )
 
     op.add_column('routers', sa.Column('enable_snat', sa.Boolean(),
-                                       nullable=False, default=True))
+                                       nullable=False, server_default="1"))
     op.create_table(
         'securitygroupportbindings',
         sa.Column('port_id', sa.String(length=36), nullable=False),