using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace GeoRitmMover.GeoRitm.Data.EntityConfigurations;
public class SourceMemberEntityConfiguration : IEntityTypeConfiguration<SourceMember>
{
	public void Configure(EntityTypeBuilder<SourceMember> builder)
	{
		_ = builder.ToTable("object_group_members");

		_ = builder.HasKey(x => new
		{
			x.GroupId,
			x.ObjectId,
		});

		_ = builder.Property(x => x.GroupId)
			.HasColumnName("group_id")
			.IsRequired();

		_ = builder.Property(x => x.ObjectId)
			.HasColumnName("object_id")
			.IsRequired();
	}
}
