Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Commit

Permalink
add sqlite migration script (#399)
Browse files Browse the repository at this point in the history
Co-authored-by: Rashad Alston <[email protected]>
  • Loading branch information
ra0x3 and Rashad Alston authored Dec 5, 2022
1 parent cec3415 commit 73f471a
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions scripts/utils/refresh_test_db.bash
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,18 @@

set -x

dropdb postgres
createdb postgres
DATABASE_URL=postgres://[email protected] bash scripts/run_migrations.bash
db_type="${1}"

if [ $db_type == "postgres" ]; then
dropdb postgres
createdb postgres
DATABASE_URL=postgres://[email protected] bash scripts/run_migrations.bash
elif [ $db_type == "sqlite" ]; then
rm -fv $PWD/packages/fuel-indexer-tests/test.db
DATABASE_URL=sqlite://$PWD/packages/fuel-indexer-tests/test.db bash scripts/run_migrations.bash
else
echo "Invalid db param. Expected 'sqlite' or 'postgres'. Found '$db_type'"
exit 1
fi

set +x

0 comments on commit 73f471a

Please sign in to comment.