Provides endpoints to query data from maps database, including moments and spaces
Make sure you have installed postgres and postgis. Follow below steps with provided commands to configure database locally
-
Login to postgres service.
psql postgres
-
Create new user with password. Make your user a supeuser to avoid privilege issues. In .env file update the username and password.
CREATE ROLE newUser WITH LOGIN PASSWORD ‘password’;
ALTER USER newUser WITH SUPERUSER;
-
Now Create Database named therr_dev_maps.
CREATE DATABASE therr_dev_maps;
-
Access the created therr_dev_maps database and create schema named main.
\c therr_dev_maps
CREATE SCHEMA main;
-
Grant privilege for database usage and schema to your created user.
GRANT ALL PRIVILEGES ON DATABASE therr_dev_maps TO newUser;
GRANT USAGE ON SCHEMA main TO newUser;
-
Now Run the migration script found in package.json.
npm run migrations:run
..