Closed rafaelrabaco closed 4 years ago
Have you tried deleting the SEC_MIGRATIONS_LOCK
rows as suggested?
What version of knex-snowflake-dialect are you using?
Have you tried deleting the
SEC_MIGRATIONS_LOCK
rows as suggested? What version of knex-snowflake-dialect are you using?
Yes, I tried to delete the row from the SEC_MIGRATIONS_LOCK
table
I'm using the latest version 0.2.2
For some reason the result of update "SEC_MIGRATIONS_LOCK" set "IS_LOCKED" = 1 where "IS_LOCKED" = 0
is failing the rowCount
check from knex/lib/migrate/Migrator.js below. What happens when you run the SQL update manually?
_lockMigrations(trx) {
const tableName = getLockTableName(this.config.tableName);
return getTable(this.knex, tableName, this.config.schemaName)
.transacting(trx)
.where('is_locked', '=', 0)
.update({ is_locked: 1 })
.then((rowCount) => {
if (rowCount != 1) {
throw new Error('Migration table is already locked');
}
});
}
Also, what knex version are you using?
Will help if you can share a minimal repo or test case to reproduce the error.
For some reason the result of
update "SEC_MIGRATIONS_LOCK" set "IS_LOCKED" = 1 where "IS_LOCKED" = 0
is failing therowCount
check from knex/lib/migrate/Migrator.js below. What happens when you run the SQL update manually?_lockMigrations(trx) { const tableName = getLockTableName(this.config.tableName); return getTable(this.knex, tableName, this.config.schemaName) .transacting(trx) .where('is_locked', '=', 0) .update({ is_locked: 1 }) .then((rowCount) => { if (rowCount != 1) { throw new Error('Migration table is already locked'); } }); }
Also, what knex version are you using?
Will help if you can share a minimal repo or test case to reproduce the error.
I put a console.log
to understand what was going in that function
That was the result
I'm using the latest version of knex 0.20.13
I will upload a repository soon
Repository for testing: https://github.com/rafaelrabaco/snowflake-demo-issue
Thank you, @rafaelrabaco! The problem is in SnowflakeDialect#processResponse, and I should have time to fix it early next week.
Fixed in 0.2.3.
Hello, when performing the migration, I always get this error. Would you help me?