If you dont have PostgresSQL on device install it via link: https://www.youtube.com/watch?v=7zsRpTRsSs0
A. Run script using pg admin
Run the script
- Opnen pg admin panel
- Create db -> mapa-bravo
- Go to query tool
- Select script file
- Execute
How to check if everything works?
- Open pg admin
- Connect to db
- Open schema "map"
- check table "user" if exist
B. Run using console
- Add PostgresSQL to the path variable via this link: https://sqlbackupandftp.com/blog/setting-windows-path-for-postgres-tools
- Open cmd
- Login as a psql user -> psql -U postgres
- Create database -> CREATE DATABASE "mapa-bravo";
- Connect to database -> \c mapa-bravo
- Ensure that the script stops running if it encounters an error -> \set ON_ERROR_STOP on
- Run the script -> \i 'path/db_script.sql' where 'path' is a path to the script, IMPORTANT -> Remember to replace backslashes in the file path with forward slashes.
How to check if everything works?
- Connect to database -> \c mapa-bravo
- List tables of mapa-bravo -> \dt mapa-bravo.*