mirror of
https://github.com/claunia/marechai.git
synced 2025-12-16 19:14:25 +00:00
Add database models for document, book and magazine scans (cover, backcover, etc).
This commit is contained in:
@@ -48,6 +48,7 @@ namespace Marechai.Database.Models
|
||||
public virtual DbSet<Book> Books { get; set; }
|
||||
public virtual DbSet<BooksByMachine> BooksByMachines { get; set; }
|
||||
public virtual DbSet<BooksByMachineFamily> BooksByMachineFamilies { get; set; }
|
||||
public virtual DbSet<BookScan> BookScans { get; set; }
|
||||
public virtual DbSet<BrowserTest> BrowserTests { get; set; }
|
||||
public virtual DbSet<CompaniesByBook> CompaniesByBooks { get; set; }
|
||||
public virtual DbSet<CompaniesByDocument> CompaniesByDocuments { get; set; }
|
||||
@@ -67,6 +68,7 @@ namespace Marechai.Database.Models
|
||||
public virtual DbSet<DocumentRole> DocumentRoles { get; set; }
|
||||
public virtual DbSet<DocumentsByMachine> DocumentsByMachines { get; set; }
|
||||
public virtual DbSet<DocumentsByMachineFamily> DocumentsByMachineFamilies { get; set; }
|
||||
public virtual DbSet<DocumentScan> DocumentScans { get; set; }
|
||||
public virtual DbSet<Dump> Dumps { get; set; }
|
||||
public virtual DbSet<DumpHardware> DumpHardwares { get; set; }
|
||||
public virtual DbSet<FileDataStream> FileDataStreams { get; set; }
|
||||
@@ -92,6 +94,7 @@ namespace Marechai.Database.Models
|
||||
public virtual DbSet<MagazineIssue> MagazineIssues { get; set; }
|
||||
public virtual DbSet<MagazinesByMachine> MagazinesByMachines { get; set; }
|
||||
public virtual DbSet<MagazinesByMachineFamily> MagazinesByMachinesFamilies { get; set; }
|
||||
public virtual DbSet<MagazineScan> MagazineScans { get; set; }
|
||||
public virtual DbSet<MarechaiDb> MarechaiDb { get; set; }
|
||||
public virtual DbSet<MasteringText> MasteringTexts { get; set; }
|
||||
public virtual DbSet<Media> Media { get; set; }
|
||||
@@ -2022,6 +2025,111 @@ namespace Marechai.Database.Models
|
||||
{
|
||||
entity.HasIndex(e => e.Path);
|
||||
});
|
||||
|
||||
modelBuilder.Entity<BookScan>(entity =>
|
||||
{
|
||||
entity.HasIndex(e => e.Author);
|
||||
|
||||
entity.HasIndex(e => e.ColorSpace);
|
||||
|
||||
entity.HasIndex(e => e.Comments);
|
||||
|
||||
entity.HasIndex(e => e.CreationDate);
|
||||
|
||||
entity.HasIndex(e => e.ExifVersion);
|
||||
|
||||
entity.HasIndex(e => e.HorizontalResolution);
|
||||
|
||||
entity.HasIndex(e => e.ResolutionUnit);
|
||||
|
||||
entity.HasIndex(e => e.ScannerManufacturer);
|
||||
|
||||
entity.HasIndex(e => e.ScannerModel);
|
||||
|
||||
entity.HasIndex(e => e.SoftwareUsed);
|
||||
|
||||
entity.HasIndex(e => e.UploadDate);
|
||||
|
||||
entity.HasIndex(e => e.VerticalResolution);
|
||||
|
||||
entity.HasIndex(e => e.Type);
|
||||
|
||||
entity.HasIndex(e => e.Page);
|
||||
|
||||
entity.HasOne(d => d.Book).WithMany(p => p.Scans).OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
entity.HasOne(d => d.User).WithMany(p => p.BookScans).OnDelete(DeleteBehavior.SetNull);
|
||||
});
|
||||
|
||||
modelBuilder.Entity<DocumentScan>(entity =>
|
||||
{
|
||||
entity.HasIndex(e => e.Author);
|
||||
|
||||
entity.HasIndex(e => e.ColorSpace);
|
||||
|
||||
entity.HasIndex(e => e.Comments);
|
||||
|
||||
entity.HasIndex(e => e.CreationDate);
|
||||
|
||||
entity.HasIndex(e => e.ExifVersion);
|
||||
|
||||
entity.HasIndex(e => e.HorizontalResolution);
|
||||
|
||||
entity.HasIndex(e => e.ResolutionUnit);
|
||||
|
||||
entity.HasIndex(e => e.ScannerManufacturer);
|
||||
|
||||
entity.HasIndex(e => e.ScannerModel);
|
||||
|
||||
entity.HasIndex(e => e.SoftwareUsed);
|
||||
|
||||
entity.HasIndex(e => e.UploadDate);
|
||||
|
||||
entity.HasIndex(e => e.VerticalResolution);
|
||||
|
||||
entity.HasIndex(e => e.Type);
|
||||
|
||||
entity.HasIndex(e => e.Page);
|
||||
|
||||
entity.HasOne(d => d.Document).WithMany(p => p.Scans).OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
entity.HasOne(d => d.User).WithMany(p => p.DocumentScans).OnDelete(DeleteBehavior.SetNull);
|
||||
});
|
||||
|
||||
modelBuilder.Entity<MagazineScan>(entity =>
|
||||
{
|
||||
entity.HasIndex(e => e.Author);
|
||||
|
||||
entity.HasIndex(e => e.ColorSpace);
|
||||
|
||||
entity.HasIndex(e => e.Comments);
|
||||
|
||||
entity.HasIndex(e => e.CreationDate);
|
||||
|
||||
entity.HasIndex(e => e.ExifVersion);
|
||||
|
||||
entity.HasIndex(e => e.HorizontalResolution);
|
||||
|
||||
entity.HasIndex(e => e.ResolutionUnit);
|
||||
|
||||
entity.HasIndex(e => e.ScannerManufacturer);
|
||||
|
||||
entity.HasIndex(e => e.ScannerModel);
|
||||
|
||||
entity.HasIndex(e => e.SoftwareUsed);
|
||||
|
||||
entity.HasIndex(e => e.UploadDate);
|
||||
|
||||
entity.HasIndex(e => e.VerticalResolution);
|
||||
|
||||
entity.HasIndex(e => e.Type);
|
||||
|
||||
entity.HasIndex(e => e.Page);
|
||||
|
||||
entity.HasOne(d => d.Magazine).WithMany(p => p.Scans).OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
entity.HasOne(d => d.User).WithMany(p => p.MagazineScans).OnDelete(DeleteBehavior.SetNull);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user