diff --git a/DB_BACKUP/20200126-all-imported-no-duplicates.sql.gz b/DB_BACKUP/20200126-all-imported-no-duplicates.sql.gz new file mode 100644 index 0000000..64755a5 Binary files /dev/null and b/DB_BACKUP/20200126-all-imported-no-duplicates.sql.gz differ diff --git a/README b/README index d05434b..e5bd658 100644 --- a/README +++ b/README @@ -25,10 +25,29 @@ to run prod version of web server: Also have to run the job manager for jobs to work: python3 pa_job_manager.py -To rebuild DB: +To rebuild DB from scratch/empty data: ###BE CAREFUL this completely destroys the database contents and starts from #scratch, when we get real data, we will instead cp a backup file not the #tables.sql ( cd /srv/docker/config/ ; sudo docker-compose stop padb ; yes | sudo docker-compose rm padb ; sudo rm -rf /srv/docker/container/padb/data/ ; sudo cp /home/ddp/src/photoassistant/tables.sql /srv/docker/container/padb/docker-entrypoint-initdb.d/tables.sql ; sudo docker-compose up padb ) + +To get back a 'working' but scanned set of data: + +# make a backup and store it in DB_BACKUP: + + sudo docker exec -it padb bash + root@2881f871e1c2:/# pg_dump --user=pa --password pa > /docker-entrypoint-initdb.d/tables.sql + cp /srv/docker/container/padb/docker-entrypoint-initdb.d/tables.sql /home/ddp/src/photoassistant/DB_BACKUP/ + mv /home/ddp/src/photoassistant/DB_BACKUP/tables.sql `date +%Y%m%d-tables.sql` + gzip -9 `date +%Y%m%d-tables.sql` + + +# start db, using new tables.sql + ### decide what tables.sql you want, e.g. + + sudo bash + # gunzip -c /home/ddp/src/photoassistant/DB_BACKUP/20200126-all-imported-no-duplicates.sql.gz > /srv/docker/container/padb/docker-entrypoint-initdb.d/tables.sql + + ( cd /srv/docker/config/ ; sudo docker-compose stop padb ; yes | sudo docker-compose rm padb ; sudo rm -rf /srv/docker/container/padb/data/ ; sudo docker-compose up padb ) diff --git a/TODO b/TODO index 68d19bb..2e3ae50 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,6 @@ +Test out file duplication bug (AddFile same name, diff dir) +so go back to empty DB, etc. + ## DB Need to think about... @@ -10,6 +13,9 @@ ### BACKEND *** Need to use thread-safe sessions per Thread, half-assed version did not work + need a manual button to restart it in the GUI, + (based on file-level optims, just run the job as new and it will optim over already done parts and continue) + Future: Admin -> reset face_flag @@ -24,6 +30,26 @@ -> delete old jobs / auto delete jobs older than ??? ### UI + View Files* + -> show only (say) the oldest / newest? week of files by day as default view? + (allow the above to be altered/re-viewed, e.g. oldest month by week, newest week by day, oldest year by week, etc.) + + sorter... + need some way to multiselect images and then get them into a new "folder" + can we do drag and drop highlighting? + maybe we could even drag a series of images to a new folder and + then eventually "execute" the change? + + Will also need a 'real storage path' + one day allow scanning this too if we want (so we can AI that and search all photos) + + timelineview? (I think maybe sunburst for large amounts of files, then maybe something more timeline-series for drilling in?) + (vertical timeline, date has thumbnails (small) horizontally along + a page, etc.? + https://www.highcharts.com/docs/chart-and-series-types/timeline-series + https://www.highcharts.com/demo/sunburst + https://www.highcharts.com/demo/heatmap + https://www.highcharts.com/demo/packed-bubble-split ### AI * allow for threshold/settings to be tweaked from the GUI