From 81a630179a61c7fe392df3e6e29f1bc9c5d4cf46 Mon Sep 17 00:00:00 2001 From: yakamok <38737288+yakamok@users.noreply.github.com> Date: Tue, 3 Jul 2018 16:26:27 +0200 Subject: [PATCH] Update vserv.py --- vserv.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vserv.py b/vserv.py index 432922d..1d235f5 100644 --- a/vserv.py +++ b/vserv.py @@ -41,8 +41,8 @@ def isdatabase(db_path): try: conn = sqlite3.connect(db_path + 'yggindex.db') c = conn.cursor() - c.execute('''create table yggindex(ipv6 varchar(45) UNIQUE, coords varchar(50),\ - time timestamp default (strftime('%s', 'now')))''') + c.execute('create table yggindex(ipv6 varchar(45) UNIQUE, coords varchar(50),\ + utimestamp int(40))') conn.commit() except Error as e: print(e) @@ -56,8 +56,8 @@ def insert_new_entry(db_path, ipv6, coords): try: conn = sqlite3.connect(db_path + "yggindex.db") c = conn.cursor() - c.execute('''INSERT OR REPLACE INTO yggindex(ipv6, coords) VALUES(?, ?)''',\ - (ipv6, coords)) + c.execute('''INSERT OR REPLACE INTO yggindex(ipv6, coords, utimestamp) VALUES(?, ?, ?)''',\ + (ipv6, coords, utimestamp)) conn.commit() conn.close() except Error as e: