def create_migration_table(keyspace):
session.set_keyspace(keyspace)
click.echo("Creating shift_migrations table... ", nl=False)
try:
session.execute(
"""
CREATE TABLE IF NOT EXISTS shift_migrations(
type text,
time timeuuid,
migration text,
hash text,
PRIMARY KEY (type, time)
)
WITH CLUSTERING ORDER BY(time DESC)
"""
)
click.secho('OK', fg='green', bold=True)
return (True, None)
except Exception as e:
click.secho('ERROR', fg='red', bold=True)
return (False, e)
评论列表
文章目录