-
Notifications
You must be signed in to change notification settings - Fork 233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Schemachange version 4.0.0 not picking up variable User from created connections.toml file #317
Comments
@BlessingZondi Do you have any errors you could share from schemachange logs? |
@pearsall-will Good day, Error logs below: 2025-01-17T21:48:28.5325707Z ##[section]Starting: Run schemachange |
@BlessingZondi You're using the wrong command line arguments for what you're wanting to do. -c should be --connections-file-path Like below schemachange -f (System.DefaultWorkingDirectory) \
--connections-file-path (System.DefaultWorkingDirectory)/connections.toml \
--connection-name sta_prod You can read through the arguments the CLI parses in this file |
@pearsall-will thanks for the feedback, I will have a look at the script and make necessary changes |
we are also getting the same
Version
|
@eugeneburd, see the comment by @pearsall-will as well as my comment on #320 for the solution. TLDR; Make sure you provide the
|
With the recent update of schemachange to version 4 and requiring to use a connections.toml file for authentication, it seems as though schemachange is not picking up variables created and populated in the connections.toml file.
My yml script creates the connections.toml file in the current working directory of the pipeline in azure devops and within the same script I have tried to validate if the file is created and what is the current working dir of where the file is created and also the contents of the file, all of this is handled by the script and the script displays all these details (the displaying of contents of the file was a way of testing and validating if the file is indeed created and populated).
I am not sure if the manner at which I pass these variables to schemachange is incorrect or if there is any other thing that is incorrect in my yml script. If anyone can assist? Maybe I could be missing something!
Below is the yml script that I have tried to put together:
trigger:
branches:
include:
- main
paths:
include:
- /Migrations
pool:
vmImage: 'ubuntu-latest'
variables:
steps:
task: UsePythonVersion@0
inputs:
versionSpec: '3.x'
addToPath: true
script: |
python -m pip install --upgrade pip
pip install schemachange
displayName: 'Install schemachange'
script: |
echo "Creating connections.toml file"
echo "[connections.sta_prod]" > connections.toml
echo "user = '$(user)'" >> connections.toml
echo "password = '$(password)'" >> connections.toml
echo "account = '$(account)'" >> connections.toml
echo "warehouse = '$(warehouse)'" >> connections.toml
echo "database = '$(database)'" >> connections.toml
echo "schema = '$(schema)'" >> connections.toml
echo "role = '$(role)'" >> connections.toml
echo "Current working directory:"
pwd
echo "Listing directory contents:"
ls -al
echo "Contents of connections.toml:"
cat connections.toml
displayName: 'Validate connections.toml file creation and directory'
script: |$(System.DefaultWorkingDirectory) -c $ (System.DefaultWorkingDirectory)/connections.toml -a sta_prod
schemachange -f
displayName: 'Run schemachange'
The text was updated successfully, but these errors were encountered: