To start review, you need to delete the database or clean it completely, because the interests field now accepts a list instead of a string
To clear the database:
python manage.py dbshell
DO $$ DECLARE
r RECORD;
BEGIN
FOR r IN (SELECT tablename FROM pg_tables WHERE schemaname = current_schema()) LOOP
EXECUTE 'DROP TABLE IF EXISTS ' || quote_ident(r.tablename) || ' CASCADE';
END LOOP;
END $$;
Then do the migration:
python manage.py makemigrationspython manage.py migrate
And add new industries to the database:
python manage.py loaddata startups/industries.json
Add new records to the database. Remember, the interests of the investor are entered in a list, for example,
{"interests": ["Health Care", "Transportation"]}
To start review, you need to delete the database or clean it completely, because the interests field now accepts a list instead of a string To clear the database:
python manage.py dbshell
Then do the migration:
python manage.py makemigrations
python manage.py migrate
And add new industries to the database:
python manage.py loaddata startups/industries.json
Add new records to the database. Remember, the interests of the investor are entered in a list, for example,
{"interests": ["Health Care", "Transportation"]}
Endpoints for testing:
api/investors/{pk}/add_interests/
api/investors/{pk}/remove_interests/
Also you can test all CRUD methods for investors, if you want, because that were refactored.
Add interests
Remove interest
Checking for the presence of interests in the investor list when we add interest
Checking for the presence of interests in the investor list when we remove interest