Skip to content

Commit b2c59d0

Browse files
addetzcaroldelwingkarl-cardenas-coding
authored
feat: add page column to database schema DOC-1138 (#6)
* feat: add page column to database schema DOC-1138 * Update README.md Co-authored-by: caroldelwing <[email protected]> * Update README.md Co-authored-by: Karl Cardenas <[email protected]> --------- Co-authored-by: caroldelwing <[email protected]> Co-authored-by: Karl Cardenas <[email protected]>
1 parent 650b527 commit b2c59d0

File tree

2 files changed

+37
-7
lines changed

2 files changed

+37
-7
lines changed

README.md

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Hello Universe DB
44

5-
A Spectro Cloud demo application. This is the database that supports the Hello Universe app.
5+
A Spectro Cloud demo application. This is the database that supports the [Hello Universe API](https://github.com/spectrocloud/hello-universe-api).
66

77
<p align="center">
88
<img src="./static/img/spectronaut.png" alt="drawing" width="400"/>
@@ -12,13 +12,41 @@ A Spectro Cloud demo application. This is the database that supports the Hello U
1212

1313
The [Hello Universe](https://github.com/spectrocloud/hello-universe) app includes an [API server](https://github.com/spectrocloud/hello-universe-api) that relies on a Postgres database for storing the number of clicks and other metadata about the clicks such as the browser, os, and timestamp. For your convenience, a Postgres container is available for use.
1414

15+
## Prerequisites
16+
17+
Ensure [Docker Desktop](https://www.docker.com/products/docker-desktop/) is available on your local machine.
18+
19+
- Use the following command and ensure you receive an output displaying the version number.
20+
```
21+
docker version
22+
```
23+
24+
Alternatively, you can install [Podman](https://podman.io/docs/installation).
25+
26+
- If you are not using a Linux operating system, create and start the Podman Machine in your local environment. Otherwise, skip this step.
27+
```
28+
podman machine init
29+
podman machine start
30+
```
31+
- Use the following command and ensure you receive an output displaying the installation information.
32+
```
33+
podman info
34+
```
35+
1536
## Usage
1637
17-
To get use the container you can issue the following command to download the container.
38+
You can issue the following commands to use the container with Docker.
39+
40+
```
41+
docker pull ghcr.io/spectrocloud/hello-universe-db:1.1.0 && \
42+
docker run -p 5432:5432 ghcr.io/spectrocloud/hello-universe-db:1.1.0
43+
```
44+
45+
If you choose Podman, you can use the following commands.
1846
1947
```
20-
docker pull ghcr.io/spectrocloud/hello-universe-db:1.0.2 && \
21-
docker run -p 5432:5432 ghcr.io/spectrocloud/hello-universe-db:1.0.2
48+
podman pull ghcr.io/spectrocloud/hello-universe-db:1.1.0 && \
49+
podman run -p 5432:5432 ghcr.io/spectrocloud/hello-universe-db:1.1.0
2250
```
2351
2452
The command you issued downloaded the container and exposed port `5432`. The default user name is `postgres` and the password is `password`.
@@ -30,9 +58,10 @@ The database uses the following schema for the `counter` table.
3058
| Field | Description | Type |
3159
| --------- | -------------------------------------------- | --------- |
3260
| `id` | The primary key. | Number |
33-
| `date` | The timestamp of the click. | Timestamp |
34-
| `browser` | The web browser used to click by the client. | Varchar |
35-
| `os` | The operating system used by the client. | Varchar |
61+
| `page` | The page associated with the event. | Varchar |
62+
| `date` | The timestamp of the event. | Timestamp |
63+
| `browser` | The client web browser. | Varchar |
64+
| `os` | The client operating system. | Varchar |
3665
3766
## Image Verification
3867

init.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
CREATE TABLE "counter" (
55
"id" SERIAL PRIMARY KEY,
6+
"page" varchar(255),
67
"date" timestamp NOT NULL,
78
"browser" varchar(255),
89
"os" varchar(255)

0 commit comments

Comments
 (0)