diff --git a/src/EllieBot/.sql b/src/EllieBot/.sql deleted file mode 100644 index 8b13789..0000000 --- a/src/EllieBot/.sql +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/EllieBot/Migrations/PostgreSql/20250126062816_cleanup.sql b/src/EllieBot/Migrations/PostgreSql/20250126062816_cleanup.sql index 2030f3a..54e4708 100644 --- a/src/EllieBot/Migrations/PostgreSql/20250126062816_cleanup.sql +++ b/src/EllieBot/Migrations/PostgreSql/20250126062816_cleanup.sql @@ -330,4 +330,5 @@ ALTER TABLE permissions ADD CONSTRAINT fk_permissions_guildconfigs_guildconfigid INSERT INTO "__EFMigrationsHistory" (migrationid, productversion) VALUES ('20250126062816_cleanup', '8.0.8'); -COMMIT; \ No newline at end of file +COMMIT; + diff --git a/src/EllieBot/Migrations/Sqlite/20250126062816_cleanup.sql b/src/EllieBot/Migrations/Sqlite/20250126062816_cleanup.sql index 78cd76f..da93828 100644 --- a/src/EllieBot/Migrations/Sqlite/20250126062816_cleanup.sql +++ b/src/EllieBot/Migrations/Sqlite/20250126062816_cleanup.sql @@ -759,4 +759,5 @@ CREATE INDEX "IX_GuildConfigs_WarnExpireHours" ON "GuildConfigs" ("WarnExpireHou INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion") VALUES ('20250126062816_cleanup', '8.0.8'); -COMMIT; \ No newline at end of file +COMMIT; + diff --git a/src/EllieBot/Modules/Administration/Protection/ProtectionService.cs b/src/EllieBot/Modules/Administration/Protection/ProtectionService.cs index fb965b0..4a9890a 100644 --- a/src/EllieBot/Modules/Administration/Protection/ProtectionService.cs +++ b/src/EllieBot/Modules/Administration/Protection/ProtectionService.cs @@ -4,7 +4,6 @@ using LinqToDB.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; using EllieBot.Common.ModuleBehaviors; using EllieBot.Db.Models; -using EllieBot.Migrations; using System.Threading.Channels; namespace EllieBot.Modules.Administration.Services; diff --git a/src/EllieBot/clean-migrations.ps1 b/src/EllieBot/clean-migrations.ps1 deleted file mode 100644 index 7db1541..0000000 --- a/src/EllieBot/clean-migrations.ps1 +++ /dev/null @@ -1,49 +0,0 @@ -# WORK IN PROGRESS - -# Define the folders to search for designer.cs files -$folders = @("Migrations/PostgreSql", "Migrations/Sqlite") - -# Loop through each folder -foreach ($folder in $folders) { - # Get all designer.cs files in the folder and subfolders - $files = Get-ChildItem -Path $folder -Filter *.designer.cs -Recurse - - $excludedPattern = "cleanup|mysql-init|squash|rero-cascade" - -$filteredFiles = $files | Where-Object { $_.Name -notmatch $excludedPattern } - # Loop through each file - foreach ($file in ($files | Where-Object { $_.Name -notmatch $excludedPattern })) { - # Read the contents of the file - $content = Get-Content -Path $file.FullName | Select-Object -First 30 - - # Find the attribute lines - $attributes = $content | Where-Object { $_ -match '\[.*\]' } | ForEach-Object { ' ' + $_.Trim() } - - # Find the namespace - $namespace = $content | Where-Object { $_ -match 'namespace' } | ForEach-Object { $_.Split(' ')[1] } - - # Find the class name - $class_name = $content | Where-Object { $_ -match 'partial class' } | ForEach-Object { $_.Trim().Split(' ')[2] } - - # Replace the contents with the new template - $new_content = @" -// <auto-generated /> -using EllieBot.Db; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace $namespace -{ -$($attributes -join "`n") - partial class $class_name - { - } -} -"@ - - # Write the new contents to the file - Set-Content -Path $file.FullName -Value $new_content - } -} \ No newline at end of file diff --git a/src/EllieBot/remove-migrations.ps1 b/src/EllieBot/remove-migrations.ps1 deleted file mode 100644 index 1732410..0000000 --- a/src/EllieBot/remove-migrations.ps1 +++ /dev/null @@ -1,5 +0,0 @@ -# get the last file in the migrations folder ending with .sql and remove it -# order files by name - -Get-ChildItem -Path "Migrations/Sqlite" -Filter *.sql -Recurse | Sort-Object Name | Select-Object -Last 1 | Remove-Item -Get-ChildItem -Path "Migrations/PostgreSql" -Filter *.sql -Recurse | Sort-Object Name | Select-Object -Last 1 | Remove-Item \ No newline at end of file