Skip to content

Commit 7c7b6c5

Browse files
author
Pedro Aim
committed
db path
1 parent b686830 commit 7c7b6c5

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

electron_app/src/backup/exporter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const start = async () => {
4141
try {
4242
await initDatabaseEncrypted({
4343
key: key,
44-
path: path.join(tempBackupDirectory, 'CriptextEncrypt.db'),
44+
dbpath: path.join(tempBackupDirectory, 'CriptextEncrypt.db'),
4545
sync: false
4646
});
4747
account = await Account().findOne({

electron_app/src/database/DBEmodel.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,23 +121,23 @@ class Version extends Model {}
121121

122122
const getDB = () => sequelize;
123123

124-
const setConfiguration = (key, path, dialectPath) => {
124+
const setConfiguration = (key, path) => {
125125
sequelize = new Sequelize(null, null, key, {
126126
dialect: 'sqlite',
127-
dialectModulePath: dialectPath || '@journeyapps/sqlcipher',
127+
dialectModulePath: '@journeyapps/sqlcipher',
128128
storage: path || myDBEncryptPath(),
129129
logging: false,
130130
transactionType: 'IMMEDIATE'
131131
});
132132
};
133133

134134
const initDatabaseEncrypted = async (
135-
{ key, shouldReset, path, sync = true, dialectPath },
135+
{ key, shouldReset, dbpath, sync = true },
136136
migrationStartCallback
137137
) => {
138138
if (shouldReset) sequelize = undefined;
139139
if (sequelize) return;
140-
await setConfiguration(key, path, dialectPath);
140+
await setConfiguration(key, dbpath);
141141

142142
Account.init(
143143
{
@@ -607,10 +607,11 @@ const initDatabaseEncrypted = async (
607607

608608
try {
609609
const migrationPath = path.join(__dirname, '/DBEmigrations');
610+
const umzugPath = getUmzugPath(process.env.NODE_ENV);
610611
const migrator = new umzug({
611612
storage: 'json',
612613
storageOptions: {
613-
path: getUmzugPath(process.env.NODE_ENV)
614+
path: umzugPath
614615
},
615616
logging: false,
616617
upName: 'up',
@@ -634,7 +635,7 @@ const initDatabaseEncrypted = async (
634635
} catch (ex) {
635636
logger.error({
636637
message: 'Migrating Database',
637-
error: ex
638+
error: ex.toString()
638639
});
639640
}
640641
};

0 commit comments

Comments
 (0)