mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Do not auto migrate database.
This commit is contained in:
@@ -37,10 +37,7 @@ namespace DiscImageChef.Database
|
|||||||
{
|
{
|
||||||
public sealed class DicContext : DbContext
|
public sealed class DicContext : DbContext
|
||||||
{
|
{
|
||||||
public DicContext(DbContextOptions options) : base(options)
|
public DicContext(DbContextOptions options) : base(options) { }
|
||||||
{
|
|
||||||
Database.Migrate();
|
|
||||||
}
|
|
||||||
|
|
||||||
public DbSet<Device> Devices { get; set; }
|
public DbSet<Device> Devices { get; set; }
|
||||||
public DbSet<Report> Reports { get; set; }
|
public DbSet<Report> Reports { get; set; }
|
||||||
@@ -56,12 +53,14 @@ namespace DiscImageChef.Database
|
|||||||
public DbSet<UsbVendor> UsbVendors { get; set; }
|
public DbSet<UsbVendor> UsbVendors { get; set; }
|
||||||
public DbSet<UsbProduct> UsbProducts { get; set; }
|
public DbSet<UsbProduct> UsbProducts { get; set; }
|
||||||
public DbSet<CdOffset> CdOffsets { get; set; }
|
public DbSet<CdOffset> CdOffsets { get; set; }
|
||||||
|
|
||||||
// Note: If table does not appear check that last migration has been REALLY added to the project
|
// Note: If table does not appear check that last migration has been REALLY added to the project
|
||||||
|
|
||||||
public static DicContext Create(string dbPath)
|
public static DicContext Create(string dbPath)
|
||||||
{
|
{
|
||||||
DbContextOptionsBuilder optionsBuilder = new DbContextOptionsBuilder();
|
var optionsBuilder = new DbContextOptionsBuilder();
|
||||||
optionsBuilder.UseSqlite($"Data Source={dbPath}");
|
optionsBuilder.UseSqlite($"Data Source={dbPath}");
|
||||||
|
|
||||||
return new DicContext(optionsBuilder.Options);
|
return new DicContext(optionsBuilder.Options);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user