New SQL files for labels, tweaked one setting dialog.

This commit is contained in:
martinrotter 2017-03-13 08:02:37 +01:00
parent 898616a38f
commit b921eb5601
6 changed files with 95 additions and 32 deletions

View file

@ -12,7 +12,7 @@ CREATE TABLE IF NOT EXISTS Information (
inf_value TEXT NOT NULL
);
-- !
INSERT INTO Information VALUES (1, 'schema_version', '6');
INSERT INTO Information VALUES (1, 'schema_version', '8');
-- !
CREATE TABLE IF NOT EXISTS Accounts (
id INTEGER PRIMARY KEY,
@ -100,3 +100,18 @@ CREATE TABLE IF NOT EXISTS Messages (
FOREIGN KEY (account_id) REFERENCES Accounts (id)
);
-- !
DROP TABLE IF EXISTS Labels;
-- !
CREATE TABLE IF NOT EXISTS Labels (
id INTEGER AUTO_INCREMENT PRIMARY KEY,
account_id INTEGER NOT NULL,
color_fg TEXT NOT NULL,
color_bg TEXT NOT NULL,
title TEXT NOT NULL,
description TEXT,
custom_id TEXT,
custom_hash TEXT,
FOREIGN KEY (account_id) REFERENCES Accounts (id)
);

View file

@ -6,7 +6,7 @@ CREATE TABLE IF NOT EXISTS Information (
inf_value TEXT NOT NULL
);
-- !
INSERT INTO Information VALUES (1, 'schema_version', '6');
INSERT INTO Information VALUES (1, 'schema_version', '8');
-- !
CREATE TABLE IF NOT EXISTS Accounts (
id INTEGER PRIMARY KEY,
@ -95,3 +95,18 @@ CREATE TABLE IF NOT EXISTS Messages (
FOREIGN KEY (account_id) REFERENCES Accounts (id)
);
-- !
DROP TABLE IF EXISTS Labels;
-- !
CREATE TABLE IF NOT EXISTS Labels (
id INTEGER PRIMARY KEY,
account_id INTEGER NOT NULL,
color_fg TEXT NOT NULL,
color_bg TEXT NOT NULL,
title TEXT NOT NULL,
description TEXT,
custom_id TEXT,
custom_hash TEXT,
FOREIGN KEY (account_id) REFERENCES Accounts (id)
);

View file

@ -0,0 +1,14 @@
CREATE TABLE IF NOT EXISTS Labels (
id INTEGER AUTO_INCREMENT PRIMARY KEY,
account_id INTEGER NOT NULL,
color_fg TEXT NOT NULL,
color_bg TEXT NOT NULL,
title TEXT NOT NULL,
description TEXT,
custom_id TEXT,
custom_hash TEXT,
FOREIGN KEY (account_id) REFERENCES Accounts (id)
);
-- !
UPDATE Information SET inf_value = '8' WHERE inf_key = 'schema_version';

View file

@ -0,0 +1,14 @@
CREATE TABLE IF NOT EXISTS Labels (
id INTEGER PRIMARY KEY,
account_id INTEGER NOT NULL,
color_fg TEXT NOT NULL,
color_bg TEXT NOT NULL,
title TEXT NOT NULL,
description TEXT,
custom_id TEXT,
custom_hash TEXT,
FOREIGN KEY (account_id) REFERENCES Accounts (id)
);
-- !
UPDATE Information SET inf_value = '8' WHERE inf_key = 'schema_version';

View file

@ -109,7 +109,7 @@
#define APP_DB_SQLITE_FILE "database.db"
// Keep this in sync with schema versions declared in SQL initialization code.
#define APP_DB_SCHEMA_VERSION "7"
#define APP_DB_SCHEMA_VERSION "8"
#define APP_DB_UPDATE_FILE_PATTERN "db_update_%1_%2_%3.sql"
#define APP_DB_COMMENT_SPLIT "-- !\n"
#define APP_DB_NAME_PLACEHOLDER "##"

View file

@ -23,33 +23,7 @@
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="m_lblDataStorageWarning">
<property name="text">
<string>WARNING: Note that switching to another data storage type will NOT copy existing your data from currently active data storage to newly selected one.</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Note that turning this option ON will make saving of new messages FASTER, but it might rarely cause some issues with messages saving.</string>
</property>
<property name="alignment">
<set>Qt::AlignHCenter|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="0">
<item row="5" column="0">
<widget class="QLabel" name="m_lblDatabaseDriver">
<property name="text">
<string>Database driver</string>
@ -59,10 +33,10 @@
</property>
</widget>
</item>
<item row="3" column="1">
<item row="5" column="1">
<widget class="QComboBox" name="m_cmbDatabaseDriver"/>
</item>
<item row="4" column="0" colspan="2">
<item row="6" column="0" colspan="2">
<widget class="QStackedWidget" name="m_stackedDatabaseDriver">
<property name="currentIndex">
<number>1</number>
@ -287,6 +261,37 @@ Authors of this application are NOT responsible for lost data.</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QLabel" name="m_lblDataStorageWarning">
<property name="styleSheet">
<string notr="true">QLabel {
margin-top: 12px;
}</string>
</property>
<property name="text">
<string>WARNING: Note that switching to another data storage type will NOT copy existing your data from currently active data storage to newly selected one.</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Note that turning this option ON will make saving of new messages FASTER, but it might rarely cause some issues with messages saving.</string>
</property>
<property name="alignment">
<set>Qt::AlignHCenter|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>