libimcv: Added inactive field to device database table

This commit is contained in:
Andreas Steffen
2018-04-27 12:42:29 +02:00
parent 234ec9225d
commit 43a1839cbc
3 changed files with 8 additions and 4 deletions
+3 -2
View File
@@ -130,8 +130,9 @@ static bool create_session(private_imv_database_t *this, imv_session_t *session)
if (!did)
{
this->db->execute(this->db, &did,
"INSERT INTO devices (value, product) VALUES (?, ?)",
DB_TEXT, device, DB_INT, pid);
"INSERT INTO devices "
"(value, description, product, trusted, inactive) "
"VALUES (?, '', ?, 0, 0)", DB_TEXT, device, DB_INT, pid);
}
free(device);
+3 -1
View File
@@ -182,7 +182,9 @@ CREATE TABLE `devices` (
`description` VARCHAR(100) DEFAULT "",
`value` VARCHAR(256) NOT NULL,
`product` INTEGER REFERENCES `products`(`id`),
`created` INTEGER
`trusted` INTEGER DEFAULT 0,
`created` INTEGER,
`inactive` INTEGER DEFAULT 0
);
DROP TABLE IF EXISTS `identities`;
+2 -1
View File
@@ -204,7 +204,8 @@ CREATE TABLE devices (
value TEXT NOT NULL,
product INTEGER REFERENCES products(id),
trusted INTEGER DEFAULT 0,
created INTEGER
created INTEGER,
inactive INTEGER DEFAULT 0
);
DROP INDEX IF EXISTS devices_id;
CREATE INDEX devices_value ON devices (