remove unseen in database

This commit is contained in:
grimhilt
2023-04-11 18:19:09 +02:00
parent dcb7075dca
commit 49e8ec64e0
7 changed files with 10 additions and 84 deletions

View File

@@ -51,12 +51,6 @@ export function updateLastUpdateRoom(roomId: number, idate: string) {
execQuery(query, values);
}
export async function incrementNotSeenRoom(roomId: number) {
const query = `UPDATE app_room SET notSeen = notSeen + 1 WHERE room_id = ?`;
const values = [roomId];
execQuery(query, values);
}
export async function getThreadInfo(messageID: string): Promise<{ room_id: number; root_id: number }[]> {
const query = `
SELECT

View File

@@ -27,10 +27,10 @@ export function registerMailbox_message(
execQuery(query, values);
}
export function registerFlag(messageId: number, flagId: number) {
const query = `INSERT IGNORE INTO flag_name (message_id, flag_id) VALUES (?, ?)`;
export async function registerFlag(messageId: number, flagId: number) {
const query = `INSERT IGNORE INTO flag (message_id, flag_id) VALUES (?, ?)`;
const values = [messageId, flagId];
execQuery(query, values);
return await execQueryAsync(query, values);
}
export function registerBodypart(messageId: number, part: string, bodypartId: number, bytes: number, nbLines: null) {

View File

@@ -123,7 +123,6 @@ CREATE TABLE app_room (
owner_id INT NOT NULL,
message_id INT NOT NULL,
room_type INT NOT NULL DEFAULT 0,
notSeen INT NOT NULL DEFAULT 0,
lastUpdate TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP(),
PRIMARY KEY (room_id),
UNIQUE KEY (owner_id, message_id, room_type),