ELTE-Clean / Clean-Administration-Platform

2 stars 1 forks source link

Initialize CAP database #39

Closed the4t4 closed 2 years ago

the4t4 commented 2 years ago

Initialized the CAP database according to our design in #18

The database is built within the cleanDB image which also holds the keycloak database. I have created the clean_db database and it holds the students, teachers, sections, tasks, and grades tables. At this stage I have filled the tables with dummy information for further development and debugging purposes. You can view the tables either through the pgadmin web UI or by accessing the cleanDB container directly.

Here are the commands needed to get to the tables in the container:

docker exec -it clean-administration-platform_cleanDB_1 bin/sh
psql -U postgres
(enter password "postgres" when prompted)
\c clean_db

From here execute \dt to see a table of all tables and select * from <table_name>; to see a table's contents.

UPDATE: Created keycloaker and demonstrator roles which only have access to auth_db and clean_db respectively. They have full privileges within their databases. Now made it so that the database trusts no connections and always prompts for passwords. Currently the password for keycloaker is "password1" and for demonstrator it is "password2". Example:

psql -U keycloaker -d auth_db
psql -U demonstrator -d clean_db
Mohido commented 2 years ago

@the4t4 Did you create a new specific user for this database? or it is only accessed via the root user account? username: postgres password: postgres ?

the4t4 commented 2 years ago

@the4t4 Did you create a new specific user for this database? or it is only accessed via the root user account? username: postgres password: postgres ?

I forgot about that part, I will add it today

Mohido commented 2 years ago

@the4t4 I think you can squash it into development.

the4t4 commented 2 years ago

@Mohido updated