Добавил слой Infrastructure
This commit is contained in:
1 parent
25d617639c
commit
df0e30a1ae
32 files changed
+4139
No files matched your search
@@ -0,0 +1,23 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
using UniVerse.Domain.Entities;
|
||||
|
||||
namespace UniVerse.Infrastructure.Data.Configurations;
|
||||
|
||||
public class AchievementConfiguration : IEntityTypeConfiguration<Achievement>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<Achievement> builder)
|
||||
{
|
||||
builder.ToTable("achievements");
|
||||
|
||||
builder.HasKey(a => a.Id);
|
||||
builder.Property(a => a.Id).HasColumnName("id");
|
||||
builder.Property(a => a.Name).HasColumnName("name").HasMaxLength(255).IsRequired();
|
||||
builder.Property(a => a.Description).HasColumnName("description");
|
||||
builder.Property(a => a.IconUrl).HasColumnName("icon_url").HasMaxLength(500);
|
||||
builder.Property(a => a.XpReward).HasColumnName("xp_reward").HasDefaultValue(0);
|
||||
builder.Property(a => a.CoinReward).HasColumnName("coin_reward").HasDefaultValue(0);
|
||||
builder.Property(a => a.Condition).HasColumnName("condition");
|
||||
builder.Property(a => a.CreatedAt).HasColumnName("created_at").HasDefaultValueSql("NOW()");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user