Ensure theme_setting table has only one data
authorSangyoon Jang <jeremy.jang@samsung.com>
Tue, 12 May 2020 07:31:02 +0000 (16:31 +0900)
committerSangyoon Jang <jeremy.jang@samsung.com>
Mon, 25 May 2020 04:28:15 +0000 (13:28 +0900)
Current theme should be only one.

Change-Id: I90d97d86fdaf9ee821274c44bf54403dba10e5c0
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
src/theme_provider/db_manager.cc

index 0d56b97..fa6e3d7 100644 (file)
@@ -40,10 +40,11 @@ const char kSelectQuery[] =
     "  details FROM theme WHERE id = ?";
 const char kCreateThemeSettingTableQuery[] =
     "CREATE TABLE IF NOT EXISTS theme_setting (\n"
+    "  dummy   INTEGER CHECK (dummy = 0),\n"
     "  current TEXT,\n"
-    "  PRIMARY KEY (current))";
+    "  PRIMARY KEY (dummy))";
 const char kSetThemeQuery[] =
-    "INSERT OR REPLACE INTO theme_setting (current) VALUES (?)";
+    "INSERT OR REPLACE INTO theme_setting (dummy, current) VALUES (0, ?)";
 
 }  // namespace