I am trying to migrate my sql files using the following code
const flywayApi = new Flyway(flywayConfig)
flywayApi.migrate().then(response => {
if (!response.success) {
// Handle failure case
console.log(`Unable to execute migrate command. Error: ${response.error.errorCode}`);
}
else {
console.log('Database migration successful!');
// Handle response
}
}).catch(err => {
console.log(`Unable to execute migrate command. Error: ${err}`);
})
config file is the following
module.exports = function() {
return {
flywayArgs: {
url: 'jdbc:postgresql://localhost:5432/gtjdb',
schemas: 'public',
locations: 'filesystem:migration/master',
user: 'postgres',
password: 'admin',
sqlMigrationSuffixes: '.pgsql',
baselineOnMigrate: true,
baselineVersion:"0"
},
// Use to configure environment variables used by flyway
env: {
JAVA_ARGS: '-Djava.util.logging.config.file=./conf/logging.properties',
},
version: '6.3.2', // optional, empty or missing will download the latest
mavenPlugins: [{ // optional, use to add any plugins (ie. logging)
groupId: 'org.slf4j',
artifactId: 'slf4j-api',
version: '1.7.25',
// This can be a specifc url to download that may be different then the auto generated url.
downloadUrl: 'https://repo1.maven.org/maven2/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar',
}, {
groupId: 'org.slf4j',
artifactId: 'slf4j-jdk14',
version: '1.7.25'
}],
downloads: {
storageDirectory: '/var/test', // optional, the specific directory to store the flyway downloaded files. The directory must be writable by the node app process' user.
expirationTimeInMs: -1, // optional, -1 will never check for updates, defaults to 1 day.
}
};
};
folder tree is the following
I can’t figure out the issue here