#if TOOLS using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Design; using SQLitePCL; // ReSharper disable UnusedType.Global namespace Content.Server.Database; public sealed class DesignTimeContextFactoryPostgres : IDesignTimeDbContextFactory { public PostgresServerDbContext CreateDbContext(string[] args) { var optionsBuilder = new DbContextOptionsBuilder(); optionsBuilder.UseNpgsql("Server=localhost"); return new PostgresServerDbContext(optionsBuilder.Options); } } public sealed class DesignTimeContextFactorySqlite : IDesignTimeDbContextFactory { public SqliteServerDbContext CreateDbContext(string[] args) { #if !USE_SYSTEM_SQLITE raw.SetProvider(new SQLite3Provider_e_sqlite3()); #endif var optionsBuilder = new DbContextOptionsBuilder(); optionsBuilder.UseSqlite("Data Source=:memory:"); return new SqliteServerDbContext(optionsBuilder.Options); } } #endif