To access the local copy of the database, you can shell into it by opening a new terminal window and executing psql -h localhost -p 5432 -U <db-username> and enter the local database password when prompted.
After making a change to a model, create migration script:
PYTHONPATH=. alembic revision --autogenerate -m "Comment relevant to change"You may have to modify the generated code to import geoalchemy2
You may want to have a data import/modification step, where you're not actually changing the database, but want to manage new data. You can create an "empty" migration, and insert data as needed:
PYTHONPATH=. alembic revision -m "Comment relevant to change"Then apply:
PYTHONPATH=. alembic upgrade headYou may need to enable postgis extension:
CREATE EXTENSION postgis;
Checking and starting postgres through brew:
brew services start postgresql
brew services listShell into local postgres server:
psql -d postgresShow list of databases:
\l
Connect to 'wps' database:
\c wps
Show list of extensions:
\dx
Install postgis extension:
create extension postgis;