From: gamesguru Date: Sat, 3 Oct 2020 01:57:37 +0000 (-0400) Subject: wip X-Git-Tag: 0.0.0~7 X-Git-Url: https://git.nutra.tk/v1?a=commitdiff_plain;h=b796a0b5aa59bba09127be4f8d599e30e3603879;p=nutratech%2Fnt-sqlite.git wip --- diff --git a/sql/data/sync_data.csv b/sql/data/sync_data.csv new file mode 100644 index 0000000..160e540 --- /dev/null +++ b/sql/data/sync_data.csv @@ -0,0 +1,4 @@ +id,tablename,guid,constraint,action +1,users,a0fdac7ab369de43f029a460879c854f,,INSERT +2,users,7abf05c84beb849628a44336acfe7a5b,,INSERT +3,users,2454c8ab7c575cd2610f9977ed3b2b61,,INSERT diff --git a/sql/import.sql b/sql/import.sql index 3dc8803..465650d 100644 --- a/sql/import.sql +++ b/sql/import.sql @@ -15,6 +15,7 @@ -- along with this program. If not, see . .mode csv +.nullvalue NULL .import '| tail -n +2 ./data/bmr_eqs.csv' bmr_eqs .import '| tail -n +2 ./data/bf_eqs.csv' bf_eqs diff --git a/sql/tables.sql b/sql/tables.sql index 14c56b7..fdc63e5 100644 --- a/sql/tables.sql +++ b/sql/tables.sql @@ -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,