Skip to content

Commit

Permalink
Populate Database (#12)
Browse files Browse the repository at this point in the history
* Add initial table setup for database

* Remove redudant attributes

* Remove redundant properties

* Add Blogs table

* - Add data insertion for tables
- Move Users and Teams foreign-key constraints to after data insertion

* Add initdb volume to docker-compose.yaml

* feat: Added init sql script to docker-compose

* docs: Added instructions on how to get access to Postgres Shell

* docs: Corrected command to access postgres shell

* fix: docker-compose

---------

Co-authored-by: miguel-merlin <[email protected]>
  • Loading branch information
cengelbart39 and miguel-merlin authored Apr 17, 2024
1 parent 02de6c0 commit 4024f95
Show file tree
Hide file tree
Showing 3 changed files with 407 additions and 1 deletion.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,22 @@ Build the application
./gradlew build
```
Run the application. (You have to run the ```admin/BlueprintAdmin.java``` this is the entry point of the Spring application).

## How to connect to database in Docker Container?
Start the docker container
```
docker-compose up
```

Connect to psql shell
```
docker exec -it blueprint_admin_backend-postgres-1 psql -U blueprint_admin_backend -d postgres
```
To see all the available tables run
```
\dt
```
To view data inside a Table
```
TABLE {table_name};
```
3 changes: 2 additions & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ services:
ports:
- '5432:5432'
volumes:
- ./postgres-data:/var/lib/postgresql/data
- ./postgres-data:/var/lib/postgresql/data
- ./initdb:/docker-entrypoint-initdb.d
Loading

0 comments on commit 4024f95

Please sign in to comment.