Files
Aaru/Aaru.Database/Migrations/20181126222301_DeviceReportV2.cs

699 lines
42 KiB
C#
Raw Normal View History

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