- Update the migrations tool to verify migrations work up and down for both MySQL and PostgresSQL.

- Add migrations for the squashed image tables and for backfilling the uncompressed sizes
- Make sure gzip stream uses a max length when determining the uncompressed size
This commit is contained in:
Joseph Schorr 2014-10-07 15:29:56 -04:00
parent f38ce51943
commit f4daa5e97b
10 changed files with 152 additions and 43 deletions

View file

@ -17,7 +17,12 @@ from util.morecollections import AttrDict
# access to the values within the .ini file in use.
db_uri = unquote(app.config['DB_URI'])
if 'GENMIGRATE' in os.environ:
db_uri = 'mysql+pymysql://root:password@192.168.59.103/genschema'
docker_host = os.environ.get('DOCKER_HOST')
docker_host_ip = docker_host[len('tcp://'):].split(':')[0]
if os.environ.get('GENMIGRATE') == 'mysql':
db_uri = 'mysql+pymysql://root:password@%s/genschema' % (docker_host_ip)
else:
db_uri = 'postgresql://postgres@%s/genschema' % (docker_host_ip)
config = context.config
config.set_main_option('sqlalchemy.url', db_uri)