mirror of
https://github.com/frappe/books.git
synced 2024-12-24 20:00:29 +00:00
fix: update prestiege to drop temp table if exists
This commit is contained in:
parent
490837a5e1
commit
77d7ce3531
@ -107,6 +107,7 @@ class SqliteDatabase extends Database {
|
|||||||
async prestigeTheTable(tableName, tableRows) {
|
async prestigeTheTable(tableName, tableRows) {
|
||||||
// Alter table hacx for sqlite in case of schema change.
|
// Alter table hacx for sqlite in case of schema change.
|
||||||
const tempName = `__${tableName}`;
|
const tempName = `__${tableName}`;
|
||||||
|
await this.knex.schema.dropTableIfExists(tempName);
|
||||||
await this.knex.raw('PRAGMA foreign_keys=OFF');
|
await this.knex.raw('PRAGMA foreign_keys=OFF');
|
||||||
await this.createTable(tableName, tempName);
|
await this.createTable(tableName, tempName);
|
||||||
await this.knex.batchInsert(tempName, tableRows);
|
await this.knex.batchInsert(tempName, tableRows);
|
||||||
|
Loading…
Reference in New Issue
Block a user