fix: Disable sample data seeding in production environment
All checks were successful
Build and Deploy LittleShop / Deploy to Production VPS (Manual Only) (push) Has been skipped
Build and Deploy LittleShop / Deploy to Pre-Production (CT109) (push) Successful in 1m1s

- Sample data (products, categories, orders) now only seeds in Development
- Production environment will start with empty database (admin user only)
- Ensures clean state for testing without pre-populated data

This allows production deployments to start with a truly empty database
for testing purposes, while development still gets sample data for
local testing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
sysadmin 2025-11-18 16:14:17 +00:00
parent 349eafbe62
commit c4caee90fb

View File

@ -461,9 +461,13 @@ using (var scope = app.Services.CreateScope())
var authService = scope.ServiceProvider.GetRequiredService<IAuthService>();
await authService.SeedDefaultUserAsync();
// Seed sample data
var dataSeeder = scope.ServiceProvider.GetRequiredService<IDataSeederService>();
await dataSeeder.SeedSampleDataAsync();
// Seed sample data - only in development
if (app.Environment.IsDevelopment())
{
Log.Information("Development environment: Seeding sample data");
var dataSeeder = scope.ServiceProvider.GetRequiredService<IDataSeederService>();
await dataSeeder.SeedSampleDataAsync();
}
// Seed system settings - enable test currencies only in development
if (app.Environment.IsDevelopment())