mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Move NameValue statistics to database.
This commit is contained in:
@@ -37,13 +37,19 @@ namespace DiscImageChef.Database
|
||||
{
|
||||
public sealed class DicContext : DbContext
|
||||
{
|
||||
// Note: If table does not appear check that last migration has been REALLY added to the project
|
||||
public DicContext()
|
||||
{
|
||||
Database.Migrate();
|
||||
}
|
||||
|
||||
public DbSet<Device> Devices { get; set; }
|
||||
public DbSet<Report> Reports { get; set; }
|
||||
public DbSet<Device> Devices { get; set; }
|
||||
public DbSet<Report> Reports { get; set; }
|
||||
public DbSet<Command> Commands { get; set; }
|
||||
public DbSet<Filesystem> Filesystems { get; set; }
|
||||
public DbSet<Filter> Filters { get; set; }
|
||||
public DbSet<MediaFormat> MediaFormats { get; set; }
|
||||
public DbSet<Partition> Partitions { get; set; }
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
|
||||
@@ -64,8 +64,15 @@
|
||||
<Compile Include="Migrations\20181127001622_AddDeviceBasicFields.Designer.cs" />
|
||||
<Compile Include="Migrations\20181127013131_CorrectReportsDbSet.cs" />
|
||||
<Compile Include="Migrations\20181127013131_CorrectReportsDbSet.Designer.cs" />
|
||||
<Compile Include="Migrations\20181221015906_NameValueStatistics.cs" />
|
||||
<Compile Include="Migrations\20181221015906_NameValueStatistics.Designer.cs" />
|
||||
<Compile Include="Migrations\DicContextModelSnapshot.cs" />
|
||||
<Compile Include="Models\Command.cs" />
|
||||
<Compile Include="Models\Device.cs" />
|
||||
<Compile Include="Models\Filesystem.cs" />
|
||||
<Compile Include="Models\Filter.cs" />
|
||||
<Compile Include="Models\MediaFormat.cs" />
|
||||
<Compile Include="Models\Partition.cs" />
|
||||
<Compile Include="Models\Report.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
1329
DiscImageChef.Database/Migrations/20181221015906_NameValueStatistics.Designer.cs
generated
Normal file
1329
DiscImageChef.Database/Migrations/20181221015906_NameValueStatistics.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,70 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace DiscImageChef.Database.Migrations
|
||||
{
|
||||
public partial class NameValueStatistics : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable("Commands",
|
||||
table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
Name = table.Column<string>(nullable: true),
|
||||
Synchronized = table.Column<bool>(nullable: false)
|
||||
}, constraints: table => { table.PrimaryKey("PK_Commands", x => x.Id); });
|
||||
|
||||
migrationBuilder.CreateTable("Filesystems",
|
||||
table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
Name = table.Column<string>(nullable: true),
|
||||
Synchronized = table.Column<bool>(nullable: false)
|
||||
},
|
||||
constraints: table => { table.PrimaryKey("PK_Filesystems", x => x.Id); });
|
||||
|
||||
migrationBuilder.CreateTable("Filters",
|
||||
table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
Name = table.Column<string>(nullable: true),
|
||||
Synchronized = table.Column<bool>(nullable: false)
|
||||
}, constraints: table => { table.PrimaryKey("PK_Filters", x => x.Id); });
|
||||
|
||||
migrationBuilder.CreateTable("MediaFormats",
|
||||
table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
Name = table.Column<string>(nullable: true),
|
||||
Synchronized = table.Column<bool>(nullable: false)
|
||||
},
|
||||
constraints: table => { table.PrimaryKey("PK_MediaFormats", x => x.Id); });
|
||||
|
||||
migrationBuilder.CreateTable("Partitions",
|
||||
table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
Name = table.Column<string>(nullable: true),
|
||||
Synchronized = table.Column<bool>(nullable: false)
|
||||
}, constraints: table => { table.PrimaryKey("PK_Partitions", x => x.Id); });
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable("Commands");
|
||||
|
||||
migrationBuilder.DropTable("Filesystems");
|
||||
|
||||
migrationBuilder.DropTable("Filters");
|
||||
|
||||
migrationBuilder.DropTable("MediaFormats");
|
||||
|
||||
migrationBuilder.DropTable("Partitions");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -824,6 +824,19 @@ namespace DiscImageChef.Database.Migrations
|
||||
b.ToTable("Usb");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DiscImageChef.Database.Models.Command", b =>
|
||||
{
|
||||
b.Property<int>("Id").ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.Property<bool>("Synchronized");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Commands");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DiscImageChef.Database.Models.Device", b =>
|
||||
{
|
||||
b.Property<int>("Id").ValueGeneratedOnAdd();
|
||||
@@ -877,6 +890,58 @@ namespace DiscImageChef.Database.Migrations
|
||||
b.ToTable("Devices");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DiscImageChef.Database.Models.Filesystem", b =>
|
||||
{
|
||||
b.Property<int>("Id").ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.Property<bool>("Synchronized");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Filesystems");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DiscImageChef.Database.Models.Filter", b =>
|
||||
{
|
||||
b.Property<int>("Id").ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.Property<bool>("Synchronized");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Filters");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DiscImageChef.Database.Models.MediaFormat", b =>
|
||||
{
|
||||
b.Property<int>("Id").ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.Property<bool>("Synchronized");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("MediaFormats");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DiscImageChef.Database.Models.Partition", b =>
|
||||
{
|
||||
b.Property<int>("Id").ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.Property<bool>("Synchronized");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Partitions");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DiscImageChef.Database.Models.Report", b =>
|
||||
{
|
||||
b.Property<int>("Id").ValueGeneratedOnAdd();
|
||||
|
||||
12
DiscImageChef.Database/Models/Command.cs
Normal file
12
DiscImageChef.Database/Models/Command.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace DiscImageChef.Database.Models
|
||||
{
|
||||
public class Command
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public bool Synchronized { get; set; }
|
||||
}
|
||||
}
|
||||
12
DiscImageChef.Database/Models/Filesystem.cs
Normal file
12
DiscImageChef.Database/Models/Filesystem.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace DiscImageChef.Database.Models
|
||||
{
|
||||
public class Filesystem
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public bool Synchronized { get; set; }
|
||||
}
|
||||
}
|
||||
12
DiscImageChef.Database/Models/Filter.cs
Normal file
12
DiscImageChef.Database/Models/Filter.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace DiscImageChef.Database.Models
|
||||
{
|
||||
public class Filter
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public bool Synchronized { get; set; }
|
||||
}
|
||||
}
|
||||
12
DiscImageChef.Database/Models/MediaFormat.cs
Normal file
12
DiscImageChef.Database/Models/MediaFormat.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace DiscImageChef.Database.Models
|
||||
{
|
||||
public class MediaFormat
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public bool Synchronized { get; set; }
|
||||
}
|
||||
}
|
||||
12
DiscImageChef.Database/Models/Partition.cs
Normal file
12
DiscImageChef.Database/Models/Partition.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace DiscImageChef.Database.Models
|
||||
{
|
||||
public class Partition
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public bool Synchronized { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user