diff --git a/.idea/.idea.DiscImageChef/.idea/contentModel.xml b/.idea/.idea.DiscImageChef/.idea/contentModel.xml index 3cd78245e..e70b84272 100644 --- a/.idea/.idea.DiscImageChef/.idea/contentModel.xml +++ b/.idea/.idea.DiscImageChef/.idea/contentModel.xml @@ -311,6 +311,8 @@ + + @@ -324,6 +326,7 @@ + diff --git a/DiscImageChef.Core/Statistics.cs b/DiscImageChef.Core/Statistics.cs index b30259180..a8bfa9636 100644 --- a/DiscImageChef.Core/Statistics.cs +++ b/DiscImageChef.Core/Statistics.cs @@ -44,7 +44,7 @@ using DiscImageChef.Database.Models; using Device = DiscImageChef.Devices.Device; using MediaType = DiscImageChef.CommonTypes.MediaType; using OperatingSystem = DiscImageChef.Database.Models.OperatingSystem; -using Version = DiscImageChef.CommonTypes.Interop.Version; +using Version = DiscImageChef.Database.Models.Version; namespace DiscImageChef.Core { @@ -82,13 +82,8 @@ namespace DiscImageChef.Core Synchronized = false, Version = DetectOS.GetVersion() }); - CurrentStats = new Stats - { - Versions = new List - { - new NameValueStats {name = Version.GetVersion(), Value = 1} - } - }; + ctx.Versions.Add(new Version {Value = CommonTypes.Interop.Version.GetVersion(), Synchronized = false}); + CurrentStats = new Stats(); XmlSerializer xs = new XmlSerializer(AllStats.GetType()); StreamReader sr = new StreamReader(Path.Combine(Settings.Settings.StatsPath, "Statistics.xml")); AllStats = (Stats)xs.Deserialize(sr); @@ -103,13 +98,8 @@ namespace DiscImageChef.Core Synchronized = false, Version = DetectOS.GetVersion() }); - CurrentStats = new Stats - { - Versions = new List - { - new NameValueStats {name = Version.GetVersion(), Value = 1} - } - }; + ctx.Versions.Add(new Version {Value = CommonTypes.Interop.Version.GetVersion(), Synchronized = false}); + CurrentStats = new Stats(); } else { @@ -159,7 +149,8 @@ namespace DiscImageChef.Core long count = 0; NameValueStats old = null; - foreach(NameValueStats nvs in AllStats.Versions.Where(nvs => nvs.name == Version.GetVersion())) + foreach(NameValueStats nvs in AllStats.Versions.Where(nvs => nvs.name == CommonTypes + .Interop.Version.GetVersion())) { count = nvs.Value + 1; old = nvs; @@ -169,7 +160,10 @@ namespace DiscImageChef.Core if(old != null) AllStats.Versions.Remove(old); count++; - AllStats.Versions.Add(new NameValueStats {name = Version.GetVersion(), Value = count}); + AllStats.Versions.Add(new NameValueStats + { + name = CommonTypes.Interop.Version.GetVersion(), Value = count + }); } else if(CurrentStats != null) AllStats.Versions = CurrentStats.Versions; @@ -228,7 +222,7 @@ namespace DiscImageChef.Core WebRequest request = WebRequest.Create("http://discimagechef.claunia.com/api/uploadstats"); ((HttpWebRequest)request).UserAgent = - $"DiscImageChef {typeof(Version).Assembly.GetName().Version}"; + $"DiscImageChef {typeof(CommonTypes.Interop.Version).Assembly.GetName().Version}"; request.Method = "POST"; request.ContentLength = fs.Length; request.ContentType = "application/xml"; diff --git a/DiscImageChef.Database/Context.cs b/DiscImageChef.Database/Context.cs index 9f0ad5990..0ea8a1124 100644 --- a/DiscImageChef.Database/Context.cs +++ b/DiscImageChef.Database/Context.cs @@ -53,6 +53,7 @@ namespace DiscImageChef.Database public DbSet Medias { get; set; } public DbSet SeenDevices { get; set; } public DbSet OperatingSystems { get; set; } + public DbSet Versions { get; set; } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { diff --git a/DiscImageChef.Database/DiscImageChef.Database.csproj b/DiscImageChef.Database/DiscImageChef.Database.csproj index 2147b7b21..ba21c5218 100644 --- a/DiscImageChef.Database/DiscImageChef.Database.csproj +++ b/DiscImageChef.Database/DiscImageChef.Database.csproj @@ -72,6 +72,8 @@ + + @@ -83,6 +85,7 @@ + diff --git a/DiscImageChef.Database/Migrations/20181221041242_VersionStatistics.Designer.cs b/DiscImageChef.Database/Migrations/20181221041242_VersionStatistics.Designer.cs new file mode 100644 index 000000000..d79117494 --- /dev/null +++ b/DiscImageChef.Database/Migrations/20181221041242_VersionStatistics.Designer.cs @@ -0,0 +1,1395 @@ +// +using System; +using DiscImageChef.Database; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +namespace DiscImageChef.Database.Migrations +{ + [DbContext(typeof(DicContext))] + [Migration("20181221041242_VersionStatistics")] + partial class VersionStatistics + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "2.1.4-rtm-31024"); + + modelBuilder.Entity("DiscImageChef.CommonTypes.Metadata.Ata", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Identify"); + + b.Property("ReadCapabilitiesId"); + + b.HasKey("Id"); + + b.HasIndex("ReadCapabilitiesId"); + + b.ToTable("Ata"); + }); + + modelBuilder.Entity("DiscImageChef.CommonTypes.Metadata.BlockDescriptor", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("BlockLength"); + + b.Property("Blocks"); + + b.Property("Density"); + + b.Property("ScsiModeId"); + + b.HasKey("Id"); + + b.HasIndex("ScsiModeId"); + + b.ToTable("BlockDescriptor"); + }); + + modelBuilder.Entity("DiscImageChef.CommonTypes.Metadata.Chs", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Cylinders"); + + b.Property("Heads"); + + b.Property("Sectors"); + + b.HasKey("Id"); + + b.ToTable("Chs"); + }); + + modelBuilder.Entity("DiscImageChef.CommonTypes.Metadata.DensityCode", b => + { + b.Property("Code") + .ValueGeneratedOnAdd(); + + b.Property("SscSupportedMediaId"); + + b.HasKey("Code"); + + b.HasIndex("SscSupportedMediaId"); + + b.ToTable("DensityCode"); + }); + + modelBuilder.Entity("DiscImageChef.CommonTypes.Metadata.FireWire", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Manufacturer"); + + b.Property("Product"); + + b.Property("ProductID"); + + b.Property("RemovableMedia"); + + b.Property("VendorID"); + + b.HasKey("Id"); + + b.ToTable("FireWire"); + }); + + modelBuilder.Entity("DiscImageChef.CommonTypes.Metadata.Mmc", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("FeaturesId"); + + b.Property("ModeSense2AId"); + + b.HasKey("Id"); + + b.HasIndex("FeaturesId"); + + b.HasIndex("ModeSense2AId"); + + b.ToTable("Mmc"); + }); + + modelBuilder.Entity("DiscImageChef.CommonTypes.Metadata.MmcFeatures", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("AACSVersion"); + + b.Property("AGIDs"); + + b.Property("BindingNonceBlocks"); + + b.Property("BlocksPerReadableUnit"); + + b.Property("BufferUnderrunFreeInDVD"); + + b.Property("BufferUnderrunFreeInSAO"); + + b.Property("BufferUnderrunFreeInTAO"); + + b.Property("CPRMVersion"); + + b.Property("CSSVersion"); + + b.Property("CanAudioScan"); + + b.Property("CanEject"); + + b.Property("CanEraseSector"); + + b.Property("CanExpandBDRESpareArea"); + + b.Property("CanFormat"); + + b.Property("CanFormatBDREWithoutSpare"); + + b.Property("CanFormatCert"); + + b.Property("CanFormatFRF"); + + b.Property("CanFormatQCert"); + + b.Property("CanFormatRRM"); + + b.Property("CanGenerateBindingNonce"); + + b.Property("CanLoad"); + + b.Property("CanMuteSeparateChannels"); + + b.Property("CanOverwriteSAOTrack"); + + b.Property("CanOverwriteTAOTrack"); + + b.Property("CanPlayCDAudio"); + + b.Property("CanPseudoOverwriteBDR"); + + b.Property("CanReadAllDualR"); + + b.Property("CanReadAllDualRW"); + + b.Property("CanReadBD"); + + b.Property("CanReadBDR"); + + b.Property("CanReadBDRE1"); + + b.Property("CanReadBDRE2"); + + b.Property("CanReadBDROM"); + + b.Property("CanReadBluBCA"); + + b.Property("CanReadCD"); + + b.Property("CanReadCDMRW"); + + b.Property("CanReadCPRM_MKB"); + + b.Property("CanReadDDCD"); + + b.Property("CanReadDVD"); + + b.Property("CanReadDVDPlusMRW"); + + b.Property("CanReadDVDPlusR"); + + b.Property("CanReadDVDPlusRDL"); + + b.Property("CanReadDVDPlusRW"); + + b.Property("CanReadDVDPlusRWDL"); + + b.Property("CanReadDriveAACSCertificate"); + + b.Property("CanReadHDDVD"); + + b.Property("CanReadHDDVDR"); + + b.Property("CanReadHDDVDRAM"); + + b.Property("CanReadLeadInCDText"); + + b.Property("CanReadOldBDR"); + + b.Property("CanReadOldBDRE"); + + b.Property("CanReadOldBDROM"); + + b.Property("CanReadSpareAreaInformation"); + + b.Property("CanReportDriveSerial"); + + b.Property("CanReportMediaSerial"); + + b.Property("CanTestWriteDDCDR"); + + b.Property("CanTestWriteDVD"); + + b.Property("CanTestWriteInSAO"); + + b.Property("CanTestWriteInTAO"); + + b.Property("CanUpgradeFirmware"); + + b.Property("CanWriteBD"); + + b.Property("CanWriteBDR"); + + b.Property("CanWriteBDRE1"); + + b.Property("CanWriteBDRE2"); + + b.Property("CanWriteBusEncryptedBlocks"); + + b.Property("CanWriteCDMRW"); + + b.Property("CanWriteCDRW"); + + b.Property("CanWriteCDRWCAV"); + + b.Property("CanWriteCDSAO"); + + b.Property("CanWriteCDTAO"); + + b.Property("CanWriteCSSManagedDVD"); + + b.Property("CanWriteDDCDR"); + + b.Property("CanWriteDDCDRW"); + + b.Property("CanWriteDVDPlusMRW"); + + b.Property("CanWriteDVDPlusR"); + + b.Property("CanWriteDVDPlusRDL"); + + b.Property("CanWriteDVDPlusRW"); + + b.Property("CanWriteDVDPlusRWDL"); + + b.Property("CanWriteDVDR"); + + b.Property("CanWriteDVDRDL"); + + b.Property("CanWriteDVDRW"); + + b.Property("CanWriteHDDVDR"); + + b.Property("CanWriteHDDVDRAM"); + + b.Property("CanWriteOldBDR"); + + b.Property("CanWriteOldBDRE"); + + b.Property("CanWritePackedSubchannelInTAO"); + + b.Property("CanWriteRWSubchannelInSAO"); + + b.Property("CanWriteRWSubchannelInTAO"); + + b.Property("CanWriteRaw"); + + b.Property("CanWriteRawMultiSession"); + + b.Property("CanWriteRawSubchannelInTAO"); + + b.Property("ChangerIsSideChangeCapable"); + + b.Property("ChangerSlots"); + + b.Property("ChangerSupportsDiscPresent"); + + b.Property("DBML"); + + b.Property("DVDMultiRead"); + + b.Property("EmbeddedChanger"); + + b.Property("ErrorRecoveryPage"); + + b.Property("FirmwareDate"); + + b.Property("LoadingMechanismType"); + + b.Property("Locked"); + + b.Property("LogicalBlockSize"); + + b.Property("MultiRead"); + + b.Property("PhysicalInterfaceStandard"); + + b.Property("PhysicalInterfaceStandardNumber"); + + b.Property("PreventJumper"); + + b.Property("SupportsAACS"); + + b.Property("SupportsBusEncryption"); + + b.Property("SupportsC2"); + + b.Property("SupportsCPRM"); + + b.Property("SupportsCSS"); + + b.Property("SupportsDAP"); + + b.Property("SupportsDeviceBusyEvent"); + + b.Property("SupportsHybridDiscs"); + + b.Property("SupportsModePage1Ch"); + + b.Property("SupportsOSSC"); + + b.Property("SupportsPWP"); + + b.Property("SupportsSWPP"); + + b.Property("SupportsSecurDisc"); + + b.Property("SupportsSeparateVolume"); + + b.Property("SupportsVCPS"); + + b.Property("SupportsWriteInhibitDCB"); + + b.Property("SupportsWriteProtectPAC"); + + b.Property("VolumeLevels"); + + b.HasKey("Id"); + + b.ToTable("MmcFeatures"); + }); + + modelBuilder.Entity("DiscImageChef.CommonTypes.Metadata.MmcSd", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("CID"); + + b.Property("CSD"); + + b.Property("ExtendedCSD"); + + b.Property("OCR"); + + b.Property("SCR"); + + b.HasKey("Id"); + + b.ToTable("MmcSd"); + }); + + modelBuilder.Entity("DiscImageChef.CommonTypes.Metadata.Pcmcia", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("CIS"); + + b.Property("CardCode"); + + b.Property("Compliance"); + + b.Property("Manufacturer"); + + b.Property("ManufacturerCode"); + + b.Property("ProductName"); + + b.HasKey("Id"); + + b.ToTable("Pcmcia"); + }); + + modelBuilder.Entity("DiscImageChef.CommonTypes.Metadata.Scsi", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("InquiryData"); + + b.Property("ModeSense10Data"); + + b.Property("ModeSense6Data"); + + b.Property("ModeSenseId"); + + b.Property("MultiMediaDeviceId"); + + b.Property("ReadCapabilitiesId"); + + b.Property("SequentialDeviceId"); + + b.Property("SupportsModeSense10"); + + b.Property("SupportsModeSense6"); + + b.Property("SupportsModeSubpages"); + + b.HasKey("Id"); + + b.HasIndex("ModeSenseId"); + + b.HasIndex("MultiMediaDeviceId"); + + b.HasIndex("ReadCapabilitiesId"); + + b.HasIndex("SequentialDeviceId"); + + b.ToTable("Scsi"); + }); + + modelBuilder.Entity("DiscImageChef.CommonTypes.Metadata.ScsiMode", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("BlankCheckEnabled"); + + b.Property("BufferedMode"); + + b.Property("DPOandFUA"); + + b.Property("MediumType"); + + b.Property("Speed"); + + b.Property("WriteProtected"); + + b.HasKey("Id"); + + b.ToTable("ScsiMode"); + }); + + modelBuilder.Entity("DiscImageChef.CommonTypes.Metadata.ScsiPage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ScsiId"); + + b.Property("ScsiModeId"); + + b.Property("page"); + + b.Property("subpage"); + + b.Property("value"); + + b.HasKey("Id"); + + b.HasIndex("ScsiId"); + + b.HasIndex("ScsiModeId"); + + b.ToTable("ScsiPage"); + }); + + modelBuilder.Entity("DiscImageChef.CommonTypes.Metadata.Ssc", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("BlockSizeGranularity"); + + b.Property("MaxBlockLength"); + + b.Property("MinBlockLength"); + + b.HasKey("Id"); + + b.ToTable("Ssc"); + }); + + modelBuilder.Entity("DiscImageChef.CommonTypes.Metadata.SscSupportedMedia", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Description"); + + b.Property("Length"); + + b.Property("MediumType"); + + b.Property("Name"); + + b.Property("Organization"); + + b.Property("SscId"); + + b.Property("TestedSequentialMediaId"); + + b.Property("Width"); + + b.HasKey("Id"); + + b.HasIndex("SscId"); + + b.HasIndex("TestedSequentialMediaId"); + + b.ToTable("SscSupportedMedia"); + }); + + modelBuilder.Entity("DiscImageChef.CommonTypes.Metadata.SupportedDensity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("BitsPerMm"); + + b.Property("Capacity"); + + b.Property("DefaultDensity"); + + b.Property("Description"); + + b.Property("Duplicate"); + + b.Property("Name"); + + b.Property("Organization"); + + b.Property("PrimaryCode"); + + b.Property("SecondaryCode"); + + b.Property("SscId"); + + b.Property("TestedSequentialMediaId"); + + b.Property("Tracks"); + + b.Property("Width"); + + b.Property("Writable"); + + b.HasKey("Id"); + + b.HasIndex("SscId"); + + b.HasIndex("TestedSequentialMediaId"); + + b.ToTable("SupportedDensity"); + }); + + modelBuilder.Entity("DiscImageChef.CommonTypes.Metadata.TestedMedia", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("AtaId"); + + b.Property("BlockSize"); + + b.Property("Blocks"); + + b.Property("CHSId"); + + b.Property("CanReadAACS"); + + b.Property("CanReadADIP"); + + b.Property("CanReadATIP"); + + b.Property("CanReadBCA"); + + b.Property("CanReadC2Pointers"); + + b.Property("CanReadCMI"); + + b.Property("CanReadCorrectedSubchannel"); + + b.Property("CanReadCorrectedSubchannelWithC2"); + + b.Property("CanReadDCB"); + + b.Property("CanReadDDS"); + + b.Property("CanReadDMI"); + + b.Property("CanReadDiscInformation"); + + b.Property("CanReadFirstTrackPreGap"); + + b.Property("CanReadFullTOC"); + + b.Property("CanReadHDCMI"); + + b.Property("CanReadLayerCapacity"); + + b.Property("CanReadLeadIn"); + + b.Property("CanReadLeadOut"); + + b.Property("CanReadMediaID"); + + b.Property("CanReadMediaSerial"); + + b.Property("CanReadPAC"); + + b.Property("CanReadPFI"); + + b.Property("CanReadPMA"); + + b.Property("CanReadPQSubchannel"); + + b.Property("CanReadPQSubchannelWithC2"); + + b.Property("CanReadPRI"); + + b.Property("CanReadRWSubchannel"); + + b.Property("CanReadRWSubchannelWithC2"); + + b.Property("CanReadRecordablePFI"); + + b.Property("CanReadSpareAreaInformation"); + + b.Property("CanReadTOC"); + + b.Property("CurrentCHSId"); + + b.Property("Density"); + + b.Property("IdentifyData"); + + b.Property("LBA48Sectors"); + + b.Property("LBASectors"); + + b.Property("LogicalAlignment"); + + b.Property("LongBlockSize"); + + b.Property("Manufacturer"); + + b.Property("MediaIsRecognized"); + + b.Property("MediumType"); + + b.Property("MediumTypeName"); + + b.Property("MmcId"); + + b.Property("ModeSense10Data"); + + b.Property("ModeSense6Data"); + + b.Property("Model"); + + b.Property("NominalRotationRate"); + + b.Property("PhysicalBlockSize"); + + b.Property("ScsiId"); + + b.Property("SolidStateDevice"); + + b.Property("SupportsHLDTSTReadRawDVD"); + + b.Property("SupportsNECReadCDDA"); + + b.Property("SupportsPioneerReadCDDA"); + + b.Property("SupportsPioneerReadCDDAMSF"); + + b.Property("SupportsPlextorReadCDDA"); + + b.Property("SupportsPlextorReadRawDVD"); + + b.Property("SupportsRead10"); + + b.Property("SupportsRead12"); + + b.Property("SupportsRead16"); + + b.Property("SupportsRead6"); + + b.Property("SupportsReadCapacity"); + + b.Property("SupportsReadCapacity16"); + + b.Property("SupportsReadCd"); + + b.Property("SupportsReadCdMsf"); + + b.Property("SupportsReadCdMsfRaw"); + + b.Property("SupportsReadCdRaw"); + + b.Property("SupportsReadDma"); + + b.Property("SupportsReadDmaLba"); + + b.Property("SupportsReadDmaLba48"); + + b.Property("SupportsReadDmaRetry"); + + b.Property("SupportsReadDmaRetryLba"); + + b.Property("SupportsReadLba"); + + b.Property("SupportsReadLba48"); + + b.Property("SupportsReadLong"); + + b.Property("SupportsReadLong16"); + + b.Property("SupportsReadLongLba"); + + b.Property("SupportsReadLongRetry"); + + b.Property("SupportsReadLongRetryLba"); + + b.Property("SupportsReadRetry"); + + b.Property("SupportsReadRetryLba"); + + b.Property("SupportsReadSectors"); + + b.Property("SupportsSeek"); + + b.Property("SupportsSeekLba"); + + b.Property("UnformattedBPS"); + + b.Property("UnformattedBPT"); + + b.HasKey("Id"); + + b.HasIndex("AtaId"); + + b.HasIndex("CHSId"); + + b.HasIndex("CurrentCHSId"); + + b.HasIndex("MmcId"); + + b.HasIndex("ScsiId"); + + b.ToTable("TestedMedia"); + }); + + modelBuilder.Entity("DiscImageChef.CommonTypes.Metadata.TestedSequentialMedia", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("CanReadMediaSerial"); + + b.Property("Density"); + + b.Property("Manufacturer"); + + b.Property("MediaIsRecognized"); + + b.Property("MediumType"); + + b.Property("MediumTypeName"); + + b.Property("ModeSense10Data"); + + b.Property("ModeSense6Data"); + + b.Property("Model"); + + b.Property("SscId"); + + b.HasKey("Id"); + + b.HasIndex("SscId"); + + b.ToTable("TestedSequentialMedia"); + }); + + modelBuilder.Entity("DiscImageChef.CommonTypes.Metadata.Usb", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Descriptors"); + + b.Property("Manufacturer"); + + b.Property("Product"); + + b.Property("ProductID"); + + b.Property("RemovableMedia"); + + b.Property("VendorID"); + + b.HasKey("Id"); + + b.ToTable("Usb"); + }); + + modelBuilder.Entity("DiscImageChef.Database.Models.Command", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Name"); + + b.Property("Synchronized"); + + b.HasKey("Id"); + + b.ToTable("Commands"); + }); + + modelBuilder.Entity("DiscImageChef.Database.Models.Device", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ATAId"); + + b.Property("ATAPIId"); + + b.Property("CompactFlash"); + + b.Property("FireWireId"); + + b.Property("LastSynchronized"); + + b.Property("Manufacturer"); + + b.Property("Model"); + + b.Property("MultiMediaCardId"); + + b.Property("PCMCIAId"); + + b.Property("Revision"); + + b.Property("SCSIId"); + + b.Property("SecureDigitalId"); + + b.Property("Type"); + + b.Property("USBId"); + + b.HasKey("Id"); + + b.HasIndex("ATAId"); + + b.HasIndex("ATAPIId"); + + b.HasIndex("FireWireId"); + + b.HasIndex("MultiMediaCardId"); + + b.HasIndex("PCMCIAId"); + + b.HasIndex("SCSIId"); + + b.HasIndex("SecureDigitalId"); + + b.HasIndex("USBId"); + + b.ToTable("Devices"); + }); + + modelBuilder.Entity("DiscImageChef.Database.Models.DeviceStat", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Bus"); + + b.Property("Manufacturer"); + + b.Property("Model"); + + b.Property("Revision"); + + b.Property("Synchronized"); + + b.HasKey("Id"); + + b.ToTable("SeenDevices"); + }); + + modelBuilder.Entity("DiscImageChef.Database.Models.Filesystem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Name"); + + b.Property("Synchronized"); + + b.HasKey("Id"); + + b.ToTable("Filesystems"); + }); + + modelBuilder.Entity("DiscImageChef.Database.Models.Filter", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Name"); + + b.Property("Synchronized"); + + b.HasKey("Id"); + + b.ToTable("Filters"); + }); + + modelBuilder.Entity("DiscImageChef.Database.Models.Media", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Real"); + + b.Property("Synchronized"); + + b.Property("Type"); + + b.HasKey("Id"); + + b.ToTable("Medias"); + }); + + modelBuilder.Entity("DiscImageChef.Database.Models.MediaFormat", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Name"); + + b.Property("Synchronized"); + + b.HasKey("Id"); + + b.ToTable("MediaFormats"); + }); + + modelBuilder.Entity("DiscImageChef.Database.Models.OperatingSystem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Name"); + + b.Property("Synchronized"); + + b.Property("Version"); + + b.HasKey("Id"); + + b.ToTable("OperatingSystems"); + }); + + modelBuilder.Entity("DiscImageChef.Database.Models.Partition", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Name"); + + b.Property("Synchronized"); + + b.HasKey("Id"); + + b.ToTable("Partitions"); + }); + + modelBuilder.Entity("DiscImageChef.Database.Models.Report", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ATAId"); + + b.Property("ATAPIId"); + + b.Property("CompactFlash"); + + b.Property("Created"); + + b.Property("FireWireId"); + + b.Property("Manufacturer"); + + b.Property("Model"); + + b.Property("MultiMediaCardId"); + + b.Property("PCMCIAId"); + + b.Property("Revision"); + + b.Property("SCSIId"); + + b.Property("SecureDigitalId"); + + b.Property("Type"); + + b.Property("USBId"); + + b.Property("Uploaded"); + + b.HasKey("Id"); + + b.HasIndex("ATAId"); + + b.HasIndex("ATAPIId"); + + b.HasIndex("FireWireId"); + + b.HasIndex("MultiMediaCardId"); + + b.HasIndex("PCMCIAId"); + + b.HasIndex("SCSIId"); + + b.HasIndex("SecureDigitalId"); + + b.HasIndex("USBId"); + + b.ToTable("Reports"); + }); + + modelBuilder.Entity("DiscImageChef.Database.Models.Version", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Synchronized"); + + b.Property("Value"); + + b.HasKey("Id"); + + b.ToTable("Versions"); + }); + + modelBuilder.Entity("DiscImageChef.Decoders.SCSI.Modes+ModePage_2A", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("AccurateCDDA"); + + b.Property("AudioPlay"); + + b.Property("BCK"); + + b.Property("BUF"); + + b.Property("BufferSize"); + + b.Property("C2Pointer"); + + b.Property("CDDACommand"); + + b.Property("CMRSupported"); + + b.Property("Composite"); + + b.Property("CurrentSpeed"); + + b.Property("CurrentWriteSpeed"); + + b.Property("CurrentWriteSpeedSelected"); + + b.Property("DeinterlaveSubchannel"); + + b.Property("DigitalPort1"); + + b.Property("DigitalPort2"); + + b.Property("Eject"); + + b.Property("ISRC"); + + b.Property("LSBF"); + + b.Property("LeadInPW"); + + b.Property("Length"); + + b.Property("LoadingMechanism"); + + b.Property("Lock"); + + b.Property("LockState"); + + b.Property("MaxWriteSpeed"); + + b.Property("MaximumSpeed"); + + b.Property("Method2"); + + b.Property("Mode2Form1"); + + b.Property("Mode2Form2"); + + b.Property("MultiSession"); + + b.Property("PS"); + + b.Property("PreventJumper"); + + b.Property("RCK"); + + b.Property("ReadBarcode"); + + b.Property("ReadCDR"); + + b.Property("ReadCDRW"); + + b.Property("ReadDVDR"); + + b.Property("ReadDVDRAM"); + + b.Property("ReadDVDROM"); + + b.Property("RotationControlSelected"); + + b.Property("SCC"); + + b.Property("SDP"); + + b.Property("SSS"); + + b.Property("SeparateChannelMute"); + + b.Property("SeparateChannelVolume"); + + b.Property("Subchannel"); + + b.Property("SupportedVolumeLevels"); + + b.Property("TestWrite"); + + b.Property("UPC"); + + b.Property("WriteCDR"); + + b.Property("WriteCDRW"); + + b.Property("WriteDVDR"); + + b.Property("WriteDVDRAM"); + + b.HasKey("Id"); + + b.ToTable("ModePage_2A"); + }); + + modelBuilder.Entity("DiscImageChef.CommonTypes.Metadata.Ata", b => + { + b.HasOne("DiscImageChef.CommonTypes.Metadata.TestedMedia", "ReadCapabilities") + .WithMany() + .HasForeignKey("ReadCapabilitiesId"); + }); + + modelBuilder.Entity("DiscImageChef.CommonTypes.Metadata.BlockDescriptor", b => + { + b.HasOne("DiscImageChef.CommonTypes.Metadata.ScsiMode") + .WithMany("BlockDescriptors") + .HasForeignKey("ScsiModeId"); + }); + + modelBuilder.Entity("DiscImageChef.CommonTypes.Metadata.DensityCode", b => + { + b.HasOne("DiscImageChef.CommonTypes.Metadata.SscSupportedMedia") + .WithMany("DensityCodes") + .HasForeignKey("SscSupportedMediaId"); + }); + + modelBuilder.Entity("DiscImageChef.CommonTypes.Metadata.Mmc", b => + { + b.HasOne("DiscImageChef.CommonTypes.Metadata.MmcFeatures", "Features") + .WithMany() + .HasForeignKey("FeaturesId"); + + b.HasOne("DiscImageChef.Decoders.SCSI.Modes+ModePage_2A", "ModeSense2A") + .WithMany() + .HasForeignKey("ModeSense2AId"); + }); + + modelBuilder.Entity("DiscImageChef.CommonTypes.Metadata.Scsi", b => + { + b.HasOne("DiscImageChef.CommonTypes.Metadata.ScsiMode", "ModeSense") + .WithMany() + .HasForeignKey("ModeSenseId"); + + b.HasOne("DiscImageChef.CommonTypes.Metadata.Mmc", "MultiMediaDevice") + .WithMany() + .HasForeignKey("MultiMediaDeviceId"); + + b.HasOne("DiscImageChef.CommonTypes.Metadata.TestedMedia", "ReadCapabilities") + .WithMany() + .HasForeignKey("ReadCapabilitiesId"); + + b.HasOne("DiscImageChef.CommonTypes.Metadata.Ssc", "SequentialDevice") + .WithMany() + .HasForeignKey("SequentialDeviceId"); + }); + + modelBuilder.Entity("DiscImageChef.CommonTypes.Metadata.ScsiPage", b => + { + b.HasOne("DiscImageChef.CommonTypes.Metadata.Scsi") + .WithMany("EVPDPages") + .HasForeignKey("ScsiId"); + + b.HasOne("DiscImageChef.CommonTypes.Metadata.ScsiMode") + .WithMany("ModePages") + .HasForeignKey("ScsiModeId"); + }); + + modelBuilder.Entity("DiscImageChef.CommonTypes.Metadata.SscSupportedMedia", b => + { + b.HasOne("DiscImageChef.CommonTypes.Metadata.Ssc") + .WithMany("SupportedMediaTypes") + .HasForeignKey("SscId"); + + b.HasOne("DiscImageChef.CommonTypes.Metadata.TestedSequentialMedia") + .WithMany("SupportedMediaTypes") + .HasForeignKey("TestedSequentialMediaId"); + }); + + modelBuilder.Entity("DiscImageChef.CommonTypes.Metadata.SupportedDensity", b => + { + b.HasOne("DiscImageChef.CommonTypes.Metadata.Ssc") + .WithMany("SupportedDensities") + .HasForeignKey("SscId"); + + b.HasOne("DiscImageChef.CommonTypes.Metadata.TestedSequentialMedia") + .WithMany("SupportedDensities") + .HasForeignKey("TestedSequentialMediaId"); + }); + + modelBuilder.Entity("DiscImageChef.CommonTypes.Metadata.TestedMedia", b => + { + b.HasOne("DiscImageChef.CommonTypes.Metadata.Ata") + .WithMany("RemovableMedias") + .HasForeignKey("AtaId"); + + b.HasOne("DiscImageChef.CommonTypes.Metadata.Chs", "CHS") + .WithMany() + .HasForeignKey("CHSId"); + + b.HasOne("DiscImageChef.CommonTypes.Metadata.Chs", "CurrentCHS") + .WithMany() + .HasForeignKey("CurrentCHSId"); + + b.HasOne("DiscImageChef.CommonTypes.Metadata.Mmc") + .WithMany("TestedMedia") + .HasForeignKey("MmcId"); + + b.HasOne("DiscImageChef.CommonTypes.Metadata.Scsi") + .WithMany("RemovableMedias") + .HasForeignKey("ScsiId"); + }); + + modelBuilder.Entity("DiscImageChef.CommonTypes.Metadata.TestedSequentialMedia", b => + { + b.HasOne("DiscImageChef.CommonTypes.Metadata.Ssc") + .WithMany("TestedMedia") + .HasForeignKey("SscId"); + }); + + modelBuilder.Entity("DiscImageChef.Database.Models.Device", b => + { + b.HasOne("DiscImageChef.CommonTypes.Metadata.Ata", "ATA") + .WithMany() + .HasForeignKey("ATAId"); + + b.HasOne("DiscImageChef.CommonTypes.Metadata.Ata", "ATAPI") + .WithMany() + .HasForeignKey("ATAPIId"); + + b.HasOne("DiscImageChef.CommonTypes.Metadata.FireWire", "FireWire") + .WithMany() + .HasForeignKey("FireWireId"); + + b.HasOne("DiscImageChef.CommonTypes.Metadata.MmcSd", "MultiMediaCard") + .WithMany() + .HasForeignKey("MultiMediaCardId"); + + b.HasOne("DiscImageChef.CommonTypes.Metadata.Pcmcia", "PCMCIA") + .WithMany() + .HasForeignKey("PCMCIAId"); + + b.HasOne("DiscImageChef.CommonTypes.Metadata.Scsi", "SCSI") + .WithMany() + .HasForeignKey("SCSIId"); + + b.HasOne("DiscImageChef.CommonTypes.Metadata.MmcSd", "SecureDigital") + .WithMany() + .HasForeignKey("SecureDigitalId"); + + b.HasOne("DiscImageChef.CommonTypes.Metadata.Usb", "USB") + .WithMany() + .HasForeignKey("USBId"); + }); + + modelBuilder.Entity("DiscImageChef.Database.Models.Report", b => + { + b.HasOne("DiscImageChef.CommonTypes.Metadata.Ata", "ATA") + .WithMany() + .HasForeignKey("ATAId"); + + b.HasOne("DiscImageChef.CommonTypes.Metadata.Ata", "ATAPI") + .WithMany() + .HasForeignKey("ATAPIId"); + + b.HasOne("DiscImageChef.CommonTypes.Metadata.FireWire", "FireWire") + .WithMany() + .HasForeignKey("FireWireId"); + + b.HasOne("DiscImageChef.CommonTypes.Metadata.MmcSd", "MultiMediaCard") + .WithMany() + .HasForeignKey("MultiMediaCardId"); + + b.HasOne("DiscImageChef.CommonTypes.Metadata.Pcmcia", "PCMCIA") + .WithMany() + .HasForeignKey("PCMCIAId"); + + b.HasOne("DiscImageChef.CommonTypes.Metadata.Scsi", "SCSI") + .WithMany() + .HasForeignKey("SCSIId"); + + b.HasOne("DiscImageChef.CommonTypes.Metadata.MmcSd", "SecureDigital") + .WithMany() + .HasForeignKey("SecureDigitalId"); + + b.HasOne("DiscImageChef.CommonTypes.Metadata.Usb", "USB") + .WithMany() + .HasForeignKey("USBId"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/DiscImageChef.Database/Migrations/20181221041242_VersionStatistics.cs b/DiscImageChef.Database/Migrations/20181221041242_VersionStatistics.cs new file mode 100644 index 000000000..fe88a6fef --- /dev/null +++ b/DiscImageChef.Database/Migrations/20181221041242_VersionStatistics.cs @@ -0,0 +1,24 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace DiscImageChef.Database.Migrations +{ + public partial class VersionStatistics : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable("Versions", + table => new + { + Id = table.Column(nullable: false) + .Annotation("Sqlite:Autoincrement", true), + Value = table.Column(nullable: true), + Synchronized = table.Column(nullable: false) + }, constraints: table => { table.PrimaryKey("PK_Versions", x => x.Id); }); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable("Versions"); + } + } +} \ No newline at end of file diff --git a/DiscImageChef.Database/Migrations/DicContextModelSnapshot.cs b/DiscImageChef.Database/Migrations/DicContextModelSnapshot.cs index c9ca87029..d18192089 100644 --- a/DiscImageChef.Database/Migrations/DicContextModelSnapshot.cs +++ b/DiscImageChef.Database/Migrations/DicContextModelSnapshot.cs @@ -1046,6 +1046,19 @@ namespace DiscImageChef.Database.Migrations b.ToTable("Reports"); }); + modelBuilder.Entity("DiscImageChef.Database.Models.Version", b => + { + b.Property("Id").ValueGeneratedOnAdd(); + + b.Property("Synchronized"); + + b.Property("Value"); + + b.HasKey("Id"); + + b.ToTable("Versions"); + }); + modelBuilder.Entity("DiscImageChef.Decoders.SCSI.Modes+ModePage_2A", b => { b.Property("Id").ValueGeneratedOnAdd(); diff --git a/DiscImageChef.Database/Models/Version.cs b/DiscImageChef.Database/Models/Version.cs new file mode 100644 index 000000000..bf6aa2f9c --- /dev/null +++ b/DiscImageChef.Database/Models/Version.cs @@ -0,0 +1,12 @@ +using System.ComponentModel.DataAnnotations; + +namespace DiscImageChef.Database.Models +{ + public class Version + { + [Key] + public int Id { get; set; } + public string Value { get; set; } + public bool Synchronized { get; set; } + } +} \ No newline at end of file