aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Core/Data/IMigration.cs
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2025-05-25 17:53:31 -0500
committerJP Dillingham <jp@dillingham.me>2025-05-25 17:53:31 -0500
commit930df71e94dedd5de5267418c3e7666a86eea416 (patch)
tree083ea0dd1f3147c7f8e38a82e2df788562897c97 /src/slskd/Core/Data/IMigration.cs
parent7a44729293863b494fd929b91f349f47b8603e7c (diff)
downloadslskd-930df71e94dedd5de5267418c3e7666a86eea416.tar.gz
final tweaks
Diffstat (limited to 'src/slskd/Core/Data/IMigration.cs')
-rw-r--r--src/slskd/Core/Data/IMigration.cs38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/slskd/Core/Data/IMigration.cs b/src/slskd/Core/Data/IMigration.cs
new file mode 100644
index 00000000..18b198b2
--- /dev/null
+++ b/src/slskd/Core/Data/IMigration.cs
@@ -0,0 +1,38 @@
+// <copyright file="IMigration.cs" company="slskd Team">
+// Copyright (c) slskd Team. All rights reserved.
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Affero General Public License as published
+// by the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Affero General Public License for more details.
+//
+// You should have received a copy of the GNU Affero General Public License
+// along with this program. If not, see https://www.gnu.org/licenses/.
+// </copyright>
+
+namespace slskd;
+
+/// <summary>
+/// Applies database migrations.
+/// </summary>
+public interface IMigration
+{
+ /// <summary>
+ /// Determines whether the migration needs to be applied.
+ /// </summary>
+ /// <remarks>
+ /// This method MUST be read-only and should contain no side effects.
+ /// </remarks>
+ /// <returns>A value indicating whether the migration needs to be applied.</returns>
+ bool NeedsToBeApplied();
+
+ /// <summary>
+ /// Applies the migration.
+ /// </summary>
+ void Apply();
+} \ No newline at end of file