Fix USB IDs and indexes in databases.

This commit is contained in:
2018-12-24 21:13:02 +00:00
parent 383794bace
commit 5a0714e795
13 changed files with 1673 additions and 24 deletions

View File

@@ -1,5 +1,6 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace DiscImageChef.Server.Models
{
@@ -7,22 +8,24 @@ namespace DiscImageChef.Server.Models
{
public UsbProduct() { }
public UsbProduct(ushort vendorId, ushort id, string product)
public UsbProduct(UsbVendor vendor, ushort id, string product)
{
ProductId = id;
Product = product;
AddedWhen = ModifiedWhen = DateTime.UtcNow;
Vendor = vendor;
}
[Key]
public int Id { get; set; }
public int ProductId { get; set; }
public string Product { get; set; }
public DateTime AddedWhen { get; set; }
public int Id { get; set; }
[Index]
public int ProductId { get; set; }
public string Product { get; set; }
public DateTime AddedWhen { get; set; }
[Index]
public DateTime ModifiedWhen { get; set; }
public int VendorId { get; set; }
public virtual UsbVendor Vendor { get; set; }
[Index]
public int VendorId { get; set; }
public virtual UsbVendor Vendor { get; set; }
}
}