diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 17c18e75f4..b3a1768d3d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,7 +39,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-dotnet@v1 with: - dotnet-version: '6.0.x' + dotnet-version: '8.0.x' - name: Nuget Cache uses: actions/cache@v2 @@ -84,10 +84,10 @@ jobs: strategy: matrix: include: - - os: win10-x64 + - os: win-x64 format: zip compression: zip - - os: win10-x86 + - os: win-x86 format: zip compression: zip - os: linux-x64 @@ -106,7 +106,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-dotnet@v1 with: - dotnet-version: '6.0.x' + dotnet-version: '8.0.x' - uses: actions/setup-dotnet@v1 with: dotnet-version: '5.0.x' diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 8c870059c7..b670023618 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -37,7 +37,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v1 + uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -48,7 +48,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v1 + uses: github/codeql-action/autobuild@v3 # ℹ️ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -62,4 +62,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + uses: github/codeql-action/analyze@v3 diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index c4c7d803c6..ea65cfaa6f 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -38,7 +38,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-dotnet@v1 with: - dotnet-version: '6.0.x' + dotnet-version: '8.0.x' - name: Nuget Cache uses: actions/cache@v2 @@ -76,10 +76,10 @@ jobs: strategy: matrix: include: - - os: win10-x64 + - os: win-x64 format: zip compression: zip - - os: win10-x86 + - os: win-x86 format: zip compression: zip - os: linux-x64 @@ -98,7 +98,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-dotnet@v1 with: - dotnet-version: '6.0.x' + dotnet-version: '8.0.x' - name: Nuget Cache uses: actions/cache@v2 diff --git a/CHANGELOG.md b/CHANGELOG.md index 561f36b193..31e2628537 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,29 @@ +# [4.44.0](https://github.com/Ombi-app/Ombi/compare/v4.43.22...v4.44.0) (2024-07-11) + + +### Features + +* Adding postgres support to ombi (beta) ([#5050](https://github.com/Ombi-app/Ombi/issues/5050)) ([f8c6102](https://github.com/Ombi-app/Ombi/commit/f8c61027bf53d657d7955a98b69d7ab90b66a75a)) + + + +## [4.43.22](https://github.com/Ombi-app/Ombi/compare/v4.43.21...v4.43.22) (2024-07-08) + + + +## [4.43.21](https://github.com/Ombi-app/Ombi/compare/v4.43.20...v4.43.21) (2024-06-26) + + + +## [4.43.20](https://github.com/Ombi-app/Ombi/compare/v4.43.16...v4.43.20) (2024-05-14) + + +### Bug Fixes + +* upgrade multiple dependencies with Snyk ([#5104](https://github.com/Ombi-app/Ombi/issues/5104)) [skip ci] ([a1083f6](https://github.com/Ombi-app/Ombi/commit/a1083f67c73c968b9ff0a0feebe5a9aac6a7c7c9)) + + + ## [4.43.16](https://github.com/Ombi-app/Ombi/compare/v4.43.15...v4.43.16) (2024-04-01) @@ -1839,40 +1865,3 @@ -## [4.35.18](https://github.com/Ombi-app/Ombi/compare/v4.35.17...v4.35.18) (2023-04-15) - - -### Bug Fixes - -* **#4906:** :bug: Fixed an issue with power users and permissions ([80884bc](https://github.com/Ombi-app/Ombi/commit/80884bcd725c329867c278ad235cd4096cd4fe7a)) - - - -## [4.35.17](https://github.com/Ombi-app/Ombi/compare/v4.35.16...v4.35.17) (2023-04-15) - - -### Bug Fixes - -* **discover:** Fix denied requests displayed as approved ([#4901](https://github.com/Ombi-app/Ombi/issues/4901)) ([1e87f20](https://github.com/Ombi-app/Ombi/commit/1e87f2010491b0f3fdda70d2b19d9afd94438df7)) -* Fix denied movie shown as 'processing request' in details view ([#4900](https://github.com/Ombi-app/Ombi/issues/4900)) ([0069bfd](https://github.com/Ombi-app/Ombi/commit/0069bfdf54e0785bad45c832ca052f19fd4b940b)) - - - -## [4.35.16](https://github.com/Ombi-app/Ombi/compare/v4.35.15...v4.35.16) (2023-04-13) - - -### Bug Fixes - -* Support duplicates in Emby/JF collections ([#4902](https://github.com/Ombi-app/Ombi/issues/4902)) ([141f96d](https://github.com/Ombi-app/Ombi/commit/141f96da5e45d5b3fa5f496806b102e473da6607)) - - - -## [4.35.15](https://github.com/Ombi-app/Ombi/compare/v4.35.14...v4.35.15) (2023-04-06) - - -### Bug Fixes - -* **sonarr:** :bug: Stop the sonarr version endpoint from breaking when Sonarr is down [#4895](https://github.com/Ombi-app/Ombi/issues/4895) ([7bb8bec](https://github.com/Ombi-app/Ombi/commit/7bb8becfb140ef6012356752a71d53b5b404e482)) - - - diff --git a/README.md b/README.md index a8d056cd9b..e9dc7e0be5 100644 --- a/README.md +++ b/README.md @@ -407,21 +407,14 @@ Here are some of the features Ombi has: Andrew Metzger - - - Torkiliuz -
- Torkil -
- - tombomb
Tom McClellan
- + + Tim-Trott @@ -456,15 +449,15 @@ Here are some of the features Ombi has:
Sean Callinan
- - + sambartik
Samuel Bartík
- + + rob1998 @@ -499,15 +492,15 @@ Here are some of the features Ombi has:
Micky
- - + LMaxence
Maxence Lecanu
- + + mattmattmatt @@ -522,6 +515,20 @@ Here are some of the features Ombi has: Marley + + + devbymadde +
+ Madeleine Schönemann +
+ + + + Lucane +
+ Lucane +
+ zobe123 @@ -535,15 +542,15 @@ Here are some of the features Ombi has:
Mike
- + + tdorsey
Tdorsey
- - + sir-marv @@ -578,15 +585,15 @@ Here are some of the features Ombi has:
Maartenheebink
- + + m4tta
M4tta
- - + echel0n @@ -621,15 +628,15 @@ Here are some of the features Ombi has:
Blake Drumm
- + + bazhip
Tim OBrien
- - + Xirg @@ -645,17 +652,17 @@ Here are some of the features Ombi has: - - devbymadde + + Torkiliuz
- Madeleine Schönemann + Torkil
- - elisspace + + Drewster727
- Eli + Drew
@@ -664,15 +671,15 @@ Here are some of the features Ombi has:
Devin Buhl - + + davidtorosyan
David Torosyan
- - + hmnd @@ -680,6 +687,13 @@ Here are some of the features Ombi has: David + + + dben +
+ David Benson +
+ danopia @@ -700,7 +714,8 @@ Here are some of the features Ombi has:
Christopher Demicoli
- + + origamirobot @@ -714,8 +729,7 @@ Here are some of the features Ombi has:
Calvin
- - + Majawat @@ -743,7 +757,8 @@ Here are some of the features Ombi has:
Aljosa Asanovic
- + + XanderStrike @@ -757,8 +772,7 @@ Here are some of the features Ombi has:
Alexander Russell
- - + AbeKline @@ -766,13 +780,6 @@ Here are some of the features Ombi has: Abe Kline - - - Lucane -
- Lucane -
- sussycatgirl @@ -793,15 +800,15 @@ Here are some of the features Ombi has:
Kris Klosterman
- + + jonocairns
Jono Cairns
- - + jonbloom @@ -809,6 +816,13 @@ Here are some of the features Ombi has: Jon Bloom + + + ExtremeFiretop +
+ Joel Samson +
+ errorhandler @@ -829,7 +843,8 @@ Here are some of the features Ombi has:
James White
- + + JPyke3 @@ -843,8 +858,7 @@ Here are some of the features Ombi has:
Imgbot
- - + comigor @@ -872,13 +886,21 @@ Here are some of the features Ombi has:
Grygon
- + + Fish2
Fish2
+ + + + elisspace +
+ Eli +
diff --git a/src/Ombi.Api.CloudService/Ombi.Api.CloudService.csproj b/src/Ombi.Api.CloudService/Ombi.Api.CloudService.csproj index 5939549de6..a0a4edab3e 100644 --- a/src/Ombi.Api.CloudService/Ombi.Api.CloudService.csproj +++ b/src/Ombi.Api.CloudService/Ombi.Api.CloudService.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 Debug;Release;NonUiBuild diff --git a/src/Ombi.Api.CouchPotato/Ombi.Api.CouchPotato.csproj b/src/Ombi.Api.CouchPotato/Ombi.Api.CouchPotato.csproj index 89c47d2513..9d0efbe775 100644 --- a/src/Ombi.Api.CouchPotato/Ombi.Api.CouchPotato.csproj +++ b/src/Ombi.Api.CouchPotato/Ombi.Api.CouchPotato.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 latest Debug;Release;NonUiBuild diff --git a/src/Ombi.Api.Discord/Ombi.Api.Discord.csproj b/src/Ombi.Api.Discord/Ombi.Api.Discord.csproj index 70032d638a..ea91cee483 100644 --- a/src/Ombi.Api.Discord/Ombi.Api.Discord.csproj +++ b/src/Ombi.Api.Discord/Ombi.Api.Discord.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 3.0.0.0 3.0.0.0 diff --git a/src/Ombi.Api.DogNzb/Ombi.Api.DogNzb.csproj b/src/Ombi.Api.DogNzb/Ombi.Api.DogNzb.csproj index 89c47d2513..9d0efbe775 100644 --- a/src/Ombi.Api.DogNzb/Ombi.Api.DogNzb.csproj +++ b/src/Ombi.Api.DogNzb/Ombi.Api.DogNzb.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 latest Debug;Release;NonUiBuild diff --git a/src/Ombi.Api.Emby/Ombi.Api.Emby.csproj b/src/Ombi.Api.Emby/Ombi.Api.Emby.csproj index f60971192c..6578445f9b 100644 --- a/src/Ombi.Api.Emby/Ombi.Api.Emby.csproj +++ b/src/Ombi.Api.Emby/Ombi.Api.Emby.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 3.0.0.0 3.0.0.0 diff --git a/src/Ombi.Api.FanartTv/Ombi.Api.FanartTv.csproj b/src/Ombi.Api.FanartTv/Ombi.Api.FanartTv.csproj index 70032d638a..ea91cee483 100644 --- a/src/Ombi.Api.FanartTv/Ombi.Api.FanartTv.csproj +++ b/src/Ombi.Api.FanartTv/Ombi.Api.FanartTv.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 3.0.0.0 3.0.0.0 diff --git a/src/Ombi.Api.Github/Ombi.Api.Github.csproj b/src/Ombi.Api.Github/Ombi.Api.Github.csproj index 89c47d2513..9d0efbe775 100644 --- a/src/Ombi.Api.Github/Ombi.Api.Github.csproj +++ b/src/Ombi.Api.Github/Ombi.Api.Github.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 latest Debug;Release;NonUiBuild diff --git a/src/Ombi.Api.Gotify/Ombi.Api.Gotify.csproj b/src/Ombi.Api.Gotify/Ombi.Api.Gotify.csproj index be32916f89..bb37e21565 100644 --- a/src/Ombi.Api.Gotify/Ombi.Api.Gotify.csproj +++ b/src/Ombi.Api.Gotify/Ombi.Api.Gotify.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 3.0.0.0 3.0.0.0 diff --git a/src/Ombi.Api.GroupMe/Ombi.Api.GroupMe.csproj b/src/Ombi.Api.GroupMe/Ombi.Api.GroupMe.csproj index 89c47d2513..9d0efbe775 100644 --- a/src/Ombi.Api.GroupMe/Ombi.Api.GroupMe.csproj +++ b/src/Ombi.Api.GroupMe/Ombi.Api.GroupMe.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 latest Debug;Release;NonUiBuild diff --git a/src/Ombi.Api.Jellyfin/Ombi.Api.Jellyfin.csproj b/src/Ombi.Api.Jellyfin/Ombi.Api.Jellyfin.csproj index 0c745556ea..b338f214f6 100644 --- a/src/Ombi.Api.Jellyfin/Ombi.Api.Jellyfin.csproj +++ b/src/Ombi.Api.Jellyfin/Ombi.Api.Jellyfin.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 3.0.0.0 3.0.0.0 diff --git a/src/Ombi.Api.Lidarr/Ombi.Api.Lidarr.csproj b/src/Ombi.Api.Lidarr/Ombi.Api.Lidarr.csproj index 89c47d2513..9d0efbe775 100644 --- a/src/Ombi.Api.Lidarr/Ombi.Api.Lidarr.csproj +++ b/src/Ombi.Api.Lidarr/Ombi.Api.Lidarr.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 latest Debug;Release;NonUiBuild diff --git a/src/Ombi.Api.Mattermost/Ombi.Api.Mattermost.csproj b/src/Ombi.Api.Mattermost/Ombi.Api.Mattermost.csproj index 2dd241a245..8b01997b32 100644 --- a/src/Ombi.Api.Mattermost/Ombi.Api.Mattermost.csproj +++ b/src/Ombi.Api.Mattermost/Ombi.Api.Mattermost.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 3.0.0.0 3.0.0.0 diff --git a/src/Ombi.Api.MediaServer/Ombi.Api.MediaServer.csproj b/src/Ombi.Api.MediaServer/Ombi.Api.MediaServer.csproj index a1b98b7654..adac0e42b2 100644 --- a/src/Ombi.Api.MediaServer/Ombi.Api.MediaServer.csproj +++ b/src/Ombi.Api.MediaServer/Ombi.Api.MediaServer.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 3.0.0.0 3.0.0.0 diff --git a/src/Ombi.Api.MusicBrainz/Ombi.Api.MusicBrainz.csproj b/src/Ombi.Api.MusicBrainz/Ombi.Api.MusicBrainz.csproj index 1a6497ceb4..4a5eb42a07 100644 --- a/src/Ombi.Api.MusicBrainz/Ombi.Api.MusicBrainz.csproj +++ b/src/Ombi.Api.MusicBrainz/Ombi.Api.MusicBrainz.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 latest Debug;Release;NonUiBuild diff --git a/src/Ombi.Api.Notifications/Ombi.Api.Notifications.csproj b/src/Ombi.Api.Notifications/Ombi.Api.Notifications.csproj index 029acb3c5f..5fa7050c02 100644 --- a/src/Ombi.Api.Notifications/Ombi.Api.Notifications.csproj +++ b/src/Ombi.Api.Notifications/Ombi.Api.Notifications.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 latest Debug;Release;NonUiBuild diff --git a/src/Ombi.Api.Plex/Ombi.Api.Plex.csproj b/src/Ombi.Api.Plex/Ombi.Api.Plex.csproj index 70032d638a..ea91cee483 100644 --- a/src/Ombi.Api.Plex/Ombi.Api.Plex.csproj +++ b/src/Ombi.Api.Plex/Ombi.Api.Plex.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 3.0.0.0 3.0.0.0 diff --git a/src/Ombi.Api.Pushbullet/Ombi.Api.Pushbullet.csproj b/src/Ombi.Api.Pushbullet/Ombi.Api.Pushbullet.csproj index 70032d638a..ea91cee483 100644 --- a/src/Ombi.Api.Pushbullet/Ombi.Api.Pushbullet.csproj +++ b/src/Ombi.Api.Pushbullet/Ombi.Api.Pushbullet.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 3.0.0.0 3.0.0.0 diff --git a/src/Ombi.Api.Pushover/Ombi.Api.Pushover.csproj b/src/Ombi.Api.Pushover/Ombi.Api.Pushover.csproj index be32916f89..bb37e21565 100644 --- a/src/Ombi.Api.Pushover/Ombi.Api.Pushover.csproj +++ b/src/Ombi.Api.Pushover/Ombi.Api.Pushover.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 3.0.0.0 3.0.0.0 diff --git a/src/Ombi.Api.Radarr/Ombi.Api.Radarr.csproj b/src/Ombi.Api.Radarr/Ombi.Api.Radarr.csproj index 97d0cb959a..d3ab9b35b8 100644 --- a/src/Ombi.Api.Radarr/Ombi.Api.Radarr.csproj +++ b/src/Ombi.Api.Radarr/Ombi.Api.Radarr.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 3.0.0.0 3.0.0.0 @@ -11,7 +11,7 @@ - + diff --git a/src/Ombi.Api.RottenTomatoes/Ombi.Api.RottenTomatoes.csproj b/src/Ombi.Api.RottenTomatoes/Ombi.Api.RottenTomatoes.csproj index 89c47d2513..9d0efbe775 100644 --- a/src/Ombi.Api.RottenTomatoes/Ombi.Api.RottenTomatoes.csproj +++ b/src/Ombi.Api.RottenTomatoes/Ombi.Api.RottenTomatoes.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 latest Debug;Release;NonUiBuild diff --git a/src/Ombi.Api.Service/Ombi.Api.Service.csproj b/src/Ombi.Api.Service/Ombi.Api.Service.csproj index 38bcd678af..ebe80cda4b 100644 --- a/src/Ombi.Api.Service/Ombi.Api.Service.csproj +++ b/src/Ombi.Api.Service/Ombi.Api.Service.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 3.0.0.0 3.0.0.0 @@ -13,7 +13,7 @@ - + diff --git a/src/Ombi.Api.SickRage/Ombi.Api.SickRage.csproj b/src/Ombi.Api.SickRage/Ombi.Api.SickRage.csproj index 89c47d2513..9d0efbe775 100644 --- a/src/Ombi.Api.SickRage/Ombi.Api.SickRage.csproj +++ b/src/Ombi.Api.SickRage/Ombi.Api.SickRage.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 latest Debug;Release;NonUiBuild diff --git a/src/Ombi.Api.Slack/Ombi.Api.Slack.csproj b/src/Ombi.Api.Slack/Ombi.Api.Slack.csproj index 70032d638a..ea91cee483 100644 --- a/src/Ombi.Api.Slack/Ombi.Api.Slack.csproj +++ b/src/Ombi.Api.Slack/Ombi.Api.Slack.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 3.0.0.0 3.0.0.0 diff --git a/src/Ombi.Api.Sonarr/Ombi.Api.Sonarr.csproj b/src/Ombi.Api.Sonarr/Ombi.Api.Sonarr.csproj index 70032d638a..ea91cee483 100644 --- a/src/Ombi.Api.Sonarr/Ombi.Api.Sonarr.csproj +++ b/src/Ombi.Api.Sonarr/Ombi.Api.Sonarr.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 3.0.0.0 3.0.0.0 diff --git a/src/Ombi.Api.Telegram/Ombi.Api.Telegram.csproj b/src/Ombi.Api.Telegram/Ombi.Api.Telegram.csproj index 89c47d2513..9d0efbe775 100644 --- a/src/Ombi.Api.Telegram/Ombi.Api.Telegram.csproj +++ b/src/Ombi.Api.Telegram/Ombi.Api.Telegram.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 latest Debug;Release;NonUiBuild diff --git a/src/Ombi.Api.Trakt/Ombi.Api.Trakt.csproj b/src/Ombi.Api.Trakt/Ombi.Api.Trakt.csproj index fd9632e56a..d485b038a1 100644 --- a/src/Ombi.Api.Trakt/Ombi.Api.Trakt.csproj +++ b/src/Ombi.Api.Trakt/Ombi.Api.Trakt.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 3.0.0.0 3.0.0.0 diff --git a/src/Ombi.Api.TvMaze/Ombi.Api.TvMaze.csproj b/src/Ombi.Api.TvMaze/Ombi.Api.TvMaze.csproj index a1b98b7654..adac0e42b2 100644 --- a/src/Ombi.Api.TvMaze/Ombi.Api.TvMaze.csproj +++ b/src/Ombi.Api.TvMaze/Ombi.Api.TvMaze.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 3.0.0.0 3.0.0.0 diff --git a/src/Ombi.Api.Twilio/Ombi.Api.Twilio.csproj b/src/Ombi.Api.Twilio/Ombi.Api.Twilio.csproj index 2b4bb3d8df..26a440276b 100644 --- a/src/Ombi.Api.Twilio/Ombi.Api.Twilio.csproj +++ b/src/Ombi.Api.Twilio/Ombi.Api.Twilio.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 Debug;Release;NonUiBuild diff --git a/src/Ombi.Api.Webhook/Ombi.Api.Webhook.csproj b/src/Ombi.Api.Webhook/Ombi.Api.Webhook.csproj index 7748aad45c..b9b0dd347e 100644 --- a/src/Ombi.Api.Webhook/Ombi.Api.Webhook.csproj +++ b/src/Ombi.Api.Webhook/Ombi.Api.Webhook.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 3.0.0.0 3.0.0.0 diff --git a/src/Ombi.Api/Ombi.Api.csproj b/src/Ombi.Api/Ombi.Api.csproj index ab0d14b5ec..2b1148b223 100644 --- a/src/Ombi.Api/Ombi.Api.csproj +++ b/src/Ombi.Api/Ombi.Api.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 3.0.0.0 3.0.0.0 @@ -11,8 +11,8 @@ - - + + diff --git a/src/Ombi.Core.Tests/Engine/MovieRequestLimitsTests.cs b/src/Ombi.Core.Tests/Engine/MovieRequestLimitsTests.cs index 5bb4c69cbc..538aca7a4f 100644 --- a/src/Ombi.Core.Tests/Engine/MovieRequestLimitsTests.cs +++ b/src/Ombi.Core.Tests/Engine/MovieRequestLimitsTests.cs @@ -300,13 +300,13 @@ public async Task UserPassedIn_MovieLimit_Set_Limit_Daily_AllRequestsToday() { UserId = "id1", RequestType = RequestType.Movie, - RequestDate = today.AddHours(-1), + RequestDate = today.AddMinutes(-1), }, new RequestLog { UserId = "id1", RequestType = RequestType.Movie, - RequestDate = today.AddHours(-2), + RequestDate = today.AddMinutes(-2), }, }; var repoMock = _mocker.GetMock>(); diff --git a/src/Ombi.Core.Tests/Engine/MusicRequestLimitTests.cs b/src/Ombi.Core.Tests/Engine/MusicRequestLimitTests.cs index 477ab7502b..544a76a552 100644 --- a/src/Ombi.Core.Tests/Engine/MusicRequestLimitTests.cs +++ b/src/Ombi.Core.Tests/Engine/MusicRequestLimitTests.cs @@ -298,13 +298,13 @@ public async Task UserPassedIn_MusicLimit_Set_Limit_Daily_AllRequestsToday() { UserId = "id1", RequestType = RequestType.Album, - RequestDate = today.AddHours(-1), + RequestDate = today.AddMinutes(-1), }, new RequestLog { UserId = "id1", RequestType = RequestType.Album, - RequestDate = today.AddHours(-2), + RequestDate = today.AddMinutes(-2), }, }; var repoMock = _mocker.GetMock>(); diff --git a/src/Ombi.Core.Tests/Engine/TvRequestLimitsTests.cs b/src/Ombi.Core.Tests/Engine/TvRequestLimitsTests.cs index 2012519608..5cfd322f44 100644 --- a/src/Ombi.Core.Tests/Engine/TvRequestLimitsTests.cs +++ b/src/Ombi.Core.Tests/Engine/TvRequestLimitsTests.cs @@ -304,7 +304,7 @@ public async Task UserPassedIn_TvLimit_Set_Limit_Daily_AllRequestsToday() { UserId = "id1", RequestType = RequestType.TvShow, - RequestDate = today.AddHours(-1), + RequestDate = today.AddMinutes(-1), EpisodeCount = 1, }, new RequestLog @@ -312,7 +312,7 @@ public async Task UserPassedIn_TvLimit_Set_Limit_Daily_AllRequestsToday() UserId = "id1", RequestType = RequestType.TvShow, EpisodeCount = 1, - RequestDate = today.AddHours(-2), + RequestDate = today.AddMinutes(-2), }, }; var repoMock = _mocker.GetMock>(); @@ -345,7 +345,7 @@ public async Task UserPassedIn_TvLimit_Set_Limit_Daily_MultipleEpisodeRequests() { UserId = "id1", RequestType = RequestType.TvShow, - RequestDate = today.AddHours(-1), + RequestDate = today.AddMinutes(-1), EpisodeCount = 5, }, new RequestLog @@ -353,7 +353,7 @@ public async Task UserPassedIn_TvLimit_Set_Limit_Daily_MultipleEpisodeRequests() UserId = "id1", RequestType = RequestType.TvShow, EpisodeCount = 4, - RequestDate = today.AddHours(-2), + RequestDate = today.AddMinutes(-2), }, }; var repoMock = _mocker.GetMock>(); diff --git a/src/Ombi.Core.Tests/Ombi.Core.Tests.csproj b/src/Ombi.Core.Tests/Ombi.Core.Tests.csproj index aff0294a52..f63762bd42 100644 --- a/src/Ombi.Core.Tests/Ombi.Core.Tests.csproj +++ b/src/Ombi.Core.Tests/Ombi.Core.Tests.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 true true Debug;Release;NonUiBuild @@ -9,7 +9,7 @@ - + diff --git a/src/Ombi.Core/Ombi.Core.csproj b/src/Ombi.Core/Ombi.Core.csproj index e4826d3c9b..7f15da6dbb 100644 --- a/src/Ombi.Core/Ombi.Core.csproj +++ b/src/Ombi.Core/Ombi.Core.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 3.0.0.0 3.0.0.0 @@ -13,8 +13,8 @@ - - + + diff --git a/src/Ombi.DependencyInjection/Ombi.DependencyInjection.csproj b/src/Ombi.DependencyInjection/Ombi.DependencyInjection.csproj index da17631a6b..4df8707856 100644 --- a/src/Ombi.DependencyInjection/Ombi.DependencyInjection.csproj +++ b/src/Ombi.DependencyInjection/Ombi.DependencyInjection.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 3.0.0.0 3.0.0.0 @@ -11,9 +11,9 @@ - - - + + + diff --git a/src/Ombi.HealthChecks/Ombi.HealthChecks.csproj b/src/Ombi.HealthChecks/Ombi.HealthChecks.csproj index e779fe0c74..4a9148a50b 100644 --- a/src/Ombi.HealthChecks/Ombi.HealthChecks.csproj +++ b/src/Ombi.HealthChecks/Ombi.HealthChecks.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 Debug;Release;NonUiBuild diff --git a/src/Ombi.Helpers.Tests/Ombi.Helpers.Tests.csproj b/src/Ombi.Helpers.Tests/Ombi.Helpers.Tests.csproj index 1ade8ef1c6..85a5ca2d48 100644 --- a/src/Ombi.Helpers.Tests/Ombi.Helpers.Tests.csproj +++ b/src/Ombi.Helpers.Tests/Ombi.Helpers.Tests.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 false @@ -10,7 +10,7 @@ - + diff --git a/src/Ombi.Helpers/Ombi.Helpers.csproj b/src/Ombi.Helpers/Ombi.Helpers.csproj index f7cbc95a8c..e8ed983a84 100644 --- a/src/Ombi.Helpers/Ombi.Helpers.csproj +++ b/src/Ombi.Helpers/Ombi.Helpers.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 3.0.0.0 3.0.0.0 @@ -13,8 +13,8 @@ - - + + diff --git a/src/Ombi.Hubs/Ombi.Hubs.csproj b/src/Ombi.Hubs/Ombi.Hubs.csproj index f8f03b5d06..075612bff5 100644 --- a/src/Ombi.Hubs/Ombi.Hubs.csproj +++ b/src/Ombi.Hubs/Ombi.Hubs.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 latest Debug;Release;NonUiBuild diff --git a/src/Ombi.I18n/Ombi.I18n.csproj b/src/Ombi.I18n/Ombi.I18n.csproj index a3387cdeae..48f4229a42 100644 --- a/src/Ombi.I18n/Ombi.I18n.csproj +++ b/src/Ombi.I18n/Ombi.I18n.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 3.0.0.0 3.0.0.0 diff --git a/src/Ombi.Mapping/Ombi.Mapping.csproj b/src/Ombi.Mapping/Ombi.Mapping.csproj index 8f120cc6b2..7b6338274c 100644 --- a/src/Ombi.Mapping/Ombi.Mapping.csproj +++ b/src/Ombi.Mapping/Ombi.Mapping.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 3.0.0.0 3.0.0.0 diff --git a/src/Ombi.Notifications.Templates/Ombi.Notifications.Templates.csproj b/src/Ombi.Notifications.Templates/Ombi.Notifications.Templates.csproj index 99e7509b47..c447167a0e 100644 --- a/src/Ombi.Notifications.Templates/Ombi.Notifications.Templates.csproj +++ b/src/Ombi.Notifications.Templates/Ombi.Notifications.Templates.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 3.0.0.0 3.0.0.0 diff --git a/src/Ombi.Notifications.Tests/Ombi.Notifications.Tests.csproj b/src/Ombi.Notifications.Tests/Ombi.Notifications.Tests.csproj index f7afeb6103..5f002cfd20 100644 --- a/src/Ombi.Notifications.Tests/Ombi.Notifications.Tests.csproj +++ b/src/Ombi.Notifications.Tests/Ombi.Notifications.Tests.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 Debug;Release;NonUiBuild @@ -10,7 +10,7 @@ - + diff --git a/src/Ombi.Notifications/Ombi.Notifications.csproj b/src/Ombi.Notifications/Ombi.Notifications.csproj index 0f074463d4..f022a838ca 100644 --- a/src/Ombi.Notifications/Ombi.Notifications.csproj +++ b/src/Ombi.Notifications/Ombi.Notifications.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 3.0.0.0 3.0.0.0 diff --git a/src/Ombi.Schedule.Tests/IssuesPurgeTests.cs b/src/Ombi.Schedule.Tests/IssuesPurgeTests.cs index dbba08d21f..8d37524e9f 100644 --- a/src/Ombi.Schedule.Tests/IssuesPurgeTests.cs +++ b/src/Ombi.Schedule.Tests/IssuesPurgeTests.cs @@ -91,12 +91,12 @@ public async Task DoesNot_Delete_AnyIssues() new Issues { Status = IssueStatus.Resolved, - ResovledDate = DateTime.Now.AddDays(-2) + ResovledDate = DateTime.UtcNow.AddDays(-2) }, new Issues { Status = IssueStatus.Resolved, - ResovledDate = DateTime.Now.AddDays(-4) + ResovledDate = DateTime.UtcNow.AddDays(-4) } }; diff --git a/src/Ombi.Schedule.Tests/Ombi.Schedule.Tests.csproj b/src/Ombi.Schedule.Tests/Ombi.Schedule.Tests.csproj index c483cb321f..97c9994971 100644 --- a/src/Ombi.Schedule.Tests/Ombi.Schedule.Tests.csproj +++ b/src/Ombi.Schedule.Tests/Ombi.Schedule.Tests.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 Debug;Release;NonUiBuild @@ -10,7 +10,7 @@ - + diff --git a/src/Ombi.Schedule/Ombi.Schedule.csproj b/src/Ombi.Schedule/Ombi.Schedule.csproj index ff7077ee1b..433e93faea 100644 --- a/src/Ombi.Schedule/Ombi.Schedule.csproj +++ b/src/Ombi.Schedule/Ombi.Schedule.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 3.0.0.0 3.0.0.0 diff --git a/src/Ombi.Settings.Tests/Ombi.Settings.Tests.csproj b/src/Ombi.Settings.Tests/Ombi.Settings.Tests.csproj index f36894a892..714c69f2ef 100644 --- a/src/Ombi.Settings.Tests/Ombi.Settings.Tests.csproj +++ b/src/Ombi.Settings.Tests/Ombi.Settings.Tests.csproj @@ -1,6 +1,7 @@  - net6.0 + + net8.0 false @@ -10,7 +11,7 @@ - + diff --git a/src/Ombi.Settings/Ombi.Settings.csproj b/src/Ombi.Settings/Ombi.Settings.csproj index 4849417bc9..7427a43ef4 100644 --- a/src/Ombi.Settings/Ombi.Settings.csproj +++ b/src/Ombi.Settings/Ombi.Settings.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 3.0.0.0 3.0.0.0 @@ -11,7 +11,7 @@ - + diff --git a/src/Ombi.Store/Context/Postgres/ExternalPostgresContext.cs b/src/Ombi.Store/Context/Postgres/ExternalPostgresContext.cs new file mode 100644 index 0000000000..1b106604b9 --- /dev/null +++ b/src/Ombi.Store/Context/Postgres/ExternalPostgresContext.cs @@ -0,0 +1,16 @@ +using Microsoft.EntityFrameworkCore; + +namespace Ombi.Store.Context.Postgres +{ + public sealed class ExternalPostgresContext : ExternalContext + { + private static bool _created; + public ExternalPostgresContext(DbContextOptions options) : base(options) + { + if (_created) return; + + _created = true; + Database.Migrate(); + } + } +} \ No newline at end of file diff --git a/src/Ombi.Store/Context/Postgres/OmbiPostgresContext.cs b/src/Ombi.Store/Context/Postgres/OmbiPostgresContext.cs new file mode 100644 index 0000000000..a2b44180fd --- /dev/null +++ b/src/Ombi.Store/Context/Postgres/OmbiPostgresContext.cs @@ -0,0 +1,22 @@ +using Microsoft.EntityFrameworkCore; + +namespace Ombi.Store.Context.Postgres +{ + public sealed class OmbiPostgresContext : OmbiContext + { + private static bool _created; + + public OmbiPostgresContext(DbContextOptions options) : base(options) + { + if (_created) return; + _created = true; + + Database.Migrate(); + } + + public override void Dispose() + { + base.Dispose(); + } + } +} \ No newline at end of file diff --git a/src/Ombi.Store/Context/Postgres/PostgresModuleInitializer.cs b/src/Ombi.Store/Context/Postgres/PostgresModuleInitializer.cs new file mode 100644 index 0000000000..8fdab7cf3a --- /dev/null +++ b/src/Ombi.Store/Context/Postgres/PostgresModuleInitializer.cs @@ -0,0 +1,17 @@ +using System; +using System.Runtime.CompilerServices; + +namespace Ombi.Store.Context.Postgres; + +public static class PostgresModuleInitializer +{ +#pragma warning disable CA2255 + // This is required to ensure that Npgsql uses a timestamp behavior that does not require a timezone + // Reference: https://stackoverflow.com/a/73586129 + [ModuleInitializer] +#pragma warning restore CA2255 + public static void Initialize() + { + AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); + } +} \ No newline at end of file diff --git a/src/Ombi.Store/Context/Postgres/SettingsPostgresContext.cs b/src/Ombi.Store/Context/Postgres/SettingsPostgresContext.cs new file mode 100644 index 0000000000..d8f343e46a --- /dev/null +++ b/src/Ombi.Store/Context/Postgres/SettingsPostgresContext.cs @@ -0,0 +1,16 @@ +using Microsoft.EntityFrameworkCore; + +namespace Ombi.Store.Context.Postgres +{ + public sealed class SettingsPostgresContext : SettingsContext + { + private static bool _created; + public SettingsPostgresContext(DbContextOptions options) : base(options) + { + if (_created) return; + + _created = true; + Database.Migrate(); + } + } +} \ No newline at end of file diff --git a/src/Ombi.Store/MigrationHelper.cs b/src/Ombi.Store/MigrationHelper.cs index 58b6d6b68d..88136d4c1a 100644 --- a/src/Ombi.Store/MigrationHelper.cs +++ b/src/Ombi.Store/MigrationHelper.cs @@ -20,5 +20,13 @@ INSERT INTO AspNetRoles(Id, ConcurrencyStamp, Name, NormalizedName) SELECT '{Guid.NewGuid()}','{Guid.NewGuid()}','{role}', '{role.ToUpper()}' WHERE NOT EXISTS(SELECT 1 FROM AspNetRoles WHERE Name = '{role}');"); } + + public static void InsertRolePostgres(this MigrationBuilder mb, string role) + { + mb.Sql($@" +INSERT INTO public.""AspNetRoles""(""Id"", ""ConcurrencyStamp"", ""Name"", ""NormalizedName"") +SELECT '{Guid.NewGuid()}','{Guid.NewGuid()}','{role}', '{role.ToUpper()}' +WHERE NOT EXISTS(SELECT 1 FROM public.""AspNetRoles"" WHERE ""Name"" = '{role}');"); + } } } diff --git a/src/Ombi.Store/Migrations/ExternalPostgres/20231212135426_Initial.Designer.cs b/src/Ombi.Store/Migrations/ExternalPostgres/20231212135426_Initial.Designer.cs new file mode 100644 index 0000000000..5ca9b77b97 --- /dev/null +++ b/src/Ombi.Store/Migrations/ExternalPostgres/20231212135426_Initial.Designer.cs @@ -0,0 +1,628 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using Ombi.Store.Context.Postgres; + +#nullable disable + +namespace Ombi.Store.Migrations.ExternalPostgres +{ + [DbContext(typeof(ExternalPostgresContext))] + [Migration("20231212135426_Initial")] + partial class Initial + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "6.0.22") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("Ombi.Store.Entities.CouchPotatoCache", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("TheMovieDbId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("CouchPotatoCache"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.EmbyContent", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AddedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("EmbyId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Has4K") + .HasColumnType("boolean"); + + b.Property("ImdbId") + .HasColumnType("text"); + + b.Property("ProviderId") + .HasColumnType("text"); + + b.Property("Quality") + .HasColumnType("text"); + + b.Property("TheMovieDbId") + .HasColumnType("text"); + + b.Property("Title") + .HasColumnType("text"); + + b.Property("TvDbId") + .HasColumnType("text"); + + b.Property("Type") + .HasColumnType("integer"); + + b.Property("Url") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("EmbyContent"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.EmbyEpisode", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AddedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("EmbyId") + .HasColumnType("text"); + + b.Property("EpisodeNumber") + .HasColumnType("integer"); + + b.Property("ImdbId") + .HasColumnType("text"); + + b.Property("ParentId") + .HasColumnType("text"); + + b.Property("ProviderId") + .HasColumnType("text"); + + b.Property("SeasonNumber") + .HasColumnType("integer"); + + b.Property("TheMovieDbId") + .HasColumnType("text"); + + b.Property("Title") + .HasColumnType("text"); + + b.Property("TvDbId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("ParentId"); + + b.ToTable("EmbyEpisode"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.JellyfinContent", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AddedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Has4K") + .HasColumnType("boolean"); + + b.Property("ImdbId") + .HasColumnType("text"); + + b.Property("JellyfinId") + .IsRequired() + .HasColumnType("text"); + + b.Property("ProviderId") + .HasColumnType("text"); + + b.Property("Quality") + .HasColumnType("text"); + + b.Property("TheMovieDbId") + .HasColumnType("text"); + + b.Property("Title") + .HasColumnType("text"); + + b.Property("TvDbId") + .HasColumnType("text"); + + b.Property("Type") + .HasColumnType("integer"); + + b.Property("Url") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("JellyfinContent"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.JellyfinEpisode", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AddedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("EpisodeNumber") + .HasColumnType("integer"); + + b.Property("ImdbId") + .HasColumnType("text"); + + b.Property("JellyfinId") + .HasColumnType("text"); + + b.Property("ParentId") + .HasColumnType("text"); + + b.Property("ProviderId") + .HasColumnType("text"); + + b.Property("SeasonNumber") + .HasColumnType("integer"); + + b.Property("TheMovieDbId") + .HasColumnType("text"); + + b.Property("Title") + .HasColumnType("text"); + + b.Property("TvDbId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("ParentId"); + + b.ToTable("JellyfinEpisode"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.LidarrAlbumCache", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AddedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ArtistId") + .HasColumnType("integer"); + + b.Property("ForeignAlbumId") + .HasColumnType("text"); + + b.Property("Monitored") + .HasColumnType("boolean"); + + b.Property("PercentOfTracks") + .HasColumnType("numeric"); + + b.Property("ReleaseDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Title") + .HasColumnType("text"); + + b.Property("TrackCount") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("LidarrAlbumCache"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.LidarrArtistCache", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ArtistId") + .HasColumnType("integer"); + + b.Property("ArtistName") + .HasColumnType("text"); + + b.Property("ForeignArtistId") + .HasColumnType("text"); + + b.Property("Monitored") + .HasColumnType("boolean"); + + b.HasKey("Id"); + + b.ToTable("LidarrArtistCache"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.PlexEpisode", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("EpisodeNumber") + .HasColumnType("integer"); + + b.Property("GrandparentKey") + .HasColumnType("text"); + + b.Property("Key") + .HasColumnType("text"); + + b.Property("ParentKey") + .HasColumnType("text"); + + b.Property("SeasonNumber") + .HasColumnType("integer"); + + b.Property("Title") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("GrandparentKey"); + + b.ToTable("PlexEpisode"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.PlexSeasonsContent", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ParentKey") + .HasColumnType("text"); + + b.Property("PlexContentId") + .HasColumnType("text"); + + b.Property("PlexServerContentId") + .HasColumnType("integer"); + + b.Property("SeasonKey") + .HasColumnType("text"); + + b.Property("SeasonNumber") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("PlexServerContentId"); + + b.ToTable("PlexSeasonsContent"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.PlexServerContent", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AddedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Has4K") + .HasColumnType("boolean"); + + b.Property("ImdbId") + .HasColumnType("text"); + + b.Property("Key") + .IsRequired() + .HasColumnType("text"); + + b.Property("Quality") + .HasColumnType("text"); + + b.Property("ReleaseYear") + .HasColumnType("text"); + + b.Property("RequestId") + .HasColumnType("integer"); + + b.Property("TheMovieDbId") + .HasColumnType("text"); + + b.Property("Title") + .HasColumnType("text"); + + b.Property("TvDbId") + .HasColumnType("text"); + + b.Property("Type") + .HasColumnType("integer"); + + b.Property("Url") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("PlexServerContent"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.PlexWatchlistHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("TmdbId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("PlexWatchlistHistory"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.RadarrCache", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Has4K") + .HasColumnType("boolean"); + + b.Property("HasFile") + .HasColumnType("boolean"); + + b.Property("HasRegular") + .HasColumnType("boolean"); + + b.Property("TheMovieDbId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("RadarrCache"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.SickRageCache", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("TvDbId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("SickRageCache"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.SickRageEpisodeCache", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("EpisodeNumber") + .HasColumnType("integer"); + + b.Property("SeasonNumber") + .HasColumnType("integer"); + + b.Property("TvDbId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("SickRageEpisodeCache"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.SonarrCache", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("TheMovieDbId") + .HasColumnType("integer"); + + b.Property("TvDbId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("SonarrCache"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.SonarrEpisodeCache", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("EpisodeNumber") + .HasColumnType("integer"); + + b.Property("HasFile") + .HasColumnType("boolean"); + + b.Property("MovieDbId") + .HasColumnType("integer"); + + b.Property("SeasonNumber") + .HasColumnType("integer"); + + b.Property("TvDbId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("SonarrEpisodeCache"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.UserPlayedEpisode", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("EpisodeNumber") + .HasColumnType("integer"); + + b.Property("SeasonNumber") + .HasColumnType("integer"); + + b.Property("TheMovieDbId") + .HasColumnType("integer"); + + b.Property("UserId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("UserPlayedEpisode"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.UserPlayedMovie", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("TheMovieDbId") + .HasColumnType("integer"); + + b.Property("UserId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("UserPlayedMovie"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.EmbyEpisode", b => + { + b.HasOne("Ombi.Store.Entities.EmbyContent", "Series") + .WithMany("Episodes") + .HasForeignKey("ParentId") + .HasPrincipalKey("EmbyId"); + + b.Navigation("Series"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.JellyfinEpisode", b => + { + b.HasOne("Ombi.Store.Entities.JellyfinContent", "Series") + .WithMany("Episodes") + .HasForeignKey("ParentId") + .HasPrincipalKey("JellyfinId"); + + b.Navigation("Series"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.PlexEpisode", b => + { + b.HasOne("Ombi.Store.Entities.PlexServerContent", "Series") + .WithMany("Episodes") + .HasForeignKey("GrandparentKey") + .HasPrincipalKey("Key"); + + b.Navigation("Series"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.PlexSeasonsContent", b => + { + b.HasOne("Ombi.Store.Entities.PlexServerContent", null) + .WithMany("Seasons") + .HasForeignKey("PlexServerContentId"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.EmbyContent", b => + { + b.Navigation("Episodes"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.JellyfinContent", b => + { + b.Navigation("Episodes"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.PlexServerContent", b => + { + b.Navigation("Episodes"); + + b.Navigation("Seasons"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/Ombi.Store/Migrations/ExternalPostgres/20231212135426_Initial.cs b/src/Ombi.Store/Migrations/ExternalPostgres/20231212135426_Initial.cs new file mode 100644 index 0000000000..9ba6ab96c1 --- /dev/null +++ b/src/Ombi.Store/Migrations/ExternalPostgres/20231212135426_Initial.cs @@ -0,0 +1,430 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace Ombi.Store.Migrations.ExternalPostgres +{ + public partial class Initial : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "CouchPotatoCache", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + TheMovieDbId = table.Column(type: "integer", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_CouchPotatoCache", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "EmbyContent", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + ProviderId = table.Column(type: "text", nullable: true), + EmbyId = table.Column(type: "text", nullable: false), + Title = table.Column(type: "text", nullable: true), + ImdbId = table.Column(type: "text", nullable: true), + TvDbId = table.Column(type: "text", nullable: true), + TheMovieDbId = table.Column(type: "text", nullable: true), + Type = table.Column(type: "integer", nullable: false), + Quality = table.Column(type: "text", nullable: true), + Has4K = table.Column(type: "boolean", nullable: false), + Url = table.Column(type: "text", nullable: true), + AddedAt = table.Column(type: "timestamp with time zone", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_EmbyContent", x => x.Id); + table.UniqueConstraint("AK_EmbyContent_EmbyId", x => x.EmbyId); + }); + + migrationBuilder.CreateTable( + name: "JellyfinContent", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + ProviderId = table.Column(type: "text", nullable: true), + JellyfinId = table.Column(type: "text", nullable: false), + Title = table.Column(type: "text", nullable: true), + ImdbId = table.Column(type: "text", nullable: true), + TvDbId = table.Column(type: "text", nullable: true), + TheMovieDbId = table.Column(type: "text", nullable: true), + Type = table.Column(type: "integer", nullable: false), + Quality = table.Column(type: "text", nullable: true), + Has4K = table.Column(type: "boolean", nullable: false), + Url = table.Column(type: "text", nullable: true), + AddedAt = table.Column(type: "timestamp with time zone", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_JellyfinContent", x => x.Id); + table.UniqueConstraint("AK_JellyfinContent_JellyfinId", x => x.JellyfinId); + }); + + migrationBuilder.CreateTable( + name: "LidarrAlbumCache", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + ArtistId = table.Column(type: "integer", nullable: false), + ForeignAlbumId = table.Column(type: "text", nullable: true), + TrackCount = table.Column(type: "integer", nullable: false), + ReleaseDate = table.Column(type: "timestamp with time zone", nullable: false), + Monitored = table.Column(type: "boolean", nullable: false), + Title = table.Column(type: "text", nullable: true), + PercentOfTracks = table.Column(type: "numeric", nullable: false), + AddedAt = table.Column(type: "timestamp with time zone", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_LidarrAlbumCache", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "LidarrArtistCache", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + ArtistId = table.Column(type: "integer", nullable: false), + ArtistName = table.Column(type: "text", nullable: true), + ForeignArtistId = table.Column(type: "text", nullable: true), + Monitored = table.Column(type: "boolean", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_LidarrArtistCache", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "PlexServerContent", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + ReleaseYear = table.Column(type: "text", nullable: true), + Key = table.Column(type: "text", nullable: false), + RequestId = table.Column(type: "integer", nullable: true), + Title = table.Column(type: "text", nullable: true), + ImdbId = table.Column(type: "text", nullable: true), + TvDbId = table.Column(type: "text", nullable: true), + TheMovieDbId = table.Column(type: "text", nullable: true), + Type = table.Column(type: "integer", nullable: false), + Quality = table.Column(type: "text", nullable: true), + Has4K = table.Column(type: "boolean", nullable: false), + Url = table.Column(type: "text", nullable: true), + AddedAt = table.Column(type: "timestamp with time zone", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_PlexServerContent", x => x.Id); + table.UniqueConstraint("AK_PlexServerContent_Key", x => x.Key); + }); + + migrationBuilder.CreateTable( + name: "PlexWatchlistHistory", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + TmdbId = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_PlexWatchlistHistory", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "RadarrCache", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + TheMovieDbId = table.Column(type: "integer", nullable: false), + HasFile = table.Column(type: "boolean", nullable: false), + Has4K = table.Column(type: "boolean", nullable: false), + HasRegular = table.Column(type: "boolean", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_RadarrCache", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "SickRageCache", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + TvDbId = table.Column(type: "integer", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_SickRageCache", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "SickRageEpisodeCache", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + SeasonNumber = table.Column(type: "integer", nullable: false), + EpisodeNumber = table.Column(type: "integer", nullable: false), + TvDbId = table.Column(type: "integer", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_SickRageEpisodeCache", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "SonarrCache", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + TvDbId = table.Column(type: "integer", nullable: false), + TheMovieDbId = table.Column(type: "integer", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_SonarrCache", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "SonarrEpisodeCache", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + SeasonNumber = table.Column(type: "integer", nullable: false), + EpisodeNumber = table.Column(type: "integer", nullable: false), + TvDbId = table.Column(type: "integer", nullable: false), + MovieDbId = table.Column(type: "integer", nullable: false), + HasFile = table.Column(type: "boolean", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_SonarrEpisodeCache", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "UserPlayedEpisode", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + TheMovieDbId = table.Column(type: "integer", nullable: false), + SeasonNumber = table.Column(type: "integer", nullable: false), + EpisodeNumber = table.Column(type: "integer", nullable: false), + UserId = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_UserPlayedEpisode", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "UserPlayedMovie", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + TheMovieDbId = table.Column(type: "integer", nullable: false), + UserId = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_UserPlayedMovie", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "EmbyEpisode", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + EmbyId = table.Column(type: "text", nullable: true), + ParentId = table.Column(type: "text", nullable: true), + ProviderId = table.Column(type: "text", nullable: true), + AddedAt = table.Column(type: "timestamp with time zone", nullable: false), + TvDbId = table.Column(type: "text", nullable: true), + ImdbId = table.Column(type: "text", nullable: true), + TheMovieDbId = table.Column(type: "text", nullable: true), + EpisodeNumber = table.Column(type: "integer", nullable: false), + SeasonNumber = table.Column(type: "integer", nullable: false), + Title = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_EmbyEpisode", x => x.Id); + table.ForeignKey( + name: "FK_EmbyEpisode_EmbyContent_ParentId", + column: x => x.ParentId, + principalTable: "EmbyContent", + principalColumn: "EmbyId"); + }); + + migrationBuilder.CreateTable( + name: "JellyfinEpisode", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + JellyfinId = table.Column(type: "text", nullable: true), + ParentId = table.Column(type: "text", nullable: true), + ProviderId = table.Column(type: "text", nullable: true), + AddedAt = table.Column(type: "timestamp with time zone", nullable: false), + TvDbId = table.Column(type: "text", nullable: true), + ImdbId = table.Column(type: "text", nullable: true), + TheMovieDbId = table.Column(type: "text", nullable: true), + EpisodeNumber = table.Column(type: "integer", nullable: false), + SeasonNumber = table.Column(type: "integer", nullable: false), + Title = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_JellyfinEpisode", x => x.Id); + table.ForeignKey( + name: "FK_JellyfinEpisode_JellyfinContent_ParentId", + column: x => x.ParentId, + principalTable: "JellyfinContent", + principalColumn: "JellyfinId"); + }); + + migrationBuilder.CreateTable( + name: "PlexEpisode", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Key = table.Column(type: "text", nullable: true), + ParentKey = table.Column(type: "text", nullable: true), + GrandparentKey = table.Column(type: "text", nullable: true), + EpisodeNumber = table.Column(type: "integer", nullable: false), + SeasonNumber = table.Column(type: "integer", nullable: false), + Title = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_PlexEpisode", x => x.Id); + table.ForeignKey( + name: "FK_PlexEpisode_PlexServerContent_GrandparentKey", + column: x => x.GrandparentKey, + principalTable: "PlexServerContent", + principalColumn: "Key"); + }); + + migrationBuilder.CreateTable( + name: "PlexSeasonsContent", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + PlexContentId = table.Column(type: "text", nullable: true), + SeasonNumber = table.Column(type: "integer", nullable: false), + SeasonKey = table.Column(type: "text", nullable: true), + ParentKey = table.Column(type: "text", nullable: true), + PlexServerContentId = table.Column(type: "integer", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_PlexSeasonsContent", x => x.Id); + table.ForeignKey( + name: "FK_PlexSeasonsContent_PlexServerContent_PlexServerContentId", + column: x => x.PlexServerContentId, + principalTable: "PlexServerContent", + principalColumn: "Id"); + }); + + migrationBuilder.CreateIndex( + name: "IX_EmbyEpisode_ParentId", + table: "EmbyEpisode", + column: "ParentId"); + + migrationBuilder.CreateIndex( + name: "IX_JellyfinEpisode_ParentId", + table: "JellyfinEpisode", + column: "ParentId"); + + migrationBuilder.CreateIndex( + name: "IX_PlexEpisode_GrandparentKey", + table: "PlexEpisode", + column: "GrandparentKey"); + + migrationBuilder.CreateIndex( + name: "IX_PlexSeasonsContent_PlexServerContentId", + table: "PlexSeasonsContent", + column: "PlexServerContentId"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "CouchPotatoCache"); + + migrationBuilder.DropTable( + name: "EmbyEpisode"); + + migrationBuilder.DropTable( + name: "JellyfinEpisode"); + + migrationBuilder.DropTable( + name: "LidarrAlbumCache"); + + migrationBuilder.DropTable( + name: "LidarrArtistCache"); + + migrationBuilder.DropTable( + name: "PlexEpisode"); + + migrationBuilder.DropTable( + name: "PlexSeasonsContent"); + + migrationBuilder.DropTable( + name: "PlexWatchlistHistory"); + + migrationBuilder.DropTable( + name: "RadarrCache"); + + migrationBuilder.DropTable( + name: "SickRageCache"); + + migrationBuilder.DropTable( + name: "SickRageEpisodeCache"); + + migrationBuilder.DropTable( + name: "SonarrCache"); + + migrationBuilder.DropTable( + name: "SonarrEpisodeCache"); + + migrationBuilder.DropTable( + name: "UserPlayedEpisode"); + + migrationBuilder.DropTable( + name: "UserPlayedMovie"); + + migrationBuilder.DropTable( + name: "EmbyContent"); + + migrationBuilder.DropTable( + name: "JellyfinContent"); + + migrationBuilder.DropTable( + name: "PlexServerContent"); + } + } +} diff --git a/src/Ombi.Store/Migrations/ExternalPostgres/ExternalPostgresContextModelSnapshot.cs b/src/Ombi.Store/Migrations/ExternalPostgres/ExternalPostgresContextModelSnapshot.cs new file mode 100644 index 0000000000..363659d502 --- /dev/null +++ b/src/Ombi.Store/Migrations/ExternalPostgres/ExternalPostgresContextModelSnapshot.cs @@ -0,0 +1,626 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using Ombi.Store.Context.Postgres; + +#nullable disable + +namespace Ombi.Store.Migrations.ExternalPostgres +{ + [DbContext(typeof(ExternalPostgresContext))] + partial class ExternalPostgresContextModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "6.0.22") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("Ombi.Store.Entities.CouchPotatoCache", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("TheMovieDbId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("CouchPotatoCache"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.EmbyContent", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AddedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("EmbyId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Has4K") + .HasColumnType("boolean"); + + b.Property("ImdbId") + .HasColumnType("text"); + + b.Property("ProviderId") + .HasColumnType("text"); + + b.Property("Quality") + .HasColumnType("text"); + + b.Property("TheMovieDbId") + .HasColumnType("text"); + + b.Property("Title") + .HasColumnType("text"); + + b.Property("TvDbId") + .HasColumnType("text"); + + b.Property("Type") + .HasColumnType("integer"); + + b.Property("Url") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("EmbyContent"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.EmbyEpisode", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AddedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("EmbyId") + .HasColumnType("text"); + + b.Property("EpisodeNumber") + .HasColumnType("integer"); + + b.Property("ImdbId") + .HasColumnType("text"); + + b.Property("ParentId") + .HasColumnType("text"); + + b.Property("ProviderId") + .HasColumnType("text"); + + b.Property("SeasonNumber") + .HasColumnType("integer"); + + b.Property("TheMovieDbId") + .HasColumnType("text"); + + b.Property("Title") + .HasColumnType("text"); + + b.Property("TvDbId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("ParentId"); + + b.ToTable("EmbyEpisode"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.JellyfinContent", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AddedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Has4K") + .HasColumnType("boolean"); + + b.Property("ImdbId") + .HasColumnType("text"); + + b.Property("JellyfinId") + .IsRequired() + .HasColumnType("text"); + + b.Property("ProviderId") + .HasColumnType("text"); + + b.Property("Quality") + .HasColumnType("text"); + + b.Property("TheMovieDbId") + .HasColumnType("text"); + + b.Property("Title") + .HasColumnType("text"); + + b.Property("TvDbId") + .HasColumnType("text"); + + b.Property("Type") + .HasColumnType("integer"); + + b.Property("Url") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("JellyfinContent"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.JellyfinEpisode", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AddedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("EpisodeNumber") + .HasColumnType("integer"); + + b.Property("ImdbId") + .HasColumnType("text"); + + b.Property("JellyfinId") + .HasColumnType("text"); + + b.Property("ParentId") + .HasColumnType("text"); + + b.Property("ProviderId") + .HasColumnType("text"); + + b.Property("SeasonNumber") + .HasColumnType("integer"); + + b.Property("TheMovieDbId") + .HasColumnType("text"); + + b.Property("Title") + .HasColumnType("text"); + + b.Property("TvDbId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("ParentId"); + + b.ToTable("JellyfinEpisode"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.LidarrAlbumCache", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AddedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ArtistId") + .HasColumnType("integer"); + + b.Property("ForeignAlbumId") + .HasColumnType("text"); + + b.Property("Monitored") + .HasColumnType("boolean"); + + b.Property("PercentOfTracks") + .HasColumnType("numeric"); + + b.Property("ReleaseDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Title") + .HasColumnType("text"); + + b.Property("TrackCount") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("LidarrAlbumCache"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.LidarrArtistCache", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ArtistId") + .HasColumnType("integer"); + + b.Property("ArtistName") + .HasColumnType("text"); + + b.Property("ForeignArtistId") + .HasColumnType("text"); + + b.Property("Monitored") + .HasColumnType("boolean"); + + b.HasKey("Id"); + + b.ToTable("LidarrArtistCache"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.PlexEpisode", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("EpisodeNumber") + .HasColumnType("integer"); + + b.Property("GrandparentKey") + .HasColumnType("text"); + + b.Property("Key") + .HasColumnType("text"); + + b.Property("ParentKey") + .HasColumnType("text"); + + b.Property("SeasonNumber") + .HasColumnType("integer"); + + b.Property("Title") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("GrandparentKey"); + + b.ToTable("PlexEpisode"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.PlexSeasonsContent", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ParentKey") + .HasColumnType("text"); + + b.Property("PlexContentId") + .HasColumnType("text"); + + b.Property("PlexServerContentId") + .HasColumnType("integer"); + + b.Property("SeasonKey") + .HasColumnType("text"); + + b.Property("SeasonNumber") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("PlexServerContentId"); + + b.ToTable("PlexSeasonsContent"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.PlexServerContent", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AddedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Has4K") + .HasColumnType("boolean"); + + b.Property("ImdbId") + .HasColumnType("text"); + + b.Property("Key") + .IsRequired() + .HasColumnType("text"); + + b.Property("Quality") + .HasColumnType("text"); + + b.Property("ReleaseYear") + .HasColumnType("text"); + + b.Property("RequestId") + .HasColumnType("integer"); + + b.Property("TheMovieDbId") + .HasColumnType("text"); + + b.Property("Title") + .HasColumnType("text"); + + b.Property("TvDbId") + .HasColumnType("text"); + + b.Property("Type") + .HasColumnType("integer"); + + b.Property("Url") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("PlexServerContent"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.PlexWatchlistHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("TmdbId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("PlexWatchlistHistory"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.RadarrCache", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Has4K") + .HasColumnType("boolean"); + + b.Property("HasFile") + .HasColumnType("boolean"); + + b.Property("HasRegular") + .HasColumnType("boolean"); + + b.Property("TheMovieDbId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("RadarrCache"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.SickRageCache", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("TvDbId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("SickRageCache"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.SickRageEpisodeCache", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("EpisodeNumber") + .HasColumnType("integer"); + + b.Property("SeasonNumber") + .HasColumnType("integer"); + + b.Property("TvDbId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("SickRageEpisodeCache"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.SonarrCache", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("TheMovieDbId") + .HasColumnType("integer"); + + b.Property("TvDbId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("SonarrCache"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.SonarrEpisodeCache", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("EpisodeNumber") + .HasColumnType("integer"); + + b.Property("HasFile") + .HasColumnType("boolean"); + + b.Property("MovieDbId") + .HasColumnType("integer"); + + b.Property("SeasonNumber") + .HasColumnType("integer"); + + b.Property("TvDbId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("SonarrEpisodeCache"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.UserPlayedEpisode", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("EpisodeNumber") + .HasColumnType("integer"); + + b.Property("SeasonNumber") + .HasColumnType("integer"); + + b.Property("TheMovieDbId") + .HasColumnType("integer"); + + b.Property("UserId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("UserPlayedEpisode"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.UserPlayedMovie", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("TheMovieDbId") + .HasColumnType("integer"); + + b.Property("UserId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("UserPlayedMovie"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.EmbyEpisode", b => + { + b.HasOne("Ombi.Store.Entities.EmbyContent", "Series") + .WithMany("Episodes") + .HasForeignKey("ParentId") + .HasPrincipalKey("EmbyId"); + + b.Navigation("Series"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.JellyfinEpisode", b => + { + b.HasOne("Ombi.Store.Entities.JellyfinContent", "Series") + .WithMany("Episodes") + .HasForeignKey("ParentId") + .HasPrincipalKey("JellyfinId"); + + b.Navigation("Series"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.PlexEpisode", b => + { + b.HasOne("Ombi.Store.Entities.PlexServerContent", "Series") + .WithMany("Episodes") + .HasForeignKey("GrandparentKey") + .HasPrincipalKey("Key"); + + b.Navigation("Series"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.PlexSeasonsContent", b => + { + b.HasOne("Ombi.Store.Entities.PlexServerContent", null) + .WithMany("Seasons") + .HasForeignKey("PlexServerContentId"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.EmbyContent", b => + { + b.Navigation("Episodes"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.JellyfinContent", b => + { + b.Navigation("Episodes"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.PlexServerContent", b => + { + b.Navigation("Episodes"); + + b.Navigation("Seasons"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/Ombi.Store/Migrations/OmbiPostgres/20231212135239_Initial.Designer.cs b/src/Ombi.Store/Migrations/OmbiPostgres/20231212135239_Initial.Designer.cs new file mode 100644 index 0000000000..243e1e13e8 --- /dev/null +++ b/src/Ombi.Store/Migrations/OmbiPostgres/20231212135239_Initial.Designer.cs @@ -0,0 +1,1359 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using Ombi.Store.Context.Postgres; + +#nullable disable + +namespace Ombi.Store.Migrations.OmbiPostgres +{ + [DbContext(typeof(OmbiPostgresContext))] + [Migration("20231212135239_Initial")] + partial class Initial + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "6.0.22") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("text"); + + b.Property("Name") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("NormalizedName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasDatabaseName("RoleNameIndex"); + + b.ToTable("AspNetRoles", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ClaimType") + .HasColumnType("text"); + + b.Property("ClaimValue") + .HasColumnType("text"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetRoleClaims", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ClaimType") + .HasColumnType("text"); + + b.Property("ClaimValue") + .HasColumnType("text"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserClaims", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider") + .HasColumnType("text"); + + b.Property("ProviderKey") + .HasColumnType("text"); + + b.Property("ProviderDisplayName") + .HasColumnType("text"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserLogins", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("text"); + + b.Property("RoleId") + .HasColumnType("text"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetUserRoles", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("text"); + + b.Property("LoginProvider") + .HasColumnType("text"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("Value") + .HasColumnType("text"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AspNetUserTokens", (string)null); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Audit", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AuditArea") + .HasColumnType("integer"); + + b.Property("AuditType") + .HasColumnType("integer"); + + b.Property("DateTime") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("User") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Audit"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.MobileDevices", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AddedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Token") + .HasColumnType("text"); + + b.Property("UserId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("MobileDevices"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.NotificationTemplates", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Agent") + .HasColumnType("integer"); + + b.Property("Enabled") + .HasColumnType("boolean"); + + b.Property("Message") + .HasColumnType("text"); + + b.Property("NotificationType") + .HasColumnType("integer"); + + b.Property("Subject") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("NotificationTemplates"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.NotificationUserId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AddedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("PlayerId") + .HasColumnType("text"); + + b.Property("UserId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("NotificationUserId"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.OmbiUser", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("AccessFailedCount") + .HasColumnType("integer"); + + b.Property("Alias") + .HasColumnType("text"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("text"); + + b.Property("Email") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("EmailConfirmed") + .HasColumnType("boolean"); + + b.Property("EpisodeRequestLimit") + .HasColumnType("integer"); + + b.Property("EpisodeRequestLimitType") + .HasColumnType("integer"); + + b.Property("Language") + .HasColumnType("text"); + + b.Property("LastLoggedIn") + .HasColumnType("timestamp with time zone"); + + b.Property("LockoutEnabled") + .HasColumnType("boolean"); + + b.Property("LockoutEnd") + .HasColumnType("timestamp with time zone"); + + b.Property("MediaServerToken") + .HasColumnType("text"); + + b.Property("MovieRequestLimit") + .HasColumnType("integer"); + + b.Property("MovieRequestLimitType") + .HasColumnType("integer"); + + b.Property("MusicRequestLimit") + .HasColumnType("integer"); + + b.Property("MusicRequestLimitType") + .HasColumnType("integer"); + + b.Property("NormalizedEmail") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("NormalizedUserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("PasswordHash") + .HasColumnType("text"); + + b.Property("PhoneNumber") + .HasColumnType("text"); + + b.Property("PhoneNumberConfirmed") + .HasColumnType("boolean"); + + b.Property("ProviderUserId") + .HasColumnType("text"); + + b.Property("SecurityStamp") + .HasColumnType("text"); + + b.Property("StreamingCountry") + .IsRequired() + .HasColumnType("text"); + + b.Property("TwoFactorEnabled") + .HasColumnType("boolean"); + + b.Property("UserAccessToken") + .HasColumnType("text"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("UserType") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEmail") + .HasDatabaseName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasDatabaseName("UserNameIndex"); + + b.ToTable("AspNetUsers", (string)null); + }); + + modelBuilder.Entity("Ombi.Store.Entities.PlexWatchlistUserError", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("MediaServerToken") + .HasColumnType("text"); + + b.Property("UserId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("PlexWatchlistUserError"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.RecentlyAddedLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AddedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("AlbumId") + .HasColumnType("text"); + + b.Property("ContentId") + .HasColumnType("integer"); + + b.Property("ContentType") + .HasColumnType("integer"); + + b.Property("EpisodeNumber") + .HasColumnType("integer"); + + b.Property("SeasonNumber") + .HasColumnType("integer"); + + b.Property("Type") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("RecentlyAddedLog"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.RequestQueue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Completed") + .HasColumnType("timestamp with time zone"); + + b.Property("Dts") + .HasColumnType("timestamp with time zone"); + + b.Property("Error") + .HasColumnType("text"); + + b.Property("RequestId") + .HasColumnType("integer"); + + b.Property("RetryCount") + .HasColumnType("integer"); + + b.Property("Type") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("RequestQueue"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Requests.AlbumRequest", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Approved") + .HasColumnType("boolean"); + + b.Property("ArtistName") + .HasColumnType("text"); + + b.Property("Available") + .HasColumnType("boolean"); + + b.Property("Cover") + .HasColumnType("text"); + + b.Property("Denied") + .HasColumnType("boolean"); + + b.Property("DeniedReason") + .HasColumnType("text"); + + b.Property("Disk") + .HasColumnType("text"); + + b.Property("ForeignAlbumId") + .HasColumnType("text"); + + b.Property("ForeignArtistId") + .HasColumnType("text"); + + b.Property("MarkedAsApproved") + .HasColumnType("timestamp with time zone"); + + b.Property("MarkedAsAvailable") + .HasColumnType("timestamp with time zone"); + + b.Property("MarkedAsDenied") + .HasColumnType("timestamp with time zone"); + + b.Property("Rating") + .HasColumnType("numeric"); + + b.Property("ReleaseDate") + .HasColumnType("timestamp with time zone"); + + b.Property("RequestType") + .HasColumnType("integer"); + + b.Property("RequestedByAlias") + .HasColumnType("text"); + + b.Property("RequestedDate") + .HasColumnType("timestamp with time zone"); + + b.Property("RequestedUserId") + .HasColumnType("text"); + + b.Property("Source") + .HasColumnType("integer"); + + b.Property("Title") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("RequestedUserId"); + + b.ToTable("AlbumRequests"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Requests.ChildRequests", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Approved") + .HasColumnType("boolean"); + + b.Property("Available") + .HasColumnType("boolean"); + + b.Property("Denied") + .HasColumnType("boolean"); + + b.Property("DeniedReason") + .HasColumnType("text"); + + b.Property("IssueId") + .HasColumnType("integer"); + + b.Property("MarkedAsApproved") + .HasColumnType("timestamp with time zone"); + + b.Property("MarkedAsAvailable") + .HasColumnType("timestamp with time zone"); + + b.Property("MarkedAsDenied") + .HasColumnType("timestamp with time zone"); + + b.Property("ParentRequestId") + .HasColumnType("integer"); + + b.Property("RequestType") + .HasColumnType("integer"); + + b.Property("RequestedByAlias") + .HasColumnType("text"); + + b.Property("RequestedDate") + .HasColumnType("timestamp with time zone"); + + b.Property("RequestedUserId") + .HasColumnType("text"); + + b.Property("SeriesType") + .HasColumnType("integer"); + + b.Property("Source") + .HasColumnType("integer"); + + b.Property("Title") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("ParentRequestId"); + + b.HasIndex("RequestedUserId"); + + b.ToTable("ChildRequests"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Requests.IssueCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Value") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("IssueCategory"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Requests.IssueComments", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Comment") + .HasColumnType("text"); + + b.Property("Date") + .HasColumnType("timestamp with time zone"); + + b.Property("IssuesId") + .HasColumnType("integer"); + + b.Property("UserId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("IssuesId"); + + b.HasIndex("UserId"); + + b.ToTable("IssueComments"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Requests.Issues", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("IssueCategoryId") + .HasColumnType("integer"); + + b.Property("IssueId") + .HasColumnType("integer"); + + b.Property("ProviderId") + .HasColumnType("text"); + + b.Property("RequestId") + .HasColumnType("integer"); + + b.Property("RequestType") + .HasColumnType("integer"); + + b.Property("ResovledDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Status") + .HasColumnType("integer"); + + b.Property("Subject") + .HasColumnType("text"); + + b.Property("Title") + .HasColumnType("text"); + + b.Property("UserReportedId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("IssueCategoryId"); + + b.HasIndex("IssueId"); + + b.HasIndex("UserReportedId"); + + b.ToTable("Issues"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Requests.MovieRequests", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Approved") + .HasColumnType("boolean"); + + b.Property("Approved4K") + .HasColumnType("boolean"); + + b.Property("Available") + .HasColumnType("boolean"); + + b.Property("Available4K") + .HasColumnType("boolean"); + + b.Property("Background") + .HasColumnType("text"); + + b.Property("Denied") + .HasColumnType("boolean"); + + b.Property("Denied4K") + .HasColumnType("boolean"); + + b.Property("DeniedReason") + .HasColumnType("text"); + + b.Property("DeniedReason4K") + .HasColumnType("text"); + + b.Property("DigitalReleaseDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Has4KRequest") + .HasColumnType("boolean"); + + b.Property("ImdbId") + .HasColumnType("text"); + + b.Property("IssueId") + .HasColumnType("integer"); + + b.Property("LangCode") + .HasColumnType("text"); + + b.Property("MarkedAsApproved") + .HasColumnType("timestamp with time zone"); + + b.Property("MarkedAsApproved4K") + .HasColumnType("timestamp with time zone"); + + b.Property("MarkedAsAvailable") + .HasColumnType("timestamp with time zone"); + + b.Property("MarkedAsAvailable4K") + .HasColumnType("timestamp with time zone"); + + b.Property("MarkedAsDenied") + .HasColumnType("timestamp with time zone"); + + b.Property("MarkedAsDenied4K") + .HasColumnType("timestamp with time zone"); + + b.Property("Overview") + .HasColumnType("text"); + + b.Property("PosterPath") + .HasColumnType("text"); + + b.Property("QualityOverride") + .HasColumnType("integer"); + + b.Property("ReleaseDate") + .HasColumnType("timestamp with time zone"); + + b.Property("RequestType") + .HasColumnType("integer"); + + b.Property("RequestedByAlias") + .HasColumnType("text"); + + b.Property("RequestedDate") + .HasColumnType("timestamp with time zone"); + + b.Property("RequestedDate4k") + .HasColumnType("timestamp with time zone"); + + b.Property("RequestedUserId") + .HasColumnType("text"); + + b.Property("RootPathOverride") + .HasColumnType("integer"); + + b.Property("Source") + .HasColumnType("integer"); + + b.Property("Status") + .HasColumnType("text"); + + b.Property("TheMovieDbId") + .HasColumnType("integer"); + + b.Property("Title") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("RequestedUserId"); + + b.ToTable("MovieRequests"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Requests.RequestLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("EpisodeCount") + .HasColumnType("integer"); + + b.Property("RequestDate") + .HasColumnType("timestamp with time zone"); + + b.Property("RequestId") + .HasColumnType("integer"); + + b.Property("RequestType") + .HasColumnType("integer"); + + b.Property("UserId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("RequestLog"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Requests.TvRequests", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Background") + .HasColumnType("text"); + + b.Property("ExternalProviderId") + .HasColumnType("integer"); + + b.Property("ImdbId") + .HasColumnType("text"); + + b.Property("LanguageProfile") + .HasColumnType("integer"); + + b.Property("Overview") + .HasColumnType("text"); + + b.Property("PosterPath") + .HasColumnType("text"); + + b.Property("QualityOverride") + .HasColumnType("integer"); + + b.Property("ReleaseDate") + .HasColumnType("timestamp with time zone"); + + b.Property("RootFolder") + .HasColumnType("integer"); + + b.Property("Status") + .HasColumnType("text"); + + b.Property("Title") + .HasColumnType("text"); + + b.Property("TotalSeasons") + .HasColumnType("integer"); + + b.Property("TvDbId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("TvRequests"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.RequestSubscription", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("RequestId") + .HasColumnType("integer"); + + b.Property("RequestType") + .HasColumnType("integer"); + + b.Property("UserId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("RequestSubscription"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Tokens", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Token") + .HasColumnType("text"); + + b.Property("UserId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("Tokens"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.UserNotificationPreferences", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Agent") + .HasColumnType("integer"); + + b.Property("Enabled") + .HasColumnType("boolean"); + + b.Property("UserId") + .HasColumnType("text"); + + b.Property("Value") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("UserNotificationPreferences"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.UserQualityProfiles", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Radarr4KQualityProfile") + .HasColumnType("integer"); + + b.Property("Radarr4KRootPath") + .HasColumnType("integer"); + + b.Property("RadarrQualityProfile") + .HasColumnType("integer"); + + b.Property("RadarrRootPath") + .HasColumnType("integer"); + + b.Property("SonarrQualityProfile") + .HasColumnType("integer"); + + b.Property("SonarrQualityProfileAnime") + .HasColumnType("integer"); + + b.Property("SonarrRootPath") + .HasColumnType("integer"); + + b.Property("SonarrRootPathAnime") + .HasColumnType("integer"); + + b.Property("UserId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("UserQualityProfiles"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Votes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Date") + .HasColumnType("timestamp with time zone"); + + b.Property("Deleted") + .HasColumnType("boolean"); + + b.Property("RequestId") + .HasColumnType("integer"); + + b.Property("RequestType") + .HasColumnType("integer"); + + b.Property("UserId") + .HasColumnType("text"); + + b.Property("VoteType") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("Votes"); + }); + + modelBuilder.Entity("Ombi.Store.Repository.Requests.EpisodeRequests", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AirDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Approved") + .HasColumnType("boolean"); + + b.Property("Available") + .HasColumnType("boolean"); + + b.Property("EpisodeNumber") + .HasColumnType("integer"); + + b.Property("Requested") + .HasColumnType("boolean"); + + b.Property("SeasonId") + .HasColumnType("integer"); + + b.Property("Title") + .HasColumnType("text"); + + b.Property("Url") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("SeasonId"); + + b.ToTable("EpisodeRequests"); + }); + + modelBuilder.Entity("Ombi.Store.Repository.Requests.SeasonRequests", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChildRequestId") + .HasColumnType("integer"); + + b.Property("Overview") + .HasColumnType("text"); + + b.Property("SeasonNumber") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("ChildRequestId"); + + b.ToTable("SeasonRequests"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.HasOne("Ombi.Store.Entities.OmbiUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("Ombi.Store.Entities.OmbiUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Ombi.Store.Entities.OmbiUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.HasOne("Ombi.Store.Entities.OmbiUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Ombi.Store.Entities.MobileDevices", b => + { + b.HasOne("Ombi.Store.Entities.OmbiUser", "User") + .WithMany() + .HasForeignKey("UserId"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.NotificationUserId", b => + { + b.HasOne("Ombi.Store.Entities.OmbiUser", "User") + .WithMany("NotificationUserIds") + .HasForeignKey("UserId"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Requests.AlbumRequest", b => + { + b.HasOne("Ombi.Store.Entities.OmbiUser", "RequestedUser") + .WithMany() + .HasForeignKey("RequestedUserId"); + + b.Navigation("RequestedUser"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Requests.ChildRequests", b => + { + b.HasOne("Ombi.Store.Entities.Requests.TvRequests", "ParentRequest") + .WithMany("ChildRequests") + .HasForeignKey("ParentRequestId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Ombi.Store.Entities.OmbiUser", "RequestedUser") + .WithMany() + .HasForeignKey("RequestedUserId"); + + b.Navigation("ParentRequest"); + + b.Navigation("RequestedUser"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Requests.IssueComments", b => + { + b.HasOne("Ombi.Store.Entities.Requests.Issues", "Issues") + .WithMany("Comments") + .HasForeignKey("IssuesId"); + + b.HasOne("Ombi.Store.Entities.OmbiUser", "User") + .WithMany() + .HasForeignKey("UserId"); + + b.Navigation("Issues"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Requests.Issues", b => + { + b.HasOne("Ombi.Store.Entities.Requests.IssueCategory", "IssueCategory") + .WithMany() + .HasForeignKey("IssueCategoryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Ombi.Store.Entities.Requests.ChildRequests", null) + .WithMany("Issues") + .HasForeignKey("IssueId"); + + b.HasOne("Ombi.Store.Entities.Requests.MovieRequests", null) + .WithMany("Issues") + .HasForeignKey("IssueId"); + + b.HasOne("Ombi.Store.Entities.OmbiUser", "UserReported") + .WithMany() + .HasForeignKey("UserReportedId"); + + b.Navigation("IssueCategory"); + + b.Navigation("UserReported"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Requests.MovieRequests", b => + { + b.HasOne("Ombi.Store.Entities.OmbiUser", "RequestedUser") + .WithMany() + .HasForeignKey("RequestedUserId"); + + b.Navigation("RequestedUser"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Requests.RequestLog", b => + { + b.HasOne("Ombi.Store.Entities.OmbiUser", "User") + .WithMany() + .HasForeignKey("UserId"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.RequestSubscription", b => + { + b.HasOne("Ombi.Store.Entities.OmbiUser", "User") + .WithMany() + .HasForeignKey("UserId"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Tokens", b => + { + b.HasOne("Ombi.Store.Entities.OmbiUser", "User") + .WithMany() + .HasForeignKey("UserId"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.UserNotificationPreferences", b => + { + b.HasOne("Ombi.Store.Entities.OmbiUser", "User") + .WithMany("UserNotificationPreferences") + .HasForeignKey("UserId"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.UserQualityProfiles", b => + { + b.HasOne("Ombi.Store.Entities.OmbiUser", "User") + .WithMany() + .HasForeignKey("UserId"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Votes", b => + { + b.HasOne("Ombi.Store.Entities.OmbiUser", "User") + .WithMany() + .HasForeignKey("UserId"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Ombi.Store.Repository.Requests.EpisodeRequests", b => + { + b.HasOne("Ombi.Store.Repository.Requests.SeasonRequests", "Season") + .WithMany("Episodes") + .HasForeignKey("SeasonId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Season"); + }); + + modelBuilder.Entity("Ombi.Store.Repository.Requests.SeasonRequests", b => + { + b.HasOne("Ombi.Store.Entities.Requests.ChildRequests", "ChildRequest") + .WithMany("SeasonRequests") + .HasForeignKey("ChildRequestId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ChildRequest"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.OmbiUser", b => + { + b.Navigation("NotificationUserIds"); + + b.Navigation("UserNotificationPreferences"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Requests.ChildRequests", b => + { + b.Navigation("Issues"); + + b.Navigation("SeasonRequests"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Requests.Issues", b => + { + b.Navigation("Comments"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Requests.MovieRequests", b => + { + b.Navigation("Issues"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Requests.TvRequests", b => + { + b.Navigation("ChildRequests"); + }); + + modelBuilder.Entity("Ombi.Store.Repository.Requests.SeasonRequests", b => + { + b.Navigation("Episodes"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/Ombi.Store/Migrations/OmbiPostgres/20231212135239_Initial.cs b/src/Ombi.Store/Migrations/OmbiPostgres/20231212135239_Initial.cs new file mode 100644 index 0000000000..1aecd8d1dd --- /dev/null +++ b/src/Ombi.Store/Migrations/OmbiPostgres/20231212135239_Initial.cs @@ -0,0 +1,934 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace Ombi.Store.Migrations.OmbiPostgres +{ + public partial class Initial : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "AspNetRoles", + columns: table => new + { + Id = table.Column(type: "text", nullable: false), + Name = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + NormalizedName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + ConcurrencyStamp = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AspNetRoles", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AspNetUsers", + columns: table => new + { + Id = table.Column(type: "text", nullable: false), + Alias = table.Column(type: "text", nullable: true), + UserType = table.Column(type: "integer", nullable: false), + ProviderUserId = table.Column(type: "text", nullable: true), + LastLoggedIn = table.Column(type: "timestamp with time zone", nullable: true), + Language = table.Column(type: "text", nullable: true), + StreamingCountry = table.Column(type: "text", nullable: false), + MovieRequestLimit = table.Column(type: "integer", nullable: true), + EpisodeRequestLimit = table.Column(type: "integer", nullable: true), + MusicRequestLimit = table.Column(type: "integer", nullable: true), + MovieRequestLimitType = table.Column(type: "integer", nullable: true), + EpisodeRequestLimitType = table.Column(type: "integer", nullable: true), + MusicRequestLimitType = table.Column(type: "integer", nullable: true), + UserAccessToken = table.Column(type: "text", nullable: true), + MediaServerToken = table.Column(type: "text", nullable: true), + PasswordHash = table.Column(type: "text", nullable: true), + SecurityStamp = table.Column(type: "text", nullable: true), + ConcurrencyStamp = table.Column(type: "text", nullable: true), + UserName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + NormalizedUserName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + Email = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + NormalizedEmail = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + EmailConfirmed = table.Column(type: "boolean", nullable: false), + PhoneNumber = table.Column(type: "text", nullable: true), + PhoneNumberConfirmed = table.Column(type: "boolean", nullable: false), + TwoFactorEnabled = table.Column(type: "boolean", nullable: false), + LockoutEnd = table.Column(type: "timestamp with time zone", nullable: true), + LockoutEnabled = table.Column(type: "boolean", nullable: false), + AccessFailedCount = table.Column(type: "integer", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AspNetUsers", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Audit", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + DateTime = table.Column(type: "timestamp with time zone", nullable: false), + Description = table.Column(type: "text", nullable: true), + AuditType = table.Column(type: "integer", nullable: false), + AuditArea = table.Column(type: "integer", nullable: false), + User = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Audit", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "IssueCategory", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Value = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_IssueCategory", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "NotificationTemplates", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + NotificationType = table.Column(type: "integer", nullable: false), + Agent = table.Column(type: "integer", nullable: false), + Subject = table.Column(type: "text", nullable: true), + Message = table.Column(type: "text", nullable: true), + Enabled = table.Column(type: "boolean", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_NotificationTemplates", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "PlexWatchlistUserError", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + UserId = table.Column(type: "text", nullable: true), + MediaServerToken = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_PlexWatchlistUserError", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "RecentlyAddedLog", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Type = table.Column(type: "integer", nullable: false), + ContentType = table.Column(type: "integer", nullable: false), + ContentId = table.Column(type: "integer", nullable: false), + EpisodeNumber = table.Column(type: "integer", nullable: true), + SeasonNumber = table.Column(type: "integer", nullable: true), + AlbumId = table.Column(type: "text", nullable: true), + AddedAt = table.Column(type: "timestamp with time zone", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_RecentlyAddedLog", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "RequestQueue", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + RequestId = table.Column(type: "integer", nullable: false), + Type = table.Column(type: "integer", nullable: false), + Dts = table.Column(type: "timestamp with time zone", nullable: false), + Error = table.Column(type: "text", nullable: true), + Completed = table.Column(type: "timestamp with time zone", nullable: true), + RetryCount = table.Column(type: "integer", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_RequestQueue", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "TvRequests", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + TvDbId = table.Column(type: "integer", nullable: false), + ExternalProviderId = table.Column(type: "integer", nullable: false), + ImdbId = table.Column(type: "text", nullable: true), + QualityOverride = table.Column(type: "integer", nullable: true), + RootFolder = table.Column(type: "integer", nullable: true), + LanguageProfile = table.Column(type: "integer", nullable: true), + Overview = table.Column(type: "text", nullable: true), + Title = table.Column(type: "text", nullable: true), + PosterPath = table.Column(type: "text", nullable: true), + Background = table.Column(type: "text", nullable: true), + ReleaseDate = table.Column(type: "timestamp with time zone", nullable: false), + Status = table.Column(type: "text", nullable: true), + TotalSeasons = table.Column(type: "integer", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_TvRequests", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AspNetRoleClaims", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + RoleId = table.Column(type: "text", nullable: false), + ClaimType = table.Column(type: "text", nullable: true), + ClaimValue = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AspNetRoleClaims", x => x.Id); + table.ForeignKey( + name: "FK_AspNetRoleClaims_AspNetRoles_RoleId", + column: x => x.RoleId, + principalTable: "AspNetRoles", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AlbumRequests", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + ForeignAlbumId = table.Column(type: "text", nullable: true), + ForeignArtistId = table.Column(type: "text", nullable: true), + Disk = table.Column(type: "text", nullable: true), + Cover = table.Column(type: "text", nullable: true), + Rating = table.Column(type: "numeric", nullable: false), + ReleaseDate = table.Column(type: "timestamp with time zone", nullable: false), + ArtistName = table.Column(type: "text", nullable: true), + Title = table.Column(type: "text", nullable: true), + Approved = table.Column(type: "boolean", nullable: false), + MarkedAsApproved = table.Column(type: "timestamp with time zone", nullable: false), + RequestedDate = table.Column(type: "timestamp with time zone", nullable: false), + Available = table.Column(type: "boolean", nullable: false), + MarkedAsAvailable = table.Column(type: "timestamp with time zone", nullable: true), + RequestedUserId = table.Column(type: "text", nullable: true), + Denied = table.Column(type: "boolean", nullable: true), + MarkedAsDenied = table.Column(type: "timestamp with time zone", nullable: false), + DeniedReason = table.Column(type: "text", nullable: true), + RequestType = table.Column(type: "integer", nullable: false), + RequestedByAlias = table.Column(type: "text", nullable: true), + Source = table.Column(type: "integer", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AlbumRequests", x => x.Id); + table.ForeignKey( + name: "FK_AlbumRequests_AspNetUsers_RequestedUserId", + column: x => x.RequestedUserId, + principalTable: "AspNetUsers", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "AspNetUserClaims", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + UserId = table.Column(type: "text", nullable: false), + ClaimType = table.Column(type: "text", nullable: true), + ClaimValue = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AspNetUserClaims", x => x.Id); + table.ForeignKey( + name: "FK_AspNetUserClaims_AspNetUsers_UserId", + column: x => x.UserId, + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AspNetUserLogins", + columns: table => new + { + LoginProvider = table.Column(type: "text", nullable: false), + ProviderKey = table.Column(type: "text", nullable: false), + ProviderDisplayName = table.Column(type: "text", nullable: true), + UserId = table.Column(type: "text", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AspNetUserLogins", x => new { x.LoginProvider, x.ProviderKey }); + table.ForeignKey( + name: "FK_AspNetUserLogins_AspNetUsers_UserId", + column: x => x.UserId, + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AspNetUserRoles", + columns: table => new + { + UserId = table.Column(type: "text", nullable: false), + RoleId = table.Column(type: "text", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AspNetUserRoles", x => new { x.UserId, x.RoleId }); + table.ForeignKey( + name: "FK_AspNetUserRoles_AspNetRoles_RoleId", + column: x => x.RoleId, + principalTable: "AspNetRoles", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_AspNetUserRoles_AspNetUsers_UserId", + column: x => x.UserId, + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AspNetUserTokens", + columns: table => new + { + UserId = table.Column(type: "text", nullable: false), + LoginProvider = table.Column(type: "text", nullable: false), + Name = table.Column(type: "text", nullable: false), + Value = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AspNetUserTokens", x => new { x.UserId, x.LoginProvider, x.Name }); + table.ForeignKey( + name: "FK_AspNetUserTokens_AspNetUsers_UserId", + column: x => x.UserId, + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "MobileDevices", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Token = table.Column(type: "text", nullable: true), + UserId = table.Column(type: "text", nullable: true), + AddedAt = table.Column(type: "timestamp with time zone", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_MobileDevices", x => x.Id); + table.ForeignKey( + name: "FK_MobileDevices_AspNetUsers_UserId", + column: x => x.UserId, + principalTable: "AspNetUsers", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "MovieRequests", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + TheMovieDbId = table.Column(type: "integer", nullable: false), + IssueId = table.Column(type: "integer", nullable: true), + RootPathOverride = table.Column(type: "integer", nullable: false), + QualityOverride = table.Column(type: "integer", nullable: false), + Has4KRequest = table.Column(type: "boolean", nullable: false), + Approved4K = table.Column(type: "boolean", nullable: false), + MarkedAsApproved4K = table.Column(type: "timestamp with time zone", nullable: false), + RequestedDate4k = table.Column(type: "timestamp with time zone", nullable: false), + Available4K = table.Column(type: "boolean", nullable: false), + MarkedAsAvailable4K = table.Column(type: "timestamp with time zone", nullable: true), + Denied4K = table.Column(type: "boolean", nullable: true), + MarkedAsDenied4K = table.Column(type: "timestamp with time zone", nullable: false), + DeniedReason4K = table.Column(type: "text", nullable: true), + LangCode = table.Column(type: "text", nullable: true), + Title = table.Column(type: "text", nullable: true), + Approved = table.Column(type: "boolean", nullable: false), + MarkedAsApproved = table.Column(type: "timestamp with time zone", nullable: false), + RequestedDate = table.Column(type: "timestamp with time zone", nullable: false), + Available = table.Column(type: "boolean", nullable: false), + MarkedAsAvailable = table.Column(type: "timestamp with time zone", nullable: true), + RequestedUserId = table.Column(type: "text", nullable: true), + Denied = table.Column(type: "boolean", nullable: true), + MarkedAsDenied = table.Column(type: "timestamp with time zone", nullable: false), + DeniedReason = table.Column(type: "text", nullable: true), + RequestType = table.Column(type: "integer", nullable: false), + RequestedByAlias = table.Column(type: "text", nullable: true), + Source = table.Column(type: "integer", nullable: false), + ImdbId = table.Column(type: "text", nullable: true), + Overview = table.Column(type: "text", nullable: true), + PosterPath = table.Column(type: "text", nullable: true), + ReleaseDate = table.Column(type: "timestamp with time zone", nullable: false), + DigitalReleaseDate = table.Column(type: "timestamp with time zone", nullable: true), + Status = table.Column(type: "text", nullable: true), + Background = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_MovieRequests", x => x.Id); + table.ForeignKey( + name: "FK_MovieRequests_AspNetUsers_RequestedUserId", + column: x => x.RequestedUserId, + principalTable: "AspNetUsers", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "NotificationUserId", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + PlayerId = table.Column(type: "text", nullable: true), + UserId = table.Column(type: "text", nullable: true), + AddedAt = table.Column(type: "timestamp with time zone", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_NotificationUserId", x => x.Id); + table.ForeignKey( + name: "FK_NotificationUserId_AspNetUsers_UserId", + column: x => x.UserId, + principalTable: "AspNetUsers", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "RequestLog", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + UserId = table.Column(type: "text", nullable: true), + RequestType = table.Column(type: "integer", nullable: false), + RequestDate = table.Column(type: "timestamp with time zone", nullable: false), + RequestId = table.Column(type: "integer", nullable: false), + EpisodeCount = table.Column(type: "integer", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_RequestLog", x => x.Id); + table.ForeignKey( + name: "FK_RequestLog_AspNetUsers_UserId", + column: x => x.UserId, + principalTable: "AspNetUsers", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "RequestSubscription", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + UserId = table.Column(type: "text", nullable: true), + RequestId = table.Column(type: "integer", nullable: false), + RequestType = table.Column(type: "integer", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_RequestSubscription", x => x.Id); + table.ForeignKey( + name: "FK_RequestSubscription_AspNetUsers_UserId", + column: x => x.UserId, + principalTable: "AspNetUsers", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "Tokens", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Token = table.Column(type: "text", nullable: true), + UserId = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Tokens", x => x.Id); + table.ForeignKey( + name: "FK_Tokens_AspNetUsers_UserId", + column: x => x.UserId, + principalTable: "AspNetUsers", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "UserNotificationPreferences", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + UserId = table.Column(type: "text", nullable: true), + Agent = table.Column(type: "integer", nullable: false), + Enabled = table.Column(type: "boolean", nullable: false), + Value = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_UserNotificationPreferences", x => x.Id); + table.ForeignKey( + name: "FK_UserNotificationPreferences_AspNetUsers_UserId", + column: x => x.UserId, + principalTable: "AspNetUsers", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "UserQualityProfiles", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + UserId = table.Column(type: "text", nullable: true), + SonarrQualityProfileAnime = table.Column(type: "integer", nullable: false), + SonarrRootPathAnime = table.Column(type: "integer", nullable: false), + SonarrRootPath = table.Column(type: "integer", nullable: false), + SonarrQualityProfile = table.Column(type: "integer", nullable: false), + RadarrRootPath = table.Column(type: "integer", nullable: false), + RadarrQualityProfile = table.Column(type: "integer", nullable: false), + Radarr4KRootPath = table.Column(type: "integer", nullable: false), + Radarr4KQualityProfile = table.Column(type: "integer", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_UserQualityProfiles", x => x.Id); + table.ForeignKey( + name: "FK_UserQualityProfiles_AspNetUsers_UserId", + column: x => x.UserId, + principalTable: "AspNetUsers", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "Votes", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + RequestId = table.Column(type: "integer", nullable: false), + VoteType = table.Column(type: "integer", nullable: false), + RequestType = table.Column(type: "integer", nullable: false), + UserId = table.Column(type: "text", nullable: true), + Date = table.Column(type: "timestamp with time zone", nullable: false), + Deleted = table.Column(type: "boolean", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Votes", x => x.Id); + table.ForeignKey( + name: "FK_Votes_AspNetUsers_UserId", + column: x => x.UserId, + principalTable: "AspNetUsers", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "ChildRequests", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + ParentRequestId = table.Column(type: "integer", nullable: false), + IssueId = table.Column(type: "integer", nullable: true), + SeriesType = table.Column(type: "integer", nullable: false), + Title = table.Column(type: "text", nullable: true), + Approved = table.Column(type: "boolean", nullable: false), + MarkedAsApproved = table.Column(type: "timestamp with time zone", nullable: false), + RequestedDate = table.Column(type: "timestamp with time zone", nullable: false), + Available = table.Column(type: "boolean", nullable: false), + MarkedAsAvailable = table.Column(type: "timestamp with time zone", nullable: true), + RequestedUserId = table.Column(type: "text", nullable: true), + Denied = table.Column(type: "boolean", nullable: true), + MarkedAsDenied = table.Column(type: "timestamp with time zone", nullable: false), + DeniedReason = table.Column(type: "text", nullable: true), + RequestType = table.Column(type: "integer", nullable: false), + RequestedByAlias = table.Column(type: "text", nullable: true), + Source = table.Column(type: "integer", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_ChildRequests", x => x.Id); + table.ForeignKey( + name: "FK_ChildRequests_AspNetUsers_RequestedUserId", + column: x => x.RequestedUserId, + principalTable: "AspNetUsers", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_ChildRequests_TvRequests_ParentRequestId", + column: x => x.ParentRequestId, + principalTable: "TvRequests", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Issues", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Title = table.Column(type: "text", nullable: true), + RequestType = table.Column(type: "integer", nullable: false), + ProviderId = table.Column(type: "text", nullable: true), + RequestId = table.Column(type: "integer", nullable: true), + Subject = table.Column(type: "text", nullable: true), + Description = table.Column(type: "text", nullable: true), + IssueCategoryId = table.Column(type: "integer", nullable: false), + Status = table.Column(type: "integer", nullable: false), + ResovledDate = table.Column(type: "timestamp with time zone", nullable: true), + CreatedDate = table.Column(type: "timestamp with time zone", nullable: false), + UserReportedId = table.Column(type: "text", nullable: true), + IssueId = table.Column(type: "integer", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Issues", x => x.Id); + table.ForeignKey( + name: "FK_Issues_AspNetUsers_UserReportedId", + column: x => x.UserReportedId, + principalTable: "AspNetUsers", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_Issues_ChildRequests_IssueId", + column: x => x.IssueId, + principalTable: "ChildRequests", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_Issues_IssueCategory_IssueCategoryId", + column: x => x.IssueCategoryId, + principalTable: "IssueCategory", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_Issues_MovieRequests_IssueId", + column: x => x.IssueId, + principalTable: "MovieRequests", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "SeasonRequests", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + SeasonNumber = table.Column(type: "integer", nullable: false), + Overview = table.Column(type: "text", nullable: true), + ChildRequestId = table.Column(type: "integer", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_SeasonRequests", x => x.Id); + table.ForeignKey( + name: "FK_SeasonRequests_ChildRequests_ChildRequestId", + column: x => x.ChildRequestId, + principalTable: "ChildRequests", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IssueComments", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + UserId = table.Column(type: "text", nullable: true), + Comment = table.Column(type: "text", nullable: true), + IssuesId = table.Column(type: "integer", nullable: true), + Date = table.Column(type: "timestamp with time zone", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IssueComments", x => x.Id); + table.ForeignKey( + name: "FK_IssueComments_AspNetUsers_UserId", + column: x => x.UserId, + principalTable: "AspNetUsers", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_IssueComments_Issues_IssuesId", + column: x => x.IssuesId, + principalTable: "Issues", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "EpisodeRequests", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + EpisodeNumber = table.Column(type: "integer", nullable: false), + Title = table.Column(type: "text", nullable: true), + AirDate = table.Column(type: "timestamp with time zone", nullable: false), + Url = table.Column(type: "text", nullable: true), + Available = table.Column(type: "boolean", nullable: false), + Approved = table.Column(type: "boolean", nullable: false), + Requested = table.Column(type: "boolean", nullable: false), + SeasonId = table.Column(type: "integer", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_EpisodeRequests", x => x.Id); + table.ForeignKey( + name: "FK_EpisodeRequests_SeasonRequests_SeasonId", + column: x => x.SeasonId, + principalTable: "SeasonRequests", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateIndex( + name: "IX_AlbumRequests_RequestedUserId", + table: "AlbumRequests", + column: "RequestedUserId"); + + migrationBuilder.CreateIndex( + name: "IX_AspNetRoleClaims_RoleId", + table: "AspNetRoleClaims", + column: "RoleId"); + + migrationBuilder.CreateIndex( + name: "RoleNameIndex", + table: "AspNetRoles", + column: "NormalizedName", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AspNetUserClaims_UserId", + table: "AspNetUserClaims", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_AspNetUserLogins_UserId", + table: "AspNetUserLogins", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_AspNetUserRoles_RoleId", + table: "AspNetUserRoles", + column: "RoleId"); + + migrationBuilder.CreateIndex( + name: "EmailIndex", + table: "AspNetUsers", + column: "NormalizedEmail"); + + migrationBuilder.CreateIndex( + name: "UserNameIndex", + table: "AspNetUsers", + column: "NormalizedUserName", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_ChildRequests_ParentRequestId", + table: "ChildRequests", + column: "ParentRequestId"); + + migrationBuilder.CreateIndex( + name: "IX_ChildRequests_RequestedUserId", + table: "ChildRequests", + column: "RequestedUserId"); + + migrationBuilder.CreateIndex( + name: "IX_EpisodeRequests_SeasonId", + table: "EpisodeRequests", + column: "SeasonId"); + + migrationBuilder.CreateIndex( + name: "IX_IssueComments_IssuesId", + table: "IssueComments", + column: "IssuesId"); + + migrationBuilder.CreateIndex( + name: "IX_IssueComments_UserId", + table: "IssueComments", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_Issues_IssueCategoryId", + table: "Issues", + column: "IssueCategoryId"); + + migrationBuilder.CreateIndex( + name: "IX_Issues_IssueId", + table: "Issues", + column: "IssueId"); + + migrationBuilder.CreateIndex( + name: "IX_Issues_UserReportedId", + table: "Issues", + column: "UserReportedId"); + + migrationBuilder.CreateIndex( + name: "IX_MobileDevices_UserId", + table: "MobileDevices", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_MovieRequests_RequestedUserId", + table: "MovieRequests", + column: "RequestedUserId"); + + migrationBuilder.CreateIndex( + name: "IX_NotificationUserId_UserId", + table: "NotificationUserId", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_RequestLog_UserId", + table: "RequestLog", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_RequestSubscription_UserId", + table: "RequestSubscription", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_SeasonRequests_ChildRequestId", + table: "SeasonRequests", + column: "ChildRequestId"); + + migrationBuilder.CreateIndex( + name: "IX_Tokens_UserId", + table: "Tokens", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_UserNotificationPreferences_UserId", + table: "UserNotificationPreferences", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_UserQualityProfiles_UserId", + table: "UserQualityProfiles", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_Votes_UserId", + table: "Votes", + column: "UserId"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "AlbumRequests"); + + migrationBuilder.DropTable( + name: "AspNetRoleClaims"); + + migrationBuilder.DropTable( + name: "AspNetUserClaims"); + + migrationBuilder.DropTable( + name: "AspNetUserLogins"); + + migrationBuilder.DropTable( + name: "AspNetUserRoles"); + + migrationBuilder.DropTable( + name: "AspNetUserTokens"); + + migrationBuilder.DropTable( + name: "Audit"); + + migrationBuilder.DropTable( + name: "EpisodeRequests"); + + migrationBuilder.DropTable( + name: "IssueComments"); + + migrationBuilder.DropTable( + name: "MobileDevices"); + + migrationBuilder.DropTable( + name: "NotificationTemplates"); + + migrationBuilder.DropTable( + name: "NotificationUserId"); + + migrationBuilder.DropTable( + name: "PlexWatchlistUserError"); + + migrationBuilder.DropTable( + name: "RecentlyAddedLog"); + + migrationBuilder.DropTable( + name: "RequestLog"); + + migrationBuilder.DropTable( + name: "RequestQueue"); + + migrationBuilder.DropTable( + name: "RequestSubscription"); + + migrationBuilder.DropTable( + name: "Tokens"); + + migrationBuilder.DropTable( + name: "UserNotificationPreferences"); + + migrationBuilder.DropTable( + name: "UserQualityProfiles"); + + migrationBuilder.DropTable( + name: "Votes"); + + migrationBuilder.DropTable( + name: "AspNetRoles"); + + migrationBuilder.DropTable( + name: "SeasonRequests"); + + migrationBuilder.DropTable( + name: "Issues"); + + migrationBuilder.DropTable( + name: "ChildRequests"); + + migrationBuilder.DropTable( + name: "IssueCategory"); + + migrationBuilder.DropTable( + name: "MovieRequests"); + + migrationBuilder.DropTable( + name: "TvRequests"); + + migrationBuilder.DropTable( + name: "AspNetUsers"); + } + } +} diff --git a/src/Ombi.Store/Migrations/OmbiPostgres/OmbiPostgresContextModelSnapshot.cs b/src/Ombi.Store/Migrations/OmbiPostgres/OmbiPostgresContextModelSnapshot.cs new file mode 100644 index 0000000000..33148346e0 --- /dev/null +++ b/src/Ombi.Store/Migrations/OmbiPostgres/OmbiPostgresContextModelSnapshot.cs @@ -0,0 +1,1357 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using Ombi.Store.Context.Postgres; + +#nullable disable + +namespace Ombi.Store.Migrations.OmbiPostgres +{ + [DbContext(typeof(OmbiPostgresContext))] + partial class OmbiPostgresContextModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "6.0.22") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("text"); + + b.Property("Name") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("NormalizedName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasDatabaseName("RoleNameIndex"); + + b.ToTable("AspNetRoles", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ClaimType") + .HasColumnType("text"); + + b.Property("ClaimValue") + .HasColumnType("text"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetRoleClaims", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ClaimType") + .HasColumnType("text"); + + b.Property("ClaimValue") + .HasColumnType("text"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserClaims", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider") + .HasColumnType("text"); + + b.Property("ProviderKey") + .HasColumnType("text"); + + b.Property("ProviderDisplayName") + .HasColumnType("text"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserLogins", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("text"); + + b.Property("RoleId") + .HasColumnType("text"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetUserRoles", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("text"); + + b.Property("LoginProvider") + .HasColumnType("text"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("Value") + .HasColumnType("text"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AspNetUserTokens", (string)null); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Audit", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AuditArea") + .HasColumnType("integer"); + + b.Property("AuditType") + .HasColumnType("integer"); + + b.Property("DateTime") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("User") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Audit"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.MobileDevices", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AddedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Token") + .HasColumnType("text"); + + b.Property("UserId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("MobileDevices"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.NotificationTemplates", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Agent") + .HasColumnType("integer"); + + b.Property("Enabled") + .HasColumnType("boolean"); + + b.Property("Message") + .HasColumnType("text"); + + b.Property("NotificationType") + .HasColumnType("integer"); + + b.Property("Subject") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("NotificationTemplates"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.NotificationUserId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AddedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("PlayerId") + .HasColumnType("text"); + + b.Property("UserId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("NotificationUserId"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.OmbiUser", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("AccessFailedCount") + .HasColumnType("integer"); + + b.Property("Alias") + .HasColumnType("text"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("text"); + + b.Property("Email") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("EmailConfirmed") + .HasColumnType("boolean"); + + b.Property("EpisodeRequestLimit") + .HasColumnType("integer"); + + b.Property("EpisodeRequestLimitType") + .HasColumnType("integer"); + + b.Property("Language") + .HasColumnType("text"); + + b.Property("LastLoggedIn") + .HasColumnType("timestamp with time zone"); + + b.Property("LockoutEnabled") + .HasColumnType("boolean"); + + b.Property("LockoutEnd") + .HasColumnType("timestamp with time zone"); + + b.Property("MediaServerToken") + .HasColumnType("text"); + + b.Property("MovieRequestLimit") + .HasColumnType("integer"); + + b.Property("MovieRequestLimitType") + .HasColumnType("integer"); + + b.Property("MusicRequestLimit") + .HasColumnType("integer"); + + b.Property("MusicRequestLimitType") + .HasColumnType("integer"); + + b.Property("NormalizedEmail") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("NormalizedUserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("PasswordHash") + .HasColumnType("text"); + + b.Property("PhoneNumber") + .HasColumnType("text"); + + b.Property("PhoneNumberConfirmed") + .HasColumnType("boolean"); + + b.Property("ProviderUserId") + .HasColumnType("text"); + + b.Property("SecurityStamp") + .HasColumnType("text"); + + b.Property("StreamingCountry") + .IsRequired() + .HasColumnType("text"); + + b.Property("TwoFactorEnabled") + .HasColumnType("boolean"); + + b.Property("UserAccessToken") + .HasColumnType("text"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("UserType") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEmail") + .HasDatabaseName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasDatabaseName("UserNameIndex"); + + b.ToTable("AspNetUsers", (string)null); + }); + + modelBuilder.Entity("Ombi.Store.Entities.PlexWatchlistUserError", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("MediaServerToken") + .HasColumnType("text"); + + b.Property("UserId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("PlexWatchlistUserError"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.RecentlyAddedLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AddedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("AlbumId") + .HasColumnType("text"); + + b.Property("ContentId") + .HasColumnType("integer"); + + b.Property("ContentType") + .HasColumnType("integer"); + + b.Property("EpisodeNumber") + .HasColumnType("integer"); + + b.Property("SeasonNumber") + .HasColumnType("integer"); + + b.Property("Type") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("RecentlyAddedLog"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.RequestQueue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Completed") + .HasColumnType("timestamp with time zone"); + + b.Property("Dts") + .HasColumnType("timestamp with time zone"); + + b.Property("Error") + .HasColumnType("text"); + + b.Property("RequestId") + .HasColumnType("integer"); + + b.Property("RetryCount") + .HasColumnType("integer"); + + b.Property("Type") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("RequestQueue"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Requests.AlbumRequest", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Approved") + .HasColumnType("boolean"); + + b.Property("ArtistName") + .HasColumnType("text"); + + b.Property("Available") + .HasColumnType("boolean"); + + b.Property("Cover") + .HasColumnType("text"); + + b.Property("Denied") + .HasColumnType("boolean"); + + b.Property("DeniedReason") + .HasColumnType("text"); + + b.Property("Disk") + .HasColumnType("text"); + + b.Property("ForeignAlbumId") + .HasColumnType("text"); + + b.Property("ForeignArtistId") + .HasColumnType("text"); + + b.Property("MarkedAsApproved") + .HasColumnType("timestamp with time zone"); + + b.Property("MarkedAsAvailable") + .HasColumnType("timestamp with time zone"); + + b.Property("MarkedAsDenied") + .HasColumnType("timestamp with time zone"); + + b.Property("Rating") + .HasColumnType("numeric"); + + b.Property("ReleaseDate") + .HasColumnType("timestamp with time zone"); + + b.Property("RequestType") + .HasColumnType("integer"); + + b.Property("RequestedByAlias") + .HasColumnType("text"); + + b.Property("RequestedDate") + .HasColumnType("timestamp with time zone"); + + b.Property("RequestedUserId") + .HasColumnType("text"); + + b.Property("Source") + .HasColumnType("integer"); + + b.Property("Title") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("RequestedUserId"); + + b.ToTable("AlbumRequests"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Requests.ChildRequests", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Approved") + .HasColumnType("boolean"); + + b.Property("Available") + .HasColumnType("boolean"); + + b.Property("Denied") + .HasColumnType("boolean"); + + b.Property("DeniedReason") + .HasColumnType("text"); + + b.Property("IssueId") + .HasColumnType("integer"); + + b.Property("MarkedAsApproved") + .HasColumnType("timestamp with time zone"); + + b.Property("MarkedAsAvailable") + .HasColumnType("timestamp with time zone"); + + b.Property("MarkedAsDenied") + .HasColumnType("timestamp with time zone"); + + b.Property("ParentRequestId") + .HasColumnType("integer"); + + b.Property("RequestType") + .HasColumnType("integer"); + + b.Property("RequestedByAlias") + .HasColumnType("text"); + + b.Property("RequestedDate") + .HasColumnType("timestamp with time zone"); + + b.Property("RequestedUserId") + .HasColumnType("text"); + + b.Property("SeriesType") + .HasColumnType("integer"); + + b.Property("Source") + .HasColumnType("integer"); + + b.Property("Title") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("ParentRequestId"); + + b.HasIndex("RequestedUserId"); + + b.ToTable("ChildRequests"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Requests.IssueCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Value") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("IssueCategory"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Requests.IssueComments", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Comment") + .HasColumnType("text"); + + b.Property("Date") + .HasColumnType("timestamp with time zone"); + + b.Property("IssuesId") + .HasColumnType("integer"); + + b.Property("UserId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("IssuesId"); + + b.HasIndex("UserId"); + + b.ToTable("IssueComments"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Requests.Issues", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("IssueCategoryId") + .HasColumnType("integer"); + + b.Property("IssueId") + .HasColumnType("integer"); + + b.Property("ProviderId") + .HasColumnType("text"); + + b.Property("RequestId") + .HasColumnType("integer"); + + b.Property("RequestType") + .HasColumnType("integer"); + + b.Property("ResovledDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Status") + .HasColumnType("integer"); + + b.Property("Subject") + .HasColumnType("text"); + + b.Property("Title") + .HasColumnType("text"); + + b.Property("UserReportedId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("IssueCategoryId"); + + b.HasIndex("IssueId"); + + b.HasIndex("UserReportedId"); + + b.ToTable("Issues"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Requests.MovieRequests", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Approved") + .HasColumnType("boolean"); + + b.Property("Approved4K") + .HasColumnType("boolean"); + + b.Property("Available") + .HasColumnType("boolean"); + + b.Property("Available4K") + .HasColumnType("boolean"); + + b.Property("Background") + .HasColumnType("text"); + + b.Property("Denied") + .HasColumnType("boolean"); + + b.Property("Denied4K") + .HasColumnType("boolean"); + + b.Property("DeniedReason") + .HasColumnType("text"); + + b.Property("DeniedReason4K") + .HasColumnType("text"); + + b.Property("DigitalReleaseDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Has4KRequest") + .HasColumnType("boolean"); + + b.Property("ImdbId") + .HasColumnType("text"); + + b.Property("IssueId") + .HasColumnType("integer"); + + b.Property("LangCode") + .HasColumnType("text"); + + b.Property("MarkedAsApproved") + .HasColumnType("timestamp with time zone"); + + b.Property("MarkedAsApproved4K") + .HasColumnType("timestamp with time zone"); + + b.Property("MarkedAsAvailable") + .HasColumnType("timestamp with time zone"); + + b.Property("MarkedAsAvailable4K") + .HasColumnType("timestamp with time zone"); + + b.Property("MarkedAsDenied") + .HasColumnType("timestamp with time zone"); + + b.Property("MarkedAsDenied4K") + .HasColumnType("timestamp with time zone"); + + b.Property("Overview") + .HasColumnType("text"); + + b.Property("PosterPath") + .HasColumnType("text"); + + b.Property("QualityOverride") + .HasColumnType("integer"); + + b.Property("ReleaseDate") + .HasColumnType("timestamp with time zone"); + + b.Property("RequestType") + .HasColumnType("integer"); + + b.Property("RequestedByAlias") + .HasColumnType("text"); + + b.Property("RequestedDate") + .HasColumnType("timestamp with time zone"); + + b.Property("RequestedDate4k") + .HasColumnType("timestamp with time zone"); + + b.Property("RequestedUserId") + .HasColumnType("text"); + + b.Property("RootPathOverride") + .HasColumnType("integer"); + + b.Property("Source") + .HasColumnType("integer"); + + b.Property("Status") + .HasColumnType("text"); + + b.Property("TheMovieDbId") + .HasColumnType("integer"); + + b.Property("Title") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("RequestedUserId"); + + b.ToTable("MovieRequests"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Requests.RequestLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("EpisodeCount") + .HasColumnType("integer"); + + b.Property("RequestDate") + .HasColumnType("timestamp with time zone"); + + b.Property("RequestId") + .HasColumnType("integer"); + + b.Property("RequestType") + .HasColumnType("integer"); + + b.Property("UserId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("RequestLog"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Requests.TvRequests", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Background") + .HasColumnType("text"); + + b.Property("ExternalProviderId") + .HasColumnType("integer"); + + b.Property("ImdbId") + .HasColumnType("text"); + + b.Property("LanguageProfile") + .HasColumnType("integer"); + + b.Property("Overview") + .HasColumnType("text"); + + b.Property("PosterPath") + .HasColumnType("text"); + + b.Property("QualityOverride") + .HasColumnType("integer"); + + b.Property("ReleaseDate") + .HasColumnType("timestamp with time zone"); + + b.Property("RootFolder") + .HasColumnType("integer"); + + b.Property("Status") + .HasColumnType("text"); + + b.Property("Title") + .HasColumnType("text"); + + b.Property("TotalSeasons") + .HasColumnType("integer"); + + b.Property("TvDbId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("TvRequests"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.RequestSubscription", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("RequestId") + .HasColumnType("integer"); + + b.Property("RequestType") + .HasColumnType("integer"); + + b.Property("UserId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("RequestSubscription"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Tokens", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Token") + .HasColumnType("text"); + + b.Property("UserId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("Tokens"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.UserNotificationPreferences", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Agent") + .HasColumnType("integer"); + + b.Property("Enabled") + .HasColumnType("boolean"); + + b.Property("UserId") + .HasColumnType("text"); + + b.Property("Value") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("UserNotificationPreferences"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.UserQualityProfiles", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Radarr4KQualityProfile") + .HasColumnType("integer"); + + b.Property("Radarr4KRootPath") + .HasColumnType("integer"); + + b.Property("RadarrQualityProfile") + .HasColumnType("integer"); + + b.Property("RadarrRootPath") + .HasColumnType("integer"); + + b.Property("SonarrQualityProfile") + .HasColumnType("integer"); + + b.Property("SonarrQualityProfileAnime") + .HasColumnType("integer"); + + b.Property("SonarrRootPath") + .HasColumnType("integer"); + + b.Property("SonarrRootPathAnime") + .HasColumnType("integer"); + + b.Property("UserId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("UserQualityProfiles"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Votes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Date") + .HasColumnType("timestamp with time zone"); + + b.Property("Deleted") + .HasColumnType("boolean"); + + b.Property("RequestId") + .HasColumnType("integer"); + + b.Property("RequestType") + .HasColumnType("integer"); + + b.Property("UserId") + .HasColumnType("text"); + + b.Property("VoteType") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("Votes"); + }); + + modelBuilder.Entity("Ombi.Store.Repository.Requests.EpisodeRequests", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AirDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Approved") + .HasColumnType("boolean"); + + b.Property("Available") + .HasColumnType("boolean"); + + b.Property("EpisodeNumber") + .HasColumnType("integer"); + + b.Property("Requested") + .HasColumnType("boolean"); + + b.Property("SeasonId") + .HasColumnType("integer"); + + b.Property("Title") + .HasColumnType("text"); + + b.Property("Url") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("SeasonId"); + + b.ToTable("EpisodeRequests"); + }); + + modelBuilder.Entity("Ombi.Store.Repository.Requests.SeasonRequests", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChildRequestId") + .HasColumnType("integer"); + + b.Property("Overview") + .HasColumnType("text"); + + b.Property("SeasonNumber") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("ChildRequestId"); + + b.ToTable("SeasonRequests"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.HasOne("Ombi.Store.Entities.OmbiUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("Ombi.Store.Entities.OmbiUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Ombi.Store.Entities.OmbiUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.HasOne("Ombi.Store.Entities.OmbiUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Ombi.Store.Entities.MobileDevices", b => + { + b.HasOne("Ombi.Store.Entities.OmbiUser", "User") + .WithMany() + .HasForeignKey("UserId"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.NotificationUserId", b => + { + b.HasOne("Ombi.Store.Entities.OmbiUser", "User") + .WithMany("NotificationUserIds") + .HasForeignKey("UserId"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Requests.AlbumRequest", b => + { + b.HasOne("Ombi.Store.Entities.OmbiUser", "RequestedUser") + .WithMany() + .HasForeignKey("RequestedUserId"); + + b.Navigation("RequestedUser"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Requests.ChildRequests", b => + { + b.HasOne("Ombi.Store.Entities.Requests.TvRequests", "ParentRequest") + .WithMany("ChildRequests") + .HasForeignKey("ParentRequestId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Ombi.Store.Entities.OmbiUser", "RequestedUser") + .WithMany() + .HasForeignKey("RequestedUserId"); + + b.Navigation("ParentRequest"); + + b.Navigation("RequestedUser"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Requests.IssueComments", b => + { + b.HasOne("Ombi.Store.Entities.Requests.Issues", "Issues") + .WithMany("Comments") + .HasForeignKey("IssuesId"); + + b.HasOne("Ombi.Store.Entities.OmbiUser", "User") + .WithMany() + .HasForeignKey("UserId"); + + b.Navigation("Issues"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Requests.Issues", b => + { + b.HasOne("Ombi.Store.Entities.Requests.IssueCategory", "IssueCategory") + .WithMany() + .HasForeignKey("IssueCategoryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Ombi.Store.Entities.Requests.ChildRequests", null) + .WithMany("Issues") + .HasForeignKey("IssueId"); + + b.HasOne("Ombi.Store.Entities.Requests.MovieRequests", null) + .WithMany("Issues") + .HasForeignKey("IssueId"); + + b.HasOne("Ombi.Store.Entities.OmbiUser", "UserReported") + .WithMany() + .HasForeignKey("UserReportedId"); + + b.Navigation("IssueCategory"); + + b.Navigation("UserReported"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Requests.MovieRequests", b => + { + b.HasOne("Ombi.Store.Entities.OmbiUser", "RequestedUser") + .WithMany() + .HasForeignKey("RequestedUserId"); + + b.Navigation("RequestedUser"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Requests.RequestLog", b => + { + b.HasOne("Ombi.Store.Entities.OmbiUser", "User") + .WithMany() + .HasForeignKey("UserId"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.RequestSubscription", b => + { + b.HasOne("Ombi.Store.Entities.OmbiUser", "User") + .WithMany() + .HasForeignKey("UserId"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Tokens", b => + { + b.HasOne("Ombi.Store.Entities.OmbiUser", "User") + .WithMany() + .HasForeignKey("UserId"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.UserNotificationPreferences", b => + { + b.HasOne("Ombi.Store.Entities.OmbiUser", "User") + .WithMany("UserNotificationPreferences") + .HasForeignKey("UserId"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.UserQualityProfiles", b => + { + b.HasOne("Ombi.Store.Entities.OmbiUser", "User") + .WithMany() + .HasForeignKey("UserId"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Votes", b => + { + b.HasOne("Ombi.Store.Entities.OmbiUser", "User") + .WithMany() + .HasForeignKey("UserId"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Ombi.Store.Repository.Requests.EpisodeRequests", b => + { + b.HasOne("Ombi.Store.Repository.Requests.SeasonRequests", "Season") + .WithMany("Episodes") + .HasForeignKey("SeasonId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Season"); + }); + + modelBuilder.Entity("Ombi.Store.Repository.Requests.SeasonRequests", b => + { + b.HasOne("Ombi.Store.Entities.Requests.ChildRequests", "ChildRequest") + .WithMany("SeasonRequests") + .HasForeignKey("ChildRequestId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ChildRequest"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.OmbiUser", b => + { + b.Navigation("NotificationUserIds"); + + b.Navigation("UserNotificationPreferences"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Requests.ChildRequests", b => + { + b.Navigation("Issues"); + + b.Navigation("SeasonRequests"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Requests.Issues", b => + { + b.Navigation("Comments"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Requests.MovieRequests", b => + { + b.Navigation("Issues"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Requests.TvRequests", b => + { + b.Navigation("ChildRequests"); + }); + + modelBuilder.Entity("Ombi.Store.Repository.Requests.SeasonRequests", b => + { + b.Navigation("Episodes"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/Ombi.Store/Migrations/SettingsPostgres/20231212135625_Initial.Designer.cs b/src/Ombi.Store/Migrations/SettingsPostgres/20231212135625_Initial.Designer.cs new file mode 100644 index 0000000000..2b84ced9b3 --- /dev/null +++ b/src/Ombi.Store/Migrations/SettingsPostgres/20231212135625_Initial.Designer.cs @@ -0,0 +1,66 @@ +// +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using Ombi.Store.Context.Postgres; + +#nullable disable + +namespace Ombi.Store.Migrations.SettingsPostgres +{ + [DbContext(typeof(SettingsPostgresContext))] + [Migration("20231212135625_Initial")] + partial class Initial + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "6.0.22") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("Ombi.Store.Entities.ApplicationConfiguration", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Type") + .HasColumnType("integer"); + + b.Property("Value") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("ApplicationConfiguration"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.GlobalSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Content") + .HasColumnType("text"); + + b.Property("SettingsName") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("GlobalSettings"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/Ombi.Store/Migrations/SettingsPostgres/20231212135625_Initial.cs b/src/Ombi.Store/Migrations/SettingsPostgres/20231212135625_Initial.cs new file mode 100644 index 0000000000..89674fb98f --- /dev/null +++ b/src/Ombi.Store/Migrations/SettingsPostgres/20231212135625_Initial.cs @@ -0,0 +1,50 @@ +using Microsoft.EntityFrameworkCore.Migrations; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace Ombi.Store.Migrations.SettingsPostgres +{ + public partial class Initial : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "ApplicationConfiguration", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Type = table.Column(type: "integer", nullable: false), + Value = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_ApplicationConfiguration", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "GlobalSettings", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Content = table.Column(type: "text", nullable: true), + SettingsName = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_GlobalSettings", x => x.Id); + }); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "ApplicationConfiguration"); + + migrationBuilder.DropTable( + name: "GlobalSettings"); + } + } +} diff --git a/src/Ombi.Store/Migrations/SettingsPostgres/SettingsPostgresContextModelSnapshot.cs b/src/Ombi.Store/Migrations/SettingsPostgres/SettingsPostgresContextModelSnapshot.cs new file mode 100644 index 0000000000..740b67a301 --- /dev/null +++ b/src/Ombi.Store/Migrations/SettingsPostgres/SettingsPostgresContextModelSnapshot.cs @@ -0,0 +1,64 @@ +// +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using Ombi.Store.Context.Postgres; + +#nullable disable + +namespace Ombi.Store.Migrations.SettingsPostgres +{ + [DbContext(typeof(SettingsPostgresContext))] + partial class SettingsPostgresContextModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "6.0.22") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("Ombi.Store.Entities.ApplicationConfiguration", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Type") + .HasColumnType("integer"); + + b.Property("Value") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("ApplicationConfiguration"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.GlobalSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Content") + .HasColumnType("text"); + + b.Property("SettingsName") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("GlobalSettings"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/Ombi.Store/Ombi.Store.csproj b/src/Ombi.Store/Ombi.Store.csproj index 9828351f56..7ab9f5b91b 100644 --- a/src/Ombi.Store/Ombi.Store.csproj +++ b/src/Ombi.Store/Ombi.Store.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 3.0.0.0 3.0.0.0 @@ -12,14 +12,15 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - + + @@ -40,4 +41,8 @@ Sql.Designer.cs + + + + \ No newline at end of file diff --git a/src/Ombi.Test.Common/Ombi.Test.Common.csproj b/src/Ombi.Test.Common/Ombi.Test.Common.csproj index a667ea9a1e..baf2fc5370 100644 --- a/src/Ombi.Test.Common/Ombi.Test.Common.csproj +++ b/src/Ombi.Test.Common/Ombi.Test.Common.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 latest Debug;Release;NonUiBuild diff --git a/src/Ombi.Tests/Ombi.Tests.csproj b/src/Ombi.Tests/Ombi.Tests.csproj index 82b80c9d42..2c5322bfb4 100644 --- a/src/Ombi.Tests/Ombi.Tests.csproj +++ b/src/Ombi.Tests/Ombi.Tests.csproj @@ -1,18 +1,18 @@  - net6.0 + net8.0 false Debug;Release;NonUiBuild - + - + diff --git a/src/Ombi.TheMovieDbApi/Ombi.Api.TheMovieDb.csproj b/src/Ombi.TheMovieDbApi/Ombi.Api.TheMovieDb.csproj index db1509ef8d..f71bc3a94a 100644 --- a/src/Ombi.TheMovieDbApi/Ombi.Api.TheMovieDb.csproj +++ b/src/Ombi.TheMovieDbApi/Ombi.Api.TheMovieDb.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 Ombi.Api.TheMovieDb 3.0.0.0 3.0.0.0 diff --git a/src/Ombi.Updater/Ombi.Updater.csproj b/src/Ombi.Updater/Ombi.Updater.csproj index 493990ac0e..c82543c084 100644 --- a/src/Ombi.Updater/Ombi.Updater.csproj +++ b/src/Ombi.Updater/Ombi.Updater.csproj @@ -3,7 +3,7 @@ Exe win10-x64;win10-x86;osx-x64;ubuntu-x64;debian.8-x64;centos.7-x64;linux-x64;linux-arm;linux-arm64; - net6.0 + net8.0 3.0.0.0 3.0.0.0 diff --git a/src/Ombi.sln b/src/Ombi.sln index a92df055ed..ead2b72e31 100644 --- a/src/Ombi.sln +++ b/src/Ombi.sln @@ -64,10 +64,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ombi.Api.Radarr", "Ombi.Api EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ombi.Api.Discord", "Ombi.Api.Discord\Ombi.Api.Discord.csproj", "{5AF2B6D2-5CC6-49FE-928A-BA27AF52B194}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ombi.Updater", "Ombi.Updater\Ombi.Updater.csproj", "{6294A82D-4915-4FC3-B301-8F985716F34C}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Update", "Update", "{D11FE57E-1E57-491D-A1D4-01AEF4BE5CB6}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ombi.Notifications.Tests", "Ombi.Notifications.Tests\Ombi.Notifications.Tests.csproj", "{2C7836E7-B120-40A6-B641-DDAA02FBAE23}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ombi.Api.Service", "Ombi.Api.Service\Ombi.Api.Service.csproj", "{A0892896-F5BD-47E2-823E-DFCE82514EEC}" @@ -261,12 +257,6 @@ Global {5AF2B6D2-5CC6-49FE-928A-BA27AF52B194}.NonUiBuild|Any CPU.Build.0 = NonUiBuild|Any CPU {5AF2B6D2-5CC6-49FE-928A-BA27AF52B194}.Release|Any CPU.ActiveCfg = Release|Any CPU {5AF2B6D2-5CC6-49FE-928A-BA27AF52B194}.Release|Any CPU.Build.0 = Release|Any CPU - {6294A82D-4915-4FC3-B301-8F985716F34C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6294A82D-4915-4FC3-B301-8F985716F34C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6294A82D-4915-4FC3-B301-8F985716F34C}.NonUiBuild|Any CPU.ActiveCfg = NonUiBuild|Any CPU - {6294A82D-4915-4FC3-B301-8F985716F34C}.NonUiBuild|Any CPU.Build.0 = NonUiBuild|Any CPU - {6294A82D-4915-4FC3-B301-8F985716F34C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6294A82D-4915-4FC3-B301-8F985716F34C}.Release|Any CPU.Build.0 = Release|Any CPU {2C7836E7-B120-40A6-B641-DDAA02FBAE23}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {2C7836E7-B120-40A6-B641-DDAA02FBAE23}.Debug|Any CPU.Build.0 = Debug|Any CPU {2C7836E7-B120-40A6-B641-DDAA02FBAE23}.NonUiBuild|Any CPU.ActiveCfg = NonUiBuild|Any CPU @@ -467,7 +457,6 @@ Global {FC6A8F7C-9722-4AE4-960D-277ACB0E81CB} = {6F42AB98-9196-44C4-B888-D5E409F415A1} {94D04C1F-E35A-499C-B0A0-9FADEBDF8336} = {9293CA11-360A-4C20-A674-B9E794431BF5} {5AF2B6D2-5CC6-49FE-928A-BA27AF52B194} = {9293CA11-360A-4C20-A674-B9E794431BF5} - {6294A82D-4915-4FC3-B301-8F985716F34C} = {D11FE57E-1E57-491D-A1D4-01AEF4BE5CB6} {2C7836E7-B120-40A6-B641-DDAA02FBAE23} = {6F42AB98-9196-44C4-B888-D5E409F415A1} {A0892896-F5BD-47E2-823E-DFCE82514EEC} = {9293CA11-360A-4C20-A674-B9E794431BF5} {FD947E63-A0D2-4878-8378-2005D5E9AB8A} = {9293CA11-360A-4C20-A674-B9E794431BF5} diff --git a/src/Ombi/ClientApp/package.json b/src/Ombi/ClientApp/package.json index 26c6ac405a..68b43e990d 100644 --- a/src/Ombi/ClientApp/package.json +++ b/src/Ombi/ClientApp/package.json @@ -13,25 +13,25 @@ }, "private": true, "dependencies": { - "@angular/animations": "^17.2.4", + "@angular/animations": "^17.3.11", "@angular/cdk": "16.2.14", - "@angular/common": "^17.2.4", - "@angular/compiler": "^17.2.4", - "@angular/core": "^17.2.4", - "@angular/forms": "^17.2.4", + "@angular/common": "^17.3.11", + "@angular/compiler": "^17.3.11", + "@angular/core": "^17.3.11", + "@angular/forms": "^17.3.11", "@angular/material": "^14.2.7", - "@angular/platform-browser": "^17.2.4", - "@angular/platform-browser-dynamic": "^17.2.4", - "@angular/platform-server": "^17.2.4", - "@angular/router": "^17.2.4", + "@angular/platform-browser": "^17.3.11", + "@angular/platform-browser-dynamic": "^17.3.11", + "@angular/platform-server": "^17.3.11", + "@angular/router": "^17.3.11", "@angularclass/hmr": "^3.0.0", "@auth0/angular-jwt": "^5.0.2", - "@fortawesome/fontawesome-free": "^6.4.2", + "@fortawesome/fontawesome-free": "^6.5.2", "@microsoft/signalr": "^6.0.23", "@ngx-translate/core": "^14.0.0", "@ngx-translate/http-loader": "^7.0.0", - "@ngxs/devtools-plugin": "3.8.1", - "@ngxs/store": "3.8.1", + "@ngxs/devtools-plugin": "3.8.2", + "@ngxs/store": "3.8.2", "@types/jquery": "^3.5.23", "@yellowspot/ng-truncate": "^2.0.0", "angularx-qrcode": "^16.0.0", @@ -50,7 +50,7 @@ "primeng": "^17.11.0", "rxjs": "^7.5.4", "ts-md5": "^1.2.7", - "zone.js": "0.14.3" + "zone.js": "0.14.7" }, "devDependencies": { "@angular-devkit/build-angular": "^17.1.3", diff --git a/src/Ombi/ClientApp/src/app/landingpage/landingpage.component.html b/src/Ombi/ClientApp/src/app/landingpage/landingpage.component.html index 3b8a46db75..bc48ae3235 100644 --- a/src/Ombi/ClientApp/src/app/landingpage/landingpage.component.html +++ b/src/Ombi/ClientApp/src/app/landingpage/landingpage.component.html @@ -1,4 +1,4 @@ -
+
diff --git a/src/Ombi/ClientApp/src/app/landingpage/landingpage.component.scss b/src/Ombi/ClientApp/src/app/landingpage/landingpage.component.scss index 37e3bbbbf5..f26d05fc1b 100644 --- a/src/Ombi/ClientApp/src/app/landingpage/landingpage.component.scss +++ b/src/Ombi/ClientApp/src/app/landingpage/landingpage.component.scss @@ -1,9 +1,11 @@ -@import "./styles/variables.scss"; +@import "./styles/variables.scss"; .small-middle-container{ height:100vh; + overflow: auto; /* or overflow: auto; */ } .row{ + overflow: auto; /* or overflow: auto; */ display:flex; align-items: center; justify-content: center; @@ -87,4 +89,4 @@ span, b, i, p { .logo-container{ display:flex; justify-content: center; -} \ No newline at end of file +} diff --git a/src/Ombi/ClientApp/yarn.lock b/src/Ombi/ClientApp/yarn.lock index 6bd22ebe29..53eb8141f4 100644 --- a/src/Ombi/ClientApp/yarn.lock +++ b/src/Ombi/ClientApp/yarn.lock @@ -155,10 +155,10 @@ ora "5.4.1" rxjs "7.8.1" -"@angular/animations@^17.2.4": - version "17.3.1" - resolved "https://registry.yarnpkg.com/@angular/animations/-/animations-17.3.1.tgz#ca0b60f9010b9291a3939242d61db5fc0e82385b" - integrity sha512-2TZ0M5J0IizhHpb404DeqArlv8Ki9BFz5ZUuET2uFROpKW8IMDCht8fSrn/DKHpjB9lvzPUhNFaRxNWEY6klnA== +"@angular/animations@^17.3.11": + version "17.3.11" + resolved "https://registry.yarnpkg.com/@angular/animations/-/animations-17.3.11.tgz#86e5c6a1fbf9b7e2bf5441e334db5b8b2132be2d" + integrity sha512-1y1Egag5jbdUSUWVK+KA39N9VFDrzq9ObjbAhrXFlXKa0npBRw5bprEEeLFQMETMP9Mpjbmj2PoASfl4vqj/Iw== dependencies: tslib "^2.3.0" @@ -195,10 +195,10 @@ symbol-observable "4.0.0" yargs "17.7.2" -"@angular/common@^17.2.4": - version "17.3.1" - resolved "https://registry.yarnpkg.com/@angular/common/-/common-17.3.1.tgz#c21e8d59c9dbbcf316d48f0df20aee6eb88cffa7" - integrity sha512-HyUTJ4RxhE3bOmFRV6Fv2y01ixbrUb8Hd4MxPm8REbNMGKsWCfXhR3FfxFL18Sc03SAF+o0Md0wwekjFKTNKfQ== +"@angular/common@^17.3.11": + version "17.3.11" + resolved "https://registry.yarnpkg.com/@angular/common/-/common-17.3.11.tgz#1698a0a93d3dab6e52da9d6600e8fba3a63a4e68" + integrity sha512-WG+HQjUaQziYLGdbcv2aW+G73uroN5VF9yk4qWYcolW+VB8SV/DOAol8uFVgCF21cIOl5+wfJZvA4r5oG3dYaw== dependencies: tslib "^2.3.0" @@ -216,24 +216,24 @@ tslib "^2.3.0" yargs "^17.2.1" -"@angular/compiler@^17.2.4": - version "17.3.1" - resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-17.3.1.tgz#82c6507afc798593ab4d0415c062862684fad981" - integrity sha512-8qqlWPGZEyD2FY5losOW3Aocro+lFysPDzsf0LHgQUM6Ub1b+pq4jUOjH6w0vzaxG3TfxkgzOQ9aNdWtSV67Rg== +"@angular/compiler@^17.3.11": + version "17.3.11" + resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-17.3.11.tgz#ecf1138bbb69be4cb7a7bf88a71f4ad93128b466" + integrity sha512-ingRoREDPkeZGSa13DlztSjZgGArNcmsAWjj+f+vQgQekTjkfQD/N+Bix/LSt5ZdbSjHMtrkDMyRPwbNyk5Keg== dependencies: tslib "^2.3.0" -"@angular/core@^17.2.4": - version "17.3.1" - resolved "https://registry.yarnpkg.com/@angular/core/-/core-17.3.1.tgz#3f143c27ab50b7bdf829b0c2086af60c16e194ae" - integrity sha512-Qf3/sgkXS1LHwOTtqAVYprySrn0YpPIZqerPc0tK+hyQfwAz5BQlpcBhbH8RWKlfCY8eO0cqo/j0+e8DQOgYfg== +"@angular/core@^17.3.11": + version "17.3.11" + resolved "https://registry.yarnpkg.com/@angular/core/-/core-17.3.11.tgz#8de94fbb986ceec7e96356a60c9edf98131ae97b" + integrity sha512-2wPZwXFei3kVxK2ylIH6CdGebrC4kvooFx7qoX+250OITAEFMODJGdh/e3x0DpFUjlRvQtIFQ+YpQlfC5JnL4g== dependencies: tslib "^2.3.0" -"@angular/forms@^17.2.4": - version "17.3.1" - resolved "https://registry.yarnpkg.com/@angular/forms/-/forms-17.3.1.tgz#b592ab701d66c0668702ee2e20b59c85061ec5af" - integrity sha512-HndsO90k67sFHzd+sII+rhAUksffBvquFuAUCc6QR9WVjILxVg2fY7oBidgS1gKNqu0mptPG0GvuORnaW/0gSg== +"@angular/forms@^17.3.11": + version "17.3.11" + resolved "https://registry.yarnpkg.com/@angular/forms/-/forms-17.3.11.tgz#5e37ff81964e184fbb98b1f016fe3062dd5d2571" + integrity sha512-719flo/1L64YOAxL3pzszTK+7bczVVOQDXT1khnjb48GVZdBUBwW2D+cFbqSW1VMuWWr2Amwy1lL4YM5S7qPJQ== dependencies: tslib "^2.3.0" @@ -244,32 +244,32 @@ dependencies: tslib "^2.3.0" -"@angular/platform-browser-dynamic@^17.2.4": - version "17.3.1" - resolved "https://registry.yarnpkg.com/@angular/platform-browser-dynamic/-/platform-browser-dynamic-17.3.1.tgz#8a265f3d8e1cda92d3b6e3fc046db2a4bb6e67a7" - integrity sha512-ACW/npNaDxUNQtEomjjv/KIBY8jHEinePff5qosnAxLE0IpA4qE9eDp36zG35xoJqrPJPYjXbZCBRqqrzM7U7Q== +"@angular/platform-browser-dynamic@^17.3.11": + version "17.3.11" + resolved "https://registry.yarnpkg.com/@angular/platform-browser-dynamic/-/platform-browser-dynamic-17.3.11.tgz#d578cefbba24800e94756338a7789dbe8014b63b" + integrity sha512-JPA0enJyJQ5H340WQ2wfXbCCHzjBiAljEDMr/Siw/CzSe0XI8aQYDqKMLUMtRyCdYhNCEYjnBWgXBi9Za9blZg== dependencies: tslib "^2.3.0" -"@angular/platform-browser@^17.2.4": - version "17.3.1" - resolved "https://registry.yarnpkg.com/@angular/platform-browser/-/platform-browser-17.3.1.tgz#45d414d948ee064d8e399fe824600d71117774a5" - integrity sha512-8ABAL8PElSGzkIparVwifsU0NSu0DdqnWYw9YvLhhZQ6lOuWbG+dTUo/DXzmWhA6ezQWJGNakEZPJJytFIIy+A== +"@angular/platform-browser@^17.3.11": + version "17.3.11" + resolved "https://registry.yarnpkg.com/@angular/platform-browser/-/platform-browser-17.3.11.tgz#44c4814b76c3de43496159d76e19913f8d331744" + integrity sha512-sWjMy8qKH6AOt5YV4OMoPhExCbGdRIPjNSwUrxCm8a8Zz5DamoX3Sib9yRk1etjBuRj+oJySSxISJim2OYXJQQ== dependencies: tslib "^2.3.0" -"@angular/platform-server@^17.2.4": - version "17.3.1" - resolved "https://registry.yarnpkg.com/@angular/platform-server/-/platform-server-17.3.1.tgz#d65c8eedfbf0fae7a56f55dc3684fcb74627dc8b" - integrity sha512-yC1WgUquIac8qFCPMLjRio2ViR3XHexlXKlZpFhqpWAFPsWSHjoCHTEW+KTUFZmOPhUEFR2W8fWOChur8mjthw== +"@angular/platform-server@^17.3.11": + version "17.3.11" + resolved "https://registry.yarnpkg.com/@angular/platform-server/-/platform-server-17.3.11.tgz#b92c3cd6764292085d9300b85db1ac8bdde60697" + integrity sha512-xytV4+5gTCECUORniXBTE1lvJ3qf3IWlawmm3eZylvJMqH2W3ApZrrwLM7umL8BOU9ISEhjolbwfGXornKL+5A== dependencies: tslib "^2.3.0" xhr2 "^0.2.0" -"@angular/router@^17.2.4": - version "17.3.1" - resolved "https://registry.yarnpkg.com/@angular/router/-/router-17.3.1.tgz#cefd0f7acc3726b5893a26cc112aa50d12ba5ce3" - integrity sha512-H6H7lY9i5Ppu0SFwwpeWqJbCFw8cILOj8Rd1+AGoCN5m3ivPtjD2Ltz62PI2zZkqx+WhQdk19l61Wm3oRqg70A== +"@angular/router@^17.3.11": + version "17.3.11" + resolved "https://registry.yarnpkg.com/@angular/router/-/router-17.3.11.tgz#fd28e6b7f836683c571f2ed50eae6b97e6383038" + integrity sha512-A3aU6uHAeJfsfCw1dgNXHn2Kjw/UieRMnFwENkzz96YFCvFPCEZjy/mODuE3zHludMuqVsJhM/uUxWu8ATRTcA== dependencies: tslib "^2.3.0" @@ -1915,10 +1915,10 @@ resolved "https://registry.yarnpkg.com/@foliojs-fork/restructure/-/restructure-2.0.2.tgz#73759aba2aff1da87b7c4554e6839c70d43c92b4" integrity sha512-59SgoZ3EXbkfSX7b63tsou/SDGzwUEK6MuB5sKqgVK1/XE0fxmpsOb9DQI8LXW3KfGnAjImCGhhEb7uPPAUVNA== -"@fortawesome/fontawesome-free@^6.4.2": - version "6.5.1" - resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-free/-/fontawesome-free-6.5.1.tgz#55cc8410abf1003b726324661ce5b0d1c10de258" - integrity sha512-CNy5vSwN3fsUStPRLX7fUYojyuzoEMSXPl7zSLJ8TgtRfjv24LOnOWKT2zYwaHZCJGkdyRnTmstR0P+Ah503Gw== +"@fortawesome/fontawesome-free@^6.5.2": + version "6.5.2" + resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-free/-/fontawesome-free-6.5.2.tgz#310fe90cb5a8dee9698833171b98e7835404293d" + integrity sha512-hRILoInAx8GNT5IMkrtIt9blOdrqHOnPBH+k70aWUAqPZPgopb9G5EQJFpaBx/S8zp2fC+mPW349Bziuk1o28Q== "@isaacs/cliui@^8.0.2": version "8.0.2" @@ -2039,17 +2039,17 @@ dependencies: tslib "^2.3.0" -"@ngxs/devtools-plugin@3.8.1": - version "3.8.1" - resolved "https://registry.yarnpkg.com/@ngxs/devtools-plugin/-/devtools-plugin-3.8.1.tgz#43f0bcc83ece59baa6d141e41fd026f91de831fb" - integrity sha512-IRHoHdV/lxNXaisKGdcGvSNbrgjCpM06eiqC93K+tOfwgmDY/hNsDNmKlXn9xmdYxF9U6v/1CXtAr0Q0Ux7dVQ== +"@ngxs/devtools-plugin@3.8.2": + version "3.8.2" + resolved "https://registry.yarnpkg.com/@ngxs/devtools-plugin/-/devtools-plugin-3.8.2.tgz#0deb8aac228483ede44c20ed3a6488e824c4f3fc" + integrity sha512-4FWZWJTtgrlTUsiprIBGHaQqvvFKiTesYK9+dg03NGv7z74Z5pNtPVbO1hMeuMmqaJ8r18fDZ3wIfXlXC6noNA== dependencies: tslib "^2.2.0" -"@ngxs/store@3.8.1": - version "3.8.1" - resolved "https://registry.yarnpkg.com/@ngxs/store/-/store-3.8.1.tgz#dc4b823fc179149c32ac6158149877dda615abd2" - integrity sha512-nbapLdMx+mtnb57BUWXbD6qYfVICv6Rp2NdoGx1++qDbc44ALC49KbF7rSjyPltlExxharAzoNpzO3JuueCP+A== +"@ngxs/store@3.8.2": + version "3.8.2" + resolved "https://registry.yarnpkg.com/@ngxs/store/-/store-3.8.2.tgz#f6c8553e03db95baea7684f0f227c0e9a8095983" + integrity sha512-IovxuGQDEpB9VefmbTaV1k4hms4iZ4aS9gPVZOC+qzyfvpi7zrUEsjo+yT6FfVBmBg/RLUmPCtqArzbKU5XrLQ== dependencies: tslib "^2.2.0" @@ -10886,9 +10886,7 @@ zepto@^1.2.0: resolved "https://registry.yarnpkg.com/zepto/-/zepto-1.2.0.tgz#e127bd9e66fd846be5eab48c1394882f7c0e4f98" integrity sha512-C1x6lfvBICFTQIMgbt3JqMOno3VOtkWat/xEakLTOurskYIHPmzJrzd1e8BnmtdDVJlGuk5D+FxyCA8MPmkIyA== -zone.js@0.14.3: - version "0.14.3" - resolved "https://registry.yarnpkg.com/zone.js/-/zone.js-0.14.3.tgz#ac01000f4eaeec5c06526f6c112ef7d36f426f78" - integrity sha512-jYoNqF046Q+JfcZSItRSt+oXFcpXL88yq7XAZjb/NKTS7w2hHpKjRJ3VlFD1k75wMaRRXNUt5vrZVlygiMyHbA== - dependencies: - tslib "^2.3.0" +zone.js@0.14.7: + version "0.14.7" + resolved "https://registry.yarnpkg.com/zone.js/-/zone.js-0.14.7.tgz#4a9a70599109663b1921165663bbac521995eef3" + integrity sha512-0w6DGkX2BPuiK/NLf+4A8FLE43QwBfuqz2dVgi/40Rj1WmqUskCqj329O/pwrqFJLG5X8wkeG2RhIAro441xtg== diff --git a/src/Ombi/Extensions/DatabaseExtensions.cs b/src/Ombi/Extensions/DatabaseExtensions.cs index a96011f1c7..c56e2f52de 100644 --- a/src/Ombi/Extensions/DatabaseExtensions.cs +++ b/src/Ombi/Extensions/DatabaseExtensions.cs @@ -1,13 +1,20 @@ using System; using System.IO; +using System.Text; using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Storage; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Diagnostics.HealthChecks; +using MySqlConnector; using Newtonsoft.Json; +using Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal; using Ombi.Helpers; using Ombi.Store.Context; using Ombi.Store.Context.MySql; using Ombi.Store.Context.Sqlite; +using Ombi.Store.Context.Postgres; +using Polly; +using Pomelo.EntityFrameworkCore.MySql.Storage.Internal; using SQLitePCL; namespace Ombi.Extensions @@ -17,6 +24,7 @@ public static class DatabaseExtensions public const string SqliteDatabase = "Sqlite"; public const string MySqlDatabase = "MySQL"; + public const string PostgresDatabase = "Postgres"; public static void ConfigureDatabases(this IServiceCollection services, IHealthChecksBuilder hcBuilder) { @@ -33,6 +41,10 @@ public static void ConfigureDatabases(this IServiceCollection services, IHealthC services.AddDbContext(x => ConfigureMySql(x, configuration.OmbiDatabase)); AddMySqlHealthCheck(hcBuilder, "Ombi Database", configuration.OmbiDatabase); break; + case var type when type.Equals(PostgresDatabase, StringComparison.InvariantCultureIgnoreCase): + services.AddDbContext(x => ConfigurePostgres(x, configuration.OmbiDatabase)); + AddPostgresHealthCheck(hcBuilder, "Ombi Database", configuration.OmbiDatabase); + break; } switch (configuration.ExternalDatabase.Type) @@ -45,6 +57,10 @@ public static void ConfigureDatabases(this IServiceCollection services, IHealthC services.AddDbContext(x => ConfigureMySql(x, configuration.ExternalDatabase)); AddMySqlHealthCheck(hcBuilder, "External Database", configuration.ExternalDatabase); break; + case var type when type.Equals(PostgresDatabase, StringComparison.InvariantCultureIgnoreCase): + services.AddDbContext(x => ConfigurePostgres(x, configuration.ExternalDatabase)); + AddPostgresHealthCheck(hcBuilder, "External Database", configuration.ExternalDatabase); + break; } switch (configuration.SettingsDatabase.Type) @@ -57,6 +73,10 @@ public static void ConfigureDatabases(this IServiceCollection services, IHealthC services.AddDbContext(x => ConfigureMySql(x, configuration.SettingsDatabase)); AddMySqlHealthCheck(hcBuilder, "Settings Database", configuration.SettingsDatabase); break; + case var type when type.Equals(PostgresDatabase, StringComparison.InvariantCultureIgnoreCase): + services.AddDbContext(x => ConfigurePostgres(x, configuration.SettingsDatabase)); + AddPostgresHealthCheck(hcBuilder, "Settings Database", configuration.SettingsDatabase); + break; } } @@ -111,6 +131,19 @@ private static void AddMySqlHealthCheck(IHealthChecksBuilder builder, string dbN } } + private static void AddPostgresHealthCheck(IHealthChecksBuilder builder, string dbName, PerDatabaseConfiguration config) + { + if (builder != null) + { + builder.AddNpgSql( + npgsqlConnectionString: config.ConnectionString, + name: dbName, + failureStatus: HealthStatus.Unhealthy, + tags: new string[] { "db" } + ); + } + } + public static void ConfigureSqlite(DbContextOptionsBuilder options, PerDatabaseConfiguration config) { SQLitePCL.Batteries.Init(); @@ -120,13 +153,48 @@ public static void ConfigureSqlite(DbContextOptionsBuilder options, PerDatabaseC public static void ConfigureMySql(DbContextOptionsBuilder options, PerDatabaseConfiguration config) { - options.UseMySql(config.ConnectionString, ServerVersion.AutoDetect(config.ConnectionString), b => + if (string.IsNullOrEmpty(config.ConnectionString)) + { + throw new ArgumentNullException("ConnectionString for the MySql/Mariadb database is empty"); + } + + options.UseMySql(config.ConnectionString, GetServerVersion(config.ConnectionString), b => { //b.CharSetBehavior(Pomelo.EntityFrameworkCore.MySql.Infrastructure.CharSetBehavior.NeverAppend); // ##ISSUE, link to migrations? b.EnableRetryOnFailure(); }); } + public static void ConfigurePostgres(DbContextOptionsBuilder options, PerDatabaseConfiguration config) + { + options.UseNpgsql(config.ConnectionString, b => + { + b.EnableRetryOnFailure(); + }).ReplaceService(); + } + + private static ServerVersion GetServerVersion(string connectionString) + { + // Workaround Windows bug, that can lead to the following exception: + // + // MySqlConnector.MySqlException (0x80004005): SSL Authentication Error + // ---> System.Security.Authentication.AuthenticationException: Authentication failed, see inner exception. + // ---> System.ComponentModel.Win32Exception (0x8009030F): The message or signature supplied for verification has been altered + // + // See https://github.com/dotnet/runtime/issues/17005#issuecomment-305848835 + // + // Also workaround for the fact, that ServerVersion.AutoDetect() does not use any retrying strategy. + ServerVersion serverVersion = null; +#pragma warning disable EF1001 + var retryPolicy = Policy.Handle(exception => MySqlTransientExceptionDetector.ShouldRetryOn(exception)) +#pragma warning restore EF1001 + .WaitAndRetry(3, (count, context) => TimeSpan.FromMilliseconds(count * 250)); + + serverVersion = retryPolicy.Execute(() => serverVersion = ServerVersion.AutoDetect(connectionString)); + + return serverVersion; + } + public class DatabaseConfiguration { public DatabaseConfiguration() @@ -161,5 +229,16 @@ public PerDatabaseConfiguration() public string Type { get; set; } public string ConnectionString { get; set; } } + + public class NpgsqlCaseInsensitiveSqlGenerationHelper : NpgsqlSqlGenerationHelper + { + const string EFMigrationsHisory = "__EFMigrationsHistory"; + public NpgsqlCaseInsensitiveSqlGenerationHelper(RelationalSqlGenerationHelperDependencies dependencies) + : base(dependencies) { } + public override string DelimitIdentifier(string identifier) => + base.DelimitIdentifier(identifier == EFMigrationsHisory ? identifier : identifier.ToLower()); + public override void DelimitIdentifier(StringBuilder builder, string identifier) + => base.DelimitIdentifier(builder, identifier == EFMigrationsHisory ? identifier : identifier.ToLower()); + } } -} \ No newline at end of file +} diff --git a/src/Ombi/Ombi.csproj b/src/Ombi/Ombi.csproj index 21173273db..4e7b55b8b8 100644 --- a/src/Ombi/Ombi.csproj +++ b/src/Ombi/Ombi.csproj @@ -1,7 +1,6 @@  - net6.0 - win10-x64;win10-x86;osx-x64;linux-x64;linux-arm;linux-arm64; + net8.0 false Latest