##// END OF EJS Templates
migrations: enable sqlalchemy echo on migrations
ergo -
Show More
@@ -47,12 +47,14 b' def main(argv=sys.argv):'
47 bootstrap(config_uri)
47 bootstrap(config_uri)
48 registry = get_current_registry()
48 registry = get_current_registry()
49 alembic_cfg = Config()
49 alembic_cfg = Config()
50 alembic_cfg.set_main_option("sqlalchemy.echo", 'true')
50 alembic_cfg.set_main_option("script_location",
51 alembic_cfg.set_main_option("script_location",
51 "ziggurat_foundations:migrations")
52 "ziggurat_foundations:migrations")
52 alembic_cfg.set_main_option("sqlalchemy.url",
53 alembic_cfg.set_main_option("sqlalchemy.url",
53 registry.settings["sqlalchemy.url"])
54 registry.settings["sqlalchemy.url"])
54 command.upgrade(alembic_cfg, "head")
55 command.upgrade(alembic_cfg, "head")
55 alembic_cfg = Config()
56 alembic_cfg = Config()
57 alembic_cfg.set_main_option("sqlalchemy.echo", 'true')
56 alembic_cfg.set_main_option("script_location", "appenlight:migrations")
58 alembic_cfg.set_main_option("script_location", "appenlight:migrations")
57 alembic_cfg.set_main_option("sqlalchemy.url",
59 alembic_cfg.set_main_option("sqlalchemy.url",
58 registry.settings["sqlalchemy.url"])
60 registry.settings["sqlalchemy.url"])
@@ -65,6 +67,7 b' def main(argv=sys.argv):'
65 config['sqlalchemy_migrations'])
67 config['sqlalchemy_migrations'])
66 alembic_cfg.set_main_option("sqlalchemy.url",
68 alembic_cfg.set_main_option("sqlalchemy.url",
67 registry.settings["sqlalchemy.url"])
69 registry.settings["sqlalchemy.url"])
70 alembic_cfg.set_main_option("sqlalchemy.echo", 'true')
68 command.upgrade(alembic_cfg, "head")
71 command.upgrade(alembic_cfg, "head")
69
72
70 with get_current_request().tm:
73 with get_current_request().tm:
General Comments 0
You need to be logged in to leave comments. Login now