#74: Add UserID to the Song model (#98)

* #74: Add UserID to the Song model

* #74: Added functionality to retrieve user id from the token

* #74: Songs will now contain the User Id when uploading

* Updated Readme and script to add migrations

* #74: Some cleanup
This commit was merged in pull request #98.
This commit is contained in:
Kun Deng
2024-06-19 15:41:55 -04:00
committed by GitHub
parent ebb15b7cdb
commit 562bc87822
25 changed files with 117 additions and 164 deletions
+6 -3
View File
@@ -117,7 +117,7 @@ Prior to starting the API, the Migrations must be applied. There are 6 tables wi
* Song
* Album
* Artist
* Year
* CoverArt
* Genre
There is a script for Linux systems to apply these migrations, it can be found in the [Scripts/Migrations/Linux](https://github.com/kdeng00/Icarus/blob/master/Scripts/Migrations/Linux/AddUpdate.sh) directory. Just merely execute:
@@ -126,12 +126,15 @@ scripts/Migrations/Linux/AddUpdate.sh
```
Or you can manually add the migrations like so for each migration:
```shell
dotnet ef migrations Add [Migration] --context [Migration]Context
dotnet-ef migrations Add InitialCreate --context UserContext
```
Then update the migrations to the database like so<sup>*</sup>:
```shell
dotnet ef database update --context [Migration]Context
dotnet-ef database update --context UserContext
```
All of the contexts can be found in Database/Contexts folder.
From this point the database has been successfully configured. Metadata and song filesystem locations can be saved.
<sup>*</sup> Will only need to execute this for UserContext and SongContext because the Song table has relational constraints with Album, Artist, Year, and Genre.