sql for probes
This commit is contained in:
parent
68bc0ac536
commit
62a36197e4
7 changed files with 31 additions and 5 deletions
|
@ -6,6 +6,7 @@
|
||||||
<file>sql/db_update_mysql_3_4.sql</file>
|
<file>sql/db_update_mysql_3_4.sql</file>
|
||||||
<file>sql/db_update_mysql_4_5.sql</file>
|
<file>sql/db_update_mysql_4_5.sql</file>
|
||||||
<file>sql/db_update_mysql_5_6.sql</file>
|
<file>sql/db_update_mysql_5_6.sql</file>
|
||||||
|
<file>sql/db_update_mysql_6_7.sql</file>
|
||||||
|
|
||||||
<file>sql/db_init_sqlite.sql</file>
|
<file>sql/db_init_sqlite.sql</file>
|
||||||
<file>sql/db_update_sqlite_1_2.sql</file>
|
<file>sql/db_update_sqlite_1_2.sql</file>
|
||||||
|
@ -13,5 +14,6 @@
|
||||||
<file>sql/db_update_sqlite_3_4.sql</file>
|
<file>sql/db_update_sqlite_3_4.sql</file>
|
||||||
<file>sql/db_update_sqlite_4_5.sql</file>
|
<file>sql/db_update_sqlite_4_5.sql</file>
|
||||||
<file>sql/db_update_sqlite_5_6.sql</file>
|
<file>sql/db_update_sqlite_5_6.sql</file>
|
||||||
|
<file>sql/db_update_sqlite_6_7.sql</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
|
@ -101,3 +101,13 @@ CREATE TABLE Labels (
|
||||||
|
|
||||||
FOREIGN KEY (account_id) REFERENCES Accounts (id) ON DELETE CASCADE
|
FOREIGN KEY (account_id) REFERENCES Accounts (id) ON DELETE CASCADE
|
||||||
);
|
);
|
||||||
|
-- !
|
||||||
|
CREATE TABLE Probes (
|
||||||
|
id $$,
|
||||||
|
name TEXT NOT NULL CHECK (name != ''),
|
||||||
|
color VARCHAR(7) NOT NULL CHECK (color != ''),
|
||||||
|
fltr TEXT NOT NULL CHECK (filter != ''), /* Regular expression. */
|
||||||
|
account_id INTEGER NOT NULL,
|
||||||
|
|
||||||
|
FOREIGN KEY (account_id) REFERENCES Accounts (id) ON DELETE CASCADE
|
||||||
|
);
|
|
@ -5,4 +5,3 @@ SET FOREIGN_KEY_CHECKS = 0;
|
||||||
!! db_update_sqlite_3_4.sql
|
!! db_update_sqlite_3_4.sql
|
||||||
-- !
|
-- !
|
||||||
SET FOREIGN_KEY_CHECKS = 1;
|
SET FOREIGN_KEY_CHECKS = 1;
|
||||||
-- !
|
|
|
@ -5,4 +5,3 @@ SET FOREIGN_KEY_CHECKS = 0;
|
||||||
!! db_update_sqlite_5_6.sql
|
!! db_update_sqlite_5_6.sql
|
||||||
-- !
|
-- !
|
||||||
SET FOREIGN_KEY_CHECKS = 1;
|
SET FOREIGN_KEY_CHECKS = 1;
|
||||||
-- !
|
|
7
resources/sql/db_update_mysql_6_7.sql
Executable file
7
resources/sql/db_update_mysql_6_7.sql
Executable file
|
@ -0,0 +1,7 @@
|
||||||
|
USE ##;
|
||||||
|
-- !
|
||||||
|
SET FOREIGN_KEY_CHECKS = 0;
|
||||||
|
-- !
|
||||||
|
!! db_update_sqlite_6_7.sql
|
||||||
|
-- !
|
||||||
|
SET FOREIGN_KEY_CHECKS = 1;
|
9
resources/sql/db_update_sqlite_6_7.sql
Executable file
9
resources/sql/db_update_sqlite_6_7.sql
Executable file
|
@ -0,0 +1,9 @@
|
||||||
|
CREATE TABLE Probes (
|
||||||
|
id $$,
|
||||||
|
name TEXT NOT NULL CHECK (name != ''),
|
||||||
|
color VARCHAR(7) NOT NULL CHECK (color != ''),
|
||||||
|
fltr TEXT NOT NULL CHECK (filter != ''), /* Regular expression. */
|
||||||
|
account_id INTEGER NOT NULL,
|
||||||
|
|
||||||
|
FOREIGN KEY (account_id) REFERENCES Accounts (id) ON DELETE CASCADE
|
||||||
|
);
|
|
@ -215,7 +215,7 @@
|
||||||
#define APP_DB_SQLITE_FILE "database.db"
|
#define APP_DB_SQLITE_FILE "database.db"
|
||||||
|
|
||||||
// Keep this in sync with schema versions declared in SQL initialization code.
|
// Keep this in sync with schema versions declared in SQL initialization code.
|
||||||
#define APP_DB_SCHEMA_VERSION "6"
|
#define APP_DB_SCHEMA_VERSION "7"
|
||||||
#define APP_DB_UPDATE_FILE_PATTERN "db_update_%1_%2_%3.sql"
|
#define APP_DB_UPDATE_FILE_PATTERN "db_update_%1_%2_%3.sql"
|
||||||
#define APP_DB_COMMENT_SPLIT "-- !\n"
|
#define APP_DB_COMMENT_SPLIT "-- !\n"
|
||||||
#define APP_DB_INCLUDE_PLACEHOLDER "!!"
|
#define APP_DB_INCLUDE_PLACEHOLDER "!!"
|
||||||
|
|
Loading…
Add table
Reference in a new issue