Entity Framework Core Migration to Supabase Hangs Indefinitely
I'm trying to apply an Entity Framework Core migration to a Supabase PostgreSQL database, but the process hangs indefinitely. Here are the key details:
- Using .NET 8 and EF Core 8.0.8
- Initial database connection succeeds (confirmed by console output)
-
dotnet ef database update
command never completes
- No error messages or exceptions are thrown
- Command timeout is set to 500 seconds in both connection string and DbContext configuration
- No logs found in supabase to indicate the migration has reached the db
I've verified the connection works, as the application prints "Successfully connected to the database" on startup. However, when trying to apply the migration, it simply hangs without any progress or error messages.
Has anyone encountered this issue with Supabase? Any suggestions for troubleshooting or resolving this problem would be greatly appreciated.4 Replies
As you see it's a really simple application because couldn't get it to work on a bigger one so wanted to test it out with minimal overhead.
update
updates the database so it has nothing to do with this code
Might be that the connection to your database was not established because of a wrong connection stringUnknown User•2mo ago
Message Not Public
Sign In & Join Server To View
I tested the connection string with this code when starting the project:
using (var scope = app.Services.CreateScope())
{
var services = scope.ServiceProvider;
try
{
var context = services.GetRequiredService<ApplicationDbContext>();
using (var connection = (NpgsqlConnection)context.Database.GetDbConnection())
{
connection.Open();
Console.WriteLine("Successfully connected to the database.");
}
}
catch (Exception ex)
{
Console.WriteLine($"An error occurred while connecting to the database: {ex.Message}");
}
}
Yea will do, just wanted to check if I missed something
Just to add, when I run a local postgres database the migration works as intended.