Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove CosmosDB #303

Merged
merged 3 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@
<PrivateAssets>all</PrivateAssets>
</PackageVersion>
<PackageVersion Include="MarkDig" Version="0.38.0" />
<PackageVersion Include="Microsoft.Azure.Cosmos" Version="3.45.2" />
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="9.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Abstractions" Version="9.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Analyzers" Version="9.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Cosmos" Version="9.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
Expand Down
1 change: 0 additions & 1 deletion src/App/App.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
<PackageReference Include="Azure.Storage.Queues" />
<PackageReference Include="Discord.Net" />
<PackageReference Include="GitVersion.MsBuild" PrivateAssets="all" />
<PackageReference Include="Microsoft.Azure.Cosmos" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" />
<PackageReference Include="Microsoft.Extensions.Logging" />
<PackageReference Include="Microsoft.Extensions.Configuration" />
Expand Down
24 changes: 0 additions & 24 deletions src/App/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
using MuzakBot.Database.Extensions;
using MuzakBot.Database.Models;
using MuzakBot.Hosting.Extensions;
using MuzakBot.Lib.Services;
using MuzakBot.Lib.Services.Extensions;

DateTimeOffset startTime = DateTimeOffset.UtcNow;
Expand Down Expand Up @@ -100,23 +99,6 @@
builder.Services
.AddMuzakBotDbContextFactory(databaseConfig);

bool shouldMigrateCosmosDbToPostgres = builder.Configuration.GetValue<bool>("MIGRATE_COSMOSDB_TO_POSTGRES");
if (shouldMigrateCosmosDbToPostgres)
{
DatabaseConfig cosmosDbConfig = new()
{
DatabaseType = DatabaseType.CosmosDb,
CosmosDbConfig = new()
{
ConnectionString = builder.Configuration.GetValue<string>("COSMOSDB_CONNECTION_STRING") ?? throw new("COSMOSDB_CONNECTION_STRING is not set."),
}
};

builder.Services
.AddAlbumReleaseDbContextFactory(cosmosDbConfig)
.AddLyricsAnalyzerDbContextFactory(cosmosDbConfig);
}

builder.Services
.AddOpenAiService(options =>
{
Expand All @@ -142,10 +124,4 @@

await host.ApplyMuzakBotDbContextMigrations();

if (shouldMigrateCosmosDbToPostgres)
{
await host.MigrateCosmosDbDataToPostgresAsync();
return;
}

await host.RunAsync();
2 changes: 0 additions & 2 deletions src/Database/Database.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@
<PackageReference Include="Azure.Core" />
<PackageReference Include="Discord.Net" PrivateAssets="all" />
<PackageReference Include="GitVersion.MsBuild" PrivateAssets="all" />
<PackageReference Include="Microsoft.Azure.Cosmos" />
<PackageReference Include="Microsoft.EntityFrameworkCore" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Abstractions" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Analyzers" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Cosmos" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
Expand Down

This file was deleted.

This file was deleted.

Loading