Skip to content

Commit

Permalink
work on settings
Browse files Browse the repository at this point in the history
  • Loading branch information
loudar committed Jun 7, 2024
1 parent bfe1112 commit 8a3bd7e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
1 change: 0 additions & 1 deletion emoji-generation/generateJson.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import fs from "fs";
import path from "path";
import {Reaction, ReactionGroup} from "../src/features/database/models";

const source = "emojis.json";
Expand Down
9 changes: 9 additions & 0 deletions src/features/database/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export interface ImageAttachment {
export interface MessageReaction {
'messageId': Id;
'reactionId': Id;
'userId': Id;
}

export interface Message {
Expand Down Expand Up @@ -111,3 +112,11 @@ export interface User {
'username': string;
}

export interface UserSetting {
'createdAt': Date;
'settingKey': string;
'updatedAt': Date;
'userId': Id;
'value': string;
}

12 changes: 12 additions & 0 deletions updateDb.sql
Original file line number Diff line number Diff line change
Expand Up @@ -221,3 +221,15 @@ create table if not exists venel.userRoles
on delete cascade
);

create table if not exists venel.userSettings
(
userId bigint not null,
settingKey varchar(32) not null,
value varchar(32) not null,
createdAt datetime default current_timestamp() not null,
updatedAt datetime default current_timestamp() not null on update current_timestamp(),
primary key (settingKey, userId),
constraint userSettings_users_id_fk
foreign key (userId) references venel.users (id)
on delete cascade
);

0 comments on commit 8a3bd7e

Please sign in to comment.