mirror of
https://github.com/chatmail/core.git
synced 2026-09-22 13:01:21 +03:00
add NOT NULL, remove hidden=0
This commit is contained in:
@@ -103,7 +103,7 @@ pub async fn get_pinned_messages(context: &Context, chat_id: ChatId) -> Result<V
|
||||
.query_map_vec(
|
||||
"SELECT id
|
||||
FROM msgs
|
||||
WHERE pinned=1 AND hidden=0 AND chat_id=?
|
||||
WHERE pinned=1 AND chat_id=?
|
||||
ORDER BY timestamp, id;",
|
||||
(chat_id,),
|
||||
|row| {
|
||||
|
||||
@@ -2603,7 +2603,7 @@ UPDATE msgs SET state=24 WHERE state=18; -- Change OutPreparing to OutFailed.
|
||||
// the partial index `WHERE pinned=1` keeps the index small and useful,
|
||||
// since the vast majority of rows are `pinned=0`.
|
||||
sql.execute_migration(
|
||||
"ALTER TABLE msgs ADD COLUMN pinned INTEGER DEFAULT 0;
|
||||
"ALTER TABLE msgs ADD COLUMN pinned INTEGER NOT NULL DEFAULT 0;
|
||||
CREATE INDEX msgs_index10 ON msgs (pinned) WHERE pinned=1;",
|
||||
migration_version,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user