From 72ff7c1627a2bff0a7b60243b258d1207c2063fa Mon Sep 17 00:00:00 2001 From: Evan Morikawa Date: Thu, 9 Jul 2015 14:05:06 -0700 Subject: [PATCH] fix(db): fix bug where seutp queries sometimes aren't run --- src/flux/stores/database-connection.coffee | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/flux/stores/database-connection.coffee b/src/flux/stores/database-connection.coffee index 822470f15..bc32a944d 100644 --- a/src/flux/stores/database-connection.coffee +++ b/src/flux/stores/database-connection.coffee @@ -32,9 +32,11 @@ class DatabaseConnection @_isConnected = false databaseManager = remote.getGlobal('application').databaseManager - ## TODO Make this a nicer migration-based system - if atom.isMainWindow() - databaseManager.addSetupQueries(@_databasePath, @_setupQueries()) + # TODO Make this a nicer migration-based system + # It's important these queries always get added. Don't worry, they'll + # 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, => @_isConnected = true