update API for more simple approach.

This commit is contained in:
programmingPug
2025-01-14 17:50:34 -05:00
parent 2de48f1fc9
commit f65ead854c
11 changed files with 130 additions and 202 deletions

View File

@@ -33,7 +33,7 @@ builder.Services.AddCors(options =>
});
// Register the DB context with SQLite
builder.Services.AddDbContext<SoilMoistureContext>(options =>
builder.Services.AddDbContext<SoilMoistureFlatContext>(options =>
options.UseSqlite(builder.Configuration.GetConnectionString("DefaultConnection")));
// Add Swagger/OpenAPI support
@@ -45,7 +45,7 @@ var app = builder.Build();
// Apply migrations at startup
using (var scope = app.Services.CreateScope())
{
var db = scope.ServiceProvider.GetRequiredService<SoilMoistureContext>();
var db = scope.ServiceProvider.GetRequiredService<SoilMoistureFlatContext>();
db.Database.Migrate();
}