From: Andreas Steffen Date: Fri, 13 Apr 2018 10:25:50 +0000 (+0200) Subject: libimcv: Added inactive field to device database table X-Git-Tag: 5.6.3dr2~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=43a1839cbc8e65e82aff186c42feecf4d887a80f;p=thirdparty%2Fstrongswan.git libimcv: Added inactive field to device database table --- diff --git a/src/libimcv/imv/imv_database.c b/src/libimcv/imv/imv_database.c index 0a18cd71bc..b444abdbb8 100644 --- a/src/libimcv/imv/imv_database.c +++ b/src/libimcv/imv/imv_database.c @@ -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); diff --git a/src/libimcv/imv/tables-mysql.sql b/src/libimcv/imv/tables-mysql.sql index cf50742c3d..3e23950a3d 100644 --- a/src/libimcv/imv/tables-mysql.sql +++ b/src/libimcv/imv/tables-mysql.sql @@ -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`; diff --git a/src/libimcv/imv/tables.sql b/src/libimcv/imv/tables.sql index b50c6ed12e..631969ce7b 100644 --- a/src/libimcv/imv/tables.sql +++ b/src/libimcv/imv/tables.sql @@ -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 (