From 9c86d3ced1d3033232429d95004b87692621cf5d Mon Sep 17 00:00:00 2001 From: josephine-jc Date: Wed, 17 Jan 2024 13:29:16 +0100 Subject: [PATCH] try adding albemic start with db schema --- alembic/versions/a3f3bc390462_alembic_start.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/alembic/versions/a3f3bc390462_alembic_start.py b/alembic/versions/a3f3bc390462_alembic_start.py index 7bc30f6f..b51784af 100644 --- a/alembic/versions/a3f3bc390462_alembic_start.py +++ b/alembic/versions/a3f3bc390462_alembic_start.py @@ -8,6 +8,7 @@ import sqlalchemy as sa from alembic import op +import os # revision identifiers, used by Alembic. revision = "a3f3bc390462" @@ -17,9 +18,11 @@ def upgrade(): - # ### commands auto generated by Alembic - please adjust! ### - pass - # ### end Alembic commands ### + conn = op.get_bind() + # migrations_dir = os.path.join(os.path.dirname(os.path.realpath(__file__))) + with open(os.path.join("/mnt/c/Github/cnaas-nms/docker/postgres/nms.sql")) as f: + data = f.read() + conn.execute(sa.text(data)) def downgrade():