From 30a82bf0470a20bf97b86191e48a94b2f8d354a6 Mon Sep 17 00:00:00 2001 From: Chintan Raval Date: Wed, 15 May 2019 15:49:14 +1000 Subject: [PATCH] remove setup code from alembic scripts --- appveyor.yml | 4 +++- .../versions/710e28aa5978_add_data_load_execution_table.py | 1 - tests/integration_tests/psql_destination/setup.sql | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 tests/integration_tests/psql_destination/setup.sql diff --git a/appveyor.yml b/appveyor.yml index c10d785..c0735b4 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -28,6 +28,7 @@ install: #Setup Python - SET PATH=%PYTHON%;%PYTHON%\Scripts;%PATH% #Swap path to python to latest version (as per matrix above) - python --version + #Create Virtual Environment - python -m venv c:\projects\relational-data-loader\venv\ build_script: @@ -35,10 +36,11 @@ build_script: - sqlcmd -b -E -S "(local)\SQL2016" -i .\tests\integration_tests\mssql_source\source_database_setup\create_database.sql - sqlcmd -b -E -f 65001 -S "(local)\SQL2016" -d RelationalDataLoaderIntegrationTestSource -i .\tests\integration_tests\mssql_source\source_database_setup\create_large_table.sql - sqlcmd -b -E -f 65001 -S "(local)\SQL2016" -d RelationalDataLoaderIntegrationTestSource -i .\tests\integration_tests\mssql_source\source_database_setup\create_compound_pk.sql - #Setup the target PostgreSQL database - psql -c "SELECT VERSION()" - createdb %DBNAME% + - psql -d %DBNAME% -U postgres -a -v ON_ERROR_STOP=1 -f .\tests\integration_tests\psql_destination\setup.sql + #Activate Virtual Environment - C:\projects\relational-data-loader\venv\Scripts\activate.bat #Install the dependencies for rdl. - pip install . diff --git a/rdl/alembic/versions/710e28aa5978_add_data_load_execution_table.py b/rdl/alembic/versions/710e28aa5978_add_data_load_execution_table.py index 43e59d7..7f66e55 100644 --- a/rdl/alembic/versions/710e28aa5978_add_data_load_execution_table.py +++ b/rdl/alembic/versions/710e28aa5978_add_data_load_execution_table.py @@ -19,7 +19,6 @@ def upgrade(): # ### commands auto generated by Alembic - please adjust! ### op.execute('CREATE SCHEMA IF NOT EXISTS rdl') - op.execute('CREATE EXTENSION IF NOT EXISTS CITEXT') op.create_table('data_load_execution', sa.Column('id', sa.Integer(), nullable=False), sa.Column('correlation_id', postgresql.UUID(as_uuid=True), nullable=True), diff --git a/tests/integration_tests/psql_destination/setup.sql b/tests/integration_tests/psql_destination/setup.sql new file mode 100644 index 0000000..34a5589 --- /dev/null +++ b/tests/integration_tests/psql_destination/setup.sql @@ -0,0 +1,2 @@ +-- create extensions +CREATE EXTENSION IF NOT EXISTS CITEXT;