Fix preprocessor not being used for initial schema

This commit is contained in:
Ajay Ramachandran
2021-03-01 22:40:13 -05:00
parent 88855ab695
commit 2c211d4730
2 changed files with 5 additions and 1 deletions

View File

@@ -50,7 +50,7 @@ export class Sqlite implements IDatabase {
this.db = new Sqlite3(this.config.dbPath, {readonly: this.config.readOnly, fileMustExist: !this.config.createDbIfNotExists});
if (this.config.createDbIfNotExists && !this.config.readOnly && fs.existsSync(this.config.dbSchemaFileName)) {
this.db.exec(fs.readFileSync(this.config.dbSchemaFileName).toString());
this.db.exec(Sqlite.processUpgradeQuery(fs.readFileSync(this.config.dbSchemaFileName).toString()));
}
if (!this.config.readOnly) {