Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Datovka projects
mobile Datovka
Commits
5a16f817
Commit
5a16f817
authored
Sep 20, 2017
by
Karel Slaný
Committed by
Martin Straka
Sep 27, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added UNIQUE constraint on dmID & testEnv entry combination.
parent
f3140948
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
src/sqlite/db_tables.cpp
src/sqlite/db_tables.cpp
+8
-5
No files found.
src/sqlite/db_tables.cpp
View file @
5a16f817
...
...
@@ -361,9 +361,9 @@ namespace MsgZfoTbl {
const
QVector
<
QPair
<
QString
,
enum
EntryType
>
>
knownAttrs
=
{
{
"dmID"
,
DB_INTEGER
},
/* NOT NULL*/
{
"testEnv"
,
DB_BOOLEAN
},
{
"lastAccessTime"
,
DB_INTEGER
},
{
"size"
,
DB_INTEGER
},
{
"testEnv"
,
DB_BOOLEAN
},
/* NOT NULL */
{
"lastAccessTime"
,
DB_INTEGER
},
/* NOT NULL*/
{
"size"
,
DB_INTEGER
},
/* NOT NULL*/
{
"data"
,
DB_TEXT
}
/*
* PRIMARY KEY (id),
...
...
@@ -372,13 +372,16 @@ namespace MsgZfoTbl {
};
const
QMap
<
QString
,
QString
>
colConstraints
=
{
{
"dmID"
,
"NOT NULL"
}
{
"dmID"
,
"NOT NULL"
},
{
"testEnv"
,
"NOT NULL"
},
{
"lastAccessTime"
,
"NOT NULL"
},
{
"size"
,
"NOT NULL"
}
};
const
QString
&
tblConstraint
(
",
\n
"
" CHECK (testEnv IN (0, 1)),
\n
"
"
FOREIGN KEY(dmID) REFERENCES messages (dmID
)"
"
UNIQUE (dmID, testEnv
)"
);
const
QMap
<
QString
,
SQLiteTbl
::
AttrProp
>
attrProps
=
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment