wip
authorgamesguru <mathmuncher11@gmail.com>
Sat, 3 Oct 2020 01:57:37 +0000 (21:57 -0400)
committergamesguru <mathmuncher11@gmail.com>
Sat, 3 Oct 2020 01:57:37 +0000 (21:57 -0400)
sql/data/sync_data.csv [new file with mode: 0644]
sql/import.sql
sql/tables.sql

diff --git a/sql/data/sync_data.csv b/sql/data/sync_data.csv
new file mode 100644 (file)
index 0000000..160e540
--- /dev/null
@@ -0,0 +1,4 @@
+id,tablename,guid,constraint,action
+1,users,a0fdac7ab369de43f029a460879c854f,,INSERT
+2,users,7abf05c84beb849628a44336acfe7a5b,,INSERT
+3,users,2454c8ab7c575cd2610f9977ed3b2b61,,INSERT
index 3dc8803262b671112839495f42a2045c97da820f..465650de77f528e83202bf59db62808b182bf148 100644 (file)
@@ -15,6 +15,7 @@
 -- along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 .mode csv
+.nullvalue NULL
 
 .import '| tail -n +2 ./data/bmr_eqs.csv' bmr_eqs
 .import '| tail -n +2 ./data/bf_eqs.csv' bf_eqs
index 14c56b76df95bee13ed586da2c42ec6bc300ac7c..fdc63e58e4a93a9f74f1fc47b49e4819b5077056 100644 (file)
@@ -29,12 +29,12 @@ INSERT INTO version(version, created, notes)
 
 CREATE TABLE bmr_eqs (
   id integer PRIMARY KEY AUTOINCREMENT,
-  name text
+  name text NOT NULL
 );
 
 CREATE TABLE bf_eqs (
   id integer PRIMARY KEY AUTOINCREMENT,
-  name text
+  name text NOT NULL
 );
 
 --
@@ -76,6 +76,9 @@ CREATE TABLE biometric_log (
   id integer PRIMARY KEY AUTOINCREMENT,
   guid text NOT NULL DEFAULT (lower(hex (randomblob (16)))) UNIQUE,
   user_id int NOT NULL,
+  created int DEFAULT (strftime ('%s', 'now')),
+  updated int DEFAULT (strftime ('%s', 'now')),
+  synced int DEFAULT -1,
   date int DEFAULT (strftime ('%s', 'now')),
   tags text,
   notes text,