mirror of
https://github.com/chatmail/core.git
synced 2026-05-07 08:56:30 +03:00
fix: recreate smtp table with AUTOINCREMENT
This ensures the rows cannot be confused accidentally when referred by row_id.
This commit is contained in:
@@ -22,6 +22,7 @@
|
|||||||
- Make the bots automatically accept group chat contact requests. #4377
|
- Make the bots automatically accept group chat contact requests. #4377
|
||||||
- Fetch at most 100 existing messages even if EXISTS was not received. #4383
|
- Fetch at most 100 existing messages even if EXISTS was not received. #4383
|
||||||
- jsonrpc: typescript client: fix types of events in event emitter
|
- jsonrpc: typescript client: fix types of events in event emitter
|
||||||
|
- Recreate `smtp` table with AUTOINCREMENT `id`. #4390
|
||||||
- delete `smtp` rows when message sending is cancelled #4391
|
- delete `smtp` rows when message sending is cancelled #4391
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -711,6 +711,24 @@ CREATE INDEX smtp_messageid ON imap(rfc724_mid);
|
|||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
}
|
}
|
||||||
|
if dbversion < 101 {
|
||||||
|
// Recreate `smtp` table with autoincrement.
|
||||||
|
// rfc724_mid index is not recreated, because it is not used.
|
||||||
|
sql.execute_migration(
|
||||||
|
"DROP TABLE smtp;
|
||||||
|
CREATE TABLE smtp (
|
||||||
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
|
rfc724_mid TEXT NOT NULL, -- Message-ID
|
||||||
|
mime TEXT NOT NULL, -- SMTP payload
|
||||||
|
msg_id INTEGER NOT NULL, -- ID of the message in `msgs` table
|
||||||
|
recipients TEXT NOT NULL, -- List of recipients separated by space
|
||||||
|
retries INTEGER NOT NULL DEFAULT 0 -- Number of failed attempts to send the message
|
||||||
|
);
|
||||||
|
",
|
||||||
|
101,
|
||||||
|
)
|
||||||
|
.await?;
|
||||||
|
}
|
||||||
|
|
||||||
let new_version = sql
|
let new_version = sql
|
||||||
.get_raw_config_int(VERSION_CFG)
|
.get_raw_config_int(VERSION_CFG)
|
||||||
|
|||||||
Reference in New Issue
Block a user