diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/slskd/Core/Data/Migrations/README.md | 2 | ||||
| -rw-r--r-- | src/slskd/Core/Data/Migrations/Z2025_04_01_TransferStateMigration.cs (renamed from src/slskd/Core/Data/Migrations/Z04012025_TransferStateMigration.cs) | 10 | ||||
| -rw-r--r-- | src/slskd/Core/Data/Migrations/Z2025_07_06_TransferIndexesMigration.cs (renamed from src/slskd/Core/Data/Migrations/Z07062025_TransferIndexesMigration.cs) | 10 | ||||
| -rw-r--r-- | src/slskd/Core/Data/Migrations/Z2025_07_26_PrivateMessageWasReplayedMigration.cs (renamed from src/slskd/Core/Data/Migrations/Z07262025_PrivateMessageWasReplayedMigration.cs) | 11 | ||||
| -rw-r--r-- | src/slskd/Core/Data/Migrations/Z2025_12_28_AdditionalTransferIndexesMigration.cs (renamed from src/slskd/Core/Data/Migrations/Z12282025_AdditionalTransferIndexesMigration.cs) | 10 |
5 files changed, 21 insertions, 22 deletions
diff --git a/src/slskd/Core/Data/Migrations/README.md b/src/slskd/Core/Data/Migrations/README.md index 2b5fd6f4..46da7ded 100644 --- a/src/slskd/Core/Data/Migrations/README.md +++ b/src/slskd/Core/Data/Migrations/README.md @@ -11,7 +11,7 @@ The `Migrator` creates a backup of each database prior to running any migrations Each migration must be created as a class that implements the `IMigration` interface. The naming convention for migration classes is: ``` -Z<MMDDYYYY>_<ShortDescription>Migration +Z<YYYY_MM_DD>_<ShortDescription>Migration ``` Migrations MUST: diff --git a/src/slskd/Core/Data/Migrations/Z04012025_TransferStateMigration.cs b/src/slskd/Core/Data/Migrations/Z2025_04_01_TransferStateMigration.cs index c6e3d2f1..146541dd 100644 --- a/src/slskd/Core/Data/Migrations/Z04012025_TransferStateMigration.cs +++ b/src/slskd/Core/Data/Migrations/Z2025_04_01_TransferStateMigration.cs @@ -1,4 +1,4 @@ -// <copyright file="Z04012025_TransferStateMigration.cs" company="slskd Team"> +// <copyright file="Z2025_04_01_TransferStateMigration.cs" company="slskd Team"> // Copyright (c) slskd Team. All rights reserved. // // This program is free software: you can redistribute it and/or modify @@ -37,14 +37,14 @@ using slskd.Transfers; /// as strings; it tries to use bitwise operators to apply HasFlags(), and these obviously don't /// work against strings. Not sure why EF didn't complain about this, but here we are. /// </summary> -public class Z04012025_TransferStateMigration : IMigration +public class Z2025_04_01_TransferStateMigration : IMigration { - public Z04012025_TransferStateMigration(ConnectionStringDictionary connectionStrings) + public Z2025_04_01_TransferStateMigration(ConnectionStringDictionary connectionStrings) { ConnectionString = connectionStrings[Database.Transfers]; } - private ILogger Log { get; } = Serilog.Log.ForContext<Z04012025_TransferStateMigration>(); + private ILogger Log { get; } = Serilog.Log.ForContext<Z2025_04_01_TransferStateMigration>(); private string ConnectionString { get; } public bool NeedsToBeApplied() @@ -61,7 +61,7 @@ public class Z04012025_TransferStateMigration : IMigration { if (!NeedsToBeApplied()) { - Log.Information("> Migration {Name} is not necessary or has already been applied", nameof(Z04012025_TransferStateMigration)); + Log.Information("> Migration {Name} is not necessary or has already been applied", nameof(Z2025_04_01_TransferStateMigration)); return; } diff --git a/src/slskd/Core/Data/Migrations/Z07062025_TransferIndexesMigration.cs b/src/slskd/Core/Data/Migrations/Z2025_07_06_TransferIndexesMigration.cs index 8ae13734..df93f685 100644 --- a/src/slskd/Core/Data/Migrations/Z07062025_TransferIndexesMigration.cs +++ b/src/slskd/Core/Data/Migrations/Z2025_07_06_TransferIndexesMigration.cs @@ -1,4 +1,4 @@ -// <copyright file="Z07062025_TransferIndexesMigration.cs" company="slskd Team"> +// <copyright file="Z2025_07_06_TransferIndexesMigration.cs" company="slskd Team"> // Copyright (c) slskd Team. All rights reserved. // // This program is free software: you can redistribute it and/or modify @@ -25,14 +25,14 @@ using Serilog; /// <summary> /// Updates the Transfers table to add indexes on the Direction and State columns. /// </summary> -public class Z07062025_TransferIndexesMigration : IMigration +public class Z2025_07_06_TransferIndexesMigration : IMigration { - public Z07062025_TransferIndexesMigration(ConnectionStringDictionary connectionStrings) + public Z2025_07_06_TransferIndexesMigration(ConnectionStringDictionary connectionStrings) { ConnectionString = connectionStrings[Database.Transfers]; } - private ILogger Log { get; } = Serilog.Log.ForContext<Z07062025_TransferIndexesMigration>(); + private ILogger Log { get; } = Serilog.Log.ForContext<Z2025_07_06_TransferIndexesMigration>(); private string ConnectionString { get; } public bool NeedsToBeApplied() @@ -56,7 +56,7 @@ public class Z07062025_TransferIndexesMigration : IMigration { if (!NeedsToBeApplied()) { - Log.Information("> Migration {Name} is not necessary or has already been applied", nameof(Z07062025_TransferIndexesMigration)); + Log.Information("> Migration {Name} is not necessary or has already been applied", nameof(Z2025_07_06_TransferIndexesMigration)); return; } diff --git a/src/slskd/Core/Data/Migrations/Z07262025_PrivateMessageWasReplayedMigration.cs b/src/slskd/Core/Data/Migrations/Z2025_07_26_PrivateMessageWasReplayedMigration.cs index a458a756..c3f3664b 100644 --- a/src/slskd/Core/Data/Migrations/Z07262025_PrivateMessageWasReplayedMigration.cs +++ b/src/slskd/Core/Data/Migrations/Z2025_07_26_PrivateMessageWasReplayedMigration.cs @@ -1,4 +1,4 @@ -// <copyright file="Z07262025_PrivateMessageWasReplayedMigration.cs" company="slskd Team"> +// <copyright file="Z2025_07_26_PrivateMessageWasReplayedMigration.cs" company="slskd Team"> // Copyright (c) slskd Team. All rights reserved. // // This program is free software: you can redistribute it and/or modify @@ -26,19 +26,18 @@ using slskd.Messaging; /// <summary> /// Updates the Transfers table to add indexes on the Direction and State columns. /// </summary> -public class Z07262025_PrivateMessageWasReplayedMigration : IMigration +public class Z2025_07_26_PrivateMessageWasReplayedMigration : IMigration { - public Z07262025_PrivateMessageWasReplayedMigration(ConnectionStringDictionary connectionStrings) + public Z2025_07_26_PrivateMessageWasReplayedMigration(ConnectionStringDictionary connectionStrings) { ConnectionString = connectionStrings[Database.Messaging]; } - private ILogger Log { get; } = Serilog.Log.ForContext<Z07262025_PrivateMessageWasReplayedMigration>(); + private ILogger Log { get; } = Serilog.Log.ForContext<Z2025_07_26_PrivateMessageWasReplayedMigration>(); private string ConnectionString { get; } public bool NeedsToBeApplied() { - // check to see if *BOTH* of the indexes are in place. if one or both are missing, we must apply var schema = SchemaInspector.GetDatabaseSchema(ConnectionString); var pms = schema["PrivateMessages"]; @@ -54,7 +53,7 @@ public class Z07262025_PrivateMessageWasReplayedMigration : IMigration { if (!NeedsToBeApplied()) { - Log.Information("> Migration {Name} is not necessary or has already been applied", nameof(Z07262025_PrivateMessageWasReplayedMigration)); + Log.Information("> Migration {Name} is not necessary or has already been applied", nameof(Z2025_07_26_PrivateMessageWasReplayedMigration)); return; } diff --git a/src/slskd/Core/Data/Migrations/Z12282025_AdditionalTransferIndexesMigration.cs b/src/slskd/Core/Data/Migrations/Z2025_12_28_AdditionalTransferIndexesMigration.cs index 2deffeb3..e66cc59d 100644 --- a/src/slskd/Core/Data/Migrations/Z12282025_AdditionalTransferIndexesMigration.cs +++ b/src/slskd/Core/Data/Migrations/Z2025_12_28_AdditionalTransferIndexesMigration.cs @@ -1,4 +1,4 @@ -// <copyright file="Z12282025_AdditionalTransferIndexesMigration.cs" company="slskd Team"> +// <copyright file="Z2025_12_28_AdditionalTransferIndexesMigration.cs" company="slskd Team"> // Copyright (c) slskd Team. All rights reserved. // // This program is free software: you can redistribute it and/or modify @@ -25,14 +25,14 @@ using Serilog; /// <summary> /// Adds additional indexes to the Transfers table for Removed, Username/Filename, and user upload statistics. /// </summary> -public class Z12282025_AdditionalTransferIndexesMigration : IMigration +public class Z2025_12_28_AdditionalTransferIndexesMigration : IMigration { - public Z12282025_AdditionalTransferIndexesMigration(ConnectionStringDictionary connectionStrings) + public Z2025_12_28_AdditionalTransferIndexesMigration(ConnectionStringDictionary connectionStrings) { ConnectionString = connectionStrings[Database.Transfers]; } - private ILogger Log { get; } = Serilog.Log.ForContext<Z12282025_AdditionalTransferIndexesMigration>(); + private ILogger Log { get; } = Serilog.Log.ForContext<Z2025_12_28_AdditionalTransferIndexesMigration>(); private string ConnectionString { get; } public bool NeedsToBeApplied() @@ -57,7 +57,7 @@ public class Z12282025_AdditionalTransferIndexesMigration : IMigration { if (!NeedsToBeApplied()) { - Log.Information("> Migration {Name} is not necessary or has already been applied", nameof(Z12282025_AdditionalTransferIndexesMigration)); + Log.Information("> Migration {Name} is not necessary or has already been applied", nameof(Z2025_12_28_AdditionalTransferIndexesMigration)); return; } |
