using System; using Microsoft.EntityFrameworkCore.Migrations; namespace DiscImageChef.Database.Migrations { public partial class DeviceReportV2 : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable("Chs", table => new { Id = table.Column(nullable: false) .Annotation("Sqlite:Autoincrement", true), Cylinders = table.Column(nullable: false), Heads = table.Column(nullable: false), Sectors = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_Chs", x => x.Id); }); migrationBuilder.CreateTable("FireWire", table => new { Id = table.Column(nullable: false) .Annotation("Sqlite:Autoincrement", true), VendorID = table.Column(nullable: false), ProductID = table.Column(nullable: false), Manufacturer = table.Column(nullable: true), Product = table.Column(nullable: true), RemovableMedia = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_FireWire", x => x.Id); }); migrationBuilder.CreateTable("MmcFeatures", table => new { Id = table.Column(nullable: false) .Annotation("Sqlite:Autoincrement", true), AACSVersion = table.Column(nullable: true), AGIDs = table.Column(nullable: true), BindingNonceBlocks = table.Column(nullable: true), BlocksPerReadableUnit = table.Column(nullable: true), BufferUnderrunFreeInDVD = table.Column(nullable: false), BufferUnderrunFreeInSAO = table.Column(nullable: false), BufferUnderrunFreeInTAO = table.Column(nullable: false), CanAudioScan = table.Column(nullable: false), CanEject = table.Column(nullable: false), CanEraseSector = table.Column(nullable: false), CanExpandBDRESpareArea = table.Column(nullable: false), CanFormat = table.Column(nullable: false), CanFormatBDREWithoutSpare = table.Column(nullable: false), CanFormatCert = table.Column(nullable: false), CanFormatFRF = table.Column(nullable: false), CanFormatQCert = table.Column(nullable: false), CanFormatRRM = table.Column(nullable: false), CanGenerateBindingNonce = table.Column(nullable: false), CanLoad = table.Column(nullable: false), CanMuteSeparateChannels = table.Column(nullable: false), CanOverwriteSAOTrack = table.Column(nullable: false), CanOverwriteTAOTrack = table.Column(nullable: false), CanPlayCDAudio = table.Column(nullable: false), CanPseudoOverwriteBDR = table.Column(nullable: false), CanReadAllDualR = table.Column(nullable: false), CanReadAllDualRW = table.Column(nullable: false), CanReadBD = table.Column(nullable: false), CanReadBDR = table.Column(nullable: false), CanReadBDRE1 = table.Column(nullable: false), CanReadBDRE2 = table.Column(nullable: false), CanReadBDROM = table.Column(nullable: false), CanReadBluBCA = table.Column(nullable: false), CanReadCD = table.Column(nullable: false), CanReadCDMRW = table.Column(nullable: false), CanReadCPRM_MKB = table.Column(nullable: false), CanReadDDCD = table.Column(nullable: false), CanReadDVD = table.Column(nullable: false), CanReadDVDPlusMRW = table.Column(nullable: false), CanReadDVDPlusR = table.Column(nullable: false), CanReadDVDPlusRDL = table.Column(nullable: false), CanReadDVDPlusRW = table.Column(nullable: false), CanReadDVDPlusRWDL = table.Column(nullable: false), CanReadDriveAACSCertificate = table.Column(nullable: false), CanReadHDDVD = table.Column(nullable: false), CanReadHDDVDR = table.Column(nullable: false), CanReadHDDVDRAM = table.Column(nullable: false), CanReadLeadInCDText = table.Column(nullable: false), CanReadOldBDR = table.Column(nullable: false), CanReadOldBDRE = table.Column(nullable: false), CanReadOldBDROM = table.Column(nullable: false), CanReadSpareAreaInformation = table.Column(nullable: false), CanReportDriveSerial = table.Column(nullable: false), CanReportMediaSerial = table.Column(nullable: false), CanTestWriteDDCDR = table.Column(nullable: false), CanTestWriteDVD = table.Column(nullable: false), CanTestWriteInSAO = table.Column(nullable: false), CanTestWriteInTAO = table.Column(nullable: false), CanUpgradeFirmware = table.Column(nullable: false), CanWriteBD = table.Column(nullable: false), CanWriteBDR = table.Column(nullable: false), CanWriteBDRE1 = table.Column(nullable: false), CanWriteBDRE2 = table.Column(nullable: false), CanWriteBusEncryptedBlocks = table.Column(nullable: false), CanWriteCDMRW = table.Column(nullable: false), CanWriteCDRW = table.Column(nullable: false), CanWriteCDRWCAV = table.Column(nullable: false), CanWriteCDSAO = table.Column(nullable: false), CanWriteCDTAO = table.Column(nullable: false), CanWriteCSSManagedDVD = table.Column(nullable: false), CanWriteDDCDR = table.Column(nullable: false), CanWriteDDCDRW = table.Column(nullable: false), CanWriteDVDPlusMRW = table.Column(nullable: false), CanWriteDVDPlusR = table.Column(nullable: false), CanWriteDVDPlusRDL = table.Column(nullable: false), CanWriteDVDPlusRW = table.Column(nullable: false), CanWriteDVDPlusRWDL = table.Column(nullable: false), CanWriteDVDR = table.Column(nullable: false), CanWriteDVDRDL = table.Column(nullable: false), CanWriteDVDRW = table.Column(nullable: false), CanWriteHDDVDR = table.Column(nullable: false), CanWriteHDDVDRAM = table.Column(nullable: false), CanWriteOldBDR = table.Column(nullable: false), CanWriteOldBDRE = table.Column(nullable: false), CanWritePackedSubchannelInTAO = table.Column(nullable: false), CanWriteRWSubchannelInSAO = table.Column(nullable: false), CanWriteRWSubchannelInTAO = table.Column(nullable: false), CanWriteRaw = table.Column(nullable: false), CanWriteRawMultiSession = table.Column(nullable: false), CanWriteRawSubchannelInTAO = table.Column(nullable: false), ChangerIsSideChangeCapable = table.Column(nullable: false), ChangerSlots = table.Column(nullable: false), ChangerSupportsDiscPresent = table.Column(nullable: false), CPRMVersion = table.Column(nullable: true), CSSVersion = table.Column(nullable: true), DBML = table.Column(nullable: false), DVDMultiRead = table.Column(nullable: false), EmbeddedChanger = table.Column(nullable: false), ErrorRecoveryPage = table.Column(nullable: false), FirmwareDate = table.Column(nullable: true), LoadingMechanismType = table.Column(nullable: true), Locked = table.Column(nullable: false), LogicalBlockSize = table.Column(nullable: true), MultiRead = table.Column(nullable: false), PhysicalInterfaceStandard = table.Column(nullable: true), PhysicalInterfaceStandardNumber = table.Column(nullable: true), PreventJumper = table.Column(nullable: false), SupportsAACS = table.Column(nullable: false), SupportsBusEncryption = table.Column(nullable: false), SupportsC2 = table.Column(nullable: false), SupportsCPRM = table.Column(nullable: false), SupportsCSS = table.Column(nullable: false), SupportsDAP = table.Column(nullable: false), SupportsDeviceBusyEvent = table.Column(nullable: false), SupportsHybridDiscs = table.Column(nullable: false), SupportsModePage1Ch = table.Column(nullable: false), SupportsOSSC = table.Column(nullable: false), SupportsPWP = table.Column(nullable: false), SupportsSWPP = table.Column(nullable: false), SupportsSecurDisc = table.Column(nullable: false), SupportsSeparateVolume = table.Column(nullable: false), SupportsVCPS = table.Column(nullable: false), SupportsWriteInhibitDCB = table.Column(nullable: false), SupportsWriteProtectPAC = table.Column(nullable: false), VolumeLevels = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_MmcFeatures", x => x.Id); }); migrationBuilder.CreateTable("MmcSd", table => new { Id = table.Column(nullable: false) .Annotation("Sqlite:Autoincrement", true), CID = table.Column(nullable: true), CSD = table.Column(nullable: true), OCR = table.Column(nullable: true), SCR = table.Column(nullable: true), ExtendedCSD = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_MmcSd", x => x.Id); }); migrationBuilder.CreateTable("ModePage_2A", table => new { PS = table.Column(nullable: false), MultiSession = table.Column(nullable: false), Mode2Form2 = table.Column(nullable: false), Mode2Form1 = table.Column(nullable: false), AudioPlay = table.Column(nullable: false), ISRC = table.Column(nullable: false), UPC = table.Column(nullable: false), C2Pointer = table.Column(nullable: false), DeinterlaveSubchannel = table.Column(nullable: false), Subchannel = table.Column(nullable: false), AccurateCDDA = table.Column(nullable: false), CDDACommand = table.Column(nullable: false), LoadingMechanism = table.Column(nullable: false), Eject = table.Column(nullable: false), PreventJumper = table.Column(nullable: false), LockState = table.Column(nullable: false), Lock = table.Column(nullable: false), SeparateChannelMute = table.Column(nullable: false), SeparateChannelVolume = table.Column(nullable: false), MaximumSpeed = table.Column(nullable: false), SupportedVolumeLevels = table.Column(nullable: false), BufferSize = table.Column(nullable: false), CurrentSpeed = table.Column(nullable: false), Method2 = table.Column(nullable: false), ReadCDRW = table.Column(nullable: false), ReadCDR = table.Column(nullable: false), WriteCDRW = table.Column(nullable: false), WriteCDR = table.Column(nullable: false), DigitalPort2 = table.Column(nullable: false), DigitalPort1 = table.Column(nullable: false), Composite = table.Column(nullable: false), SSS = table.Column(nullable: false), SDP = table.Column(nullable: false), Length = table.Column(nullable: false), LSBF = table.Column(nullable: false), RCK = table.Column(nullable: false), BCK = table.Column(nullable: false), TestWrite = table.Column(nullable: false), MaxWriteSpeed = table.Column(nullable: false), CurrentWriteSpeed = table.Column(nullable: false), ReadBarcode = table.Column(nullable: false), ReadDVDRAM = table.Column(nullable: false), ReadDVDR = table.Column(nullable: false), ReadDVDROM = table.Column(nullable: false), WriteDVDRAM = table.Column(nullable: false), WriteDVDR = table.Column(nullable: false), LeadInPW = table.Column(nullable: false), SCC = table.Column(nullable: false), CMRSupported = table.Column(nullable: false), BUF = table.Column(nullable: false), RotationControlSelected = table.Column(nullable: false), CurrentWriteSpeedSelected = table.Column(nullable: false), Id = table.Column(nullable: false) .Annotation("Sqlite:Autoincrement", true) }, constraints: table => { table.PrimaryKey("PK_ModePage_2A", x => x.Id); }); migrationBuilder.CreateTable("Pcmcia", table => new { Id = table.Column(nullable: false) .Annotation("Sqlite:Autoincrement", true), CIS = table.Column(nullable: true), Compliance = table.Column(nullable: true), ManufacturerCode = table.Column(nullable: true), CardCode = table.Column(nullable: true), Manufacturer = table.Column(nullable: true), ProductName = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_Pcmcia", x => x.Id); }); migrationBuilder.CreateTable("ScsiMode", table => new { Id = table.Column(nullable: false) .Annotation("Sqlite:Autoincrement", true), MediumType = table.Column(nullable: true), WriteProtected = table.Column(nullable: false), Speed = table.Column(nullable: true), BufferedMode = table.Column(nullable: true), BlankCheckEnabled = table.Column(nullable: false), DPOandFUA = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_ScsiMode", x => x.Id); }); migrationBuilder.CreateTable("Ssc", table => new { Id = table.Column(nullable: false) .Annotation("Sqlite:Autoincrement", true), BlockSizeGranularity = table.Column(nullable: true), MaxBlockLength = table.Column(nullable: true), MinBlockLength = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_Ssc", x => x.Id); }); migrationBuilder.CreateTable("Usb", table => new { Id = table.Column(nullable: false) .Annotation("Sqlite:Autoincrement", true), VendorID = table.Column(nullable: false), ProductID = table.Column(nullable: false), Manufacturer = table.Column(nullable: true), Product = table.Column(nullable: true), RemovableMedia = table.Column(nullable: false), Descriptors = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_Usb", x => x.Id); }); migrationBuilder.CreateTable("Mmc", table => new { Id = table.Column(nullable: false) .Annotation("Sqlite:Autoincrement", true), ModeSense2AId = table.Column(nullable: true), FeaturesId = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_Mmc", x => x.Id); table.ForeignKey("FK_Mmc_MmcFeatures_FeaturesId", x => x.FeaturesId, "MmcFeatures", "Id", onDelete: ReferentialAction.Restrict); table.ForeignKey("FK_Mmc_ModePage_2A_ModeSense2AId", x => x.ModeSense2AId, "ModePage_2A", "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable("BlockDescriptor", table => new { Id = table.Column(nullable: false) .Annotation("Sqlite:Autoincrement", true), Density = table.Column(nullable: false), Blocks = table.Column(nullable: true), BlockLength = table.Column(nullable: true), ScsiModeId = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_BlockDescriptor", x => x.Id); table.ForeignKey("FK_BlockDescriptor_ScsiMode_ScsiModeId", x => x.ScsiModeId, "ScsiMode", "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable("TestedSequentialMedia", table => new { Id = table.Column(nullable: false) .Annotation("Sqlite:Autoincrement", true), CanReadMediaSerial = table.Column(nullable: true), Density = table.Column(nullable: true), Manufacturer = table.Column(nullable: true), MediaIsRecognized = table.Column(nullable: false), MediumType = table.Column(nullable: true), MediumTypeName = table.Column(nullable: true), Model = table.Column(nullable: true), ModeSense6Data = table.Column(nullable: true), ModeSense10Data = table.Column(nullable: true), SscId = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_TestedSequentialMedia", x => x.Id); table.ForeignKey("FK_TestedSequentialMedia_Ssc_SscId", x => x.SscId, "Ssc", "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable("SscSupportedMedia", table => new { Id = table.Column(nullable: false) .Annotation("Sqlite:Autoincrement", true), MediumType = table.Column(nullable: false), Width = table.Column(nullable: false), Length = table.Column(nullable: false), Organization = table.Column(nullable: true), Name = table.Column(nullable: true), Description = table.Column(nullable: true), SscId = table.Column(nullable: true), TestedSequentialMediaId = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_SscSupportedMedia", x => x.Id); table.ForeignKey("FK_SscSupportedMedia_Ssc_SscId", x => x.SscId, "Ssc", "Id", onDelete: ReferentialAction.Restrict); table .ForeignKey("FK_SscSupportedMedia_TestedSequentialMedia_TestedSequentialMediaId", x => x.TestedSequentialMediaId, "TestedSequentialMedia", "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable("SupportedDensity", table => new { Id = table.Column(nullable: false) .Annotation("Sqlite:Autoincrement", true), PrimaryCode = table.Column(nullable: false), SecondaryCode = table.Column(nullable: false), Writable = table.Column(nullable: false), Duplicate = table.Column(nullable: false), DefaultDensity = table.Column(nullable: false), BitsPerMm = table.Column(nullable: false), Width = table.Column(nullable: false), Tracks = table.Column(nullable: false), Capacity = table.Column(nullable: false), Organization = table.Column(nullable: true), Name = table.Column(nullable: true), Description = table.Column(nullable: true), SscId = table.Column(nullable: true), TestedSequentialMediaId = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_SupportedDensity", x => x.Id); table.ForeignKey("FK_SupportedDensity_Ssc_SscId", x => x.SscId, "Ssc", "Id", onDelete: ReferentialAction.Restrict); table .ForeignKey("FK_SupportedDensity_TestedSequentialMedia_TestedSequentialMediaId", x => x.TestedSequentialMediaId, "TestedSequentialMedia", "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable("DensityCode", table => new { Code = table.Column(nullable: false) .Annotation("Sqlite:Autoincrement", true), SscSupportedMediaId = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_DensityCode", x => x.Code); table.ForeignKey("FK_DensityCode_SscSupportedMedia_SscSupportedMediaId", x => x.SscSupportedMediaId, "SscSupportedMedia", "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable("Reports", table => new { Id = table.Column(nullable: false) .Annotation("Sqlite:Autoincrement", true), USBId = table.Column(nullable: true), FireWireId = table.Column(nullable: true), PCMCIAId = table.Column(nullable: true), CompactFlash = table.Column(nullable: false), ATAId = table.Column(nullable: true), ATAPIId = table.Column(nullable: true), SCSIId = table.Column(nullable: true), MultiMediaCardId = table.Column(nullable: true), SecureDigitalId = table.Column(nullable: true), Discriminator = table.Column(nullable: false), LastSynchronized = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_Reports", x => x.Id); table.ForeignKey("FK_Reports_FireWire_FireWireId", x => x.FireWireId, "FireWire", "Id", onDelete: ReferentialAction.Restrict); table.ForeignKey("FK_Reports_MmcSd_MultiMediaCardId", x => x.MultiMediaCardId, "MmcSd", "Id", onDelete: ReferentialAction.Restrict); table.ForeignKey("FK_Reports_Pcmcia_PCMCIAId", x => x.PCMCIAId, "Pcmcia", "Id", onDelete: ReferentialAction.Restrict); table.ForeignKey("FK_Reports_MmcSd_SecureDigitalId", x => x.SecureDigitalId, "MmcSd", "Id", onDelete: ReferentialAction.Restrict); table.ForeignKey("FK_Reports_Usb_USBId", x => x.USBId, "Usb", "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable("TestedMedia", table => new { Id = table.Column(nullable: false) .Annotation("Sqlite:Autoincrement", true), IdentifyData = table.Column(nullable: true), Blocks = table.Column(nullable: true), BlockSize = table.Column(nullable: true), CanReadAACS = table.Column(nullable: true), CanReadADIP = table.Column(nullable: true), CanReadATIP = table.Column(nullable: true), CanReadBCA = table.Column(nullable: true), CanReadC2Pointers = table.Column(nullable: true), CanReadCMI = table.Column(nullable: true), CanReadCorrectedSubchannel = table.Column(nullable: true), CanReadCorrectedSubchannelWithC2 = table.Column(nullable: true), CanReadDCB = table.Column(nullable: true), CanReadDDS = table.Column(nullable: true), CanReadDMI = table.Column(nullable: true), CanReadDiscInformation = table.Column(nullable: true), CanReadFullTOC = table.Column(nullable: true), CanReadHDCMI = table.Column(nullable: true), CanReadLayerCapacity = table.Column(nullable: true), CanReadFirstTrackPreGap = table.Column(nullable: true), CanReadLeadIn = table.Column(nullable: true), CanReadLeadOut = table.Column(nullable: true), CanReadMediaID = table.Column(nullable: true), CanReadMediaSerial = table.Column(nullable: true), CanReadPAC = table.Column(nullable: true), CanReadPFI = table.Column(nullable: true), CanReadPMA = table.Column(nullable: true), CanReadPQSubchannel = table.Column(nullable: true), CanReadPQSubchannelWithC2 = table.Column(nullable: true), CanReadPRI = table.Column(nullable: true), CanReadRWSubchannel = table.Column(nullable: true), CanReadRWSubchannelWithC2 = table.Column(nullable: true), CanReadRecordablePFI = table.Column(nullable: true), CanReadSpareAreaInformation = table.Column(nullable: true), CanReadTOC = table.Column(nullable: true), Density = table.Column(nullable: true), LongBlockSize = table.Column(nullable: true), Manufacturer = table.Column(nullable: true), MediaIsRecognized = table.Column(nullable: false), MediumType = table.Column(nullable: true), MediumTypeName = table.Column(nullable: true), Model = table.Column(nullable: true), SupportsHLDTSTReadRawDVD = table.Column(nullable: true), SupportsNECReadCDDA = table.Column(nullable: true), SupportsPioneerReadCDDA = table.Column(nullable: true), SupportsPioneerReadCDDAMSF = table.Column(nullable: true), SupportsPlextorReadCDDA = table.Column(nullable: true), SupportsPlextorReadRawDVD = table.Column(nullable: true), SupportsRead10 = table.Column(nullable: true), SupportsRead12 = table.Column(nullable: true), SupportsRead16 = table.Column(nullable: true), SupportsRead6 = table.Column(nullable: true), SupportsReadCapacity16 = table.Column(nullable: true), SupportsReadCapacity = table.Column(nullable: true), SupportsReadCd = table.Column(nullable: true), SupportsReadCdMsf = table.Column(nullable: true), SupportsReadCdRaw = table.Column(nullable: true), SupportsReadCdMsfRaw = table.Column(nullable: true), SupportsReadLong16 = table.Column(nullable: true), SupportsReadLong = table.Column(nullable: true), ModeSense6Data = table.Column(nullable: true), ModeSense10Data = table.Column(nullable: true), CHSId = table.Column(nullable: true), CurrentCHSId = table.Column(nullable: true), LBASectors = table.Column(nullable: true), LBA48Sectors = table.Column(nullable: true), LogicalAlignment = table.Column(nullable: true), NominalRotationRate = table.Column(nullable: true), PhysicalBlockSize = table.Column(nullable: true), SolidStateDevice = table.Column(nullable: true), UnformattedBPT = table.Column(nullable: true), UnformattedBPS = table.Column(nullable: true), SupportsReadDmaLba = table.Column(nullable: true), SupportsReadDmaRetryLba = table.Column(nullable: true), SupportsReadLba = table.Column(nullable: true), SupportsReadRetryLba = table.Column(nullable: true), SupportsReadLongLba = table.Column(nullable: true), SupportsReadLongRetryLba = table.Column(nullable: true), SupportsSeekLba = table.Column(nullable: true), SupportsReadDmaLba48 = table.Column(nullable: true), SupportsReadLba48 = table.Column(nullable: true), SupportsReadDma = table.Column(nullable: true), SupportsReadDmaRetry = table.Column(nullable: true), SupportsReadRetry = table.Column(nullable: true), SupportsReadSectors = table.Column(nullable: true), SupportsReadLongRetry = table.Column(nullable: true), SupportsSeek = table.Column(nullable: true), AtaId = table.Column(nullable: true), MmcId = table.Column(nullable: true), ScsiId = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_TestedMedia", x => x.Id); table.ForeignKey("FK_TestedMedia_Chs_CHSId", x => x.CHSId, "Chs", "Id", onDelete: ReferentialAction.Restrict); table.ForeignKey("FK_TestedMedia_Chs_CurrentCHSId", x => x.CurrentCHSId, "Chs", "Id", onDelete: ReferentialAction.Restrict); table.ForeignKey("FK_TestedMedia_Mmc_MmcId", x => x.MmcId, "Mmc", "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable("Ata", table => new { Id = table.Column(nullable: false) .Annotation("Sqlite:Autoincrement", true), Identify = table.Column(nullable: true), ReadCapabilitiesId = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_Ata", x => x.Id); table.ForeignKey("FK_Ata_TestedMedia_ReadCapabilitiesId", x => x.ReadCapabilitiesId, "TestedMedia", "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable("Scsi", table => new { Id = table.Column(nullable: false) .Annotation("Sqlite:Autoincrement", true), InquiryData = table.Column(nullable: true), SupportsModeSense6 = table.Column(nullable: false), SupportsModeSense10 = table.Column(nullable: false), SupportsModeSubpages = table.Column(nullable: false), ModeSenseId = table.Column(nullable: true), MultiMediaDeviceId = table.Column(nullable: true), ReadCapabilitiesId = table.Column(nullable: true), SequentialDeviceId = table.Column(nullable: true), ModeSense6Data = table.Column(nullable: true), ModeSense10Data = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_Scsi", x => x.Id); table.ForeignKey("FK_Scsi_ScsiMode_ModeSenseId", x => x.ModeSenseId, "ScsiMode", "Id", onDelete: ReferentialAction.Restrict); table.ForeignKey("FK_Scsi_Mmc_MultiMediaDeviceId", x => x.MultiMediaDeviceId, "Mmc", "Id", onDelete: ReferentialAction.Restrict); table.ForeignKey("FK_Scsi_TestedMedia_ReadCapabilitiesId", x => x.ReadCapabilitiesId, "TestedMedia", "Id", onDelete: ReferentialAction.Restrict); table.ForeignKey("FK_Scsi_Ssc_SequentialDeviceId", x => x.SequentialDeviceId, "Ssc", "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable("ScsiPage", table => new { Id = table.Column(nullable: false) .Annotation("Sqlite:Autoincrement", true), page = table.Column(nullable: false), subpage = table.Column(nullable: true), value = table.Column(nullable: true), ScsiId = table.Column(nullable: true), ScsiModeId = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_ScsiPage", x => x.Id); table.ForeignKey("FK_ScsiPage_Scsi_ScsiId", x => x.ScsiId, "Scsi", "Id", onDelete: ReferentialAction.Restrict); table.ForeignKey("FK_ScsiPage_ScsiMode_ScsiModeId", x => x.ScsiModeId, "ScsiMode", "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateIndex("IX_Ata_ReadCapabilitiesId", "Ata", "ReadCapabilitiesId"); migrationBuilder.CreateIndex("IX_BlockDescriptor_ScsiModeId", "BlockDescriptor", "ScsiModeId"); migrationBuilder.CreateIndex("IX_DensityCode_SscSupportedMediaId", "DensityCode", "SscSupportedMediaId"); migrationBuilder.CreateIndex("IX_Mmc_FeaturesId", "Mmc", "FeaturesId"); migrationBuilder.CreateIndex("IX_Mmc_ModeSense2AId", "Mmc", "ModeSense2AId"); migrationBuilder.CreateIndex("IX_Reports_ATAId", "Reports", "ATAId"); migrationBuilder.CreateIndex("IX_Reports_ATAPIId", "Reports", "ATAPIId"); migrationBuilder.CreateIndex("IX_Reports_FireWireId", "Reports", "FireWireId"); migrationBuilder.CreateIndex("IX_Reports_MultiMediaCardId", "Reports", "MultiMediaCardId"); migrationBuilder.CreateIndex("IX_Reports_PCMCIAId", "Reports", "PCMCIAId"); migrationBuilder.CreateIndex("IX_Reports_SCSIId", "Reports", "SCSIId"); migrationBuilder.CreateIndex("IX_Reports_SecureDigitalId", "Reports", "SecureDigitalId"); migrationBuilder.CreateIndex("IX_Reports_USBId", "Reports", "USBId"); migrationBuilder.CreateIndex("IX_Scsi_ModeSenseId", "Scsi", "ModeSenseId"); migrationBuilder.CreateIndex("IX_Scsi_MultiMediaDeviceId", "Scsi", "MultiMediaDeviceId"); migrationBuilder.CreateIndex("IX_Scsi_ReadCapabilitiesId", "Scsi", "ReadCapabilitiesId"); migrationBuilder.CreateIndex("IX_Scsi_SequentialDeviceId", "Scsi", "SequentialDeviceId"); migrationBuilder.CreateIndex("IX_ScsiPage_ScsiId", "ScsiPage", "ScsiId"); migrationBuilder.CreateIndex("IX_ScsiPage_ScsiModeId", "ScsiPage", "ScsiModeId"); migrationBuilder.CreateIndex("IX_SscSupportedMedia_SscId", "SscSupportedMedia", "SscId"); migrationBuilder.CreateIndex("IX_SscSupportedMedia_TestedSequentialMediaId", "SscSupportedMedia", "TestedSequentialMediaId"); migrationBuilder.CreateIndex("IX_SupportedDensity_SscId", "SupportedDensity", "SscId"); migrationBuilder.CreateIndex("IX_SupportedDensity_TestedSequentialMediaId", "SupportedDensity", "TestedSequentialMediaId"); migrationBuilder.CreateIndex("IX_TestedMedia_AtaId", "TestedMedia", "AtaId"); migrationBuilder.CreateIndex("IX_TestedMedia_CHSId", "TestedMedia", "CHSId"); migrationBuilder.CreateIndex("IX_TestedMedia_CurrentCHSId", "TestedMedia", "CurrentCHSId"); migrationBuilder.CreateIndex("IX_TestedMedia_MmcId", "TestedMedia", "MmcId"); migrationBuilder.CreateIndex("IX_TestedMedia_ScsiId", "TestedMedia", "ScsiId"); migrationBuilder.CreateIndex("IX_TestedSequentialMedia_SscId", "TestedSequentialMedia", "SscId"); migrationBuilder.AddForeignKey("FK_Reports_Ata_ATAId", "Reports", "ATAId", "Ata", principalColumn: "Id", onDelete: ReferentialAction.Restrict); migrationBuilder.AddForeignKey("FK_Reports_Ata_ATAPIId", "Reports", "ATAPIId", "Ata", principalColumn: "Id", onDelete: ReferentialAction.Restrict); migrationBuilder.AddForeignKey("FK_Reports_Scsi_SCSIId", "Reports", "SCSIId", "Scsi", principalColumn: "Id", onDelete: ReferentialAction.Restrict); migrationBuilder.AddForeignKey("FK_TestedMedia_Ata_AtaId", "TestedMedia", "AtaId", "Ata", principalColumn: "Id", onDelete: ReferentialAction.Restrict); migrationBuilder.AddForeignKey("FK_TestedMedia_Scsi_ScsiId", "TestedMedia", "ScsiId", "Scsi", principalColumn: "Id", onDelete: ReferentialAction.Restrict); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey("FK_Ata_TestedMedia_ReadCapabilitiesId", "Ata"); migrationBuilder.DropForeignKey("FK_Scsi_TestedMedia_ReadCapabilitiesId", "Scsi"); migrationBuilder.DropTable("BlockDescriptor"); migrationBuilder.DropTable("DensityCode"); migrationBuilder.DropTable("Reports"); migrationBuilder.DropTable("ScsiPage"); migrationBuilder.DropTable("SupportedDensity"); migrationBuilder.DropTable("SscSupportedMedia"); migrationBuilder.DropTable("FireWire"); migrationBuilder.DropTable("MmcSd"); migrationBuilder.DropTable("Pcmcia"); migrationBuilder.DropTable("Usb"); migrationBuilder.DropTable("TestedSequentialMedia"); migrationBuilder.DropTable("TestedMedia"); migrationBuilder.DropTable("Ata"); migrationBuilder.DropTable("Chs"); migrationBuilder.DropTable("Scsi"); migrationBuilder.DropTable("ScsiMode"); migrationBuilder.DropTable("Mmc"); migrationBuilder.DropTable("Ssc"); migrationBuilder.DropTable("MmcFeatures"); migrationBuilder.DropTable("ModePage_2A"); } } }