Sync products with old e5 CRM

This commit is contained in:
Michał Zieliński
2025-06-23 21:52:09 +02:00
parent 8cb3b50fe7
commit 63b7ed51d1
17 changed files with 339 additions and 80 deletions

View File

@@ -6,12 +6,15 @@ namespace Bimix.Infrastructure.Data;
public class BimixDbContext(DbContextOptions<BimixDbContext> options) : DbContext(options)
{
public DbSet<Product> Products { get; set; }
public DbSet<SyncState> SyncStates { get; set; }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.Entity<Product>().HasKey(p => p.Id);
modelBuilder.Entity<Product>().Property(p => p.Name).IsRequired().HasMaxLength(200);
modelBuilder.Entity<Product>().HasKey(x => x.Id);
modelBuilder.Entity<Product>().Property(x => x.Name).IsRequired().HasMaxLength(512);
modelBuilder.Entity<SyncState>().HasKey((x => x.Entity));
}
}