|
|
|
@ -1619,6 +1619,15 @@ class SqliteClient extends KnexClient {
|
|
|
|
|
|
|
|
|
|
await this.sqlClient.raw('PRAGMA legacy_alter_table = ON;'); |
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
This is a hack to avoid the following error: |
|
|
|
|
- SQLITE_ERROR: duplicate column name: column_name |
|
|
|
|
|
|
|
|
|
Somehow this error is thrown when we drop a column and add a new column with the same name right after it. |
|
|
|
|
TODO - Find a better solution for this. |
|
|
|
|
*/ |
|
|
|
|
await this.sqlClient.raw('SELECT * FROM ?? LIMIT 1', [args.table]); |
|
|
|
|
|
|
|
|
|
const trx = await this.sqlClient.transaction(); |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
@ -1650,7 +1659,7 @@ class SqliteClient extends KnexClient {
|
|
|
|
|
await trx.commit(); |
|
|
|
|
} catch (e) { |
|
|
|
|
await trx.rollback(); |
|
|
|
|
log.ppe(e, _func); |
|
|
|
|
// log.ppe(e, _func);
|
|
|
|
|
throw e; |
|
|
|
|
} finally { |
|
|
|
|
if (fkCheckEnabled) |
|
|
|
|