mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
removed foreign keys PRAGMAs since foreign key constraints are not used anymore
This commit is contained in:
parent
d0e6be3e0c
commit
995ebbf577
@ -43,9 +43,6 @@ async function migrate() {
|
|||||||
try {
|
try {
|
||||||
log.info("Attempting migration to version " + mig.dbVersion);
|
log.info("Attempting migration to version " + mig.dbVersion);
|
||||||
|
|
||||||
// needs to happen outside of the transaction (otherwise it's a NO-OP)
|
|
||||||
await sql.execute("PRAGMA foreign_keys = OFF");
|
|
||||||
|
|
||||||
await sql.transactional(async () => {
|
await sql.transactional(async () => {
|
||||||
if (mig.type === 'sql') {
|
if (mig.type === 'sql') {
|
||||||
const migrationSql = fs.readFileSync(resourceDir.MIGRATIONS_DIR + "/" + mig.file).toString('utf8');
|
const migrationSql = fs.readFileSync(resourceDir.MIGRATIONS_DIR + "/" + mig.file).toString('utf8');
|
||||||
@ -76,10 +73,6 @@ async function migrate() {
|
|||||||
|
|
||||||
utils.crash();
|
utils.crash();
|
||||||
}
|
}
|
||||||
finally {
|
|
||||||
// make sure foreign keys are enabled even if migration script disables them
|
|
||||||
await sql.execute("PRAGMA foreign_keys = ON");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (await sqlInit.isDbUpToDate()) {
|
if (await sqlInit.isDbUpToDate()) {
|
||||||
|
@ -57,8 +57,6 @@ async function initDbConnection() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
await sql.execute("PRAGMA foreign_keys = ON");
|
|
||||||
|
|
||||||
const currentDbVersion = await getDbVersion();
|
const currentDbVersion = await getDbVersion();
|
||||||
|
|
||||||
if (currentDbVersion > appInfo.dbVersion) {
|
if (currentDbVersion > appInfo.dbVersion) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user