From: gamesguru Date: Sun, 10 Apr 2022 16:15:00 +0000 (-0400) Subject: rename to LICENSE.txt, add CHANGELOG.md, update docs/nt.svg X-Git-Tag: 0.0.5~11 X-Git-Url: https://git.nutra.tk/v2?a=commitdiff_plain;h=05b4ad22c30609af83cb9d7e9767d73c641556ba;p=nutratech%2Fnt-sqlite.git rename to LICENSE.txt, add CHANGELOG.md, update docs/nt.svg --- diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..12870f4 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,63 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] +### Changed +- Replace grams with `msre_id` and `amt` in `food_log` table + +## [0.0.4] - 2021-06-17 +### Added +- Empty `__init__.py` file to make packagable with `cli` repo (as a `git submodule`) +- Tables `custom_foods` and respective `cf_dat` + +### Changed +- Build with `python sql/__init__.py` (removed root-level script `build.py`) +- Rename pre-populted `meals` table to `meal_name` + +### Fixed +- Slight bash inconvenience when using `export.sh` + +### Removed +- `food_costs` table + +## [0.0.3] - 2021-05-24 +### Added +- More dummy CSV data (not production ready) +- `tagname` column to `recipes` table + +### Changed +- `date` column uses `INT` type now, instead of `date` +- Drop `created` and `updated` fields off of `rda` table, add them to `biometrics` + +### Removed +- `last_sync` column (future release? Feature is planned, but not alloted) +- `guid` parameter from `functions.sql` + +## [0.0.2] - 2021-05-24 +### Added +`SCRIPT_DIR` in `sql/__init__.py` to help track `cwd` + +### Removed +- `guid` columns (may return in a future release) + +## [0.0.1] - 2021-05-21 +### Added +- Version table +- Travis CI configuration file `.travis.yml` +- `functions.sql` for use in Python client +- [TODO] Placeholder for initial upgrade script (`sql/upgrade_scripts/0.0.1.sql`) +- `food_costs` table (lone table, functionality not yet implemented) + +### Changed +- Use Python for import script (`build.py` replaced `import.sql`) + +## [0.0.0] - 2020-09-22 +### Added +- Initial release of table schema design +- Import script `import.sql` (SQL) +- Export script `export.sh` (Shell) +- Rudimentary dummy data in CSV files (e.g. `food_log.csv`, `biometric_log.csv`, `profiles.csv`) +- Database diagram generated via `docs/sqleton.sh` diff --git a/LICENSE b/LICENSE.txt similarity index 100% rename from LICENSE rename to LICENSE.txt diff --git a/docs/nt.svg b/docs/nt.svg index 3b6a0ba..2b4a91e 100644 --- a/docs/nt.svg +++ b/docs/nt.svg @@ -4,323 +4,363 @@ - - + + undefined - -nt.sqlite + +nt.sqlite version - -version - -id* -integer -version -text -created -date -notes -text + +version + +id* +integer +version +text +created +date +notes +text bmr_eqs - -bmr_eqs - -id* -integer -name -text + +bmr_eqs + +id* +integer +name +text bf_eqs - -bf_eqs - -id* -integer -name -text + +bf_eqs + +id* +integer +name +text profiles - -profiles - -id* -integer -name -text -created -int -updated -int -eula -int -gender -text -dob -date -act_lvl -int -goal_wt -real -goal_bf -real -bmr_eq_id -int -bf_eq_id -int + +profiles + +id* +integer +name +text +created +int +updated +int +eula +int +gender +text +dob +date +act_lvl +int +goal_wt +real +goal_bf +real +bmr_eq_id +int +bf_eq_id +int profiles->bmr_eqs - - + + profiles->bf_eqs - - - - - -food_costs - -food_costs - -food_id* -integer -profile_id* -integer -cost -real - - - -food_costs->profiles - - + + - + biometrics - -biometrics - -id* -integer -created -int -updated -int -name -text -unit -text + +biometrics + +id* +integer +created +int +updated +int +name +text +unit +text - + biometric_log - -biometric_log - -id* -integer -profile_id -int -created -int -updated -int -date -int -tags -text -notes -text + +biometric_log + +id* +integer +profile_id +int +created +int +updated +int +date +int +tags +text +notes +text - + biometric_log->profiles - - + + - + bio_log_entry - -bio_log_entry - -log_id* -int -biometric_id* -int -value -real + +bio_log_entry + +log_id* +int +biometric_id* +int +value +real - + bio_log_entry->biometrics - - + + - + bio_log_entry->biometric_log - - + + - + recipes - -recipes - -id* -integer -created -int -updated -int -tagname -text -name -text + +recipes + +id* +integer +created +int +updated +int +tagname +text +name +text - + recipe_dat - -recipe_dat - -recipe_id* -int -food_id* -int -grams -real -notes -text + +recipe_dat + +recipe_id* +int +food_id* +int +grams +real +notes +text - + recipe_dat->recipes - - + + - + + +custom_foods + +custom_foods + +id* +integer +created +int +updated +int +tagname +text +name +text + + +cf_dat + +cf_dat + +cf_id* +int +nutr_id* +int +nutr_val +real +notes +text + + + +cf_dat->custom_foods + + + + + meal_name - -meal_name - -id* -integer -name -text + +meal_name + +id* +integer +name +text - + food_log - -food_log - -id* -integer -profile_id -int -created -int -updated -int -date -int -meal_id -int -food_id -int -grams -real + +food_log + +id* +integer +profile_id +int +created +int +updated +int +date +int +meal_id +int +food_id +int +msre_id +int +amt +real food_log->profiles - - + + food_log->meal_name - - + + - + recipe_log - -recipe_log - -id* -integer -profile_id -int -created -int -updated -int -date -int -meal_id -int -recipe_id -int -grams -real + +recipe_log + +id* +integer +profile_id +int +created +int +updated +int +date +int +meal_id +int +recipe_id +int +grams +real recipe_log->profiles - - + + recipe_log->recipes - - + + recipe_log->meal_name - - + + - + rda - -rda - -profile_id* -int -nutr_id* -int -rda -real + +rda + +profile_id* +int +nutr_id* +int +rda +real rda->profiles - - + + + + + +food_costs + +food_costs + +food_id* +integer +profile_id* +integer +cost +real + + + +food_costs->profiles + + diff --git a/sql/tables.sql b/sql/tables.sql index 668302d..4008c25 100644 --- a/sql/tables.sql +++ b/sql/tables.sql @@ -1,4 +1,4 @@ --- ntsqlite, an sqlite3 database for nutratracker clients +-- nt-sqlite, an sqlite3 database for nutratracker clients -- Copyright (C) 2018-2022 Shane Jaroch -- -- This program is free software: you can redistribute it and/or modify