Skip to content

Commit

Permalink
Import data every time (#2)
Browse files Browse the repository at this point in the history
* Include the dataset

* fix the dataset

* use chinook-postgres DDL

* Import data from the files

* do not replace table

* add missing import

* fix import data.py

* sort files

* import data in a fixed order

* fix file order again
  • Loading branch information
codingkarthik authored Dec 18, 2024
1 parent b03e38e commit 9fb84ec
Show file tree
Hide file tree
Showing 15 changed files with 59,316 additions and 15,627 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/pr-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ jobs:
- name: Setup Docker
uses: docker/setup-buildx-action@v3

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install Python Dependencies
run: |
pip install psycopg2-binary pandas sqlalchemy
- name: Start PostgreSQL
working-directory: static/relational/postgres
run: |
Expand All @@ -29,6 +38,15 @@ jobs:
sleep 2
done
- name: Load Data into PostgreSQL
working-directory: static/relational/postgres
run: |
python import-data.py ../../../relational/dataset \
--database postgres \
--user postgres \
--port 5433 \
--password postgres
- name: Setup NDC Postgres
working-directory: static/relational/postgres
env:
Expand Down
22 changes: 22 additions & 0 deletions relational/dataset/001_MediaType.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[
{
"MediaTypeId": 1,
"Name": "MPEG audio file"
},
{
"MediaTypeId": 2,
"Name": "Protected AAC audio file"
},
{
"MediaTypeId": 3,
"Name": "Protected MPEG-4 video file"
},
{
"MediaTypeId": 4,
"Name": "Purchased AAC audio file"
},
{
"MediaTypeId": 5,
"Name": "AAC audio file"
}
]
102 changes: 102 additions & 0 deletions relational/dataset/002_Genre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
[
{
"GenreId": 1,
"Name": "Rock"
},
{
"GenreId": 2,
"Name": "Jazz"
},
{
"GenreId": 3,
"Name": "Metal"
},
{
"GenreId": 4,
"Name": "Alternative & Punk"
},
{
"GenreId": 5,
"Name": "Rock And Roll"
},
{
"GenreId": 6,
"Name": "Blues"
},
{
"GenreId": 7,
"Name": "Latin"
},
{
"GenreId": 8,
"Name": "Reggae"
},
{
"GenreId": 9,
"Name": "Pop"
},
{
"GenreId": 10,
"Name": "Soundtrack"
},
{
"GenreId": 11,
"Name": "Bossa Nova"
},
{
"GenreId": 12,
"Name": "Easy Listening"
},
{
"GenreId": 13,
"Name": "Heavy Metal"
},
{
"GenreId": 14,
"Name": "R&B/Soul"
},
{
"GenreId": 15,
"Name": "Electronica/Dance"
},
{
"GenreId": 16,
"Name": "World"
},
{
"GenreId": 17,
"Name": "Hip Hop/Rap"
},
{
"GenreId": 18,
"Name": "Science Fiction"
},
{
"GenreId": 19,
"Name": "TV Shows"
},
{
"GenreId": 20,
"Name": "Sci Fi & Fantasy"
},
{
"GenreId": 21,
"Name": "Drama"
},
{
"GenreId": 22,
"Name": "Comedy"
},
{
"GenreId": 23,
"Name": "Alternative"
},
{
"GenreId": 24,
"Name": "Classical"
},
{
"GenreId": 25,
"Name": "Opera"
}
]
Loading

0 comments on commit 9fb84ec

Please sign in to comment.