Properly apply column default in migration pool_monitor_status

server_default parameter should be used to apply default value at
table/column creation time. Otherwise non-nullable column can't
be created because of existing rows in the tables.

Change-Id: I7136e6a0dfb9dc66ca63ff3c9fcf6de164e27e63
Closes-Bug: #1305725
This commit is contained in:
Eugene Nikanorov 2014-04-10 13:36:45 +04:00
parent a701f23807
commit a58b1657c4

View File

@ -45,6 +45,7 @@ def upgrade(active_plugins=None, options=None):
op.add_column('poolmonitorassociations', sa.Column('status',
sa.String(16),
server_default='',
nullable=False))
op.add_column('poolmonitorassociations', sa.Column('status_description',
sa.String(255)))