mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 11:14:25 +00:00
[Aaru.Database] Reformat and cleanup.
This commit is contained in:
@@ -32,8 +32,8 @@
|
||||
<NoWarn>CS1591;CS1574</NoWarn>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||
<InternalsVisibleTo Include="Aaru.Tests" />
|
||||
<InternalsVisibleTo Include="Aaru.Tests.Devices" />
|
||||
<InternalsVisibleTo Include="Aaru.Tests"/>
|
||||
<InternalsVisibleTo Include="Aaru.Tests.Devices"/>
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<NrtRevisionFormat>$(Version)+{chash:8}</NrtRevisionFormat>
|
||||
@@ -46,19 +46,19 @@
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="EntityFramework" Version="6.4.4" />
|
||||
<PackageReference Include="EntityFramework" Version="6.4.4"/>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.0-rc.1.23419.6">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="8.0.0-rc.1.23419.6" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.0-rc.1.23419.6" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Design" Version="2.0.0-preview1-final" />
|
||||
<PackageReference Include="System.Text.Json" Version="8.0.0-rc.1.23419.4" />
|
||||
<PackageReference Include="Unclassified.NetRevisionTask" Version="0.4.3" PrivateAssets="all" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="8.0.0-rc.1.23419.6"/>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.0-rc.1.23419.6"/>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Design" Version="2.0.0-preview1-final"/>
|
||||
<PackageReference Include="System.Text.Json" Version="8.0.0-rc.1.23419.4"/>
|
||||
<PackageReference Include="Unclassified.NetRevisionTask" Version="0.4.3" PrivateAssets="all"/>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Aaru.CommonTypes\Aaru.CommonTypes.csproj" />
|
||||
<ProjectReference Include="..\Aaru.Decoders\Aaru.Decoders.csproj" />
|
||||
<ProjectReference Include="..\Aaru.CommonTypes\Aaru.CommonTypes.csproj"/>
|
||||
<ProjectReference Include="..\Aaru.Decoders\Aaru.Decoders.csproj"/>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -46,38 +46,55 @@ public sealed class AaruContext : DbContext
|
||||
|
||||
/// <summary>List of known devices</summary>
|
||||
public DbSet<Device> Devices { get; set; }
|
||||
|
||||
/// <summary>List of local device reports</summary>
|
||||
public DbSet<Report> Reports { get; set; }
|
||||
|
||||
/// <summary>Command usage statistics</summary>
|
||||
public DbSet<Command> Commands { get; set; }
|
||||
|
||||
/// <summary>Statistics for found filesystems</summary>
|
||||
public DbSet<Filesystem> Filesystems { get; set; }
|
||||
|
||||
/// <summary>Statistics for used filters</summary>
|
||||
public DbSet<Filter> Filters { get; set; }
|
||||
|
||||
/// <summary>Statistics for media image formats</summary>
|
||||
public DbSet<MediaFormat> MediaFormats { get; set; }
|
||||
|
||||
/// <summary>Statistics for partitioning schemes</summary>
|
||||
public DbSet<Partition> Partitions { get; set; }
|
||||
|
||||
/// <summary>Statistics for media types</summary>
|
||||
public DbSet<Media> Medias { get; set; }
|
||||
|
||||
/// <summary>Statistics for devices seen using commands</summary>
|
||||
public DbSet<DeviceStat> SeenDevices { get; set; }
|
||||
|
||||
/// <summary>Statistics for operating systems</summary>
|
||||
public DbSet<OperatingSystem> OperatingSystems { get; set; }
|
||||
|
||||
/// <summary>Statistics for used Aaru versions</summary>
|
||||
public DbSet<Version> Versions { get; set; }
|
||||
|
||||
/// <summary>List of known USB vendors</summary>
|
||||
public DbSet<UsbVendor> UsbVendors { get; set; }
|
||||
|
||||
/// <summary>List of known USB products</summary>
|
||||
public DbSet<UsbProduct> UsbProducts { get; set; }
|
||||
|
||||
/// <summary>List of CD reading offsets</summary>
|
||||
public DbSet<CdOffset> CdOffsets { get; set; }
|
||||
|
||||
/// <summary>Statistics of remote applications</summary>
|
||||
public DbSet<RemoteApplication> RemoteApplications { get; set; }
|
||||
|
||||
/// <summary>Statistics of remote architectures</summary>
|
||||
public DbSet<RemoteArchitecture> RemoteArchitectures { get; set; }
|
||||
|
||||
/// <summary>Statistics of remote operating systems</summary>
|
||||
public DbSet<RemoteOperatingSystem> RemoteOperatingSystems { get; set; }
|
||||
|
||||
/// <summary>Known iNES/NES 2.0 headers</summary>
|
||||
public DbSet<NesHeaderInfo> NesHeaders { get; set; }
|
||||
|
||||
|
||||
@@ -38,9 +38,13 @@ namespace Aaru.Database;
|
||||
/// <summary>Database context factory, for design time</summary>
|
||||
public class AaruContextFactory : IDesignTimeDbContextFactory<AaruContext>
|
||||
{
|
||||
#region IDesignTimeDbContextFactory<AaruContext> Members
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>Creates a database context</summary>
|
||||
/// <param name="args">Ignored parameters</param>
|
||||
/// <returns>A database context</returns>
|
||||
public AaruContext CreateDbContext(string[] args) => AaruContext.Create("aaru.db");
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -38,10 +38,13 @@ public abstract class BaseOperatingSystem : BaseModel
|
||||
{
|
||||
/// <summary>Operating system name</summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>Operating system version</summary>
|
||||
public string Version { get; set; }
|
||||
|
||||
/// <summary>Has already been synchronized with Aaru's server</summary>
|
||||
public bool Synchronized { get; set; }
|
||||
|
||||
/// <summary>Statistical count</summary>
|
||||
public ulong Count { get; set; }
|
||||
}
|
||||
@@ -71,8 +71,10 @@ public class CdOffset : CommonTypes.Metadata.CdOffset
|
||||
|
||||
/// <summary>Database ID</summary>
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>Date when model has been added to the database</summary>
|
||||
public DateTime AddedWhen { get; set; }
|
||||
|
||||
/// <summary>Date when model was last modified</summary>
|
||||
public DateTime ModifiedWhen { get; set; }
|
||||
}
|
||||
@@ -38,12 +38,16 @@ public class DeviceStat : BaseModel
|
||||
{
|
||||
/// <summary>Manufacturer</summary>
|
||||
public string Manufacturer { get; set; }
|
||||
|
||||
/// <summary>Model</summary>
|
||||
public string Model { get; set; }
|
||||
|
||||
/// <summary>Revision or firmware version</summary>
|
||||
public string Revision { get; set; }
|
||||
|
||||
/// <summary>Bus</summary>
|
||||
public string Bus { get; set; }
|
||||
|
||||
/// <summary>Has already been synchronized with Aaru's server</summary>
|
||||
public bool Synchronized { get; set; }
|
||||
}
|
||||
@@ -38,10 +38,13 @@ public class Media : BaseModel
|
||||
{
|
||||
/// <summary>Media type name</summary>
|
||||
public string Type { get; set; }
|
||||
|
||||
/// <summary>Found physically, or in image</summary>
|
||||
public bool Real { get; set; }
|
||||
|
||||
/// <summary>Has already been synchronized with Aaru's server</summary>
|
||||
public bool Synchronized { get; set; }
|
||||
|
||||
/// <summary>Count of times found</summary>
|
||||
public ulong Count { get; set; }
|
||||
}
|
||||
@@ -38,8 +38,10 @@ public abstract class NameCountModel : BaseModel
|
||||
{
|
||||
/// <summary>Value name</summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>Has already been synchronized with Aaru's server</summary>
|
||||
public bool Synchronized { get; set; }
|
||||
|
||||
/// <summary>Value count</summary>
|
||||
public ulong Count { get; set; }
|
||||
}
|
||||
@@ -9,32 +9,46 @@ namespace Aaru.Database.Models;
|
||||
public class NesHeaderInfo : BaseModel
|
||||
{
|
||||
/// <summary>ROM hash</summary>
|
||||
[StringLength(64), Required]
|
||||
[StringLength(64)]
|
||||
[Required]
|
||||
public string Sha256 { get; set; }
|
||||
|
||||
/// <summary>If <c>true</c> vertical mirroring is hard-wired, horizontal or mapper defined otherwise</summary>
|
||||
public bool NametableMirroring { get; set; }
|
||||
|
||||
/// <summary>If <c>true</c> a battery is present</summary>
|
||||
public bool BatteryPresent { get; set; }
|
||||
|
||||
/// <summary>If <c>true</c> the four player screen mode is hardwired</summary>
|
||||
public bool FourScreenMode { get; set; }
|
||||
|
||||
/// <summary>Mapper number (NES 2.0 when in conflict)</summary>
|
||||
public ushort Mapper { get; set; }
|
||||
|
||||
/// <summary>Console type</summary>
|
||||
public NesConsoleType ConsoleType { get; set; }
|
||||
|
||||
/// <summary>Submapper number</summary>
|
||||
public byte Submapper { get; set; }
|
||||
|
||||
/// <summary>Timing mode</summary>
|
||||
public NesTimingMode TimingMode { get; set; }
|
||||
|
||||
/// <summary>Vs. PPU type</summary>
|
||||
public NesVsPpuType VsPpuType { get; set; }
|
||||
|
||||
/// <summary>Vs. hardware type</summary>
|
||||
public NesVsHardwareType VsHardwareType { get; set; }
|
||||
|
||||
/// <summary>Extended console type</summary>
|
||||
public NesExtendedConsoleType ExtendedConsoleType { get; set; }
|
||||
|
||||
/// <summary>Default expansion device</summary>
|
||||
public NesDefaultExpansionDevice DefaultExpansionDevice { get; set; }
|
||||
|
||||
/// <summary>Date when model has been added to the database</summary>
|
||||
public DateTime AddedWhen { get; set; }
|
||||
|
||||
/// <summary>Date when model was last modified</summary>
|
||||
public DateTime ModifiedWhen { get; set; }
|
||||
}
|
||||
@@ -70,6 +70,7 @@ public class Report : DeviceReport
|
||||
|
||||
/// <summary>Date when the device report was created</summary>
|
||||
public DateTime Created { get; set; }
|
||||
|
||||
/// <summary>If this model has already been upload</summary>
|
||||
public bool Uploaded { get; set; }
|
||||
}
|
||||
@@ -56,16 +56,22 @@ public class UsbProduct
|
||||
/// <summary>Database ID</summary>
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>Product ID</summary>
|
||||
public ushort ProductId { get; set; }
|
||||
|
||||
/// <summary>Product name</summary>
|
||||
public string Product { get; set; }
|
||||
|
||||
/// <summary>Date when model has been added to the database</summary>
|
||||
public DateTime AddedWhen { get; set; }
|
||||
|
||||
/// <summary>Date when model was last modified</summary>
|
||||
public DateTime ModifiedWhen { get; set; }
|
||||
|
||||
/// <summary>USB vendor ID</summary>
|
||||
public ushort VendorId { get; set; }
|
||||
|
||||
/// <summary>Database link to USB vendor</summary>
|
||||
public virtual UsbVendor Vendor { get; set; }
|
||||
}
|
||||
@@ -55,10 +55,13 @@ public class UsbVendor
|
||||
/// <summary>Database ID</summary>
|
||||
[Key]
|
||||
public ushort Id { get; set; }
|
||||
|
||||
/// <summary>Vendor name</summary>
|
||||
public string Vendor { get; set; }
|
||||
|
||||
/// <summary>Date when model has been added to the database</summary>
|
||||
public DateTime AddedWhen { get; set; }
|
||||
|
||||
/// <summary>Date when model was last modified</summary>
|
||||
public DateTime ModifiedWhen { get; set; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user