292 lines
9.7 KiB
C#
292 lines
9.7 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
using app.Data;
|
|
|
|
namespace app.Data.Migrations
|
|
{
|
|
[DbContext(typeof(DatabaseContext))]
|
|
[Migration("20210220140309_2021_03_14")]
|
|
partial class _2021_03_14
|
|
{
|
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasAnnotation("ProductVersion", "3.1.9")
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
|
|
|
modelBuilder.Entity("app.Model.AuthUser", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<int>("AuthRole")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("ConfirmationId")
|
|
.HasColumnType("varchar(255) CHARACTER SET utf8mb4");
|
|
|
|
b.Property<DateTimeOffset>("CreatedOn")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("EMail")
|
|
.HasColumnType("varchar(255) CHARACTER SET utf8mb4");
|
|
|
|
b.Property<string>("FirstName")
|
|
.HasColumnType("longtext CHARACTER SET utf8mb4");
|
|
|
|
b.Property<string>("ForgotPasswordId")
|
|
.HasColumnType("varchar(255) CHARACTER SET utf8mb4");
|
|
|
|
b.Property<DateTimeOffset>("LastModifiedOn")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("LastName")
|
|
.HasColumnType("longtext CHARACTER SET utf8mb4");
|
|
|
|
b.Property<string>("Password")
|
|
.HasColumnType("longtext CHARACTER SET utf8mb4");
|
|
|
|
b.Property<string>("RefreshToken")
|
|
.HasColumnType("longtext CHARACTER SET utf8mb4");
|
|
|
|
b.Property<DateTime>("RefreshTokenExpiryTime")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("ConfirmationId")
|
|
.IsUnique();
|
|
|
|
b.HasIndex("EMail")
|
|
.IsUnique();
|
|
|
|
b.HasIndex("ForgotPasswordId")
|
|
.IsUnique();
|
|
|
|
b.ToTable("AuthUsers");
|
|
});
|
|
|
|
modelBuilder.Entity("app.Model.Domain", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<DateTimeOffset>("CreatedOn")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<DateTimeOffset>("LastModifiedOn")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("Name")
|
|
.HasColumnType("longtext CHARACTER SET utf8mb4");
|
|
|
|
b.Property<bool>("NotifyWhenLogin")
|
|
.HasColumnType("tinyint(1)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("Domains");
|
|
});
|
|
|
|
modelBuilder.Entity("app.Model.Host", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<DateTimeOffset>("CreatedOn")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<long?>("DomainId")
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<byte[]>("IPAddress")
|
|
.HasColumnType("varbinary(1400)")
|
|
.HasMaxLength(1400);
|
|
|
|
b.Property<DateTimeOffset>("LastModifiedOn")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("Name")
|
|
.HasColumnType("varchar(255) CHARACTER SET utf8mb4");
|
|
|
|
b.Property<bool>("NotifyWhenLogin")
|
|
.HasColumnType("tinyint(1)");
|
|
|
|
b.Property<long>("OSId")
|
|
.HasColumnType("bigint");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("DomainId");
|
|
|
|
b.HasIndex("OSId");
|
|
|
|
b.HasIndex("DomainId", "Name")
|
|
.IsUnique();
|
|
|
|
b.HasIndex("IPAddress", "Name")
|
|
.IsUnique();
|
|
|
|
b.ToTable("Hosts");
|
|
});
|
|
|
|
modelBuilder.Entity("app.Model.Login", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<DateTimeOffset>("CreatedOn")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<long>("HostId")
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<DateTimeOffset>("LastModifiedOn")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<DateTimeOffset>("Time")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<long>("UserId")
|
|
.HasColumnType("bigint");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("HostId");
|
|
|
|
b.HasIndex("UserId");
|
|
|
|
b.ToTable("Logins");
|
|
});
|
|
|
|
modelBuilder.Entity("app.Model.OperatingSystem", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<DateTimeOffset>("CreatedOn")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<DateTimeOffset>("LastModifiedOn")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("Name")
|
|
.HasColumnType("varchar(255) CHARACTER SET utf8mb4");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("Name")
|
|
.IsUnique();
|
|
|
|
b.ToTable("OperatingSystems");
|
|
});
|
|
|
|
modelBuilder.Entity("app.Model.User", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<DateTimeOffset>("CreatedOn")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("Discriminator")
|
|
.IsRequired()
|
|
.HasColumnType("longtext CHARACTER SET utf8mb4");
|
|
|
|
b.Property<DateTimeOffset>("LastModifiedOn")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("Name")
|
|
.HasColumnType("longtext CHARACTER SET utf8mb4");
|
|
|
|
b.Property<bool>("NotifyWhenLogin")
|
|
.HasColumnType("tinyint(1)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("Users");
|
|
|
|
b.HasDiscriminator<string>("Discriminator").HasValue("User");
|
|
});
|
|
|
|
modelBuilder.Entity("app.Model.DomainUser", b =>
|
|
{
|
|
b.HasBaseType("app.Model.User");
|
|
|
|
b.Property<long?>("DomainId")
|
|
.HasColumnType("bigint");
|
|
|
|
b.HasIndex("DomainId");
|
|
|
|
b.HasDiscriminator().HasValue("DomainUser");
|
|
});
|
|
|
|
modelBuilder.Entity("app.Model.HostUser", b =>
|
|
{
|
|
b.HasBaseType("app.Model.User");
|
|
|
|
b.Property<long?>("HostId")
|
|
.HasColumnType("bigint");
|
|
|
|
b.HasIndex("HostId");
|
|
|
|
b.HasDiscriminator().HasValue("HostUser");
|
|
});
|
|
|
|
modelBuilder.Entity("app.Model.Host", b =>
|
|
{
|
|
b.HasOne("app.Model.Domain", "Domain")
|
|
.WithMany("Hosts")
|
|
.HasForeignKey("DomainId");
|
|
|
|
b.HasOne("app.Model.OperatingSystem", "OS")
|
|
.WithMany()
|
|
.HasForeignKey("OSId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("app.Model.Login", b =>
|
|
{
|
|
b.HasOne("app.Model.Host", "Host")
|
|
.WithMany("Logins")
|
|
.HasForeignKey("HostId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("app.Model.User", "User")
|
|
.WithMany("Logins")
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("app.Model.DomainUser", b =>
|
|
{
|
|
b.HasOne("app.Model.Domain", "Domain")
|
|
.WithMany("Users")
|
|
.HasForeignKey("DomainId");
|
|
});
|
|
|
|
modelBuilder.Entity("app.Model.HostUser", b =>
|
|
{
|
|
b.HasOne("app.Model.Host", "Host")
|
|
.WithMany("Users")
|
|
.HasForeignKey("HostId");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|