Script for setting up database user, schema, and seed data.

This script is for bootstrapping the initial database. It can be run via
a container, but requires that a Postgres superuser's credentials be
provided via our normal config. That way the superuser can provision a
less-privileged user for the application's database connection.
This commit is contained in:
dandds
2020-01-23 06:25:35 -05:00
parent 49edd028a0
commit 49a1a219ae
3 changed files with 88 additions and 3 deletions

View File

@@ -16,7 +16,9 @@ from atst.app import make_config, make_app
def reset_database():
conn = db.engine.connect()
meta = sqlalchemy.MetaData(bind=conn, reflect=True)
meta = sqlalchemy.MetaData(bind=conn)
meta.reflect()
trans = conn.begin()
# drop all tables