adding migration for person photo
This commit is contained in:
@@ -21,8 +21,8 @@ namespace FamilyTreeAPI.Models
|
||||
public virtual DbSet<RelationShip> RelationShips { get; set; } = null!;
|
||||
public virtual DbSet<Lookup> Lookups { get; set; } = null!;
|
||||
public virtual DbSet<staff> staff { get; set; } = null!;
|
||||
public virtual DbSet<PersonPhoto> PersonPhotos { get; set; } = null!;
|
||||
|
||||
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
@@ -74,6 +74,18 @@ namespace FamilyTreeAPI.Models
|
||||
|
||||
});
|
||||
|
||||
modelBuilder.Entity<PersonPhoto>(entity =>
|
||||
{
|
||||
entity.ToTable("personphoto");
|
||||
|
||||
entity.Property(e => e.Id).HasColumnName("id");
|
||||
entity.Property(e => e.PersonId).HasColumnName("personid");
|
||||
entity.Property(e => e.Photo).HasColumnName("photo");
|
||||
entity.Property(e => e.ImagePhoto).HasColumnName("imagephot"); //try to store binary in table. "bytea"
|
||||
|
||||
});
|
||||
|
||||
|
||||
modelBuilder.Entity<Lookup>(entity =>
|
||||
{
|
||||
entity.ToTable("lookup");
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
namespace FamilyTreeAPI.Models
|
||||
{
|
||||
public class PersonPhoto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
public int PersonId { get; set; }
|
||||
public string Photo { get; set; }
|
||||
|
||||
public byte[] ImagePhoto { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user