Cleaning the cadasta database in the local setup

Manorama Perera
1 min readJan 5, 2017

--

I’ve finished the user profile update UI test cases. But once I run all the test cases against my local server on http://localhost:8000, those tests messed up my whole cadasta database. :(

Now it’s time to find a way to clean the cadasta DB. I posted my question on https://cadasta.slack.com/messages/development/ and fortunately I got the exact answer for it. I’m sharing it with you here.

If we need to clean the cadasta DB what we have to do is drop the database and recreate it. Here are the steps.

Assume the virtual machine is already up and running (If not execute vagrant up at cadasta-platform directory).

Log into VM using vagrant ssh. Now you are inside the VM.

Then drop the DB and recreate it using following commands.

sudo -u postgres psql
drop database cadasta;
create database cadasta with owner cadasta;

Type \q and then press ENTER to quit psql

Now run following Django management commands

./manage.py migrate
./manage.py loadstatic

--

--

No responses yet