2020-11-27 22:52:52 -05:00
|
|
|
|
using System;
|
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
|
|
|
|
|
namespace SharedLibraryCore.Database.MigrationContext
|
|
|
|
|
{
|
|
|
|
|
public class SqliteDatabaseContext : DatabaseContext
|
|
|
|
|
{
|
|
|
|
|
public SqliteDatabaseContext()
|
|
|
|
|
{
|
|
|
|
|
if (!Utilities.IsMigration)
|
|
|
|
|
{
|
|
|
|
|
throw new InvalidOperationException();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-11-29 17:01:52 -05:00
|
|
|
|
public SqliteDatabaseContext(DbContextOptions options) : base(options)
|
2020-11-27 22:52:52 -05:00
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
|
|
|
|
{
|
|
|
|
|
if (Utilities.IsMigration)
|
|
|
|
|
{
|
|
|
|
|
optionsBuilder.UseSqlite("Data Source=IW4MAdmin_Migration.db")
|
|
|
|
|
.EnableDetailedErrors(true)
|
|
|
|
|
.EnableSensitiveDataLogging(true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|