From 01ef3e70d8e1ffdfea2cb096aa0f28a2a1c2153b Mon Sep 17 00:00:00 2001 From: Nodir Temirkhodjaev Date: Sat, 9 Mar 2024 12:50:02 +0300 Subject: [PATCH] UI: Rules: Sort by name --- src/ui/conf/confmanager.cpp | 2 +- src/ui/conf/migrations/1.sql | 2 +- src/ui/model/rulelistmodel.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ui/conf/confmanager.cpp b/src/ui/conf/confmanager.cpp index f96d870f..514ecc93 100644 --- a/src/ui/conf/confmanager.cpp +++ b/src/ui/conf/confmanager.cpp @@ -32,7 +32,7 @@ namespace { const QLoggingCategory LC("conf"); -constexpr int DATABASE_USER_VERSION = 35; +constexpr int DATABASE_USER_VERSION = 36; const char *const sqlSelectAddressGroups = "SELECT addr_group_id, include_all, exclude_all," " include_zones, exclude_zones," diff --git a/src/ui/conf/migrations/1.sql b/src/ui/conf/migrations/1.sql index bfa3bdb5..835a2f52 100644 --- a/src/ui/conf/migrations/1.sql +++ b/src/ui/conf/migrations/1.sql @@ -98,7 +98,7 @@ CREATE TABLE rule( mod_time INTEGER NOT NULL ); -CREATE INDEX rule_rule_type_name_idx ON rule(rule_type, name); +CREATE INDEX rule_rule_type_name_idx ON rule(rule_type, lower(name)); CREATE TABLE app_rule( app_rule_id INTEGER PRIMARY KEY, diff --git a/src/ui/model/rulelistmodel.cpp b/src/ui/model/rulelistmodel.cpp index 46afdf26..b4ebf85a 100644 --- a/src/ui/model/rulelistmodel.cpp +++ b/src/ui/model/rulelistmodel.cpp @@ -240,5 +240,5 @@ QString RuleListModel::sqlWhereFts() const QString RuleListModel::sqlOrderColumn() const { - return "t.name"; + return "rule_type, lower(name)"; }