delete after loading sqlite old data

This commit is contained in:
Thomas Nahuel Rusiecki 2025-02-03 01:59:57 -03:00
parent de2a1190ab
commit 48bea36e49
2 changed files with 6 additions and 3 deletions

1
.gitignore vendored
View file

@ -5,3 +5,4 @@ __pycache__/
# the following could be autogenerated by devicehub
db.sqlite3
example/snapshots/snapshot_workbench-script_verifiable-credential.json
sqlite3dump.json

View file

@ -229,12 +229,14 @@ deploy() {
echo "DOMAIN: ${DOMAIN}"
fi
#IMPORTANT: run python manage.py dumpdata --natural-foreign --natural-primary > sqlite3dump.json
#IMPORTANT: run python manage.py dumpdata --natural-foreign --natural-primary > sqlite3dump.json on root folder
# detect if exists a sqlite3 dump
if [ -f "${program_dir}/db/sqlite3dump.json" ]; then
if [ -f "${program_dir}/sqlite3dump.json" ]; then
echo "INFO: detected EXISTING sqlite3 deployment. Migrating to postgres"
./manage.py migrate
./manage.py loaddata ${program_dir}/db/sqltie3dump.json
./manage.py loaddata ${program_dir}/sqlite3dump.json
rm "${program_dir}/sqlite3dump.json"
echo "INFO: Old sqlite data loaded successfully"
else
# move the migrate thing in docker entrypoint