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) if (!did)
{ {
this->db->execute(this->db, &did, this->db->execute(this->db, &did,
"INSERT INTO devices (value, product) VALUES (?, ?)", "INSERT INTO devices "
DB_TEXT, device, DB_INT, pid); "(value, description, product, trusted, inactive) "
"VALUES (?, '', ?, 0, 0)", DB_TEXT, device, DB_INT, pid);
} }
free(device); free(device);
+3 -1
View File
@@ -182,7 +182,9 @@ CREATE TABLE `devices` (
`description` VARCHAR(100) DEFAULT "", `description` VARCHAR(100) DEFAULT "",
`value` VARCHAR(256) NOT NULL, `value` VARCHAR(256) NOT NULL,
`product` INTEGER REFERENCES `products`(`id`), `product` INTEGER REFERENCES `products`(`id`),
`created` INTEGER `trusted` INTEGER DEFAULT 0,
`created` INTEGER,
`inactive` INTEGER DEFAULT 0
); );
DROP TABLE IF EXISTS `identities`; DROP TABLE IF EXISTS `identities`;
+2 -1
View File
@@ -204,7 +204,8 @@ CREATE TABLE devices (
value TEXT NOT NULL, value TEXT NOT NULL,
product INTEGER REFERENCES products(id), product INTEGER REFERENCES products(id),
trusted INTEGER DEFAULT 0, trusted INTEGER DEFAULT 0,
created INTEGER created INTEGER,
inactive INTEGER DEFAULT 0
); );
DROP INDEX IF EXISTS devices_id; DROP INDEX IF EXISTS devices_id;
CREATE INDEX devices_value ON devices ( CREATE INDEX devices_value ON devices (