Skip to content

Commit

Permalink
schema: add UserSettings
Browse files Browse the repository at this point in the history
  • Loading branch information
velzie committed Jan 4, 2025
1 parent 0d640b7 commit 6d86dd4
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/entities/UserSettings.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#pragma once
#include "database.h"

struct UserSettings {
string userId;
string email;

std::map<string, string> frontendSettings;

string password;


ORM(usersettings, userId,
F(userId)
F(email)

JSON(frontendSettings)
F(password)
)

LOOKUPKEY(UserSettings, usersettings, userId)
};
13 changes: 13 additions & 0 deletions src/migrations/1-init.cc
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,19 @@ MIGRATION_UP(init, 1) {
)
)");

db->exec(R"(
CREATE TABLE usersettings(
userId TEXT PRIMARY KEY NOT NULL,
email TEXT NOT NULL,
frontendSettings JSON NOT NULL,
password TEXT NOT NULL
)
)");



setVersion(db, 1);
}

Expand Down

0 comments on commit 6d86dd4

Please sign in to comment.