Merge "Add column only when it doesn't exist"
This commit is contained in:
commit
90550d0b53
@ -28,7 +28,9 @@ def upgrade(migrate_engine):
|
||||
active_backend_id = Column('active_backend_id', String(length=255))
|
||||
frozen = Column('frozen', Boolean, nullable=False, default=False,
|
||||
server_default=expression.false())
|
||||
|
||||
clusters.create_column(replication_status)
|
||||
clusters.create_column(frozen)
|
||||
clusters.create_column(active_backend_id)
|
||||
if not hasattr(clusters.c, 'replication_status'):
|
||||
clusters.create_column(replication_status)
|
||||
if not hasattr(clusters.c, 'frozen'):
|
||||
clusters.create_column(frozen)
|
||||
if not hasattr(clusters.c, 'active_backend_id'):
|
||||
clusters.create_column(active_backend_id)
|
||||
|
@ -24,4 +24,5 @@ def upgrade(migrate_engine):
|
||||
|
||||
image_cache = Table('image_volume_cache_entries', meta, autoload=True)
|
||||
cluster_name = Column('cluster_name', String(255), nullable=True)
|
||||
image_cache.create_column(cluster_name)
|
||||
if not hasattr(image_cache.c, 'cluster_name'):
|
||||
image_cache.create_column(cluster_name)
|
||||
|
@ -24,4 +24,5 @@ def upgrade(migrate_engine):
|
||||
workers = Table('workers', meta, autoload=True)
|
||||
race_preventer = Column('race_preventer', Integer, nullable=False,
|
||||
default=0, server_default=text('0'))
|
||||
race_preventer.create(workers, populate_default=True)
|
||||
if not hasattr(workers.c, 'race_preventer'):
|
||||
race_preventer.create(workers, populate_default=True)
|
||||
|
@ -19,4 +19,5 @@ def upgrade(migrate_engine):
|
||||
# Add connection_info column to attachment table
|
||||
attachment = Table('volume_attachment', meta, autoload=True)
|
||||
connection_info = Column('connection_info', Text)
|
||||
attachment.create_column(connection_info)
|
||||
if not hasattr(attachment.c, 'connection_info'):
|
||||
attachment.create_column(connection_info)
|
||||
|
@ -19,5 +19,7 @@ def upgrade(migrate_engine):
|
||||
messages = Table('messages', meta, autoload=True)
|
||||
detail_id = Column('detail_id', String(10), nullable=True)
|
||||
action_id = Column('action_id', String(10), nullable=True)
|
||||
messages.create_column(detail_id)
|
||||
messages.create_column(action_id)
|
||||
if not hasattr(messages.c, 'detail_id'):
|
||||
messages.create_column(detail_id)
|
||||
if not hasattr(messages.c, 'action_id'):
|
||||
messages.create_column(action_id)
|
||||
|
@ -20,4 +20,5 @@ def upgrade(migrate_engine):
|
||||
backups = Table('backups', meta, autoload=True)
|
||||
|
||||
encryption_key_id = Column('encryption_key_id', String(length=36))
|
||||
backups.create_column(encryption_key_id)
|
||||
if not hasattr(backups.c, 'encryption_key_id'):
|
||||
backups.create_column(encryption_key_id)
|
||||
|
Loading…
Reference in New Issue
Block a user