]> Nutra Git (v1) - nutratech/nt-sqlite.git/commitdiff
update schema, and config files
authorShane Jaroch <chown_tee@proton.me>
Thu, 22 Jan 2026 05:16:08 +0000 (00:16 -0500)
committerShane Jaroch <chown_tee@proton.me>
Thu, 22 Jan 2026 05:16:26 +0000 (00:16 -0500)
.github/workflows/ci.yml [new file with mode: 0644]
.travis.yml [deleted file]
Makefile
sql/data/bf_eq.csv
sql/data/bmr_eq.csv
sql/tables.sql

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644 (file)
index 0000000..146c274
--- /dev/null
@@ -0,0 +1,32 @@
+---
+name: CI
+
+on:
+  push:
+    branches: [master, main]
+  pull_request:
+    branches: [master, main]
+  workflow_dispatch:
+
+jobs:
+  build:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v4
+
+      - name: Set up Python
+        uses: actions/setup-python@v5
+        with:
+          python-version: "3.x"
+
+      - name: Build
+        run: |
+          make build
+
+      - name: Test
+        run: |
+          make test
+
+      - name: Clean
+        run: |
+          make clean
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644 (file)
index 9a28983..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
----
-dist: xenial
-os: ["linux"]
-language: python
-python:
-  - "3.6"
-script:
-  - make build
-  - make test
-  - make clean
index 14b0c7d001db0342c69354d6fd1aabb54847d501..871829e55d865481cf155f85e6f5ade4007bca3d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -25,7 +25,10 @@ test:        ## Cursory sanity check
                'SELECT * FROM bmr_eq;' \
                'SELECT * FROM meal_name;' \
                'SELECT * FROM rda;' \
-               'SELECT * FROM version;' \
+               'PRAGMA user_version;' \
+               'PRAGMA application_id;' \
+               'PRAGMA foreign_keys;' \
+               'PRAGMA integrity_check;' \
 
 .PHONY: install
 install:       ## Copy sqlite file into ~/.nutra
index e26f6d0d773ebba365d3556084ea908bdc224de6..ae8fb474243eeceb0e06fd39b0a74d88c54c6e47 100644 (file)
@@ -1,4 +1,4 @@
-id,name
-1,NAVY
-2,3SITE
-3,7SITE
+id,name,friendly_name,requires
+1,NAVY,Navy,"gender, height (cm), waist (cm), neck (cm), and (if female) hip (cm)"
+2,3SITE,3 Site calipers,"gender, age, chest (mm), abdominal (mm), and thigh (mm)"
+3,7SITE,7 Site calipers,"gender, age, chest (mm), abdominal (mm), thigh (mm), tricep (mm), sub (mm), sup (mm), and mid (mm)"
index 399d4f871d6e1bf15eea052412cdbc276f493e78..e9f7e59e7dcb792fdd622a9353d43a5a03ba2311 100644 (file)
@@ -1,5 +1,5 @@
-id,name
-1,HARRIS_BENEDICT
-2,KATCH_MACARDLE
-3,MIFFLIN_ST_JEOR
-4,CUNNINGHAM
+id,name,friendly_name,requires
+1,HARRIS_BENEDICT,Harris Benedict,activity_factor;weight;body_fat
+2,KATCH_MACARDLE,Katch Macardle,activity_factor;weight;body_fat
+3,MIFFLIN_ST_JEOR,Mifflin St Jeor,activity_factor;weight;gender;height;age
+4,CUNNINGHAM,Cunningham,activity_factor;weight;gender;height;age
index 38091f2aa04d1291fe50583220f12ccbb75931e4..c6f87a2a74a765bdaba227d2a3fae79275a69cf9 100644 (file)
 -- You should have received a copy of the GNU General Public License
 -- along with this program.  If not, see <https://www.gnu.org/licenses/>.
 --
+
 PRAGMA user_version = 9;
+PRAGMA application_id = 1314145346; -- 'NTDB'
 
--- NOTE: INSERT INTO statements for version, bmr_eq, bf_eq? Don't maintain as CSV?
+-- NOTE: INSERT INTO statements for bmr_eq, bf_eq? Don't maintain as CSV?
 -- TODO: enforce FK constraint across two DBs?
 --
 ---------------------------------
@@ -24,12 +26,16 @@ PRAGMA user_version = 9;
 ---------------------------------
 CREATE TABLE bmr_eq (
   id integer PRIMARY KEY,
-  name text NOT NULL UNIQUE
+  name text NOT NULL UNIQUE,
+  friendly_name text NOT NULL UNIQUE,
+  requires text NOT NULL
 );
 
 CREATE TABLE bf_eq (
   id integer PRIMARY KEY,
-  name text NOT NULL UNIQUE
+  name text NOT NULL UNIQUE,
+  friendly_name text NOT NULL UNIQUE,
+  requires text NOT NULL
 );
 
 --