mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Fix USB IDs and indexes in databases.
This commit is contained in:
@@ -82,6 +82,8 @@
|
||||
<Compile Include="Migrations\20181223214411_UseBinaryDataForIdentifyInquiryAndModesInReports.Designer.cs" />
|
||||
<Compile Include="Migrations\20181224044809_StoreUsbIdsInDatabase.cs" />
|
||||
<Compile Include="Migrations\20181224044809_StoreUsbIdsInDatabase.Designer.cs" />
|
||||
<Compile Include="Migrations\20181224172147_FixUsbIdsAndIndexes.cs" />
|
||||
<Compile Include="Migrations\20181224172147_FixUsbIdsAndIndexes.Designer.cs" />
|
||||
<Compile Include="Migrations\DicContextModelSnapshot.cs" />
|
||||
<Compile Include="Models\Command.cs" />
|
||||
<Compile Include="Models\Device.cs" />
|
||||
|
||||
1407
DiscImageChef.Database/Migrations/20181224172147_FixUsbIdsAndIndexes.Designer.cs
generated
Normal file
1407
DiscImageChef.Database/Migrations/20181224172147_FixUsbIdsAndIndexes.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,21 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace DiscImageChef.Database.Migrations
|
||||
{
|
||||
public partial class FixUsbIdsAndIndexes : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateIndex("IX_UsbProducts_ProductId", "UsbProducts", "ProductId");
|
||||
migrationBuilder.CreateIndex("IX_UsbProducts_ModifiedWhen", "UsbProducts", "ModifiedWhen");
|
||||
migrationBuilder.CreateIndex("IX_UsbVendors_ModifiedWhen", "UsbVendors", "ModifiedWhen");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex("IX_UsbProducts_ProductId", "UsbProducts");
|
||||
migrationBuilder.DropIndex("IX_UsbProducts_ModifiedWhen", "UsbProducts");
|
||||
migrationBuilder.DropIndex("IX_UsbVendors_ModifiedWhen", "UsbVendors");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1140,6 +1140,10 @@ namespace DiscImageChef.Database.Migrations
|
||||
|
||||
b.HasIndex("VendorId");
|
||||
|
||||
b.HasIndex("ProductId");
|
||||
|
||||
b.HasIndex("ModifiedWhen");
|
||||
|
||||
b.ToTable("UsbProducts");
|
||||
});
|
||||
|
||||
@@ -1155,6 +1159,8 @@ namespace DiscImageChef.Database.Migrations
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ModifiedWhen");
|
||||
|
||||
b.ToTable("UsbVendors");
|
||||
});
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace DiscImageChef.Database.Models
|
||||
{
|
||||
@@ -15,14 +16,15 @@ namespace DiscImageChef.Database.Models
|
||||
}
|
||||
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
public ushort ProductId { get; set; }
|
||||
|
||||
public string Product { get; set; }
|
||||
public DateTime AddedWhen { get; set; }
|
||||
public int Id { get; set; }
|
||||
[Index]
|
||||
public ushort ProductId { get; set; }
|
||||
public string Product { get; set; }
|
||||
public DateTime AddedWhen { get; set; }
|
||||
[Index]
|
||||
public DateTime ModifiedWhen { get; set; }
|
||||
|
||||
public ushort VendorId { get; set; }
|
||||
public virtual UsbVendor Vendor { get; set; }
|
||||
[Index]
|
||||
public ushort VendorId { get; set; }
|
||||
public virtual UsbVendor Vendor { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace DiscImageChef.Database.Models
|
||||
{
|
||||
@@ -16,9 +17,10 @@ namespace DiscImageChef.Database.Models
|
||||
}
|
||||
|
||||
[Key]
|
||||
public ushort Id { get; set; }
|
||||
public string Vendor { get; set; }
|
||||
public DateTime AddedWhen { get; set; }
|
||||
public ushort Id { get; set; }
|
||||
public string Vendor { get; set; }
|
||||
public DateTime AddedWhen { get; set; }
|
||||
[Index]
|
||||
public DateTime ModifiedWhen { get; set; }
|
||||
|
||||
public virtual ICollection<UsbProduct> Products { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user