diff --git a/ProjectLighthouse/Database/DatabaseContextFactory.cs b/ProjectLighthouse/Database/DatabaseContextFactory.cs
new file mode 100644
index 00000000..8c8dbeee
--- /dev/null
+++ b/ProjectLighthouse/Database/DatabaseContextFactory.cs
@@ -0,0 +1,12 @@
+using Microsoft.EntityFrameworkCore.Design;
+
+namespace LBPUnion.ProjectLighthouse.Database;
+
+///
+/// This class is only used for the code-first migration builder to detect the DbContext
+///
+// ReSharper disable once UnusedType.Global
+public class DatabaseContextFactory : IDesignTimeDbContextFactory
+{
+ public DatabaseContext CreateDbContext(string[] args) => DatabaseContext.CreateNewInstance();
+}
\ No newline at end of file