From 61b5c8493e57c73469f31a795037922bd9d34931 Mon Sep 17 00:00:00 2001
From: Julien Dessaux
Date: Wed, 31 May 2023 01:19:31 +0200
Subject: Reworked the systems handling and caching with sqlite

---
 database/001_systems.sql | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

(limited to 'database/001_systems.sql')

diff --git a/database/001_systems.sql b/database/001_systems.sql
index 8448955..9ad76b1 100644
--- a/database/001_systems.sql
+++ b/database/001_systems.sql
@@ -1,6 +1,6 @@
 CREATE TABLE systems (
        id INTEGER PRIMARY KEY,
-       symbol TEXT NOT NULL UNIQUE,
-       data TEXT NOT NULL,
-       updated DATE DEFAULT (datetime('now'))
+       data JSON NOT NULL,
+       updated DATE DEFAULT NULL
 );
+CREATE UNIQUE INDEX systems_data_symbol on systems (json_extract(data, '$.symbol'));
-- 
cgit v1.2.3

