40 lines
1.1 KiB
C#
40 lines
1.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace administration.Models;
|
|
|
|
public partial class LayoutDataContext : DbContext
|
|
{
|
|
public LayoutDataContext()
|
|
{
|
|
}
|
|
|
|
public LayoutDataContext(DbContextOptions<LayoutDataContext> options)
|
|
: base(options)
|
|
{
|
|
}
|
|
|
|
public virtual DbSet<User> Users { get; set; }
|
|
|
|
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
{
|
|
modelBuilder.Entity<User>(entity =>
|
|
{
|
|
entity.HasKey(e => e.Id).HasName("PK__Users__3214EC0774A20142");
|
|
|
|
entity.HasIndex(e => e.Username, "UX_Users_Username").IsUnique();
|
|
|
|
entity.Property(e => e.CreatedAt).HasDefaultValueSql("(sysdatetimeoffset())");
|
|
entity.Property(e => e.PasswordHash).HasMaxLength(512);
|
|
entity.Property(e => e.ResetToken).HasMaxLength(256);
|
|
entity.Property(e => e.Username).HasMaxLength(100);
|
|
});
|
|
|
|
OnModelCreatingPartial(modelBuilder);
|
|
}
|
|
|
|
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
|
|
}
|