fix sql to support mariadb 10.3

This commit is contained in:
Martin Rotter 2022-02-02 08:04:59 +01:00
parent 2d767afea9
commit 392ff2415f
4 changed files with 15 additions and 6 deletions

View File

@ -26,7 +26,7 @@
<url type="donation">https://github.com/sponsors/martinrotter</url>
<content_rating type="oars-1.1" />
<releases>
<release version="4.1.2" date="2022-02-01"/>
<release version="4.1.2" date="2022-02-02"/>
</releases>
<content_rating type="oars-1.0">
<content_attribute id="violence-cartoon">none</content_attribute>

View File

@ -1,5 +1,5 @@
CREATE TABLE Information (
inf_key TEXT NOT NULL UNIQUE CHECK (inf_key != ''),
inf_key VARCHAR(128) NOT NULL UNIQUE CHECK (inf_key != ''), /* Use VARCHAR as MariaDB 10.3 does no support UNIQUE TEXT columns. */
inf_value TEXT
);
-- !

View File

@ -103,6 +103,9 @@ QString MessagesModelSqlLayer::orderByClause() const {
? QSL("%1")
: QSL("LOWER(%1)");
//sorts.append(QSL("LENGTH(%1)").arg(order_sql.arg(field_name)) +
// (m_sortOrders[i] == Qt::SortOrder::AscendingOrder ? QSL(" ASC") : QSL(" DESC")));
sorts.append(order_sql.arg(field_name) +
(m_sortOrders[i] == Qt::SortOrder::AscendingOrder ? QSL(" ASC") : QSL(" DESC")));
}

View File

@ -10,8 +10,8 @@
<height>450</height>
</rect>
</property>
<layout class="QFormLayout" name="formLayout_2">
<item row="0" column="0" colspan="2">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QScrollArea" name="m_scroll">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
@ -25,7 +25,7 @@
<x>0</x>
<y>0</y>
<width>532</width>
<height>403</height>
<height>402</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
@ -43,6 +43,12 @@
</property>
<item>
<widget class="QTabWidget" name="m_tabWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>1</verstretch>
</sizepolicy>
</property>
<property name="currentIndex">
<number>-1</number>
</property>
@ -52,7 +58,7 @@
</widget>
</widget>
</item>
<item row="1" column="0" colspan="2">
<item>
<widget class="QDialogButtonBox" name="m_buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>