A image/user/db/notifications_001.sql => image/user/db/notifications_001.sql +5 -0
@@ 0,0 1,5 @@
+CREATE TABLE IF NOT EXISTS notifications(
+ _id INTEGER PRIMARY KEY,
+ key INTEGER UNIQUE DEFAULT 0,
+ value INTEGER DEFAULT 0
+);
M module-db/Databases/NotificationsDB.cpp => module-db/Databases/NotificationsDB.cpp +1 -5
@@ 8,8 8,4 @@
const char *NotificationsDB::dbName = USER_PATH("notifications.db");
NotificationsDB::NotificationsDB() : Database(dbName), notifications(this)
-{
- if (notifications.create() == false)
- return;
- isInitialized_ = true;
-}
+{}
M module-db/Tables/NotificationsTable.cpp => module-db/Tables/NotificationsTable.cpp +0 -4
@@ 14,10 14,6 @@ NotificationsTable::NotificationsTable(Database *db) : Table(db)
bool NotificationsTable::create()
{
- if (!db->execute(createTableQuery)) {
- return false;
- }
-
if (!add({{.ID = 0}, .key = static_cast<uint32_t>(NotificationsRecord::Key::Calls), .value = 0})) {
return false;
}
M module-db/Tables/NotificationsTable.hpp => module-db/Tables/NotificationsTable.hpp +0 -6
@@ 40,10 40,4 @@ class NotificationsTable : public Table<NotificationsTableRow, NotificationsTabl
uint32_t limit,
NotificationsTableFields field,
const char *str) override final;
-
- private:
- const char *createTableQuery = "CREATE TABLE IF NOT EXISTS notifications("
- "_id INTEGER PRIMARY KEY,"
- "key INTEGER UNIQUE DEFAULT 0,"
- "value INTEGER DEFAULT 0)";
};