mirror of
https://github.com/frappe/books.git
synced 2024-12-23 19:39:07 +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) {
|
||||
// Alter table hacx for sqlite in case of schema change.
|
||||
const tempName = `__${tableName}`;
|
||||
await this.knex.schema.dropTableIfExists(tempName);
|
||||
await this.knex.raw('PRAGMA foreign_keys=OFF');
|
||||
await this.createTable(tableName, tempName);
|
||||
await this.knex.batchInsert(tempName, tableRows);
|
||||
|
Loading…
Reference in New Issue
Block a user