mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-10-06 03:14:39 +08:00
fix(db): fix bug where seutp queries sometimes aren't run
This commit is contained in:
parent
4c6b0bf1e9
commit
1af9f07f85
1 changed files with 5 additions and 3 deletions
|
@ -32,9 +32,11 @@ class DatabaseConnection
|
||||||
@_isConnected = false
|
@_isConnected = false
|
||||||
databaseManager = remote.getGlobal('application').databaseManager
|
databaseManager = remote.getGlobal('application').databaseManager
|
||||||
|
|
||||||
## TODO Make this a nicer migration-based system
|
# TODO Make this a nicer migration-based system
|
||||||
if atom.isMainWindow()
|
# It's important these queries always get added. Don't worry, they'll
|
||||||
databaseManager.addSetupQueries(@_databasePath, @_setupQueries())
|
# only run if the DB doesn't exist yet, and even if they do run they
|
||||||
|
# all have `IF NOT EXISTS` clauses in them.
|
||||||
|
databaseManager.addSetupQueries(@_databasePath, @_setupQueries())
|
||||||
|
|
||||||
databaseManager.prepare @_databasePath, =>
|
databaseManager.prepare @_databasePath, =>
|
||||||
@_isConnected = true
|
@_isConnected = true
|
||||||
|
|
Loading…
Add table
Reference in a new issue