feat: default automatic C* schema migration to false in request
Change-Id: I62cb2103f3a3721bd3baf38f97ca25fa4d897904
This commit is contained in:
parent
0d361d1980
commit
8e67aa8879
|
@ -75,6 +75,7 @@ installed and running in a Docker Container.
|
|||
cluster = <docker ip>
|
||||
keyspace = poppy
|
||||
migrations_path = /home/poppy/poppy/storage/cassandra/migrations
|
||||
automatic_schema_migration = True #True is recommended for local dev machine
|
||||
|
||||
|
||||
5. For logging, find the ``[DEFAULT]`` section in
|
||||
|
|
|
@ -88,6 +88,7 @@ keyspace = poppy
|
|||
replication_strategy = class:SimpleStrategy, replication_factor:1
|
||||
# Path to directory containing CQL migration scripts
|
||||
migrations_path = <poppy_code_path>/poppy/storage/cassandra/migrations
|
||||
automatic_schema_migration = False
|
||||
|
||||
[drivers:distributed_task:taskflow]
|
||||
jobboard_backend_type = zookeeper
|
||||
|
|
|
@ -73,6 +73,8 @@ CASSANDRA_OPTIONS = [
|
|||
),
|
||||
cfg.BoolOpt('archive_on_delete', default=True,
|
||||
help='Archive services on delete?'),
|
||||
cfg.BoolOpt('automatic_schema_migration', default=False,
|
||||
help='Automatically migrate schema in request ?')
|
||||
]
|
||||
|
||||
CASSANDRA_GROUP = 'drivers:storage:cassandra'
|
||||
|
@ -121,10 +123,12 @@ def _connection(conf, datacenter, keyspace=None):
|
|||
except cassandra.InvalidRequest:
|
||||
_create_keyspace(session, keyspace, conf.replication_strategy)
|
||||
|
||||
migration_session = copy.copy(session)
|
||||
migration_session.default_consistency_level = \
|
||||
getattr(cassandra.ConsistencyLevel, conf.migrations_consistency_level)
|
||||
_run_migrations(conf.migrations_path, migration_session)
|
||||
if conf.automatic_schema_migration:
|
||||
migration_session = copy.copy(session)
|
||||
migration_session.default_consistency_level = \
|
||||
getattr(cassandra.ConsistencyLevel,
|
||||
conf.migrations_consistency_level)
|
||||
_run_migrations(conf.migrations_path, migration_session)
|
||||
|
||||
session.row_factory = query.dict_factory
|
||||
|
||||
|
|
|
@ -63,6 +63,8 @@ CASSANDRA_OPTIONS = [
|
|||
),
|
||||
cfg.BoolOpt('archive_on_delete', default=True,
|
||||
help='Archive services on delete?'),
|
||||
cfg.BoolOpt('automatic_schema_migration', default=False,
|
||||
help='Automatically migrate schema in request ?')
|
||||
]
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue