feat: add Drawing entity with revision tracking
Introduce a Drawing table that tracks unique drawing numbers with their current PDF content hash and revision counter. ExportRecord gains a DrawingId FK. Includes a data migration to seed Drawings from existing export records. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
15
FabWorks.Core/Models/Drawing.cs
Normal file
15
FabWorks.Core/Models/Drawing.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace FabWorks.Core.Models
|
||||
{
|
||||
public class Drawing
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string DrawingNumber { get; set; }
|
||||
public string Title { get; set; }
|
||||
public string PdfContentHash { get; set; }
|
||||
public int Revision { get; set; } = 1;
|
||||
|
||||
public virtual ICollection<ExportRecord> ExportRecords { get; set; } = new List<ExportRecord>();
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,9 @@ namespace FabWorks.Core.Models
|
||||
public string ExportedBy { get; set; }
|
||||
public string PdfContentHash { get; set; }
|
||||
|
||||
public int? DrawingId { get; set; }
|
||||
public virtual Drawing Drawing { get; set; }
|
||||
|
||||
public virtual ICollection<BomItem> BomItems { get; set; } = new List<BomItem>();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user