diff --git a/Directory.Packages.props b/Directory.Packages.props index 8f53a643..fb725d65 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -14,11 +14,9 @@ all - - runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/App/App.csproj b/src/App/App.csproj index 0ab9e0d3..be96801a 100644 --- a/src/App/App.csproj +++ b/src/App/App.csproj @@ -27,7 +27,6 @@ - diff --git a/src/App/Program.cs b/src/App/Program.cs index d23030e7..ffb1f68a 100644 --- a/src/App/Program.cs +++ b/src/App/Program.cs @@ -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; @@ -100,23 +99,6 @@ builder.Services .AddMuzakBotDbContextFactory(databaseConfig); -bool shouldMigrateCosmosDbToPostgres = builder.Configuration.GetValue("MIGRATE_COSMOSDB_TO_POSTGRES"); -if (shouldMigrateCosmosDbToPostgres) -{ - DatabaseConfig cosmosDbConfig = new() - { - DatabaseType = DatabaseType.CosmosDb, - CosmosDbConfig = new() - { - ConnectionString = builder.Configuration.GetValue("COSMOSDB_CONNECTION_STRING") ?? throw new("COSMOSDB_CONNECTION_STRING is not set."), - } - }; - - builder.Services - .AddAlbumReleaseDbContextFactory(cosmosDbConfig) - .AddLyricsAnalyzerDbContextFactory(cosmosDbConfig); -} - builder.Services .AddOpenAiService(options => { @@ -142,10 +124,4 @@ await host.ApplyMuzakBotDbContextMigrations(); -if (shouldMigrateCosmosDbToPostgres) -{ - await host.MigrateCosmosDbDataToPostgresAsync(); - return; -} - await host.RunAsync(); diff --git a/src/Database/Database.csproj b/src/Database/Database.csproj index b8aa13b8..08ba643f 100644 --- a/src/Database/Database.csproj +++ b/src/Database/Database.csproj @@ -26,11 +26,9 @@ - - runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/Database/DbContexts/AlbumReleaseDbContext/AlbumReleaseDbContext.cs b/src/Database/DbContexts/AlbumReleaseDbContext/AlbumReleaseDbContext.cs deleted file mode 100644 index 12e1663f..00000000 --- a/src/Database/DbContexts/AlbumReleaseDbContext/AlbumReleaseDbContext.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Microsoft.EntityFrameworkCore; - -using MuzakBot.Database.Extensions; -using MuzakBot.Lib.Models.Database.AlbumRelease; - -namespace MuzakBot.Database; - -/// -/// Database context for album release reminders. -/// -public class AlbumReleaseDbContext : DbContext -{ - /// - /// Initializes a new instance of the class. - /// - /// - public AlbumReleaseDbContext(DbContextOptions options) : base(options) - { } - - /// - /// items in the database. - /// - public DbSet AlbumReleaseReminders { get; set; } = null!; - - /// - protected override void OnModelCreating(ModelBuilder modelBuilder) - { - modelBuilder - .CreateAlbumReleaseReminderModel(); - } -} diff --git a/src/Database/DbContexts/LyricsAnalyzerDbContext/LyricsAnalyzerDbContext.cs b/src/Database/DbContexts/LyricsAnalyzerDbContext/LyricsAnalyzerDbContext.cs deleted file mode 100644 index c8fffa2d..00000000 --- a/src/Database/DbContexts/LyricsAnalyzerDbContext/LyricsAnalyzerDbContext.cs +++ /dev/null @@ -1,74 +0,0 @@ -using Microsoft.EntityFrameworkCore; - -using MuzakBot.Database.Extensions; -using MuzakBot.Lib.Models.Database; -using MuzakBot.Lib.Models.Database.LyricsAnalyzer; - -namespace MuzakBot.Database; - -/// -/// Database context for song lyrics. -/// -public class LyricsAnalyzerDbContext : DbContext -{ - /// - /// Initializes a new instance of the class. - /// - /// The options for the database context. - public LyricsAnalyzerDbContext(DbContextOptions options) : base(options) - { } - - /// - /// items in the database. - /// - public DbSet DatabaseUpdates { get; set; } = null!; - - /// - /// items in the database. - /// - public DbSet SongLyricsItems { get; set; } = null!; - - /// - /// items in the database. - /// - public DbSet SongLyricsRequestJobs { get; set; } = null!; - - /// - /// items in the database. - /// - public DbSet LyricsAnalyzerItems { get; set; } = null!; - - /// - /// items in the database. - /// - public DbSet LyricsAnalyzerConfigs { get; set; } = null!; - - /// - /// items in the database. - /// - public DbSet LyricsAnalyzerPromptStyles { get; set; } = null!; - - /// - /// items in the database. - /// - public DbSet LyricsAnalyzerUserRateLimits { get; set; } = null!; - - /// - /// items in the database. - /// - public DbSet AnalyzedLyricsItems { get; set; } = null!; - - /// - protected override void OnModelCreating(ModelBuilder modelBuilder) - { - modelBuilder - .CreateDatabaseUpdateModel() - .CreateSongLyricsItemModel() - .CreateSongLyricsRequestJobModel() - .CreateLyricsAnalyzerItemModel() - .CreateLyricsAnalyzerConfigModel() - .CreateLyricsAnalyzerPromptStyleModel() - .CreateLyricsAnalyzerUserRateLimitModel() - .CreateAnalyedLyricsModel(); - } -} diff --git a/src/Database/DbContexts/MuzakBotDbContext/MuzakBotDbContext.cs b/src/Database/DbContexts/MuzakBotDbContext/MuzakBotDbContext.cs index e3a80d37..0c617c51 100644 --- a/src/Database/DbContexts/MuzakBotDbContext/MuzakBotDbContext.cs +++ b/src/Database/DbContexts/MuzakBotDbContext/MuzakBotDbContext.cs @@ -1,7 +1,6 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; using MuzakBot.Database.Models; using MuzakBot.Lib.Models.Database; @@ -122,7 +121,7 @@ private static IServiceCollection AddMuzakBotDbContextFactoryForSqlite(this ISer { string dbPath = Path.Join(sqliteDbConfig.DbPath, "muzakbot.sqlite"); - services.AddDbContextFactory(options => + services.AddDbContextFactory(options => { options.UseSqlite($"Data Source={dbPath}"); }); @@ -152,329 +151,4 @@ public static async Task ApplyMuzakBotDbContextMigrations(this IHost host) await context.SaveChangesAsync(); } } - - /// - /// Migrates data from CosmosDB to Postgres. - /// - /// The host. - /// - public static async Task MigrateCosmosDbDataToPostgresAsync(this IHost host) - { - using var scope = host.Services.CreateScope(); - - var albumreleaseDbContextFactory = scope.ServiceProvider.GetRequiredService>(); - var lyricsanalyzerDbContextFactory = scope.ServiceProvider.GetRequiredService>(); - var muzakBotDbContextFactory = scope.ServiceProvider.GetRequiredService>(); - - using var albumReleaseContext = albumreleaseDbContextFactory.CreateDbContext(); - using var lyricsAnalyzerContext = lyricsanalyzerDbContextFactory.CreateDbContext(); - using var muzakBotContext = muzakBotDbContextFactory.CreateDbContext(); - - using ILoggerFactory loggerFactory = scope.ServiceProvider.GetRequiredService(); - ILogger logger = loggerFactory.CreateLogger("MuzakBot.Database.MigrateCosmosDbDataToPostgres"); - - logger.LogInformation("Migrating data from CosmosDB to Postgres..."); - - // Migrate album release reminders - await MigrateAlbumReleaseRemindersAsync(logger, muzakBotContext, albumReleaseContext); - - // Migrate lyrics analyzer prompt styles - await MigrateLyricsAnalyzerPromptStylesAsync(logger, muzakBotContext, lyricsAnalyzerContext); - - // Migrate analyzed lyrics - await MigrateAnalyzedLyricsAsync(logger, muzakBotContext, lyricsAnalyzerContext); - - // Migrate lyrics analyzer command configs - await MigrateLyricsAnalyzerCommandConfigsAsync(logger, muzakBotContext, lyricsAnalyzerContext); - - // Migrate lyrics analyzer user rate limits - await MigrateLyricsAnalyzerUserRateLimitsAsync(logger, muzakBotContext, lyricsAnalyzerContext); - - // Migrate song lyrics items - await MigrateSongLyricsItemsAsync(logger, muzakBotContext, lyricsAnalyzerContext); - - // Migrate song lyrics request jobs - await MigrateSongLyricsRequestJobsAsync(logger, muzakBotContext, lyricsAnalyzerContext); - - // Migrate database updates - await MigrateDatabaseUpdatesAsync(logger, muzakBotContext, lyricsAnalyzerContext); - - // Migrate lyrics analyzer items - await MigrateLyricsAnalyzerItemsAsync(logger, muzakBotContext, lyricsAnalyzerContext); - - logger.LogInformation("Data migration from CosmosDB to Postgres complete."); - } - - /// - /// Migrates AlbumReleaseReminders from CosmosDB to Postgres. - /// - /// Logger instance. - /// The instance. - /// The instance. - /// - private static async Task MigrateAlbumReleaseRemindersAsync(ILogger logger, MuzakBotDbContext muzakBotDbContext, AlbumReleaseDbContext albumReleaseDbContext) - { - int albumReleaseRemindersPostgresCount = await muzakBotDbContext.AlbumReleaseReminders.CountAsync(); - - if (albumReleaseRemindersPostgresCount > 0) - { - logger.LogWarning("AlbumReleaseReminders table in Postgres is not empty. Skipping migration."); - return; - } - - logger.LogInformation("Migrating AlbumReleaseReminders from CosmosDB to Postgres..."); - AlbumReleaseReminder[] albumReleaseRemindersCosmosAll = await albumReleaseDbContext.AlbumReleaseReminders.ToArrayAsync(); - - foreach (AlbumReleaseReminder albumReleaseReminder in albumReleaseRemindersCosmosAll) - { - muzakBotDbContext.AlbumReleaseReminders.Add(albumReleaseReminder); - } - - await muzakBotDbContext.SaveChangesAsync(); - - logger.LogInformation("Migrated AlbumReleaseReminders from CosmosDB to Postgres."); - } - - /// - /// Migrates AnalyzedLyricsItems from CosmosDB to Postgres. - /// - /// Logger instance. - /// The instance. - /// The instance. - /// - private static async Task MigrateAnalyzedLyricsAsync(ILogger logger, MuzakBotDbContext muzakBotDbContext, LyricsAnalyzerDbContext lyricsAnalyzerDbContext) - { - int analyzedLyricsPostgresCount = await muzakBotDbContext.AnalyzedLyricsItems.CountAsync(); - - if (analyzedLyricsPostgresCount > 0) - { - logger.LogWarning("AnalyzedLyricsItems table in Postgres is not empty. Skipping migration."); - return; - } - - logger.LogInformation("Migrating AnalyzedLyricsItems from CosmosDB to Postgres..."); - AnalyzedLyrics[] analyzedLyricsCosmosAll = await lyricsAnalyzerDbContext.AnalyzedLyricsItems.ToArrayAsync(); - - foreach (AnalyzedLyrics analyzedLyrics in analyzedLyricsCosmosAll) - { - muzakBotDbContext.AnalyzedLyricsItems.Add(analyzedLyrics); - } - - await muzakBotDbContext.SaveChangesAsync(); - - logger.LogInformation("Migrated AnalyzedLyricsItems from CosmosDB to Postgres."); - } - - /// - /// Migrates LyricsAnalyzerConfigs from CosmosDB to Postgres. - /// - /// Logger instance. - /// The instance. - /// The instance. - /// - private static async Task MigrateLyricsAnalyzerCommandConfigsAsync(ILogger logger, MuzakBotDbContext muzakBotDbContext, LyricsAnalyzerDbContext lyricsAnalyzerDbContext) - { - int lyricsAnalyzerConfigsPostgresCount = await muzakBotDbContext.LyricsAnalyzerConfigs.CountAsync(); - - if (lyricsAnalyzerConfigsPostgresCount > 0) - { - logger.LogWarning("LyricsAnalyzerConfigs table in Postgres is not empty. Skipping migration."); - return; - } - - logger.LogInformation("Migrating LyricsAnalyzerConfigs from CosmosDB to Postgres..."); - LyricsAnalyzerConfig[] lyricsAnalyzerConfigsCosmosAll = await lyricsAnalyzerDbContext.LyricsAnalyzerConfigs.ToArrayAsync(); - - foreach (LyricsAnalyzerConfig lyricsAnalyzerConfig in lyricsAnalyzerConfigsCosmosAll) - { - muzakBotDbContext.LyricsAnalyzerConfigs.Add(lyricsAnalyzerConfig); - } - - await muzakBotDbContext.SaveChangesAsync(); - - logger.LogInformation("Migrated LyricsAnalyzerConfigs from CosmosDB to Postgres."); - } - - /// - /// Migrates LyricsAnalyzerPromptStyles from CosmosDB to Postgres. - /// - /// Logger instance. - /// The instance. - /// The instance. - /// - private static async Task MigrateLyricsAnalyzerPromptStylesAsync(ILogger logger, MuzakBotDbContext muzakBotDbContext, LyricsAnalyzerDbContext lyricsAnalyzerDbContext) - { - int lyricsAnalyzerPromptStylesPostgresCount = await muzakBotDbContext.LyricsAnalyzerPromptStyles.CountAsync(); - - if (lyricsAnalyzerPromptStylesPostgresCount > 0) - { - logger.LogWarning("LyricsAnalyzerPromptStyles table in Postgres is not empty. Skipping migration."); - return; - } - - logger.LogInformation("Migrating LyricsAnalyzerPromptStyles from CosmosDB to Postgres..."); - - List lyricsAnalyzerPromptStylesCosmosAll = await lyricsAnalyzerDbContext.LyricsAnalyzerPromptStyles.ToListAsync(); - - foreach (LyricsAnalyzerPromptStyle lyricsAnalyzerPromptStyle in lyricsAnalyzerPromptStylesCosmosAll) - { - lyricsAnalyzerPromptStyle.CreatedOn = lyricsAnalyzerPromptStyle.CreatedOn.ToUniversalTime(); - lyricsAnalyzerPromptStyle.LastUpdated = lyricsAnalyzerPromptStyle.LastUpdated.ToUniversalTime(); - muzakBotDbContext.LyricsAnalyzerPromptStyles.Add(lyricsAnalyzerPromptStyle); - } - - await muzakBotDbContext.SaveChangesAsync(); - - logger.LogInformation("Migrated LyricsAnalyzerPromptStyles from CosmosDB to Postgres."); - } - - /// - /// Migrates LyricsAnalyzerUserRateLimits from CosmosDB to Postgres. - /// - /// Logger instance. - /// The instance. - /// The instance. - /// - private static async Task MigrateLyricsAnalyzerUserRateLimitsAsync(ILogger logger, MuzakBotDbContext muzakBotDbContext, LyricsAnalyzerDbContext lyricsAnalyzerDbContext) - { - int lyricsAnalyzerUserRateLimitsPostgresCount = await muzakBotDbContext.LyricsAnalyzerUserRateLimits.CountAsync(); - - if (lyricsAnalyzerUserRateLimitsPostgresCount > 0) - { - logger.LogWarning("LyricsAnalyzerUserRateLimits table in Postgres is not empty. Skipping migration."); - return; - } - - logger.LogInformation("Migrating LyricsAnalyzerUserRateLimits from CosmosDB to Postgres..."); - LyricsAnalyzerUserRateLimit[] lyricsAnalyzerUserRateLimitsCosmosAll = await lyricsAnalyzerDbContext.LyricsAnalyzerUserRateLimits.ToArrayAsync(); - - foreach (LyricsAnalyzerUserRateLimit lyricsAnalyzerUserRateLimit in lyricsAnalyzerUserRateLimitsCosmosAll) - { - muzakBotDbContext.LyricsAnalyzerUserRateLimits.Add(lyricsAnalyzerUserRateLimit); - } - - await muzakBotDbContext.SaveChangesAsync(); - - logger.LogInformation("Migrated LyricsAnalyzerUserRateLimits from CosmosDB to Postgres."); - } - - /// - /// Migrates SongLyricsItems from CosmosDB to Postgres. - /// - /// Logger instance. - /// The instance. - /// The instance. - /// - private static async Task MigrateSongLyricsItemsAsync(ILogger logger, MuzakBotDbContext muzakBotDbContext, LyricsAnalyzerDbContext lyricsAnalyzerDbContext) - { - int songLyricsItemsPostgresCount = await muzakBotDbContext.SongLyricsItems.CountAsync(); - - if (songLyricsItemsPostgresCount > 0) - { - logger.LogWarning("SongLyricsItems table in Postgres is not empty. Skipping migration."); - return; - } - - logger.LogInformation("Migrating SongLyricsItems from CosmosDB to Postgres..."); - SongLyricsItem[] songLyricsItemsCosmosAll = await lyricsAnalyzerDbContext.SongLyricsItems.ToArrayAsync(); - - foreach (SongLyricsItem songLyricsItem in songLyricsItemsCosmosAll) - { - muzakBotDbContext.SongLyricsItems.Add(songLyricsItem); - } - - await muzakBotDbContext.SaveChangesAsync(); - - logger.LogInformation("Migrated SongLyricsItems from CosmosDB to Postgres."); - } - - /// - /// Migrates SongLyricsRequestJobs from CosmosDB to Postgres. - /// - /// Logger instance. - /// The instance. - /// The instance. - /// - private static async Task MigrateSongLyricsRequestJobsAsync(ILogger logger, MuzakBotDbContext muzakBotDbContext, LyricsAnalyzerDbContext lyricsAnalyzerDbContext) - { - int songLyricsRequestJobsPostgresCount = await muzakBotDbContext.SongLyricsRequestJobs.CountAsync(); - - if (songLyricsRequestJobsPostgresCount > 0) - { - logger.LogWarning("SongLyricsRequestJobs table in Postgres is not empty. Skipping migration."); - return; - } - - logger.LogInformation("Migrating SongLyricsRequestJobs from CosmosDB to Postgres..."); - SongLyricsRequestJob[] songLyricsRequestJobsCosmosAll = await lyricsAnalyzerDbContext.SongLyricsRequestJobs.ToArrayAsync(); - - foreach (SongLyricsRequestJob songLyricsRequestJob in songLyricsRequestJobsCosmosAll) - { - muzakBotDbContext.SongLyricsRequestJobs.Add(songLyricsRequestJob); - } - - await muzakBotDbContext.SaveChangesAsync(); - - logger.LogInformation("Migrated SongLyricsRequestJobs from CosmosDB to Postgres."); - } - - /// - /// Migrates DatabaseUpdates from CosmosDB to Postgres. - /// - /// Logger instance. - /// The instance. - /// The instance. - /// - private static async Task MigrateDatabaseUpdatesAsync(ILogger logger, MuzakBotDbContext muzakBotDbContext, LyricsAnalyzerDbContext lyricsAnalyzerDbContext) - { - int databaseUpdatesPostgresCount = await muzakBotDbContext.DatabaseUpdates.CountAsync(); - - if (databaseUpdatesPostgresCount > 0) - { - logger.LogWarning("DatabaseUpdates table in Postgres is not empty. Skipping migration."); - return; - } - - logger.LogInformation("Migrating DatabaseUpdates from CosmosDB to Postgres..."); - DatabaseUpdate[] databaseUpdatesCosmosAll = await lyricsAnalyzerDbContext.DatabaseUpdates.ToArrayAsync(); - - foreach (DatabaseUpdate databaseUpdate in databaseUpdatesCosmosAll) - { - muzakBotDbContext.DatabaseUpdates.Add(databaseUpdate); - } - - await muzakBotDbContext.SaveChangesAsync(); - - logger.LogInformation("Migrated DatabaseUpdates from CosmosDB to Postgres."); - } - - /// - /// Migrates LyricsAnalyzerItems from CosmosDB to Postgres. - /// - /// Logger instance. - /// The instance. - /// The instance. - /// - private static async Task MigrateLyricsAnalyzerItemsAsync(ILogger logger, MuzakBotDbContext muzakBotDbContext, LyricsAnalyzerDbContext lyricsAnalyzerDbContext) - { - int lyricsAnalyzerItemsPostgresCount = await muzakBotDbContext.LyricsAnalyzerItems.CountAsync(); - - if (lyricsAnalyzerItemsPostgresCount > 0) - { - logger.LogWarning("LyricsAnalyzerItems table in Postgres is not empty. Skipping migration."); - return; - } - - logger.LogInformation("Migrating LyricsAnalyzerItems from CosmosDB to Postgres..."); - LyricsAnalyzerItem[] lyricsAnalyzerItemsCosmosAll = await lyricsAnalyzerDbContext.LyricsAnalyzerItems.ToArrayAsync(); - - foreach (LyricsAnalyzerItem lyricsAnalyzerItem in lyricsAnalyzerItemsCosmosAll) - { - muzakBotDbContext.LyricsAnalyzerItems.Add(lyricsAnalyzerItem); - } - - await muzakBotDbContext.SaveChangesAsync(); - - logger.LogInformation("Migrated LyricsAnalyzerItems from CosmosDB to Postgres."); - } } diff --git a/src/Database/Extensions/AlbumReleaseDbContextExtensions.cs b/src/Database/Extensions/AlbumReleaseDbContextExtensions.cs deleted file mode 100644 index 4500e4f9..00000000 --- a/src/Database/Extensions/AlbumReleaseDbContextExtensions.cs +++ /dev/null @@ -1,130 +0,0 @@ -using System.Text; -using System.Text.Json.Nodes; - -using Microsoft.Azure.Cosmos; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; - -using MuzakBot.Database.Models; -using MuzakBot.Lib.Models.Database; - -namespace MuzakBot.Database.Extensions; - -/// -/// Extension methods for the class. -/// -public static class AlbumReleaseDbContextExtensions -{ - /// - /// Adds a factory to the service collection. - /// - /// The service collection. - /// The database configuration. - /// The same service collection so that multiple calls can be chained. - /// Thrown when an invalid database type is found. - public static IServiceCollection AddAlbumReleaseDbContextFactory(this IServiceCollection services, DatabaseConfig databaseConfig) - { - switch (databaseConfig.DatabaseType) - { - case DatabaseType.CosmosDb: - services.AddAlbumReleaseDbContextFactoryForCosmosDb(databaseConfig.CosmosDbConfig!); - break; - - case DatabaseType.PostgreSql: - services.AddAlbumReleaseDbContextFactoryForPostgres(databaseConfig.PostgresDbConfig!); - break; - - case DatabaseType.Sqlite: - services.AddAlbumReleaseDbContextFactoryForSqlite(databaseConfig.SqliteDbConfig!); - break; - - default: - throw new InvalidOperationException("Invalid database type."); - } - - return services; - } - - /// - /// Adds a factory and configures it for Cosmos DB to the service collection. - /// - /// The service collection. - /// The Cosmos DB configuration. - /// The same service collection so that multiple calls can be chained. - private static IServiceCollection AddAlbumReleaseDbContextFactoryForCosmosDb(this IServiceCollection services, CosmosDbConfigOptions cosmosDbConfig) - { - services.AddDbContextFactory(options => - { - options.UseCosmos( - connectionString: cosmosDbConfig.ConnectionString, - databaseName: "album_releases" - ); - }); - - return services; - } - - /// - /// Adds a factory and configures it for PostgreSQL to the service collection. - /// - /// The service collection. - /// The PostgreSQL configuration. - /// The same service collection so that multiple calls can be chained. - private static IServiceCollection AddAlbumReleaseDbContextFactoryForPostgres(this IServiceCollection services, PostgresConfigOptions postgresConfig) - { - services.AddDbContextFactory(options => - { - options.UseNpgsql($"{postgresConfig.ConnectionString}Database=album_releases;"); - }); - - return services; - } - - /// - /// Adds a factory and configures it for SQLite to the service collection. - /// - /// The service collection. - /// The SQLite DB configuration. - /// The same service collection so that multiple calls can be chained. - private static IServiceCollection AddAlbumReleaseDbContextFactoryForSqlite(this IServiceCollection services, SqliteDbConfigOptions sqliteDbConfig) - { - string dbPath = Path.Join(sqliteDbConfig.DbPath, "album_releases.sqlite"); - - services.AddDbContextFactory(options => - { - options.UseSqlite($"Data Source={dbPath}"); - }); - - return services; - } - - /// - /// Applies migrations for to the database. - /// - /// - /// This method will not apply migrations if the database is not relational. - /// - /// The host. - /// - public static async Task ApplyAlbumReleaseDbContextMigrations(this IHost host) - { - using var scope = host.Services.CreateScope(); - - var dbContextFactory = scope.ServiceProvider.GetRequiredService>(); - - using var context = dbContextFactory.CreateDbContext(); - - if (context.Database.IsRelational()) - { - await context.Database.MigrateAsync(); - await context.SaveChangesAsync(); - } - - if (context.Database.IsCosmos()) - { - await context.Database.EnsureCreatedAsync(); - } - } -} diff --git a/src/Database/Extensions/AlbumReleaseDbContextModelBuilderExtensions.cs b/src/Database/Extensions/AlbumReleaseDbContextModelBuilderExtensions.cs deleted file mode 100644 index 926a2df7..00000000 --- a/src/Database/Extensions/AlbumReleaseDbContextModelBuilderExtensions.cs +++ /dev/null @@ -1,70 +0,0 @@ -using Microsoft.EntityFrameworkCore; - -using MuzakBot.Lib.Models.Database.AlbumRelease; - -namespace MuzakBot.Database.Extensions; - -/// -/// Extension methods for creating the models for . -/// -public static class AlbumReleaseDbContextModelBuilderExtensions -{ - /// - /// Creates the model for the entity. - /// - /// The model builder. - /// The model builder. - public static ModelBuilder CreateAlbumReleaseReminderModel(this ModelBuilder modelBuilder) - { - modelBuilder.Entity(entity => - { - entity.ToTable("release_reminders"); - entity.ToContainer("release_reminders"); - - entity.HasKey(e => e.Id); - entity.HasPartitionKey(e => e.PartitionKey); - - entity - .Property(e => e.Id) - .HasColumnName("id") - .ToJsonProperty("id"); - - entity - .Property(e => e.PartitionKey) - .HasColumnName("partitionKey") - .ToJsonProperty("partitionKey"); - - entity - .Property(e => e.AlbumId) - .HasColumnName("albumId") - .ToJsonProperty("albumId"); - - entity - .Property(e => e.GuildId) - .HasColumnName("guildId") - .ToJsonProperty("guildId"); - - entity - .Property(e => e.ChannelId) - .HasColumnName("channelId") - .ToJsonProperty("channelId"); - - entity - .Property(e => e.UserIdsToRemind) - .HasColumnName("userIdsToRemind") - .ToJsonProperty("userIdsToRemind"); - - entity - .Property(e => e.ReleaseDate) - .HasColumnName("releaseDate") - .ToJsonProperty("releaseDate"); - - entity - .Property(e => e.ReminderSent) - .HasColumnName("reminderSent") - .ToJsonProperty("reminderSent"); - }); - - return modelBuilder; - } -} diff --git a/src/Database/Extensions/DatabaseConfigExtensions.cs b/src/Database/Extensions/DatabaseConfigExtensions.cs index 96ba3b95..dfc907f4 100644 --- a/src/Database/Extensions/DatabaseConfigExtensions.cs +++ b/src/Database/Extensions/DatabaseConfigExtensions.cs @@ -25,15 +25,6 @@ public static DatabaseConfig GetDatabaseConfig(this ConfigurationManager configu DatabaseConfig databaseConfig = databaseType switch { - DatabaseType.CosmosDb => new() - { - DatabaseType = databaseType, - CosmosDbConfig = new() - { - ConnectionString = configuration.GetValue("COSMOSDB_CONNECTIONSTRING") ?? throw new ConfigValueNotFoundException("COSMOSDB_CONNECTIONSTRING") - } - }, - DatabaseType.PostgreSql => new() { DatabaseType = databaseType, diff --git a/src/Database/Extensions/LyricsAnalyzerDbContextExtensions.cs b/src/Database/Extensions/LyricsAnalyzerDbContextExtensions.cs deleted file mode 100644 index 6ca2b36d..00000000 --- a/src/Database/Extensions/LyricsAnalyzerDbContextExtensions.cs +++ /dev/null @@ -1,281 +0,0 @@ -using System.Text; -using System.Text.Json.Nodes; - -using Microsoft.Azure.Cosmos; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; - -using MuzakBot.Database.Models; -using MuzakBot.Lib.Models.Database; - -namespace MuzakBot.Database.Extensions; - -/// -/// Extension methods for the class. -/// -public static class LyricsAnalyzerDbContextExtensions -{ - /// - /// Adds a factory to the service collection. - /// - /// The service collection. - /// The database configuration. - /// The same service collection so that multiple calls can be chained. - /// Thrown when an invalid database type is found. - public static IServiceCollection AddLyricsAnalyzerDbContextFactory(this IServiceCollection services, DatabaseConfig databaseConfig) - { - switch (databaseConfig.DatabaseType) - { - case DatabaseType.CosmosDb: - services.AddLyricsAnalyzerDbContextFactoryForCosmosDb(databaseConfig.CosmosDbConfig!); - break; - - case DatabaseType.PostgreSql: - services.AddLyricsAnalyzerDbContextFactoryForPostgres(databaseConfig.PostgresDbConfig!); - break; - - case DatabaseType.Sqlite: - services.AddLyricsAnalyzerDbContextFactoryForSqlite(databaseConfig.SqliteDbConfig!); - break; - - default: - throw new InvalidOperationException("Invalid database type."); - } - - return services; - } - - /// - /// Adds a factory and configures it for Cosmos DB to the service collection. - /// - /// The service collection. - /// The Cosmos DB configuration. - /// The same service collection so that multiple calls can be chained. - private static IServiceCollection AddLyricsAnalyzerDbContextFactoryForCosmosDb(this IServiceCollection services, CosmosDbConfigOptions cosmosDbConfig) - { - services.AddDbContextFactory(options => - { - options.UseCosmos( - connectionString: cosmosDbConfig.ConnectionString, - databaseName: "lyrics_analyzer" - ); - }); - - return services; - } - - /// - /// Adds a factory and configures it for PostgreSQL to the service collection. - /// - /// The service collection. - /// The PostgreSQL configuration. - /// The same service collection so that multiple calls can be chained. - private static IServiceCollection AddLyricsAnalyzerDbContextFactoryForPostgres(this IServiceCollection services, PostgresConfigOptions postgresDbConfig) - { - services.AddDbContextFactory(options => - { - options.UseNpgsql($"{postgresDbConfig.ConnectionString}Database=lyrics_analyzer;"); - }); - - return services; - } - - /// - /// Adds a factory and configures it for SQLite to the service collection. - /// - /// The service collection. - /// The SQLite DB configuration. - /// The same service collection so that multiple calls can be chained. - private static IServiceCollection AddLyricsAnalyzerDbContextFactoryForSqlite(this IServiceCollection services, SqliteDbConfigOptions sqliteDbConfig) - { - string dbPath = Path.Join(sqliteDbConfig.DbPath, "lyrics_analyzer.sqlite"); - - services.AddDbContextFactory(options => - { - options.UseSqlite($"Data Source={dbPath}"); - }); - - return services; - } - - /// - /// Applies migrations for to the database. - /// - /// - /// This method will not apply migrations if the database is not relational. - /// - /// The host. - /// - public static async Task ApplyLyricsAnalyzerDbContextMigrations(this IHost host) - { - using var scope = host.Services.CreateScope(); - - var dbContextFactory = scope.ServiceProvider.GetRequiredService>(); - - using var context = dbContextFactory.CreateDbContext(); - - if (context.Database.IsRelational()) - { - await context.Database.MigrateAsync(); - await context.SaveChangesAsync(); - } - - if (context.Database.IsCosmos()) - { - await context.Database.EnsureCreatedAsync(); - - DatabaseUpdate databaseUpdates = await context.DatabaseUpdates - .WithPartitionKey("applied-updates") - .FirstOrDefaultAsync() - ?? new() - { - Id = Guid.NewGuid().ToString(), - PartitionKey = "applied-updates", - FirstRun = true, - MigratedToEfCore = false - }; - - if (!databaseUpdates.MigratedToEfCore) - { - using ILoggerFactory loggerFactory = LoggerFactory.Create(builder => - { - builder.AddSimpleConsole(options => - { - options.IncludeScopes = true; - }); - }); - - ILogger logger = loggerFactory.CreateLogger("MuzakBot.Database.Upgrade"); - - logger.LogWarning("Initial EF Core migration has not been applied yet. Applying migration..."); - - await dbContextFactory.EnsureDiscriminatorValuesExistAsync_CosmosDb(); - - databaseUpdates.MigratedToEfCore = true; - - if (databaseUpdates.FirstRun) - { - context.DatabaseUpdates.Add(databaseUpdates); - } - else - { - context.DatabaseUpdates.Update(databaseUpdates); - } - - await context.SaveChangesAsync(); - - logger.LogInformation("Initial EF Core migration has been applied."); - } - } - } - - /// - /// Ensures that discriminator values exist in the Cosmos DB containers. - /// - /// The database context factory. - /// - private static async Task EnsureDiscriminatorValuesExistAsync_CosmosDb(this IDbContextFactory dbContextFactory) - { - Tuple[] containerUpdates = [ - new("command_configs", "lyricsanalyzer-config", "LyricsAnalyzerConfig"), - new("prompt_styles", "prompt-style", "LyricsAnalyzerPromptStyle"), - new("user_rate_limit", "user-item", "LyricsAnalyzerUserRateLimit") - ]; - - foreach (var (containerName, partitionKey, discriminatorValue) in containerUpdates) - { - await dbContextFactory.AddDiscriminatorPropertyAsync( - databaseName: "lyrics_analyzer", - containerName: containerName, - partitionKey: partitionKey, - discriminatorValue: discriminatorValue - ); - } - } - - /// - /// Adds a discriminator property to documents in a Cosmos DB container. - /// - /// The database context factory. - /// The name of the database. - /// The name of the container. - /// The partition key for the items in the container. - /// The value of the discriminator property. - /// - private static async Task AddDiscriminatorPropertyAsync(this IDbContextFactory dbContextFactory, string databaseName, string containerName, string partitionKey, string discriminatorValue) - { - using ILoggerFactory loggerFactory = LoggerFactory.Create(builder => - { - builder.AddSimpleConsole(options => - { - options.IncludeScopes = true; - }); - }); - - ILogger logger = loggerFactory.CreateLogger("MuzakBot.Database.Upgrade"); - - using var dbContext = dbContextFactory.CreateDbContext(); - - var cosmosClient = dbContext.Database.GetCosmosClient(); - - var container = cosmosClient.GetContainer(databaseName, containerName); - - QueryDefinition query = new("SELECT * FROM c"); - - using var feedIterator = container.GetItemQueryStreamIterator( - queryDefinition: query, - requestOptions: new() - { - PartitionKey = new(partitionKey) - } - ); - - while (feedIterator.HasMoreResults) - { - using var response = await feedIterator.ReadNextAsync(); - - JsonNode? jsonNode = JsonNode.Parse( - utf8Json: response.Content - ); - - if (jsonNode is null) - { - continue; - } - - if (jsonNode["Documents"] is null) - { - continue; - } - - foreach (var document in jsonNode["Documents"]!.AsArray()) - { - if (document is null) - { - continue; - } - - if (document["Discriminator"] is not null) - { - continue; - } - - document["Discriminator"] = JsonValue.Create(discriminatorValue); - - using var stream = new MemoryStream(); - - await stream.WriteAsync(Encoding.UTF8.GetBytes(document.ToJsonString())); - - await container.ReplaceItemStreamAsync( - streamPayload: stream, - id: document["id"]!.GetValue(), - partitionKey: new(partitionKey) - ); - } - - logger.LogInformation("Discriminator property added to documents in container '{ContainerName}'.", containerName); - } - } -} diff --git a/src/Database/Extensions/LyricsAnalyzerDbContextModelBuilderExtensions.cs b/src/Database/Extensions/LyricsAnalyzerDbContextModelBuilderExtensions.cs deleted file mode 100644 index 17cbef3f..00000000 --- a/src/Database/Extensions/LyricsAnalyzerDbContextModelBuilderExtensions.cs +++ /dev/null @@ -1,436 +0,0 @@ -using Microsoft.EntityFrameworkCore; - -using MuzakBot.Lib.Models.Database; -using MuzakBot.Lib.Models.Database.LyricsAnalyzer; - -namespace MuzakBot.Database.Extensions; - -internal static class LyricsAnalyzerDbContextModelBuilderExtensions -{ - /// - /// Creates the model for the class. - /// - /// The model builder. - /// The same builder instance so that multiple calls can be chained. - public static ModelBuilder CreateDatabaseUpdateModel(this ModelBuilder modelBuilder) - { - modelBuilder.Entity(entity => - { - entity.ToTable("database_updates"); - entity.ToContainer("database_updates"); - - entity.HasKey(e => e.Id); - entity.HasPartitionKey(e => e.PartitionKey); - - entity - .Property(e => e.Id) - .HasColumnName("id") - .ToJsonProperty("id"); - - entity - .Property(e => e.PartitionKey) - .HasColumnName("partitionKey") - .ToJsonProperty("partitionKey"); - - entity - .Property(e => e.MigratedToEfCore) - .HasColumnName("migratedToEfCore") - .ToJsonProperty("migratedToEfCore"); - }); - - return modelBuilder; - } - - /// - /// Creates the model for the class. - /// - /// The model builder. - /// The same builder instance so that multiple calls can be chained. - public static ModelBuilder CreateSongLyricsItemModel(this ModelBuilder modelBuilder) - { - modelBuilder.Entity(entity => - { - entity.ToTable("song_lyrics"); - entity.ToContainer("song_lyrics"); - - entity.HasKey(e => e.Id); - entity.HasPartitionKey(e => e.PartitionKey); - - entity - .Property(e => e.Id) - .HasColumnName("id") - .ToJsonProperty("id"); - - entity - .Property(e => e.PartitionKey) - .HasColumnName("partitionKey") - .ToJsonProperty("partitionKey"); - - entity - .Property(e => e.ArtistName) - .HasColumnName("artistName") - .ToJsonProperty("artistName"); - - entity - .Property(e => e.SongName) - .HasColumnName("songName") - .ToJsonProperty("songName"); - - entity - .Property(e => e.Lyrics) - .HasColumnName("lyrics") - .ToJsonProperty("lyrics"); - - entity - .Property(e => e.CreatedAt) - .HasColumnName("createdAt") - .ToJsonProperty("createdAt"); - }); - - return modelBuilder; - } - - /// - /// Creates the model for the class. - /// - /// The model builder. - /// The same builder instance so that multiple calls can be chained. - public static ModelBuilder CreateSongLyricsRequestJobModel(this ModelBuilder modelBuilder) - { - modelBuilder.Entity(entity => - { - entity.ToTable("song_lyrics_request_jobs"); - entity.ToContainer("song_lyrics_request_jobs"); - - entity.HasKey(e => e.Id); - entity.HasPartitionKey(e => e.PartitionKey); - - entity - .Property(e => e.Id) - .HasColumnName("id") - .ToJsonProperty("id"); - - entity - .Property(e => e.PartitionKey) - .HasColumnName("partitionKey") - .ToJsonProperty("partitionKey"); - - entity - .Property(e => e.GeniusUrl) - .HasColumnName("geniusUrl") - .ToJsonProperty("geniusUrl"); - - entity - .Property(e => e.CreatedAt) - .HasColumnName("createdAt") - .ToJsonProperty("createdAt"); - - entity - .Property(e => e.StandaloneServiceAcknowledged) - .HasColumnName("standaloneServiceAcknowledged") - .ToJsonProperty("standaloneServiceAcknowledged"); - - entity - .Property(e => e.FallbackMethodNeeded) - .HasColumnName("fallbackMethodNeeded") - .ToJsonProperty("fallbackMethodNeeded"); - - entity - .Property(e => e.IsCompleted) - .HasColumnName("isCompleted") - .ToJsonProperty("isCompleted"); - - entity - .Property(e => e.SongLyricsItemId) - .HasColumnName("songLyricsItemId") - .ToJsonProperty("songLyricsItemId"); - }); - - return modelBuilder; - } - - /// - /// Creates the model for the class. - /// - /// The model builder. - /// The same builder instance so that multiple calls can be chained. - public static ModelBuilder CreateLyricsAnalyzerItemModel(this ModelBuilder modelBuilder) - { - modelBuilder.Entity(entity => - { - entity.ToTable("lyrics_analyzer_items"); - entity.ToContainer("lyrics_analyzer_items"); - - entity.HasKey(e => e.Id); - entity.HasPartitionKey(e => e.PartitionKey); - - entity - .Property(e => e.Id) - .HasColumnName("id") - .ToJsonProperty("id"); - - entity - .Property(e => e.PartitionKey) - .HasColumnName("partitionKey") - .ToJsonProperty("partitionKey"); - - entity - .Property(e => e.ArtistName) - .HasColumnName("artistName") - .ToJsonProperty("artistName"); - - entity - .Property(e => e.SongName) - .HasColumnName("songName") - .ToJsonProperty("songName"); - - entity - .Property(e => e.PromptStyle) - .HasColumnName("promptStyle") - .ToJsonProperty("promptStyle"); - - entity - .Property(e => e.CreatedAt) - .HasColumnName("createdAt") - .ToJsonProperty("createdAt"); - }); - - return modelBuilder; - } - - /// - /// Creates the model for the class. - /// - /// The model builder. - /// The same builder instance so that multiple calls can be chained. - public static ModelBuilder CreateLyricsAnalyzerConfigModel(this ModelBuilder modelBuilder) - { - modelBuilder.Entity(entity => - { - entity.ToTable("command_configs"); - entity.ToContainer("command_configs"); - - entity.HasKey(e => e.Id); - entity.HasPartitionKey(e => e.PartitionKey); - - entity - .Property(e => e.Id) - .HasColumnName("id") - .ToJsonProperty("id"); - - entity - .Property(e => e.PartitionKey) - .HasColumnName("partitionKey") - .ToJsonProperty("partitionKey"); - - entity - .Property(e => e.RateLimitEnabled) - .HasColumnName("rateLimitEnabled") - .ToJsonProperty("rateLimitEnabled"); - - entity - .Property(e => e.RateLimitMaxRequests) - .HasColumnName("rateLimitMaxRequests") - .ToJsonProperty("rateLimitMaxRequests"); - - entity - .Property(e => e.RateLimitIgnoredUserIds) - .HasColumnName("rateLimitIgnoredUserIds") - .ToJsonProperty("rateLimitIgnoredUserIds"); - - entity - .Property(e => e.CommandIsEnabledToSpecificGuilds) - .HasColumnName("commandIsEnabledToSpecificGuilds") - .ToJsonProperty("commandIsEnabledToSpecificGuilds"); - - entity - .Property(e => e.CommandEnabledGuildIds) - .HasColumnName("commandEnabledGuildIds") - .ToJsonProperty("commandEnabledGuildIds"); - - entity - .Property(e => e.CommandDisabledGuildIds) - .HasColumnName("commandDisabledGuildIds") - .ToJsonProperty("commandDisabledGuildIds"); - }); - - return modelBuilder; - } - - /// - /// Creates the model for the class. - /// - /// The model builder. - /// The same builder instance so that multiple calls can be chained. - public static ModelBuilder CreateLyricsAnalyzerPromptStyleModel(this ModelBuilder modelBuilder) - { - modelBuilder.Entity(entity => - { - entity.ToTable("prompt_styles"); - entity.ToContainer("prompt_styles"); - - entity.HasKey(e => e.Id); - entity.HasPartitionKey(e => e.PartitionKey); - - entity - .Property(e => e.Id) - .HasColumnName("id") - .ToJsonProperty("id"); - - entity - .Property(e => e.PartitionKey) - .HasColumnName("partitionKey") - .ToJsonProperty("partitionKey"); - - entity - .Property(e => e.Name) - .HasColumnName("name") - .ToJsonProperty("name"); - - entity - .Property(e => e.ShortName) - .HasColumnName("shortName") - .ToJsonProperty("shortName"); - - entity - .Property(e => e.GptModel) - .HasColumnName("gptModel") - .ToJsonProperty("gptModel"); - - entity - .Property(e => e.AnalysisType) - .HasColumnName("analysisType") - .ToJsonProperty("analysisType"); - - entity - .Property(e => e.Prompt) - .HasColumnName("prompt") - .ToJsonProperty("prompt"); - - entity - .Property(e => e.UserPrompt) - .HasColumnName("userPrompt") - .ToJsonProperty("userPrompt"); - - entity - .Property(e => e.NoticeText) - .HasColumnName("noticeText") - .ToJsonProperty("noticeText"); - - entity - .Property(e => e.CreatedOn) - .HasColumnName("createdOn") - .ToJsonProperty("createdOn"); - - entity - .Property(e => e.LastUpdated) - .HasColumnName("lastUpdated") - .ToJsonProperty("lastUpdated"); - }); - - return modelBuilder; - } - - /// - /// Creates the model for the class. - /// - /// The model builder. - /// The same builder instance so that multiple calls can be chained. - public static ModelBuilder CreateLyricsAnalyzerUserRateLimitModel(this ModelBuilder modelBuilder) - { - modelBuilder.Entity(entity => - { - entity.ToTable("user_rate_limit"); - entity.ToContainer("user_rate_limit"); - - entity.HasKey(e => e.Id); - entity.HasPartitionKey(e => e.PartitionKey); - - entity - .Property(e => e.Id) - .HasColumnName("id") - .ToJsonProperty("id"); - - entity - .Property(e => e.PartitionKey) - .HasColumnName("partitionKey") - .ToJsonProperty("partitionKey"); - - entity - .Property(e => e.UserId) - .HasColumnName("userId") - .ToJsonProperty("userId"); - - entity - .Property(e => e.CurrentRequestCount) - .HasColumnName("currentRequestCount") - .ToJsonProperty("currentRequestCount"); - - entity - .Property(e => e.LastRequestTime) - .HasColumnName("lastRequestTime") - .ToJsonProperty("lastRequestTime"); - }); - - return modelBuilder; - } - - /// - /// Creates the model for the class. - /// - /// The model builder. - /// The same builder instance so that multiple calls can be chained. - public static ModelBuilder CreateAnalyedLyricsModel(this ModelBuilder modelBuilder) - { - modelBuilder.Entity(entity => - { - entity.ToTable("analyzed_lyrics"); - entity.ToContainer("analyzed_lyrics"); - - entity.HasKey(e => e.Id); - entity.HasPartitionKey(e => e.PartitionKey); - - entity - .Property(e => e.Id) - .HasColumnName("id") - .ToJsonProperty("id"); - - entity - .Property(e => e.PartitionKey) - .HasColumnName("partitionKey") - .ToJsonProperty("partitionKey"); - - entity - .Property(e => e.CreatedAt) - .HasColumnName("createdAt") - .ToJsonProperty("createdAt"); - - entity - .Property(e => e.ArtistName) - .HasColumnName("artistName") - .ToJsonProperty("artistName"); - - entity - .Property(e => e.SongName) - .HasColumnName("songName") - .ToJsonProperty("songName"); - - entity - .Property(e => e.PromptStyleUsed) - .HasColumnName("promptStyleUsed") - .ToJsonProperty("promptStyleUsed"); - - entity - .Property(e => e.SongLyricsId) - .HasColumnName("songLyricsId") - .ToJsonProperty("songLyricsId"); - - entity - .Property(e => e.Analysis) - .HasColumnName("analysis") - .ToJsonProperty("analysis"); - }); - - return modelBuilder; - } -} diff --git a/src/Database/Migrations/20240403162518_Initial.Designer.cs b/src/Database/Migrations/20240403162518_Initial.Designer.cs deleted file mode 100644 index 0c34779e..00000000 --- a/src/Database/Migrations/20240403162518_Initial.Designer.cs +++ /dev/null @@ -1,127 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using MuzakBot.Database; - -#nullable disable - -namespace MuzakBot.Database.Migrations -{ - [DbContext(typeof(LyricsAnalyzerDbContext))] - [Migration("20240403162518_Initial")] - partial class Initial - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.3"); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.LyricsAnalyzer.SongLyricsItem", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("ArtistName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("artistName") - .HasAnnotation("Cosmos:PropertyName", "artistName") - .HasAnnotation("Relational:JsonPropertyName", "artistName"); - - b.Property("CreatedAt") - .HasColumnType("TEXT") - .HasColumnName("createdAt") - .HasAnnotation("Cosmos:PropertyName", "createdAt") - .HasAnnotation("Relational:JsonPropertyName", "createdAt"); - - b.Property("Lyrics") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("lyrics") - .HasAnnotation("Cosmos:PropertyName", "lyrics") - .HasAnnotation("Relational:JsonPropertyName", "lyrics"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("SongName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("songName") - .HasAnnotation("Cosmos:PropertyName", "songName") - .HasAnnotation("Relational:JsonPropertyName", "songName"); - - b.HasKey("Id"); - - b.ToTable("song_lyrics", (string)null); - - b.HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.LyricsAnalyzer.SongLyricsRequestJob", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("TEXT") - .HasColumnName("createdAt") - .HasAnnotation("Cosmos:PropertyName", "createdAt") - .HasAnnotation("Relational:JsonPropertyName", "createdAt"); - - b.Property("FallbackMethodNeeded") - .HasColumnType("INTEGER") - .HasColumnName("fallbackMethodNeeded") - .HasAnnotation("Cosmos:PropertyName", "fallbackMethodNeeded") - .HasAnnotation("Relational:JsonPropertyName", "fallbackMethodNeeded"); - - b.Property("GeniusUrl") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("geniusUrl") - .HasAnnotation("Cosmos:PropertyName", "geniusUrl") - .HasAnnotation("Relational:JsonPropertyName", "geniusUrl"); - - b.Property("IsCompleted") - .HasColumnType("INTEGER") - .HasColumnName("isCompleted") - .HasAnnotation("Cosmos:PropertyName", "isCompleted") - .HasAnnotation("Relational:JsonPropertyName", "isCompleted"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("StandaloneServiceAcknowledged") - .HasColumnType("INTEGER") - .HasColumnName("standaloneServiceAcknowledged") - .HasAnnotation("Cosmos:PropertyName", "standaloneServiceAcknowledged") - .HasAnnotation("Relational:JsonPropertyName", "standaloneServiceAcknowledged"); - - b.HasKey("Id"); - - b.ToTable("song_lyrics_request_jobs", (string)null); - - b.HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Database/Migrations/20240403162518_Initial.cs b/src/Database/Migrations/20240403162518_Initial.cs deleted file mode 100644 index 069731b8..00000000 --- a/src/Database/Migrations/20240403162518_Initial.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System; - -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace MuzakBot.Database.Migrations -{ - /// - public partial class Initial : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "song_lyrics", - columns: table => new - { - id = table.Column(type: "TEXT", nullable: false), - artistName = table.Column(type: "TEXT", nullable: false), - songName = table.Column(type: "TEXT", nullable: false), - lyrics = table.Column(type: "TEXT", nullable: false), - createdAt = table.Column(type: "TEXT", nullable: false), - partitionKey = table.Column(type: "TEXT", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_song_lyrics", x => x.id); - }); - - migrationBuilder.CreateTable( - name: "song_lyrics_request_jobs", - columns: table => new - { - id = table.Column(type: "TEXT", nullable: false), - geniusUrl = table.Column(type: "TEXT", nullable: false), - createdAt = table.Column(type: "TEXT", nullable: false), - standaloneServiceAcknowledged = table.Column(type: "INTEGER", nullable: false), - fallbackMethodNeeded = table.Column(type: "INTEGER", nullable: false), - isCompleted = table.Column(type: "INTEGER", nullable: false), - partitionKey = table.Column(type: "TEXT", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_song_lyrics_request_jobs", x => x.id); - }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "song_lyrics"); - - migrationBuilder.DropTable( - name: "song_lyrics_request_jobs"); - } - } -} diff --git a/src/Database/Migrations/20240403173418_AddSongLyricsItemIdProperty.Designer.cs b/src/Database/Migrations/20240403173418_AddSongLyricsItemIdProperty.Designer.cs deleted file mode 100644 index 0361d22a..00000000 --- a/src/Database/Migrations/20240403173418_AddSongLyricsItemIdProperty.Designer.cs +++ /dev/null @@ -1,137 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using MuzakBot.Database; - -#nullable disable - -namespace MuzakBot.Database.Migrations -{ - [DbContext(typeof(LyricsAnalyzerDbContext))] - [Migration("20240403173418_AddSongLyricsItemIdProperty")] - partial class AddSongLyricsItemIdProperty - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.3"); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.LyricsAnalyzer.SongLyricsItem", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("ArtistName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("artistName") - .HasAnnotation("Cosmos:PropertyName", "artistName") - .HasAnnotation("Relational:JsonPropertyName", "artistName"); - - b.Property("CreatedAt") - .HasColumnType("TEXT") - .HasColumnName("createdAt") - .HasAnnotation("Cosmos:PropertyName", "createdAt") - .HasAnnotation("Relational:JsonPropertyName", "createdAt"); - - b.Property("Lyrics") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("lyrics") - .HasAnnotation("Cosmos:PropertyName", "lyrics") - .HasAnnotation("Relational:JsonPropertyName", "lyrics"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("SongName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("songName") - .HasAnnotation("Cosmos:PropertyName", "songName") - .HasAnnotation("Relational:JsonPropertyName", "songName"); - - b.HasKey("Id"); - - b.ToTable("song_lyrics", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "song_lyrics") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.LyricsAnalyzer.SongLyricsRequestJob", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("TEXT") - .HasColumnName("createdAt") - .HasAnnotation("Cosmos:PropertyName", "createdAt") - .HasAnnotation("Relational:JsonPropertyName", "createdAt"); - - b.Property("FallbackMethodNeeded") - .HasColumnType("INTEGER") - .HasColumnName("fallbackMethodNeeded") - .HasAnnotation("Cosmos:PropertyName", "fallbackMethodNeeded") - .HasAnnotation("Relational:JsonPropertyName", "fallbackMethodNeeded"); - - b.Property("GeniusUrl") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("geniusUrl") - .HasAnnotation("Cosmos:PropertyName", "geniusUrl") - .HasAnnotation("Relational:JsonPropertyName", "geniusUrl"); - - b.Property("IsCompleted") - .HasColumnType("INTEGER") - .HasColumnName("isCompleted") - .HasAnnotation("Cosmos:PropertyName", "isCompleted") - .HasAnnotation("Relational:JsonPropertyName", "isCompleted"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("SongLyricsItemId") - .HasColumnType("TEXT") - .HasColumnName("songLyricsItemId") - .HasAnnotation("Cosmos:PropertyName", "songLyricsItemId") - .HasAnnotation("Relational:JsonPropertyName", "songLyricsItemId"); - - b.Property("StandaloneServiceAcknowledged") - .HasColumnType("INTEGER") - .HasColumnName("standaloneServiceAcknowledged") - .HasAnnotation("Cosmos:PropertyName", "standaloneServiceAcknowledged") - .HasAnnotation("Relational:JsonPropertyName", "standaloneServiceAcknowledged"); - - b.HasKey("Id"); - - b.ToTable("song_lyrics_request_jobs", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "song_lyrics_request_jobs") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Database/Migrations/20240403173418_AddSongLyricsItemIdProperty.cs b/src/Database/Migrations/20240403173418_AddSongLyricsItemIdProperty.cs deleted file mode 100644 index fa8f2023..00000000 --- a/src/Database/Migrations/20240403173418_AddSongLyricsItemIdProperty.cs +++ /dev/null @@ -1,28 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace MuzakBot.Database.Migrations -{ - /// - public partial class AddSongLyricsItemIdProperty : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "songLyricsItemId", - table: "song_lyrics_request_jobs", - type: "TEXT", - nullable: true); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "songLyricsItemId", - table: "song_lyrics_request_jobs"); - } - } -} diff --git a/src/Database/Migrations/20240419011819_AddLyricsAnalyzerItems.Designer.cs b/src/Database/Migrations/20240419011819_AddLyricsAnalyzerItems.Designer.cs deleted file mode 100644 index 670aa436..00000000 --- a/src/Database/Migrations/20240419011819_AddLyricsAnalyzerItems.Designer.cs +++ /dev/null @@ -1,190 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using MuzakBot.Database; - -#nullable disable - -namespace MuzakBot.Database.Migrations -{ - [DbContext(typeof(LyricsAnalyzerDbContext))] - [Migration("20240419011819_AddLyricsAnalyzerItems")] - partial class AddLyricsAnalyzerItems - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.4"); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.LyricsAnalyzer.LyricsAnalyzerItem", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("ArtistName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("artistName") - .HasAnnotation("Cosmos:PropertyName", "artistName") - .HasAnnotation("Relational:JsonPropertyName", "artistName"); - - b.Property("CreatedAt") - .IsConcurrencyToken() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("TEXT") - .HasColumnName("createdAt") - .HasAnnotation("Cosmos:PropertyName", "createdAt") - .HasAnnotation("Relational:JsonPropertyName", "createdAt"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("PromptStyle") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("promptStyle") - .HasAnnotation("Cosmos:PropertyName", "promptStyle") - .HasAnnotation("Relational:JsonPropertyName", "promptStyle"); - - b.Property("SongName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("songName") - .HasAnnotation("Cosmos:PropertyName", "songName") - .HasAnnotation("Relational:JsonPropertyName", "songName"); - - b.HasKey("Id"); - - b.ToTable("lyrics_analyzer_items", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "lyrics_analyzer_items") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.LyricsAnalyzer.SongLyricsItem", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("ArtistName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("artistName") - .HasAnnotation("Cosmos:PropertyName", "artistName") - .HasAnnotation("Relational:JsonPropertyName", "artistName"); - - b.Property("CreatedAt") - .HasColumnType("TEXT") - .HasColumnName("createdAt") - .HasAnnotation("Cosmos:PropertyName", "createdAt") - .HasAnnotation("Relational:JsonPropertyName", "createdAt"); - - b.Property("Lyrics") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("lyrics") - .HasAnnotation("Cosmos:PropertyName", "lyrics") - .HasAnnotation("Relational:JsonPropertyName", "lyrics"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("SongName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("songName") - .HasAnnotation("Cosmos:PropertyName", "songName") - .HasAnnotation("Relational:JsonPropertyName", "songName"); - - b.HasKey("Id"); - - b.ToTable("song_lyrics", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "song_lyrics") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.LyricsAnalyzer.SongLyricsRequestJob", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("TEXT") - .HasColumnName("createdAt") - .HasAnnotation("Cosmos:PropertyName", "createdAt") - .HasAnnotation("Relational:JsonPropertyName", "createdAt"); - - b.Property("FallbackMethodNeeded") - .HasColumnType("INTEGER") - .HasColumnName("fallbackMethodNeeded") - .HasAnnotation("Cosmos:PropertyName", "fallbackMethodNeeded") - .HasAnnotation("Relational:JsonPropertyName", "fallbackMethodNeeded"); - - b.Property("GeniusUrl") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("geniusUrl") - .HasAnnotation("Cosmos:PropertyName", "geniusUrl") - .HasAnnotation("Relational:JsonPropertyName", "geniusUrl"); - - b.Property("IsCompleted") - .HasColumnType("INTEGER") - .HasColumnName("isCompleted") - .HasAnnotation("Cosmos:PropertyName", "isCompleted") - .HasAnnotation("Relational:JsonPropertyName", "isCompleted"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("SongLyricsItemId") - .HasColumnType("TEXT") - .HasColumnName("songLyricsItemId") - .HasAnnotation("Cosmos:PropertyName", "songLyricsItemId") - .HasAnnotation("Relational:JsonPropertyName", "songLyricsItemId"); - - b.Property("StandaloneServiceAcknowledged") - .HasColumnType("INTEGER") - .HasColumnName("standaloneServiceAcknowledged") - .HasAnnotation("Cosmos:PropertyName", "standaloneServiceAcknowledged") - .HasAnnotation("Relational:JsonPropertyName", "standaloneServiceAcknowledged"); - - b.HasKey("Id"); - - b.ToTable("song_lyrics_request_jobs", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "song_lyrics_request_jobs") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Database/Migrations/20240419011819_AddLyricsAnalyzerItems.cs b/src/Database/Migrations/20240419011819_AddLyricsAnalyzerItems.cs deleted file mode 100644 index b5e5919d..00000000 --- a/src/Database/Migrations/20240419011819_AddLyricsAnalyzerItems.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; - -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace MuzakBot.Database.Migrations -{ - /// - public partial class AddLyricsAnalyzerItems : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "lyrics_analyzer_items", - columns: table => new - { - id = table.Column(type: "TEXT", nullable: false), - artistName = table.Column(type: "TEXT", nullable: false), - songName = table.Column(type: "TEXT", nullable: false), - promptStyle = table.Column(type: "TEXT", nullable: false), - createdAt = table.Column(type: "TEXT", rowVersion: true, nullable: false), - partitionKey = table.Column(type: "TEXT", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_lyrics_analyzer_items", x => x.id); - }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "lyrics_analyzer_items"); - } - } -} diff --git a/src/Database/Migrations/20240419013754_RemoveTimestampAnnotation_LyricsAnalyzerItem.Designer.cs b/src/Database/Migrations/20240419013754_RemoveTimestampAnnotation_LyricsAnalyzerItem.Designer.cs deleted file mode 100644 index d5ad53d3..00000000 --- a/src/Database/Migrations/20240419013754_RemoveTimestampAnnotation_LyricsAnalyzerItem.Designer.cs +++ /dev/null @@ -1,188 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using MuzakBot.Database; - -#nullable disable - -namespace MuzakBot.Database.Migrations -{ - [DbContext(typeof(LyricsAnalyzerDbContext))] - [Migration("20240419013754_RemoveTimestampAnnotation_LyricsAnalyzerItem")] - partial class RemoveTimestampAnnotation_LyricsAnalyzerItem - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.4"); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.LyricsAnalyzer.LyricsAnalyzerItem", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("ArtistName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("artistName") - .HasAnnotation("Cosmos:PropertyName", "artistName") - .HasAnnotation("Relational:JsonPropertyName", "artistName"); - - b.Property("CreatedAt") - .HasColumnType("TEXT") - .HasColumnName("createdAt") - .HasAnnotation("Cosmos:PropertyName", "createdAt") - .HasAnnotation("Relational:JsonPropertyName", "createdAt"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("PromptStyle") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("promptStyle") - .HasAnnotation("Cosmos:PropertyName", "promptStyle") - .HasAnnotation("Relational:JsonPropertyName", "promptStyle"); - - b.Property("SongName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("songName") - .HasAnnotation("Cosmos:PropertyName", "songName") - .HasAnnotation("Relational:JsonPropertyName", "songName"); - - b.HasKey("Id"); - - b.ToTable("lyrics_analyzer_items", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "lyrics_analyzer_items") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.LyricsAnalyzer.SongLyricsItem", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("ArtistName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("artistName") - .HasAnnotation("Cosmos:PropertyName", "artistName") - .HasAnnotation("Relational:JsonPropertyName", "artistName"); - - b.Property("CreatedAt") - .HasColumnType("TEXT") - .HasColumnName("createdAt") - .HasAnnotation("Cosmos:PropertyName", "createdAt") - .HasAnnotation("Relational:JsonPropertyName", "createdAt"); - - b.Property("Lyrics") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("lyrics") - .HasAnnotation("Cosmos:PropertyName", "lyrics") - .HasAnnotation("Relational:JsonPropertyName", "lyrics"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("SongName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("songName") - .HasAnnotation("Cosmos:PropertyName", "songName") - .HasAnnotation("Relational:JsonPropertyName", "songName"); - - b.HasKey("Id"); - - b.ToTable("song_lyrics", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "song_lyrics") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.LyricsAnalyzer.SongLyricsRequestJob", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("TEXT") - .HasColumnName("createdAt") - .HasAnnotation("Cosmos:PropertyName", "createdAt") - .HasAnnotation("Relational:JsonPropertyName", "createdAt"); - - b.Property("FallbackMethodNeeded") - .HasColumnType("INTEGER") - .HasColumnName("fallbackMethodNeeded") - .HasAnnotation("Cosmos:PropertyName", "fallbackMethodNeeded") - .HasAnnotation("Relational:JsonPropertyName", "fallbackMethodNeeded"); - - b.Property("GeniusUrl") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("geniusUrl") - .HasAnnotation("Cosmos:PropertyName", "geniusUrl") - .HasAnnotation("Relational:JsonPropertyName", "geniusUrl"); - - b.Property("IsCompleted") - .HasColumnType("INTEGER") - .HasColumnName("isCompleted") - .HasAnnotation("Cosmos:PropertyName", "isCompleted") - .HasAnnotation("Relational:JsonPropertyName", "isCompleted"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("SongLyricsItemId") - .HasColumnType("TEXT") - .HasColumnName("songLyricsItemId") - .HasAnnotation("Cosmos:PropertyName", "songLyricsItemId") - .HasAnnotation("Relational:JsonPropertyName", "songLyricsItemId"); - - b.Property("StandaloneServiceAcknowledged") - .HasColumnType("INTEGER") - .HasColumnName("standaloneServiceAcknowledged") - .HasAnnotation("Cosmos:PropertyName", "standaloneServiceAcknowledged") - .HasAnnotation("Relational:JsonPropertyName", "standaloneServiceAcknowledged"); - - b.HasKey("Id"); - - b.ToTable("song_lyrics_request_jobs", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "song_lyrics_request_jobs") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Database/Migrations/20240419013754_RemoveTimestampAnnotation_LyricsAnalyzerItem.cs b/src/Database/Migrations/20240419013754_RemoveTimestampAnnotation_LyricsAnalyzerItem.cs deleted file mode 100644 index 284f83c2..00000000 --- a/src/Database/Migrations/20240419013754_RemoveTimestampAnnotation_LyricsAnalyzerItem.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace MuzakBot.Database.Migrations -{ - /// - public partial class RemoveTimestampAnnotation_LyricsAnalyzerItem : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/src/Database/Migrations/20240422155839_Add_Currently_Remaining_DatabaseItems.Designer.cs b/src/Database/Migrations/20240422155839_Add_Currently_Remaining_DatabaseItems.Designer.cs deleted file mode 100644 index 10acf606..00000000 --- a/src/Database/Migrations/20240422155839_Add_Currently_Remaining_DatabaseItems.Designer.cs +++ /dev/null @@ -1,367 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using MuzakBot.Database; - -#nullable disable - -namespace MuzakBot.Database.Migrations -{ - [DbContext(typeof(LyricsAnalyzerDbContext))] - [Migration("20240422155839_Add_Currently_Remaining_DatabaseItems")] - partial class Add_Currently_Remaining_DatabaseItems - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.4"); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.LyricsAnalyzer.LyricsAnalyzerConfig", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CommandDisabledGuildIds") - .HasColumnType("TEXT") - .HasColumnName("commandDisabledGuildIds") - .HasAnnotation("Cosmos:PropertyName", "commandDisabledGuildIds") - .HasAnnotation("Relational:JsonPropertyName", "commandDisabledGuildIds"); - - b.Property("CommandEnabledGuildIds") - .HasColumnType("TEXT") - .HasColumnName("commandEnabledGuildIds") - .HasAnnotation("Cosmos:PropertyName", "commandEnabledGuildIds") - .HasAnnotation("Relational:JsonPropertyName", "commandEnabledGuildIds"); - - b.Property("CommandIsEnabledToSpecificGuilds") - .HasColumnType("INTEGER") - .HasColumnName("commandIsEnabledToSpecificGuilds") - .HasAnnotation("Cosmos:PropertyName", "commandIsEnabledToSpecificGuilds") - .HasAnnotation("Relational:JsonPropertyName", "commandIsEnabledToSpecificGuilds"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("RateLimitEnabled") - .HasColumnType("INTEGER") - .HasColumnName("rateLimitEnabled") - .HasAnnotation("Cosmos:PropertyName", "rateLimitEnabled") - .HasAnnotation("Relational:JsonPropertyName", "rateLimitEnabled"); - - b.Property("RateLimitIgnoredUserIds") - .HasColumnType("TEXT") - .HasColumnName("rateLimitIgnoredUserIds") - .HasAnnotation("Cosmos:PropertyName", "rateLimitIgnoredUserIds") - .HasAnnotation("Relational:JsonPropertyName", "rateLimitIgnoredUserIds"); - - b.Property("RateLimitMaxRequests") - .HasColumnType("INTEGER") - .HasColumnName("rateLimitMaxRequests") - .HasAnnotation("Cosmos:PropertyName", "rateLimitMaxRequests") - .HasAnnotation("Relational:JsonPropertyName", "rateLimitMaxRequests"); - - b.HasKey("Id"); - - b.ToTable("command_configs", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "command_configs") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.LyricsAnalyzer.LyricsAnalyzerItem", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("ArtistName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("artistName") - .HasAnnotation("Cosmos:PropertyName", "artistName") - .HasAnnotation("Relational:JsonPropertyName", "artistName"); - - b.Property("CreatedAt") - .HasColumnType("TEXT") - .HasColumnName("createdAt") - .HasAnnotation("Cosmos:PropertyName", "createdAt") - .HasAnnotation("Relational:JsonPropertyName", "createdAt"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("PromptStyle") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("promptStyle") - .HasAnnotation("Cosmos:PropertyName", "promptStyle") - .HasAnnotation("Relational:JsonPropertyName", "promptStyle"); - - b.Property("SongName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("songName") - .HasAnnotation("Cosmos:PropertyName", "songName") - .HasAnnotation("Relational:JsonPropertyName", "songName"); - - b.HasKey("Id"); - - b.ToTable("lyrics_analyzer_items", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "lyrics_analyzer_items") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.LyricsAnalyzer.LyricsAnalyzerPromptStyle", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("AnalysisType") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("analysisType") - .HasAnnotation("Cosmos:PropertyName", "analysisType") - .HasAnnotation("Relational:JsonPropertyName", "analysisType"); - - b.Property("CreatedOn") - .HasColumnType("TEXT") - .HasColumnName("createdOn") - .HasAnnotation("Cosmos:PropertyName", "createdOn") - .HasAnnotation("Relational:JsonPropertyName", "createdOn"); - - b.Property("LastUpdated") - .HasColumnType("TEXT") - .HasColumnName("lastUpdated") - .HasAnnotation("Cosmos:PropertyName", "lastUpdated") - .HasAnnotation("Relational:JsonPropertyName", "lastUpdated"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("name") - .HasAnnotation("Cosmos:PropertyName", "name") - .HasAnnotation("Relational:JsonPropertyName", "name"); - - b.Property("NoticeText") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("noticeText") - .HasAnnotation("Cosmos:PropertyName", "noticeText") - .HasAnnotation("Relational:JsonPropertyName", "noticeText"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("Prompt") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("prompt") - .HasAnnotation("Cosmos:PropertyName", "prompt") - .HasAnnotation("Relational:JsonPropertyName", "prompt"); - - b.Property("ShortName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("shortName") - .HasAnnotation("Cosmos:PropertyName", "shortName") - .HasAnnotation("Relational:JsonPropertyName", "shortName"); - - b.Property("UserPrompt") - .IsRequired() - .HasColumnType("TEXT") - .HasAnnotation("Relational:JsonPropertyName", "userPrompt"); - - b.HasKey("Id"); - - b.ToTable("prompt_styles", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "prompt_styles") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.LyricsAnalyzer.LyricsAnalyzerUserRateLimit", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CurrentRequestCount") - .HasColumnType("INTEGER") - .HasColumnName("currentRequestCount") - .HasAnnotation("Cosmos:PropertyName", "currentRequestCount") - .HasAnnotation("Relational:JsonPropertyName", "currentRequestCount"); - - b.Property("LastRequestTime") - .HasColumnType("TEXT") - .HasColumnName("lastRequestTime") - .HasAnnotation("Cosmos:PropertyName", "lastRequestTime") - .HasAnnotation("Relational:JsonPropertyName", "lastRequestTime"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("userId") - .HasAnnotation("Cosmos:PropertyName", "userId") - .HasAnnotation("Relational:JsonPropertyName", "userId"); - - b.HasKey("Id"); - - b.ToTable("user_rate_limit", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "user_rate_limit") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.LyricsAnalyzer.SongLyricsItem", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("ArtistName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("artistName") - .HasAnnotation("Cosmos:PropertyName", "artistName") - .HasAnnotation("Relational:JsonPropertyName", "artistName"); - - b.Property("CreatedAt") - .HasColumnType("TEXT") - .HasColumnName("createdAt") - .HasAnnotation("Cosmos:PropertyName", "createdAt") - .HasAnnotation("Relational:JsonPropertyName", "createdAt"); - - b.Property("Lyrics") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("lyrics") - .HasAnnotation("Cosmos:PropertyName", "lyrics") - .HasAnnotation("Relational:JsonPropertyName", "lyrics"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("SongName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("songName") - .HasAnnotation("Cosmos:PropertyName", "songName") - .HasAnnotation("Relational:JsonPropertyName", "songName"); - - b.HasKey("Id"); - - b.ToTable("song_lyrics", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "song_lyrics") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.LyricsAnalyzer.SongLyricsRequestJob", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("TEXT") - .HasColumnName("createdAt") - .HasAnnotation("Cosmos:PropertyName", "createdAt") - .HasAnnotation("Relational:JsonPropertyName", "createdAt"); - - b.Property("FallbackMethodNeeded") - .HasColumnType("INTEGER") - .HasColumnName("fallbackMethodNeeded") - .HasAnnotation("Cosmos:PropertyName", "fallbackMethodNeeded") - .HasAnnotation("Relational:JsonPropertyName", "fallbackMethodNeeded"); - - b.Property("GeniusUrl") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("geniusUrl") - .HasAnnotation("Cosmos:PropertyName", "geniusUrl") - .HasAnnotation("Relational:JsonPropertyName", "geniusUrl"); - - b.Property("IsCompleted") - .HasColumnType("INTEGER") - .HasColumnName("isCompleted") - .HasAnnotation("Cosmos:PropertyName", "isCompleted") - .HasAnnotation("Relational:JsonPropertyName", "isCompleted"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("SongLyricsItemId") - .HasColumnType("TEXT") - .HasColumnName("songLyricsItemId") - .HasAnnotation("Cosmos:PropertyName", "songLyricsItemId") - .HasAnnotation("Relational:JsonPropertyName", "songLyricsItemId"); - - b.Property("StandaloneServiceAcknowledged") - .HasColumnType("INTEGER") - .HasColumnName("standaloneServiceAcknowledged") - .HasAnnotation("Cosmos:PropertyName", "standaloneServiceAcknowledged") - .HasAnnotation("Relational:JsonPropertyName", "standaloneServiceAcknowledged"); - - b.HasKey("Id"); - - b.ToTable("song_lyrics_request_jobs", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "song_lyrics_request_jobs") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Database/Migrations/20240422155839_Add_Currently_Remaining_DatabaseItems.cs b/src/Database/Migrations/20240422155839_Add_Currently_Remaining_DatabaseItems.cs deleted file mode 100644 index 5a9b5e16..00000000 --- a/src/Database/Migrations/20240422155839_Add_Currently_Remaining_DatabaseItems.cs +++ /dev/null @@ -1,82 +0,0 @@ -using System; - -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace MuzakBot.Database.Migrations -{ - /// - public partial class Add_Currently_Remaining_DatabaseItems : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "command_configs", - columns: table => new - { - id = table.Column(type: "TEXT", nullable: false), - rateLimitEnabled = table.Column(type: "INTEGER", nullable: false), - rateLimitMaxRequests = table.Column(type: "INTEGER", nullable: false), - rateLimitIgnoredUserIds = table.Column(type: "TEXT", nullable: true), - commandIsEnabledToSpecificGuilds = table.Column(type: "INTEGER", nullable: false), - commandEnabledGuildIds = table.Column(type: "TEXT", nullable: true), - commandDisabledGuildIds = table.Column(type: "TEXT", nullable: true), - partitionKey = table.Column(type: "TEXT", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_command_configs", x => x.id); - }); - - migrationBuilder.CreateTable( - name: "prompt_styles", - columns: table => new - { - id = table.Column(type: "TEXT", nullable: false), - name = table.Column(type: "TEXT", nullable: false), - shortName = table.Column(type: "TEXT", nullable: false), - analysisType = table.Column(type: "TEXT", nullable: false), - prompt = table.Column(type: "TEXT", nullable: false), - UserPrompt = table.Column(type: "TEXT", nullable: false), - noticeText = table.Column(type: "TEXT", nullable: false), - createdOn = table.Column(type: "TEXT", nullable: false), - lastUpdated = table.Column(type: "TEXT", nullable: false), - partitionKey = table.Column(type: "TEXT", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_prompt_styles", x => x.id); - }); - - migrationBuilder.CreateTable( - name: "user_rate_limit", - columns: table => new - { - id = table.Column(type: "TEXT", nullable: false), - userId = table.Column(type: "TEXT", nullable: false), - currentRequestCount = table.Column(type: "INTEGER", nullable: false), - lastRequestTime = table.Column(type: "TEXT", nullable: false), - partitionKey = table.Column(type: "TEXT", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_user_rate_limit", x => x.id); - }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "command_configs"); - - migrationBuilder.DropTable( - name: "prompt_styles"); - - migrationBuilder.DropTable( - name: "user_rate_limit"); - } - } -} diff --git a/src/Database/Migrations/20240422190129_Add_DatabaseUpdate_Model.Designer.cs b/src/Database/Migrations/20240422190129_Add_DatabaseUpdate_Model.Designer.cs deleted file mode 100644 index ed277e93..00000000 --- a/src/Database/Migrations/20240422190129_Add_DatabaseUpdate_Model.Designer.cs +++ /dev/null @@ -1,397 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using MuzakBot.Database; - -#nullable disable - -namespace MuzakBot.Database.Migrations -{ - [DbContext(typeof(LyricsAnalyzerDbContext))] - [Migration("20240422190129_Add_DatabaseUpdate_Model")] - partial class Add_DatabaseUpdate_Model - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.4"); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.DatabaseUpdate", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("MigratedToEfCore") - .HasColumnType("INTEGER") - .HasColumnName("migratedToEfCore") - .HasAnnotation("Cosmos:PropertyName", "migratedToEfCore") - .HasAnnotation("Relational:JsonPropertyName", "migratedToEfCore"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.HasKey("Id"); - - b.ToTable("database_updates", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "database_updates") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.LyricsAnalyzer.LyricsAnalyzerConfig", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CommandDisabledGuildIds") - .HasColumnType("TEXT") - .HasColumnName("commandDisabledGuildIds") - .HasAnnotation("Cosmos:PropertyName", "commandDisabledGuildIds") - .HasAnnotation("Relational:JsonPropertyName", "commandDisabledGuildIds"); - - b.Property("CommandEnabledGuildIds") - .HasColumnType("TEXT") - .HasColumnName("commandEnabledGuildIds") - .HasAnnotation("Cosmos:PropertyName", "commandEnabledGuildIds") - .HasAnnotation("Relational:JsonPropertyName", "commandEnabledGuildIds"); - - b.Property("CommandIsEnabledToSpecificGuilds") - .HasColumnType("INTEGER") - .HasColumnName("commandIsEnabledToSpecificGuilds") - .HasAnnotation("Cosmos:PropertyName", "commandIsEnabledToSpecificGuilds") - .HasAnnotation("Relational:JsonPropertyName", "commandIsEnabledToSpecificGuilds"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("RateLimitEnabled") - .HasColumnType("INTEGER") - .HasColumnName("rateLimitEnabled") - .HasAnnotation("Cosmos:PropertyName", "rateLimitEnabled") - .HasAnnotation("Relational:JsonPropertyName", "rateLimitEnabled"); - - b.Property("RateLimitIgnoredUserIds") - .HasColumnType("TEXT") - .HasColumnName("rateLimitIgnoredUserIds") - .HasAnnotation("Cosmos:PropertyName", "rateLimitIgnoredUserIds") - .HasAnnotation("Relational:JsonPropertyName", "rateLimitIgnoredUserIds"); - - b.Property("RateLimitMaxRequests") - .HasColumnType("INTEGER") - .HasColumnName("rateLimitMaxRequests") - .HasAnnotation("Cosmos:PropertyName", "rateLimitMaxRequests") - .HasAnnotation("Relational:JsonPropertyName", "rateLimitMaxRequests"); - - b.HasKey("Id"); - - b.ToTable("command_configs", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "command_configs") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.LyricsAnalyzer.LyricsAnalyzerItem", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("ArtistName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("artistName") - .HasAnnotation("Cosmos:PropertyName", "artistName") - .HasAnnotation("Relational:JsonPropertyName", "artistName"); - - b.Property("CreatedAt") - .HasColumnType("TEXT") - .HasColumnName("createdAt") - .HasAnnotation("Cosmos:PropertyName", "createdAt") - .HasAnnotation("Relational:JsonPropertyName", "createdAt"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("PromptStyle") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("promptStyle") - .HasAnnotation("Cosmos:PropertyName", "promptStyle") - .HasAnnotation("Relational:JsonPropertyName", "promptStyle"); - - b.Property("SongName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("songName") - .HasAnnotation("Cosmos:PropertyName", "songName") - .HasAnnotation("Relational:JsonPropertyName", "songName"); - - b.HasKey("Id"); - - b.ToTable("lyrics_analyzer_items", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "lyrics_analyzer_items") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.LyricsAnalyzer.LyricsAnalyzerPromptStyle", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("AnalysisType") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("analysisType") - .HasAnnotation("Cosmos:PropertyName", "analysisType") - .HasAnnotation("Relational:JsonPropertyName", "analysisType"); - - b.Property("CreatedOn") - .HasColumnType("TEXT") - .HasColumnName("createdOn") - .HasAnnotation("Cosmos:PropertyName", "createdOn") - .HasAnnotation("Relational:JsonPropertyName", "createdOn"); - - b.Property("LastUpdated") - .HasColumnType("TEXT") - .HasColumnName("lastUpdated") - .HasAnnotation("Cosmos:PropertyName", "lastUpdated") - .HasAnnotation("Relational:JsonPropertyName", "lastUpdated"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("name") - .HasAnnotation("Cosmos:PropertyName", "name") - .HasAnnotation("Relational:JsonPropertyName", "name"); - - b.Property("NoticeText") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("noticeText") - .HasAnnotation("Cosmos:PropertyName", "noticeText") - .HasAnnotation("Relational:JsonPropertyName", "noticeText"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("Prompt") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("prompt") - .HasAnnotation("Cosmos:PropertyName", "prompt") - .HasAnnotation("Relational:JsonPropertyName", "prompt"); - - b.Property("ShortName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("shortName") - .HasAnnotation("Cosmos:PropertyName", "shortName") - .HasAnnotation("Relational:JsonPropertyName", "shortName"); - - b.Property("UserPrompt") - .IsRequired() - .HasColumnType("TEXT") - .HasAnnotation("Relational:JsonPropertyName", "userPrompt"); - - b.HasKey("Id"); - - b.ToTable("prompt_styles", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "prompt_styles") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.LyricsAnalyzer.LyricsAnalyzerUserRateLimit", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CurrentRequestCount") - .HasColumnType("INTEGER") - .HasColumnName("currentRequestCount") - .HasAnnotation("Cosmos:PropertyName", "currentRequestCount") - .HasAnnotation("Relational:JsonPropertyName", "currentRequestCount"); - - b.Property("LastRequestTime") - .HasColumnType("TEXT") - .HasColumnName("lastRequestTime") - .HasAnnotation("Cosmos:PropertyName", "lastRequestTime") - .HasAnnotation("Relational:JsonPropertyName", "lastRequestTime"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("userId") - .HasAnnotation("Cosmos:PropertyName", "userId") - .HasAnnotation("Relational:JsonPropertyName", "userId"); - - b.HasKey("Id"); - - b.ToTable("user_rate_limit", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "user_rate_limit") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.LyricsAnalyzer.SongLyricsItem", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("ArtistName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("artistName") - .HasAnnotation("Cosmos:PropertyName", "artistName") - .HasAnnotation("Relational:JsonPropertyName", "artistName"); - - b.Property("CreatedAt") - .HasColumnType("TEXT") - .HasColumnName("createdAt") - .HasAnnotation("Cosmos:PropertyName", "createdAt") - .HasAnnotation("Relational:JsonPropertyName", "createdAt"); - - b.Property("Lyrics") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("lyrics") - .HasAnnotation("Cosmos:PropertyName", "lyrics") - .HasAnnotation("Relational:JsonPropertyName", "lyrics"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("SongName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("songName") - .HasAnnotation("Cosmos:PropertyName", "songName") - .HasAnnotation("Relational:JsonPropertyName", "songName"); - - b.HasKey("Id"); - - b.ToTable("song_lyrics", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "song_lyrics") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.LyricsAnalyzer.SongLyricsRequestJob", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("TEXT") - .HasColumnName("createdAt") - .HasAnnotation("Cosmos:PropertyName", "createdAt") - .HasAnnotation("Relational:JsonPropertyName", "createdAt"); - - b.Property("FallbackMethodNeeded") - .HasColumnType("INTEGER") - .HasColumnName("fallbackMethodNeeded") - .HasAnnotation("Cosmos:PropertyName", "fallbackMethodNeeded") - .HasAnnotation("Relational:JsonPropertyName", "fallbackMethodNeeded"); - - b.Property("GeniusUrl") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("geniusUrl") - .HasAnnotation("Cosmos:PropertyName", "geniusUrl") - .HasAnnotation("Relational:JsonPropertyName", "geniusUrl"); - - b.Property("IsCompleted") - .HasColumnType("INTEGER") - .HasColumnName("isCompleted") - .HasAnnotation("Cosmos:PropertyName", "isCompleted") - .HasAnnotation("Relational:JsonPropertyName", "isCompleted"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("SongLyricsItemId") - .HasColumnType("TEXT") - .HasColumnName("songLyricsItemId") - .HasAnnotation("Cosmos:PropertyName", "songLyricsItemId") - .HasAnnotation("Relational:JsonPropertyName", "songLyricsItemId"); - - b.Property("StandaloneServiceAcknowledged") - .HasColumnType("INTEGER") - .HasColumnName("standaloneServiceAcknowledged") - .HasAnnotation("Cosmos:PropertyName", "standaloneServiceAcknowledged") - .HasAnnotation("Relational:JsonPropertyName", "standaloneServiceAcknowledged"); - - b.HasKey("Id"); - - b.ToTable("song_lyrics_request_jobs", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "song_lyrics_request_jobs") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Database/Migrations/20240422190129_Add_DatabaseUpdate_Model.cs b/src/Database/Migrations/20240422190129_Add_DatabaseUpdate_Model.cs deleted file mode 100644 index de7f55fd..00000000 --- a/src/Database/Migrations/20240422190129_Add_DatabaseUpdate_Model.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace MuzakBot.Database.Migrations -{ - /// - public partial class Add_DatabaseUpdate_Model : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "database_updates", - columns: table => new - { - id = table.Column(type: "TEXT", nullable: false), - migratedToEfCore = table.Column(type: "INTEGER", nullable: false), - partitionKey = table.Column(type: "TEXT", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_database_updates", x => x.id); - }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "database_updates"); - } - } -} diff --git a/src/Database/Migrations/20240422213807_LyricsAnalyzerPromptStyle_Missing_Property.Designer.cs b/src/Database/Migrations/20240422213807_LyricsAnalyzerPromptStyle_Missing_Property.Designer.cs deleted file mode 100644 index 5ac08f0c..00000000 --- a/src/Database/Migrations/20240422213807_LyricsAnalyzerPromptStyle_Missing_Property.Designer.cs +++ /dev/null @@ -1,399 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using MuzakBot.Database; - -#nullable disable - -namespace MuzakBot.Database.Migrations -{ - [DbContext(typeof(LyricsAnalyzerDbContext))] - [Migration("20240422213807_LyricsAnalyzerPromptStyle_Missing_Property")] - partial class LyricsAnalyzerPromptStyle_Missing_Property - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.4"); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.DatabaseUpdate", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("MigratedToEfCore") - .HasColumnType("INTEGER") - .HasColumnName("migratedToEfCore") - .HasAnnotation("Cosmos:PropertyName", "migratedToEfCore") - .HasAnnotation("Relational:JsonPropertyName", "migratedToEfCore"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.HasKey("Id"); - - b.ToTable("database_updates", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "database_updates") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.LyricsAnalyzer.LyricsAnalyzerConfig", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CommandDisabledGuildIds") - .HasColumnType("TEXT") - .HasColumnName("commandDisabledGuildIds") - .HasAnnotation("Cosmos:PropertyName", "commandDisabledGuildIds") - .HasAnnotation("Relational:JsonPropertyName", "commandDisabledGuildIds"); - - b.Property("CommandEnabledGuildIds") - .HasColumnType("TEXT") - .HasColumnName("commandEnabledGuildIds") - .HasAnnotation("Cosmos:PropertyName", "commandEnabledGuildIds") - .HasAnnotation("Relational:JsonPropertyName", "commandEnabledGuildIds"); - - b.Property("CommandIsEnabledToSpecificGuilds") - .HasColumnType("INTEGER") - .HasColumnName("commandIsEnabledToSpecificGuilds") - .HasAnnotation("Cosmos:PropertyName", "commandIsEnabledToSpecificGuilds") - .HasAnnotation("Relational:JsonPropertyName", "commandIsEnabledToSpecificGuilds"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("RateLimitEnabled") - .HasColumnType("INTEGER") - .HasColumnName("rateLimitEnabled") - .HasAnnotation("Cosmos:PropertyName", "rateLimitEnabled") - .HasAnnotation("Relational:JsonPropertyName", "rateLimitEnabled"); - - b.Property("RateLimitIgnoredUserIds") - .HasColumnType("TEXT") - .HasColumnName("rateLimitIgnoredUserIds") - .HasAnnotation("Cosmos:PropertyName", "rateLimitIgnoredUserIds") - .HasAnnotation("Relational:JsonPropertyName", "rateLimitIgnoredUserIds"); - - b.Property("RateLimitMaxRequests") - .HasColumnType("INTEGER") - .HasColumnName("rateLimitMaxRequests") - .HasAnnotation("Cosmos:PropertyName", "rateLimitMaxRequests") - .HasAnnotation("Relational:JsonPropertyName", "rateLimitMaxRequests"); - - b.HasKey("Id"); - - b.ToTable("command_configs", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "command_configs") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.LyricsAnalyzer.LyricsAnalyzerItem", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("ArtistName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("artistName") - .HasAnnotation("Cosmos:PropertyName", "artistName") - .HasAnnotation("Relational:JsonPropertyName", "artistName"); - - b.Property("CreatedAt") - .HasColumnType("TEXT") - .HasColumnName("createdAt") - .HasAnnotation("Cosmos:PropertyName", "createdAt") - .HasAnnotation("Relational:JsonPropertyName", "createdAt"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("PromptStyle") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("promptStyle") - .HasAnnotation("Cosmos:PropertyName", "promptStyle") - .HasAnnotation("Relational:JsonPropertyName", "promptStyle"); - - b.Property("SongName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("songName") - .HasAnnotation("Cosmos:PropertyName", "songName") - .HasAnnotation("Relational:JsonPropertyName", "songName"); - - b.HasKey("Id"); - - b.ToTable("lyrics_analyzer_items", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "lyrics_analyzer_items") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.LyricsAnalyzer.LyricsAnalyzerPromptStyle", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("AnalysisType") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("analysisType") - .HasAnnotation("Cosmos:PropertyName", "analysisType") - .HasAnnotation("Relational:JsonPropertyName", "analysisType"); - - b.Property("CreatedOn") - .HasColumnType("TEXT") - .HasColumnName("createdOn") - .HasAnnotation("Cosmos:PropertyName", "createdOn") - .HasAnnotation("Relational:JsonPropertyName", "createdOn"); - - b.Property("LastUpdated") - .HasColumnType("TEXT") - .HasColumnName("lastUpdated") - .HasAnnotation("Cosmos:PropertyName", "lastUpdated") - .HasAnnotation("Relational:JsonPropertyName", "lastUpdated"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("name") - .HasAnnotation("Cosmos:PropertyName", "name") - .HasAnnotation("Relational:JsonPropertyName", "name"); - - b.Property("NoticeText") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("noticeText") - .HasAnnotation("Cosmos:PropertyName", "noticeText") - .HasAnnotation("Relational:JsonPropertyName", "noticeText"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("Prompt") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("prompt") - .HasAnnotation("Cosmos:PropertyName", "prompt") - .HasAnnotation("Relational:JsonPropertyName", "prompt"); - - b.Property("ShortName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("shortName") - .HasAnnotation("Cosmos:PropertyName", "shortName") - .HasAnnotation("Relational:JsonPropertyName", "shortName"); - - b.Property("UserPrompt") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("userPrompt") - .HasAnnotation("Cosmos:PropertyName", "userPrompt") - .HasAnnotation("Relational:JsonPropertyName", "userPrompt"); - - b.HasKey("Id"); - - b.ToTable("prompt_styles", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "prompt_styles") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.LyricsAnalyzer.LyricsAnalyzerUserRateLimit", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CurrentRequestCount") - .HasColumnType("INTEGER") - .HasColumnName("currentRequestCount") - .HasAnnotation("Cosmos:PropertyName", "currentRequestCount") - .HasAnnotation("Relational:JsonPropertyName", "currentRequestCount"); - - b.Property("LastRequestTime") - .HasColumnType("TEXT") - .HasColumnName("lastRequestTime") - .HasAnnotation("Cosmos:PropertyName", "lastRequestTime") - .HasAnnotation("Relational:JsonPropertyName", "lastRequestTime"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("userId") - .HasAnnotation("Cosmos:PropertyName", "userId") - .HasAnnotation("Relational:JsonPropertyName", "userId"); - - b.HasKey("Id"); - - b.ToTable("user_rate_limit", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "user_rate_limit") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.LyricsAnalyzer.SongLyricsItem", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("ArtistName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("artistName") - .HasAnnotation("Cosmos:PropertyName", "artistName") - .HasAnnotation("Relational:JsonPropertyName", "artistName"); - - b.Property("CreatedAt") - .HasColumnType("TEXT") - .HasColumnName("createdAt") - .HasAnnotation("Cosmos:PropertyName", "createdAt") - .HasAnnotation("Relational:JsonPropertyName", "createdAt"); - - b.Property("Lyrics") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("lyrics") - .HasAnnotation("Cosmos:PropertyName", "lyrics") - .HasAnnotation("Relational:JsonPropertyName", "lyrics"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("SongName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("songName") - .HasAnnotation("Cosmos:PropertyName", "songName") - .HasAnnotation("Relational:JsonPropertyName", "songName"); - - b.HasKey("Id"); - - b.ToTable("song_lyrics", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "song_lyrics") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.LyricsAnalyzer.SongLyricsRequestJob", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("TEXT") - .HasColumnName("createdAt") - .HasAnnotation("Cosmos:PropertyName", "createdAt") - .HasAnnotation("Relational:JsonPropertyName", "createdAt"); - - b.Property("FallbackMethodNeeded") - .HasColumnType("INTEGER") - .HasColumnName("fallbackMethodNeeded") - .HasAnnotation("Cosmos:PropertyName", "fallbackMethodNeeded") - .HasAnnotation("Relational:JsonPropertyName", "fallbackMethodNeeded"); - - b.Property("GeniusUrl") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("geniusUrl") - .HasAnnotation("Cosmos:PropertyName", "geniusUrl") - .HasAnnotation("Relational:JsonPropertyName", "geniusUrl"); - - b.Property("IsCompleted") - .HasColumnType("INTEGER") - .HasColumnName("isCompleted") - .HasAnnotation("Cosmos:PropertyName", "isCompleted") - .HasAnnotation("Relational:JsonPropertyName", "isCompleted"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("SongLyricsItemId") - .HasColumnType("TEXT") - .HasColumnName("songLyricsItemId") - .HasAnnotation("Cosmos:PropertyName", "songLyricsItemId") - .HasAnnotation("Relational:JsonPropertyName", "songLyricsItemId"); - - b.Property("StandaloneServiceAcknowledged") - .HasColumnType("INTEGER") - .HasColumnName("standaloneServiceAcknowledged") - .HasAnnotation("Cosmos:PropertyName", "standaloneServiceAcknowledged") - .HasAnnotation("Relational:JsonPropertyName", "standaloneServiceAcknowledged"); - - b.HasKey("Id"); - - b.ToTable("song_lyrics_request_jobs", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "song_lyrics_request_jobs") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Database/Migrations/20240422213807_LyricsAnalyzerPromptStyle_Missing_Property.cs b/src/Database/Migrations/20240422213807_LyricsAnalyzerPromptStyle_Missing_Property.cs deleted file mode 100644 index 8dae67ec..00000000 --- a/src/Database/Migrations/20240422213807_LyricsAnalyzerPromptStyle_Missing_Property.cs +++ /dev/null @@ -1,28 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace MuzakBot.Database.Migrations -{ - /// - public partial class LyricsAnalyzerPromptStyle_Missing_Property : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.RenameColumn( - name: "UserPrompt", - table: "prompt_styles", - newName: "userPrompt"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.RenameColumn( - name: "userPrompt", - table: "prompt_styles", - newName: "UserPrompt"); - } - } -} diff --git a/src/Database/Migrations/20240424201828_Add_AnalyzedLyrics.Designer.cs b/src/Database/Migrations/20240424201828_Add_AnalyzedLyrics.Designer.cs deleted file mode 100644 index 6b2ef330..00000000 --- a/src/Database/Migrations/20240424201828_Add_AnalyzedLyrics.Designer.cs +++ /dev/null @@ -1,464 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using MuzakBot.Database; - -#nullable disable - -namespace MuzakBot.Database.Migrations -{ - [DbContext(typeof(LyricsAnalyzerDbContext))] - [Migration("20240424201828_Add_AnalyzedLyrics")] - partial class Add_AnalyzedLyrics - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.4"); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.DatabaseUpdate", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("MigratedToEfCore") - .HasColumnType("INTEGER") - .HasColumnName("migratedToEfCore") - .HasAnnotation("Cosmos:PropertyName", "migratedToEfCore") - .HasAnnotation("Relational:JsonPropertyName", "migratedToEfCore"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.HasKey("Id"); - - b.ToTable("database_updates", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "database_updates") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.LyricsAnalyzer.AnalyzedLyrics", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("Analysis") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("analysis") - .HasAnnotation("Cosmos:PropertyName", "analysis") - .HasAnnotation("Relational:JsonPropertyName", "analysis"); - - b.Property("ArtistName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("artistName") - .HasAnnotation("Cosmos:PropertyName", "artistName") - .HasAnnotation("Relational:JsonPropertyName", "artistName"); - - b.Property("CreatedAt") - .HasColumnType("TEXT") - .HasColumnName("createdAt") - .HasAnnotation("Cosmos:PropertyName", "createdAt") - .HasAnnotation("Relational:JsonPropertyName", "createdAt"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("PromptStyleUsed") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("promptStyleUsed") - .HasAnnotation("Cosmos:PropertyName", "promptStyleUsed") - .HasAnnotation("Relational:JsonPropertyName", "promptStyleUsed"); - - b.Property("SongLyricsId") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("songLyricsId") - .HasAnnotation("Cosmos:PropertyName", "songLyricsId") - .HasAnnotation("Relational:JsonPropertyName", "songLyricsId"); - - b.Property("SongName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("songName") - .HasAnnotation("Cosmos:PropertyName", "songName") - .HasAnnotation("Relational:JsonPropertyName", "songName"); - - b.HasKey("Id"); - - b.ToTable("analyzed_lyrics", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "analyzed_lyrics") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.LyricsAnalyzer.LyricsAnalyzerConfig", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CommandDisabledGuildIds") - .HasColumnType("TEXT") - .HasColumnName("commandDisabledGuildIds") - .HasAnnotation("Cosmos:PropertyName", "commandDisabledGuildIds") - .HasAnnotation("Relational:JsonPropertyName", "commandDisabledGuildIds"); - - b.Property("CommandEnabledGuildIds") - .HasColumnType("TEXT") - .HasColumnName("commandEnabledGuildIds") - .HasAnnotation("Cosmos:PropertyName", "commandEnabledGuildIds") - .HasAnnotation("Relational:JsonPropertyName", "commandEnabledGuildIds"); - - b.Property("CommandIsEnabledToSpecificGuilds") - .HasColumnType("INTEGER") - .HasColumnName("commandIsEnabledToSpecificGuilds") - .HasAnnotation("Cosmos:PropertyName", "commandIsEnabledToSpecificGuilds") - .HasAnnotation("Relational:JsonPropertyName", "commandIsEnabledToSpecificGuilds"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("RateLimitEnabled") - .HasColumnType("INTEGER") - .HasColumnName("rateLimitEnabled") - .HasAnnotation("Cosmos:PropertyName", "rateLimitEnabled") - .HasAnnotation("Relational:JsonPropertyName", "rateLimitEnabled"); - - b.Property("RateLimitIgnoredUserIds") - .HasColumnType("TEXT") - .HasColumnName("rateLimitIgnoredUserIds") - .HasAnnotation("Cosmos:PropertyName", "rateLimitIgnoredUserIds") - .HasAnnotation("Relational:JsonPropertyName", "rateLimitIgnoredUserIds"); - - b.Property("RateLimitMaxRequests") - .HasColumnType("INTEGER") - .HasColumnName("rateLimitMaxRequests") - .HasAnnotation("Cosmos:PropertyName", "rateLimitMaxRequests") - .HasAnnotation("Relational:JsonPropertyName", "rateLimitMaxRequests"); - - b.HasKey("Id"); - - b.ToTable("command_configs", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "command_configs") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.LyricsAnalyzer.LyricsAnalyzerItem", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("ArtistName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("artistName") - .HasAnnotation("Cosmos:PropertyName", "artistName") - .HasAnnotation("Relational:JsonPropertyName", "artistName"); - - b.Property("CreatedAt") - .HasColumnType("TEXT") - .HasColumnName("createdAt") - .HasAnnotation("Cosmos:PropertyName", "createdAt") - .HasAnnotation("Relational:JsonPropertyName", "createdAt"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("PromptStyle") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("promptStyle") - .HasAnnotation("Cosmos:PropertyName", "promptStyle") - .HasAnnotation("Relational:JsonPropertyName", "promptStyle"); - - b.Property("SongName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("songName") - .HasAnnotation("Cosmos:PropertyName", "songName") - .HasAnnotation("Relational:JsonPropertyName", "songName"); - - b.HasKey("Id"); - - b.ToTable("lyrics_analyzer_items", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "lyrics_analyzer_items") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.LyricsAnalyzer.LyricsAnalyzerPromptStyle", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("AnalysisType") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("analysisType") - .HasAnnotation("Cosmos:PropertyName", "analysisType") - .HasAnnotation("Relational:JsonPropertyName", "analysisType"); - - b.Property("CreatedOn") - .HasColumnType("TEXT") - .HasColumnName("createdOn") - .HasAnnotation("Cosmos:PropertyName", "createdOn") - .HasAnnotation("Relational:JsonPropertyName", "createdOn"); - - b.Property("LastUpdated") - .HasColumnType("TEXT") - .HasColumnName("lastUpdated") - .HasAnnotation("Cosmos:PropertyName", "lastUpdated") - .HasAnnotation("Relational:JsonPropertyName", "lastUpdated"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("name") - .HasAnnotation("Cosmos:PropertyName", "name") - .HasAnnotation("Relational:JsonPropertyName", "name"); - - b.Property("NoticeText") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("noticeText") - .HasAnnotation("Cosmos:PropertyName", "noticeText") - .HasAnnotation("Relational:JsonPropertyName", "noticeText"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("Prompt") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("prompt") - .HasAnnotation("Cosmos:PropertyName", "prompt") - .HasAnnotation("Relational:JsonPropertyName", "prompt"); - - b.Property("ShortName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("shortName") - .HasAnnotation("Cosmos:PropertyName", "shortName") - .HasAnnotation("Relational:JsonPropertyName", "shortName"); - - b.Property("UserPrompt") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("userPrompt") - .HasAnnotation("Cosmos:PropertyName", "userPrompt") - .HasAnnotation("Relational:JsonPropertyName", "userPrompt"); - - b.HasKey("Id"); - - b.ToTable("prompt_styles", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "prompt_styles") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.LyricsAnalyzer.LyricsAnalyzerUserRateLimit", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CurrentRequestCount") - .HasColumnType("INTEGER") - .HasColumnName("currentRequestCount") - .HasAnnotation("Cosmos:PropertyName", "currentRequestCount") - .HasAnnotation("Relational:JsonPropertyName", "currentRequestCount"); - - b.Property("LastRequestTime") - .HasColumnType("TEXT") - .HasColumnName("lastRequestTime") - .HasAnnotation("Cosmos:PropertyName", "lastRequestTime") - .HasAnnotation("Relational:JsonPropertyName", "lastRequestTime"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("userId") - .HasAnnotation("Cosmos:PropertyName", "userId") - .HasAnnotation("Relational:JsonPropertyName", "userId"); - - b.HasKey("Id"); - - b.ToTable("user_rate_limit", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "user_rate_limit") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.LyricsAnalyzer.SongLyricsItem", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("ArtistName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("artistName") - .HasAnnotation("Cosmos:PropertyName", "artistName") - .HasAnnotation("Relational:JsonPropertyName", "artistName"); - - b.Property("CreatedAt") - .HasColumnType("TEXT") - .HasColumnName("createdAt") - .HasAnnotation("Cosmos:PropertyName", "createdAt") - .HasAnnotation("Relational:JsonPropertyName", "createdAt"); - - b.Property("Lyrics") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("lyrics") - .HasAnnotation("Cosmos:PropertyName", "lyrics") - .HasAnnotation("Relational:JsonPropertyName", "lyrics"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("SongName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("songName") - .HasAnnotation("Cosmos:PropertyName", "songName") - .HasAnnotation("Relational:JsonPropertyName", "songName"); - - b.HasKey("Id"); - - b.ToTable("song_lyrics", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "song_lyrics") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.LyricsAnalyzer.SongLyricsRequestJob", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("TEXT") - .HasColumnName("createdAt") - .HasAnnotation("Cosmos:PropertyName", "createdAt") - .HasAnnotation("Relational:JsonPropertyName", "createdAt"); - - b.Property("FallbackMethodNeeded") - .HasColumnType("INTEGER") - .HasColumnName("fallbackMethodNeeded") - .HasAnnotation("Cosmos:PropertyName", "fallbackMethodNeeded") - .HasAnnotation("Relational:JsonPropertyName", "fallbackMethodNeeded"); - - b.Property("GeniusUrl") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("geniusUrl") - .HasAnnotation("Cosmos:PropertyName", "geniusUrl") - .HasAnnotation("Relational:JsonPropertyName", "geniusUrl"); - - b.Property("IsCompleted") - .HasColumnType("INTEGER") - .HasColumnName("isCompleted") - .HasAnnotation("Cosmos:PropertyName", "isCompleted") - .HasAnnotation("Relational:JsonPropertyName", "isCompleted"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("SongLyricsItemId") - .HasColumnType("TEXT") - .HasColumnName("songLyricsItemId") - .HasAnnotation("Cosmos:PropertyName", "songLyricsItemId") - .HasAnnotation("Relational:JsonPropertyName", "songLyricsItemId"); - - b.Property("StandaloneServiceAcknowledged") - .HasColumnType("INTEGER") - .HasColumnName("standaloneServiceAcknowledged") - .HasAnnotation("Cosmos:PropertyName", "standaloneServiceAcknowledged") - .HasAnnotation("Relational:JsonPropertyName", "standaloneServiceAcknowledged"); - - b.HasKey("Id"); - - b.ToTable("song_lyrics_request_jobs", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "song_lyrics_request_jobs") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Database/Migrations/20240424201828_Add_AnalyzedLyrics.cs b/src/Database/Migrations/20240424201828_Add_AnalyzedLyrics.cs deleted file mode 100644 index 16bd8e61..00000000 --- a/src/Database/Migrations/20240424201828_Add_AnalyzedLyrics.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; - -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace MuzakBot.Database.Migrations -{ - /// - public partial class Add_AnalyzedLyrics : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "analyzed_lyrics", - columns: table => new - { - id = table.Column(type: "TEXT", nullable: false), - createdAt = table.Column(type: "TEXT", nullable: false), - artistName = table.Column(type: "TEXT", nullable: false), - songName = table.Column(type: "TEXT", nullable: false), - promptStyleUsed = table.Column(type: "TEXT", nullable: false), - songLyricsId = table.Column(type: "TEXT", nullable: false), - analysis = table.Column(type: "TEXT", nullable: false), - partitionKey = table.Column(type: "TEXT", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_analyzed_lyrics", x => x.id); - }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "analyzed_lyrics"); - } - } -} diff --git a/src/Database/Migrations/20240517045922_Add_GptModel_Property.Designer.cs b/src/Database/Migrations/20240517045922_Add_GptModel_Property.Designer.cs deleted file mode 100644 index 0a80fa4f..00000000 --- a/src/Database/Migrations/20240517045922_Add_GptModel_Property.Designer.cs +++ /dev/null @@ -1,471 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using MuzakBot.Database; - -#nullable disable - -namespace MuzakBot.Database.Migrations -{ - [DbContext(typeof(LyricsAnalyzerDbContext))] - [Migration("20240517045922_Add_GptModel_Property")] - partial class Add_GptModel_Property - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.5"); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.DatabaseUpdate", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("MigratedToEfCore") - .HasColumnType("INTEGER") - .HasColumnName("migratedToEfCore") - .HasAnnotation("Cosmos:PropertyName", "migratedToEfCore") - .HasAnnotation("Relational:JsonPropertyName", "migratedToEfCore"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.HasKey("Id"); - - b.ToTable("database_updates", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "database_updates") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.LyricsAnalyzer.AnalyzedLyrics", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("Analysis") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("analysis") - .HasAnnotation("Cosmos:PropertyName", "analysis") - .HasAnnotation("Relational:JsonPropertyName", "analysis"); - - b.Property("ArtistName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("artistName") - .HasAnnotation("Cosmos:PropertyName", "artistName") - .HasAnnotation("Relational:JsonPropertyName", "artistName"); - - b.Property("CreatedAt") - .HasColumnType("TEXT") - .HasColumnName("createdAt") - .HasAnnotation("Cosmos:PropertyName", "createdAt") - .HasAnnotation("Relational:JsonPropertyName", "createdAt"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("PromptStyleUsed") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("promptStyleUsed") - .HasAnnotation("Cosmos:PropertyName", "promptStyleUsed") - .HasAnnotation("Relational:JsonPropertyName", "promptStyleUsed"); - - b.Property("SongLyricsId") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("songLyricsId") - .HasAnnotation("Cosmos:PropertyName", "songLyricsId") - .HasAnnotation("Relational:JsonPropertyName", "songLyricsId"); - - b.Property("SongName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("songName") - .HasAnnotation("Cosmos:PropertyName", "songName") - .HasAnnotation("Relational:JsonPropertyName", "songName"); - - b.HasKey("Id"); - - b.ToTable("analyzed_lyrics", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "analyzed_lyrics") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.LyricsAnalyzer.LyricsAnalyzerConfig", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CommandDisabledGuildIds") - .HasColumnType("TEXT") - .HasColumnName("commandDisabledGuildIds") - .HasAnnotation("Cosmos:PropertyName", "commandDisabledGuildIds") - .HasAnnotation("Relational:JsonPropertyName", "commandDisabledGuildIds"); - - b.Property("CommandEnabledGuildIds") - .HasColumnType("TEXT") - .HasColumnName("commandEnabledGuildIds") - .HasAnnotation("Cosmos:PropertyName", "commandEnabledGuildIds") - .HasAnnotation("Relational:JsonPropertyName", "commandEnabledGuildIds"); - - b.Property("CommandIsEnabledToSpecificGuilds") - .HasColumnType("INTEGER") - .HasColumnName("commandIsEnabledToSpecificGuilds") - .HasAnnotation("Cosmos:PropertyName", "commandIsEnabledToSpecificGuilds") - .HasAnnotation("Relational:JsonPropertyName", "commandIsEnabledToSpecificGuilds"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("RateLimitEnabled") - .HasColumnType("INTEGER") - .HasColumnName("rateLimitEnabled") - .HasAnnotation("Cosmos:PropertyName", "rateLimitEnabled") - .HasAnnotation("Relational:JsonPropertyName", "rateLimitEnabled"); - - b.Property("RateLimitIgnoredUserIds") - .HasColumnType("TEXT") - .HasColumnName("rateLimitIgnoredUserIds") - .HasAnnotation("Cosmos:PropertyName", "rateLimitIgnoredUserIds") - .HasAnnotation("Relational:JsonPropertyName", "rateLimitIgnoredUserIds"); - - b.Property("RateLimitMaxRequests") - .HasColumnType("INTEGER") - .HasColumnName("rateLimitMaxRequests") - .HasAnnotation("Cosmos:PropertyName", "rateLimitMaxRequests") - .HasAnnotation("Relational:JsonPropertyName", "rateLimitMaxRequests"); - - b.HasKey("Id"); - - b.ToTable("command_configs", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "command_configs") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.LyricsAnalyzer.LyricsAnalyzerItem", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("ArtistName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("artistName") - .HasAnnotation("Cosmos:PropertyName", "artistName") - .HasAnnotation("Relational:JsonPropertyName", "artistName"); - - b.Property("CreatedAt") - .HasColumnType("TEXT") - .HasColumnName("createdAt") - .HasAnnotation("Cosmos:PropertyName", "createdAt") - .HasAnnotation("Relational:JsonPropertyName", "createdAt"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("PromptStyle") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("promptStyle") - .HasAnnotation("Cosmos:PropertyName", "promptStyle") - .HasAnnotation("Relational:JsonPropertyName", "promptStyle"); - - b.Property("SongName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("songName") - .HasAnnotation("Cosmos:PropertyName", "songName") - .HasAnnotation("Relational:JsonPropertyName", "songName"); - - b.HasKey("Id"); - - b.ToTable("lyrics_analyzer_items", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "lyrics_analyzer_items") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.LyricsAnalyzer.LyricsAnalyzerPromptStyle", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("AnalysisType") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("analysisType") - .HasAnnotation("Cosmos:PropertyName", "analysisType") - .HasAnnotation("Relational:JsonPropertyName", "analysisType"); - - b.Property("CreatedOn") - .HasColumnType("TEXT") - .HasColumnName("createdOn") - .HasAnnotation("Cosmos:PropertyName", "createdOn") - .HasAnnotation("Relational:JsonPropertyName", "createdOn"); - - b.Property("GptModel") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("gptModel") - .HasAnnotation("Cosmos:PropertyName", "gptModel") - .HasAnnotation("Relational:JsonPropertyName", "gptModel"); - - b.Property("LastUpdated") - .HasColumnType("TEXT") - .HasColumnName("lastUpdated") - .HasAnnotation("Cosmos:PropertyName", "lastUpdated") - .HasAnnotation("Relational:JsonPropertyName", "lastUpdated"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("name") - .HasAnnotation("Cosmos:PropertyName", "name") - .HasAnnotation("Relational:JsonPropertyName", "name"); - - b.Property("NoticeText") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("noticeText") - .HasAnnotation("Cosmos:PropertyName", "noticeText") - .HasAnnotation("Relational:JsonPropertyName", "noticeText"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("Prompt") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("prompt") - .HasAnnotation("Cosmos:PropertyName", "prompt") - .HasAnnotation("Relational:JsonPropertyName", "prompt"); - - b.Property("ShortName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("shortName") - .HasAnnotation("Cosmos:PropertyName", "shortName") - .HasAnnotation("Relational:JsonPropertyName", "shortName"); - - b.Property("UserPrompt") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("userPrompt") - .HasAnnotation("Cosmos:PropertyName", "userPrompt") - .HasAnnotation("Relational:JsonPropertyName", "userPrompt"); - - b.HasKey("Id"); - - b.ToTable("prompt_styles", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "prompt_styles") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.LyricsAnalyzer.LyricsAnalyzerUserRateLimit", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CurrentRequestCount") - .HasColumnType("INTEGER") - .HasColumnName("currentRequestCount") - .HasAnnotation("Cosmos:PropertyName", "currentRequestCount") - .HasAnnotation("Relational:JsonPropertyName", "currentRequestCount"); - - b.Property("LastRequestTime") - .HasColumnType("TEXT") - .HasColumnName("lastRequestTime") - .HasAnnotation("Cosmos:PropertyName", "lastRequestTime") - .HasAnnotation("Relational:JsonPropertyName", "lastRequestTime"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("userId") - .HasAnnotation("Cosmos:PropertyName", "userId") - .HasAnnotation("Relational:JsonPropertyName", "userId"); - - b.HasKey("Id"); - - b.ToTable("user_rate_limit", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "user_rate_limit") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.LyricsAnalyzer.SongLyricsItem", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("ArtistName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("artistName") - .HasAnnotation("Cosmos:PropertyName", "artistName") - .HasAnnotation("Relational:JsonPropertyName", "artistName"); - - b.Property("CreatedAt") - .HasColumnType("TEXT") - .HasColumnName("createdAt") - .HasAnnotation("Cosmos:PropertyName", "createdAt") - .HasAnnotation("Relational:JsonPropertyName", "createdAt"); - - b.Property("Lyrics") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("lyrics") - .HasAnnotation("Cosmos:PropertyName", "lyrics") - .HasAnnotation("Relational:JsonPropertyName", "lyrics"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("SongName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("songName") - .HasAnnotation("Cosmos:PropertyName", "songName") - .HasAnnotation("Relational:JsonPropertyName", "songName"); - - b.HasKey("Id"); - - b.ToTable("song_lyrics", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "song_lyrics") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.LyricsAnalyzer.SongLyricsRequestJob", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("TEXT") - .HasColumnName("createdAt") - .HasAnnotation("Cosmos:PropertyName", "createdAt") - .HasAnnotation("Relational:JsonPropertyName", "createdAt"); - - b.Property("FallbackMethodNeeded") - .HasColumnType("INTEGER") - .HasColumnName("fallbackMethodNeeded") - .HasAnnotation("Cosmos:PropertyName", "fallbackMethodNeeded") - .HasAnnotation("Relational:JsonPropertyName", "fallbackMethodNeeded"); - - b.Property("GeniusUrl") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("geniusUrl") - .HasAnnotation("Cosmos:PropertyName", "geniusUrl") - .HasAnnotation("Relational:JsonPropertyName", "geniusUrl"); - - b.Property("IsCompleted") - .HasColumnType("INTEGER") - .HasColumnName("isCompleted") - .HasAnnotation("Cosmos:PropertyName", "isCompleted") - .HasAnnotation("Relational:JsonPropertyName", "isCompleted"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("SongLyricsItemId") - .HasColumnType("TEXT") - .HasColumnName("songLyricsItemId") - .HasAnnotation("Cosmos:PropertyName", "songLyricsItemId") - .HasAnnotation("Relational:JsonPropertyName", "songLyricsItemId"); - - b.Property("StandaloneServiceAcknowledged") - .HasColumnType("INTEGER") - .HasColumnName("standaloneServiceAcknowledged") - .HasAnnotation("Cosmos:PropertyName", "standaloneServiceAcknowledged") - .HasAnnotation("Relational:JsonPropertyName", "standaloneServiceAcknowledged"); - - b.HasKey("Id"); - - b.ToTable("song_lyrics_request_jobs", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "song_lyrics_request_jobs") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Database/Migrations/20240517045922_Add_GptModel_Property.cs b/src/Database/Migrations/20240517045922_Add_GptModel_Property.cs deleted file mode 100644 index d7971540..00000000 --- a/src/Database/Migrations/20240517045922_Add_GptModel_Property.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace MuzakBot.Database.Migrations -{ - /// - public partial class Add_GptModel_Property : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "gptModel", - table: "prompt_styles", - type: "TEXT", - nullable: false, - defaultValue: ""); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "gptModel", - table: "prompt_styles"); - } - } -} diff --git a/src/Database/Migrations/AlbumReleaseDb/20240509162641_Add_AlbumReleaseDbContext.Designer.cs b/src/Database/Migrations/AlbumReleaseDb/20240509162641_Add_AlbumReleaseDbContext.Designer.cs deleted file mode 100644 index 0c1152f4..00000000 --- a/src/Database/Migrations/AlbumReleaseDb/20240509162641_Add_AlbumReleaseDbContext.Designer.cs +++ /dev/null @@ -1,82 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using MuzakBot.Database; - -#nullable disable - -namespace MuzakBot.Database.Migrations.AlbumReleaseDb -{ - [DbContext(typeof(AlbumReleaseDbContext))] - [Migration("20240509162641_Add_AlbumReleaseDbContext")] - partial class Add_AlbumReleaseDbContext - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.4"); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.AlbumRelease.AlbumReleaseReminder", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("AlbumId") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("albumId") - .HasAnnotation("Cosmos:PropertyName", "albumId") - .HasAnnotation("Relational:JsonPropertyName", "albumId"); - - b.Property("ArtistId") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("artistId") - .HasAnnotation("Cosmos:PropertyName", "artistId") - .HasAnnotation("Relational:JsonPropertyName", "artistId"); - - b.Property("GuildId") - .HasColumnType("INTEGER") - .HasColumnName("guildId") - .HasAnnotation("Cosmos:PropertyName", "guildId") - .HasAnnotation("Relational:JsonPropertyName", "guildId"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("ReleaseDate") - .HasColumnType("TEXT") - .HasColumnName("releaseDate") - .HasAnnotation("Cosmos:PropertyName", "releaseDate") - .HasAnnotation("Relational:JsonPropertyName", "releaseDate"); - - b.Property("UserIdsToRemind") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("userIdsToRemind") - .HasAnnotation("Cosmos:PropertyName", "userIdsToRemind") - .HasAnnotation("Relational:JsonPropertyName", "userIdsToRemind"); - - b.HasKey("Id"); - - b.ToTable("release_reminders", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "release_reminders") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Database/Migrations/AlbumReleaseDb/20240509162641_Add_AlbumReleaseDbContext.cs b/src/Database/Migrations/AlbumReleaseDb/20240509162641_Add_AlbumReleaseDbContext.cs deleted file mode 100644 index 792f4e7f..00000000 --- a/src/Database/Migrations/AlbumReleaseDb/20240509162641_Add_AlbumReleaseDbContext.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; - -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace MuzakBot.Database.Migrations.AlbumReleaseDb -{ - /// - public partial class Add_AlbumReleaseDbContext : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "release_reminders", - columns: table => new - { - id = table.Column(type: "TEXT", nullable: false), - artistId = table.Column(type: "TEXT", nullable: false), - albumId = table.Column(type: "TEXT", nullable: false), - guildId = table.Column(type: "INTEGER", nullable: false), - userIdsToRemind = table.Column(type: "TEXT", nullable: false), - releaseDate = table.Column(type: "TEXT", nullable: false), - partitionKey = table.Column(type: "TEXT", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_release_reminders", x => x.id); - }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "release_reminders"); - } - } -} diff --git a/src/Database/Migrations/AlbumReleaseDb/20240510010413_Add_ReminderSentProperty.Designer.cs b/src/Database/Migrations/AlbumReleaseDb/20240510010413_Add_ReminderSentProperty.Designer.cs deleted file mode 100644 index 2d2192b8..00000000 --- a/src/Database/Migrations/AlbumReleaseDb/20240510010413_Add_ReminderSentProperty.Designer.cs +++ /dev/null @@ -1,88 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using MuzakBot.Database; - -#nullable disable - -namespace MuzakBot.Database.Migrations.AlbumReleaseDb -{ - [DbContext(typeof(AlbumReleaseDbContext))] - [Migration("20240510010413_Add_ReminderSentProperty")] - partial class Add_ReminderSentProperty - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.4"); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.AlbumRelease.AlbumReleaseReminder", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("AlbumId") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("albumId") - .HasAnnotation("Cosmos:PropertyName", "albumId") - .HasAnnotation("Relational:JsonPropertyName", "albumId"); - - b.Property("ArtistId") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("artistId") - .HasAnnotation("Cosmos:PropertyName", "artistId") - .HasAnnotation("Relational:JsonPropertyName", "artistId"); - - b.Property("GuildId") - .HasColumnType("INTEGER") - .HasColumnName("guildId") - .HasAnnotation("Cosmos:PropertyName", "guildId") - .HasAnnotation("Relational:JsonPropertyName", "guildId"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("ReleaseDate") - .HasColumnType("TEXT") - .HasColumnName("releaseDate") - .HasAnnotation("Cosmos:PropertyName", "releaseDate") - .HasAnnotation("Relational:JsonPropertyName", "releaseDate"); - - b.Property("ReminderSent") - .HasColumnType("INTEGER") - .HasColumnName("reminderSent") - .HasAnnotation("Cosmos:PropertyName", "reminderSent") - .HasAnnotation("Relational:JsonPropertyName", "reminderSent"); - - b.Property("UserIdsToRemind") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("userIdsToRemind") - .HasAnnotation("Cosmos:PropertyName", "userIdsToRemind") - .HasAnnotation("Relational:JsonPropertyName", "userIdsToRemind"); - - b.HasKey("Id"); - - b.ToTable("release_reminders", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "release_reminders") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Database/Migrations/AlbumReleaseDb/20240510010413_Add_ReminderSentProperty.cs b/src/Database/Migrations/AlbumReleaseDb/20240510010413_Add_ReminderSentProperty.cs deleted file mode 100644 index 53c4da92..00000000 --- a/src/Database/Migrations/AlbumReleaseDb/20240510010413_Add_ReminderSentProperty.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace MuzakBot.Database.Migrations.AlbumReleaseDb -{ - /// - public partial class Add_ReminderSentProperty : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "reminderSent", - table: "release_reminders", - type: "INTEGER", - nullable: false, - defaultValue: false); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "reminderSent", - table: "release_reminders"); - } - } -} diff --git a/src/Database/Migrations/AlbumReleaseDb/20240510012042_Remove_ArtistId_Property.Designer.cs b/src/Database/Migrations/AlbumReleaseDb/20240510012042_Remove_ArtistId_Property.Designer.cs deleted file mode 100644 index e0b7a214..00000000 --- a/src/Database/Migrations/AlbumReleaseDb/20240510012042_Remove_ArtistId_Property.Designer.cs +++ /dev/null @@ -1,81 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using MuzakBot.Database; - -#nullable disable - -namespace MuzakBot.Database.Migrations.AlbumReleaseDb -{ - [DbContext(typeof(AlbumReleaseDbContext))] - [Migration("20240510012042_Remove_ArtistId_Property")] - partial class Remove_ArtistId_Property - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.4"); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.AlbumRelease.AlbumReleaseReminder", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("AlbumId") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("albumId") - .HasAnnotation("Cosmos:PropertyName", "albumId") - .HasAnnotation("Relational:JsonPropertyName", "albumId"); - - b.Property("GuildId") - .HasColumnType("INTEGER") - .HasColumnName("guildId") - .HasAnnotation("Cosmos:PropertyName", "guildId") - .HasAnnotation("Relational:JsonPropertyName", "guildId"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("ReleaseDate") - .HasColumnType("TEXT") - .HasColumnName("releaseDate") - .HasAnnotation("Cosmos:PropertyName", "releaseDate") - .HasAnnotation("Relational:JsonPropertyName", "releaseDate"); - - b.Property("ReminderSent") - .HasColumnType("INTEGER") - .HasColumnName("reminderSent") - .HasAnnotation("Cosmos:PropertyName", "reminderSent") - .HasAnnotation("Relational:JsonPropertyName", "reminderSent"); - - b.Property("UserIdsToRemind") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("userIdsToRemind") - .HasAnnotation("Cosmos:PropertyName", "userIdsToRemind") - .HasAnnotation("Relational:JsonPropertyName", "userIdsToRemind"); - - b.HasKey("Id"); - - b.ToTable("release_reminders", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "release_reminders") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Database/Migrations/AlbumReleaseDb/20240510012042_Remove_ArtistId_Property.cs b/src/Database/Migrations/AlbumReleaseDb/20240510012042_Remove_ArtistId_Property.cs deleted file mode 100644 index 21313e65..00000000 --- a/src/Database/Migrations/AlbumReleaseDb/20240510012042_Remove_ArtistId_Property.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace MuzakBot.Database.Migrations.AlbumReleaseDb -{ - /// - public partial class Remove_ArtistId_Property : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "artistId", - table: "release_reminders"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "artistId", - table: "release_reminders", - type: "TEXT", - nullable: false, - defaultValue: ""); - } - } -} diff --git a/src/Database/Migrations/AlbumReleaseDb/20240510021405_Add_ChannelId_Property.Designer.cs b/src/Database/Migrations/AlbumReleaseDb/20240510021405_Add_ChannelId_Property.Designer.cs deleted file mode 100644 index 5a5657ce..00000000 --- a/src/Database/Migrations/AlbumReleaseDb/20240510021405_Add_ChannelId_Property.Designer.cs +++ /dev/null @@ -1,87 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using MuzakBot.Database; - -#nullable disable - -namespace MuzakBot.Database.Migrations.AlbumReleaseDb -{ - [DbContext(typeof(AlbumReleaseDbContext))] - [Migration("20240510021405_Add_ChannelId_Property")] - partial class Add_ChannelId_Property - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.4"); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.AlbumRelease.AlbumReleaseReminder", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("AlbumId") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("albumId") - .HasAnnotation("Cosmos:PropertyName", "albumId") - .HasAnnotation("Relational:JsonPropertyName", "albumId"); - - b.Property("ChannelId") - .HasColumnType("INTEGER") - .HasColumnName("channelId") - .HasAnnotation("Cosmos:PropertyName", "channelId") - .HasAnnotation("Relational:JsonPropertyName", "channelId"); - - b.Property("GuildId") - .HasColumnType("INTEGER") - .HasColumnName("guildId") - .HasAnnotation("Cosmos:PropertyName", "guildId") - .HasAnnotation("Relational:JsonPropertyName", "guildId"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("ReleaseDate") - .HasColumnType("TEXT") - .HasColumnName("releaseDate") - .HasAnnotation("Cosmos:PropertyName", "releaseDate") - .HasAnnotation("Relational:JsonPropertyName", "releaseDate"); - - b.Property("ReminderSent") - .HasColumnType("INTEGER") - .HasColumnName("reminderSent") - .HasAnnotation("Cosmos:PropertyName", "reminderSent") - .HasAnnotation("Relational:JsonPropertyName", "reminderSent"); - - b.Property("UserIdsToRemind") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("userIdsToRemind") - .HasAnnotation("Cosmos:PropertyName", "userIdsToRemind") - .HasAnnotation("Relational:JsonPropertyName", "userIdsToRemind"); - - b.HasKey("Id"); - - b.ToTable("release_reminders", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "release_reminders") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Database/Migrations/AlbumReleaseDb/20240510021405_Add_ChannelId_Property.cs b/src/Database/Migrations/AlbumReleaseDb/20240510021405_Add_ChannelId_Property.cs deleted file mode 100644 index 9c976bf1..00000000 --- a/src/Database/Migrations/AlbumReleaseDb/20240510021405_Add_ChannelId_Property.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace MuzakBot.Database.Migrations.AlbumReleaseDb -{ - /// - public partial class Add_ChannelId_Property : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "channelId", - table: "release_reminders", - type: "INTEGER", - nullable: false, - defaultValue: 0ul); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "channelId", - table: "release_reminders"); - } - } -} diff --git a/src/Database/Migrations/AlbumReleaseDb/20240510025424_Update_ulong-to-string.Designer.cs b/src/Database/Migrations/AlbumReleaseDb/20240510025424_Update_ulong-to-string.Designer.cs deleted file mode 100644 index 3f8ecc19..00000000 --- a/src/Database/Migrations/AlbumReleaseDb/20240510025424_Update_ulong-to-string.Designer.cs +++ /dev/null @@ -1,89 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using MuzakBot.Database; - -#nullable disable - -namespace MuzakBot.Database.Migrations.AlbumReleaseDb -{ - [DbContext(typeof(AlbumReleaseDbContext))] - [Migration("20240510025424_Update_ulong-to-string")] - partial class Update_ulongtostring - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.4"); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.AlbumRelease.AlbumReleaseReminder", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("AlbumId") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("albumId") - .HasAnnotation("Cosmos:PropertyName", "albumId") - .HasAnnotation("Relational:JsonPropertyName", "albumId"); - - b.Property("ChannelId") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("channelId") - .HasAnnotation("Cosmos:PropertyName", "channelId") - .HasAnnotation("Relational:JsonPropertyName", "channelId"); - - b.Property("GuildId") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("guildId") - .HasAnnotation("Cosmos:PropertyName", "guildId") - .HasAnnotation("Relational:JsonPropertyName", "guildId"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("ReleaseDate") - .HasColumnType("TEXT") - .HasColumnName("releaseDate") - .HasAnnotation("Cosmos:PropertyName", "releaseDate") - .HasAnnotation("Relational:JsonPropertyName", "releaseDate"); - - b.Property("ReminderSent") - .HasColumnType("INTEGER") - .HasColumnName("reminderSent") - .HasAnnotation("Cosmos:PropertyName", "reminderSent") - .HasAnnotation("Relational:JsonPropertyName", "reminderSent"); - - b.Property("UserIdsToRemind") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("userIdsToRemind") - .HasAnnotation("Cosmos:PropertyName", "userIdsToRemind") - .HasAnnotation("Relational:JsonPropertyName", "userIdsToRemind"); - - b.HasKey("Id"); - - b.ToTable("release_reminders", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "release_reminders") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Database/Migrations/AlbumReleaseDb/20240510025424_Update_ulong-to-string.cs b/src/Database/Migrations/AlbumReleaseDb/20240510025424_Update_ulong-to-string.cs deleted file mode 100644 index 8c3e7fdf..00000000 --- a/src/Database/Migrations/AlbumReleaseDb/20240510025424_Update_ulong-to-string.cs +++ /dev/null @@ -1,50 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace MuzakBot.Database.Migrations.AlbumReleaseDb -{ - /// - public partial class Update_ulongtostring : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "guildId", - table: "release_reminders", - type: "TEXT", - nullable: false, - oldClrType: typeof(ulong), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn( - name: "channelId", - table: "release_reminders", - type: "TEXT", - nullable: false, - oldClrType: typeof(ulong), - oldType: "INTEGER"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "guildId", - table: "release_reminders", - type: "INTEGER", - nullable: false, - oldClrType: typeof(string), - oldType: "TEXT"); - - migrationBuilder.AlterColumn( - name: "channelId", - table: "release_reminders", - type: "INTEGER", - nullable: false, - oldClrType: typeof(string), - oldType: "TEXT"); - } - } -} diff --git a/src/Database/Migrations/AlbumReleaseDb/AlbumReleaseDbContextModelSnapshot.cs b/src/Database/Migrations/AlbumReleaseDb/AlbumReleaseDbContextModelSnapshot.cs deleted file mode 100644 index bedc9edf..00000000 --- a/src/Database/Migrations/AlbumReleaseDb/AlbumReleaseDbContextModelSnapshot.cs +++ /dev/null @@ -1,86 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using MuzakBot.Database; - -#nullable disable - -namespace MuzakBot.Database.Migrations.AlbumReleaseDb -{ - [DbContext(typeof(AlbumReleaseDbContext))] - partial class AlbumReleaseDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.4"); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.AlbumRelease.AlbumReleaseReminder", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("AlbumId") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("albumId") - .HasAnnotation("Cosmos:PropertyName", "albumId") - .HasAnnotation("Relational:JsonPropertyName", "albumId"); - - b.Property("ChannelId") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("channelId") - .HasAnnotation("Cosmos:PropertyName", "channelId") - .HasAnnotation("Relational:JsonPropertyName", "channelId"); - - b.Property("GuildId") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("guildId") - .HasAnnotation("Cosmos:PropertyName", "guildId") - .HasAnnotation("Relational:JsonPropertyName", "guildId"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("ReleaseDate") - .HasColumnType("TEXT") - .HasColumnName("releaseDate") - .HasAnnotation("Cosmos:PropertyName", "releaseDate") - .HasAnnotation("Relational:JsonPropertyName", "releaseDate"); - - b.Property("ReminderSent") - .HasColumnType("INTEGER") - .HasColumnName("reminderSent") - .HasAnnotation("Cosmos:PropertyName", "reminderSent") - .HasAnnotation("Relational:JsonPropertyName", "reminderSent"); - - b.Property("UserIdsToRemind") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("userIdsToRemind") - .HasAnnotation("Cosmos:PropertyName", "userIdsToRemind") - .HasAnnotation("Relational:JsonPropertyName", "userIdsToRemind"); - - b.HasKey("Id"); - - b.ToTable("release_reminders", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "release_reminders") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Database/Migrations/LyricsAnalyzerDbContextModelSnapshot.cs b/src/Database/Migrations/LyricsAnalyzerDbContextModelSnapshot.cs deleted file mode 100644 index ed897bf1..00000000 --- a/src/Database/Migrations/LyricsAnalyzerDbContextModelSnapshot.cs +++ /dev/null @@ -1,468 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using MuzakBot.Database; - -#nullable disable - -namespace MuzakBot.Database.Migrations -{ - [DbContext(typeof(LyricsAnalyzerDbContext))] - partial class LyricsAnalyzerDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.5"); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.DatabaseUpdate", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("MigratedToEfCore") - .HasColumnType("INTEGER") - .HasColumnName("migratedToEfCore") - .HasAnnotation("Cosmos:PropertyName", "migratedToEfCore") - .HasAnnotation("Relational:JsonPropertyName", "migratedToEfCore"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.HasKey("Id"); - - b.ToTable("database_updates", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "database_updates") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.LyricsAnalyzer.AnalyzedLyrics", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("Analysis") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("analysis") - .HasAnnotation("Cosmos:PropertyName", "analysis") - .HasAnnotation("Relational:JsonPropertyName", "analysis"); - - b.Property("ArtistName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("artistName") - .HasAnnotation("Cosmos:PropertyName", "artistName") - .HasAnnotation("Relational:JsonPropertyName", "artistName"); - - b.Property("CreatedAt") - .HasColumnType("TEXT") - .HasColumnName("createdAt") - .HasAnnotation("Cosmos:PropertyName", "createdAt") - .HasAnnotation("Relational:JsonPropertyName", "createdAt"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("PromptStyleUsed") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("promptStyleUsed") - .HasAnnotation("Cosmos:PropertyName", "promptStyleUsed") - .HasAnnotation("Relational:JsonPropertyName", "promptStyleUsed"); - - b.Property("SongLyricsId") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("songLyricsId") - .HasAnnotation("Cosmos:PropertyName", "songLyricsId") - .HasAnnotation("Relational:JsonPropertyName", "songLyricsId"); - - b.Property("SongName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("songName") - .HasAnnotation("Cosmos:PropertyName", "songName") - .HasAnnotation("Relational:JsonPropertyName", "songName"); - - b.HasKey("Id"); - - b.ToTable("analyzed_lyrics", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "analyzed_lyrics") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.LyricsAnalyzer.LyricsAnalyzerConfig", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CommandDisabledGuildIds") - .HasColumnType("TEXT") - .HasColumnName("commandDisabledGuildIds") - .HasAnnotation("Cosmos:PropertyName", "commandDisabledGuildIds") - .HasAnnotation("Relational:JsonPropertyName", "commandDisabledGuildIds"); - - b.Property("CommandEnabledGuildIds") - .HasColumnType("TEXT") - .HasColumnName("commandEnabledGuildIds") - .HasAnnotation("Cosmos:PropertyName", "commandEnabledGuildIds") - .HasAnnotation("Relational:JsonPropertyName", "commandEnabledGuildIds"); - - b.Property("CommandIsEnabledToSpecificGuilds") - .HasColumnType("INTEGER") - .HasColumnName("commandIsEnabledToSpecificGuilds") - .HasAnnotation("Cosmos:PropertyName", "commandIsEnabledToSpecificGuilds") - .HasAnnotation("Relational:JsonPropertyName", "commandIsEnabledToSpecificGuilds"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("RateLimitEnabled") - .HasColumnType("INTEGER") - .HasColumnName("rateLimitEnabled") - .HasAnnotation("Cosmos:PropertyName", "rateLimitEnabled") - .HasAnnotation("Relational:JsonPropertyName", "rateLimitEnabled"); - - b.Property("RateLimitIgnoredUserIds") - .HasColumnType("TEXT") - .HasColumnName("rateLimitIgnoredUserIds") - .HasAnnotation("Cosmos:PropertyName", "rateLimitIgnoredUserIds") - .HasAnnotation("Relational:JsonPropertyName", "rateLimitIgnoredUserIds"); - - b.Property("RateLimitMaxRequests") - .HasColumnType("INTEGER") - .HasColumnName("rateLimitMaxRequests") - .HasAnnotation("Cosmos:PropertyName", "rateLimitMaxRequests") - .HasAnnotation("Relational:JsonPropertyName", "rateLimitMaxRequests"); - - b.HasKey("Id"); - - b.ToTable("command_configs", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "command_configs") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.LyricsAnalyzer.LyricsAnalyzerItem", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("ArtistName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("artistName") - .HasAnnotation("Cosmos:PropertyName", "artistName") - .HasAnnotation("Relational:JsonPropertyName", "artistName"); - - b.Property("CreatedAt") - .HasColumnType("TEXT") - .HasColumnName("createdAt") - .HasAnnotation("Cosmos:PropertyName", "createdAt") - .HasAnnotation("Relational:JsonPropertyName", "createdAt"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("PromptStyle") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("promptStyle") - .HasAnnotation("Cosmos:PropertyName", "promptStyle") - .HasAnnotation("Relational:JsonPropertyName", "promptStyle"); - - b.Property("SongName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("songName") - .HasAnnotation("Cosmos:PropertyName", "songName") - .HasAnnotation("Relational:JsonPropertyName", "songName"); - - b.HasKey("Id"); - - b.ToTable("lyrics_analyzer_items", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "lyrics_analyzer_items") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.LyricsAnalyzer.LyricsAnalyzerPromptStyle", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("AnalysisType") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("analysisType") - .HasAnnotation("Cosmos:PropertyName", "analysisType") - .HasAnnotation("Relational:JsonPropertyName", "analysisType"); - - b.Property("CreatedOn") - .HasColumnType("TEXT") - .HasColumnName("createdOn") - .HasAnnotation("Cosmos:PropertyName", "createdOn") - .HasAnnotation("Relational:JsonPropertyName", "createdOn"); - - b.Property("GptModel") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("gptModel") - .HasAnnotation("Cosmos:PropertyName", "gptModel") - .HasAnnotation("Relational:JsonPropertyName", "gptModel"); - - b.Property("LastUpdated") - .HasColumnType("TEXT") - .HasColumnName("lastUpdated") - .HasAnnotation("Cosmos:PropertyName", "lastUpdated") - .HasAnnotation("Relational:JsonPropertyName", "lastUpdated"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("name") - .HasAnnotation("Cosmos:PropertyName", "name") - .HasAnnotation("Relational:JsonPropertyName", "name"); - - b.Property("NoticeText") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("noticeText") - .HasAnnotation("Cosmos:PropertyName", "noticeText") - .HasAnnotation("Relational:JsonPropertyName", "noticeText"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("Prompt") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("prompt") - .HasAnnotation("Cosmos:PropertyName", "prompt") - .HasAnnotation("Relational:JsonPropertyName", "prompt"); - - b.Property("ShortName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("shortName") - .HasAnnotation("Cosmos:PropertyName", "shortName") - .HasAnnotation("Relational:JsonPropertyName", "shortName"); - - b.Property("UserPrompt") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("userPrompt") - .HasAnnotation("Cosmos:PropertyName", "userPrompt") - .HasAnnotation("Relational:JsonPropertyName", "userPrompt"); - - b.HasKey("Id"); - - b.ToTable("prompt_styles", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "prompt_styles") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.LyricsAnalyzer.LyricsAnalyzerUserRateLimit", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CurrentRequestCount") - .HasColumnType("INTEGER") - .HasColumnName("currentRequestCount") - .HasAnnotation("Cosmos:PropertyName", "currentRequestCount") - .HasAnnotation("Relational:JsonPropertyName", "currentRequestCount"); - - b.Property("LastRequestTime") - .HasColumnType("TEXT") - .HasColumnName("lastRequestTime") - .HasAnnotation("Cosmos:PropertyName", "lastRequestTime") - .HasAnnotation("Relational:JsonPropertyName", "lastRequestTime"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("userId") - .HasAnnotation("Cosmos:PropertyName", "userId") - .HasAnnotation("Relational:JsonPropertyName", "userId"); - - b.HasKey("Id"); - - b.ToTable("user_rate_limit", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "user_rate_limit") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.LyricsAnalyzer.SongLyricsItem", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("ArtistName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("artistName") - .HasAnnotation("Cosmos:PropertyName", "artistName") - .HasAnnotation("Relational:JsonPropertyName", "artistName"); - - b.Property("CreatedAt") - .HasColumnType("TEXT") - .HasColumnName("createdAt") - .HasAnnotation("Cosmos:PropertyName", "createdAt") - .HasAnnotation("Relational:JsonPropertyName", "createdAt"); - - b.Property("Lyrics") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("lyrics") - .HasAnnotation("Cosmos:PropertyName", "lyrics") - .HasAnnotation("Relational:JsonPropertyName", "lyrics"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("SongName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("songName") - .HasAnnotation("Cosmos:PropertyName", "songName") - .HasAnnotation("Relational:JsonPropertyName", "songName"); - - b.HasKey("Id"); - - b.ToTable("song_lyrics", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "song_lyrics") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); - - modelBuilder.Entity("MuzakBot.Lib.Models.Database.LyricsAnalyzer.SongLyricsRequestJob", b => - { - b.Property("Id") - .HasColumnType("TEXT") - .HasColumnName("id") - .HasAnnotation("Cosmos:PropertyName", "id") - .HasAnnotation("Relational:JsonPropertyName", "id"); - - b.Property("CreatedAt") - .HasColumnType("TEXT") - .HasColumnName("createdAt") - .HasAnnotation("Cosmos:PropertyName", "createdAt") - .HasAnnotation("Relational:JsonPropertyName", "createdAt"); - - b.Property("FallbackMethodNeeded") - .HasColumnType("INTEGER") - .HasColumnName("fallbackMethodNeeded") - .HasAnnotation("Cosmos:PropertyName", "fallbackMethodNeeded") - .HasAnnotation("Relational:JsonPropertyName", "fallbackMethodNeeded"); - - b.Property("GeniusUrl") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("geniusUrl") - .HasAnnotation("Cosmos:PropertyName", "geniusUrl") - .HasAnnotation("Relational:JsonPropertyName", "geniusUrl"); - - b.Property("IsCompleted") - .HasColumnType("INTEGER") - .HasColumnName("isCompleted") - .HasAnnotation("Cosmos:PropertyName", "isCompleted") - .HasAnnotation("Relational:JsonPropertyName", "isCompleted"); - - b.Property("PartitionKey") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("partitionKey") - .HasAnnotation("Cosmos:PropertyName", "partitionKey") - .HasAnnotation("Relational:JsonPropertyName", "partitionKey"); - - b.Property("SongLyricsItemId") - .HasColumnType("TEXT") - .HasColumnName("songLyricsItemId") - .HasAnnotation("Cosmos:PropertyName", "songLyricsItemId") - .HasAnnotation("Relational:JsonPropertyName", "songLyricsItemId"); - - b.Property("StandaloneServiceAcknowledged") - .HasColumnType("INTEGER") - .HasColumnName("standaloneServiceAcknowledged") - .HasAnnotation("Cosmos:PropertyName", "standaloneServiceAcknowledged") - .HasAnnotation("Relational:JsonPropertyName", "standaloneServiceAcknowledged"); - - b.HasKey("Id"); - - b.ToTable("song_lyrics_request_jobs", (string)null); - - b - .HasAnnotation("Cosmos:ContainerName", "song_lyrics_request_jobs") - .HasAnnotation("Cosmos:PartitionKeyName", "PartitionKey"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Database/Models/CosmosDbConfigOptions.cs b/src/Database/Models/CosmosDbConfigOptions.cs deleted file mode 100644 index 0bb64c84..00000000 --- a/src/Database/Models/CosmosDbConfigOptions.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.Text.Json.Serialization; - -namespace MuzakBot.Database.Models; - -/// -/// Configuration options for Cosmos DB. -/// -public sealed class CosmosDbConfigOptions -{ - /// - /// The connection string for Cosmos DB. - /// - [JsonPropertyName("COSMOSDB_CONNECTIONSTRING")] - public string ConnectionString { get; set; } = null!; -} diff --git a/src/Database/Models/DatabaseConfig.cs b/src/Database/Models/DatabaseConfig.cs index 928c9036..d0f86624 100644 --- a/src/Database/Models/DatabaseConfig.cs +++ b/src/Database/Models/DatabaseConfig.cs @@ -10,11 +10,6 @@ public sealed class DatabaseConfig /// public DatabaseType DatabaseType { get; set; } - /// - /// Configuration options for Cosmos DB. - /// - public CosmosDbConfigOptions? CosmosDbConfig { get; set; } - /// /// Configuration options for SQLite. /// diff --git a/src/Database/Models/DatabaseType.cs b/src/Database/Models/DatabaseType.cs index be692977..ecde63ed 100644 --- a/src/Database/Models/DatabaseType.cs +++ b/src/Database/Models/DatabaseType.cs @@ -10,13 +10,8 @@ public enum DatabaseType /// Sqlite = 0, - /// - /// Azure Cosmos DB - /// - CosmosDb = 1, - /// /// PostgreSQL database /// - PostgreSql = 2 + PostgreSql = 1 }