423 lines
14 KiB
C#
423 lines
14 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using Baya.Infrastructure.Persistence;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Metadata;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
using Persistence;
|
|
|
|
#nullable disable
|
|
|
|
namespace Persistence.Migrations
|
|
{
|
|
[DbContext(typeof(ApplicationDbContext))]
|
|
[Migration("20221205084354_AddedOrderAndUserRelation")]
|
|
partial class AddedOrderAndUserRelation
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasAnnotation("ProductVersion", "7.0.0")
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
|
|
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
|
|
|
modelBuilder.Entity("Domain.Entities.Order.Order", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<DateTime>("CreatedTime")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<DateTime?>("ModifiedDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("OrderName")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("UserId")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("UserId");
|
|
|
|
b.ToTable("Orders");
|
|
});
|
|
|
|
modelBuilder.Entity("Domain.Entities.User.Role", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("ConcurrencyStamp")
|
|
.IsConcurrencyToken()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime>("CreatedDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("DisplayName")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Name")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("nvarchar(256)");
|
|
|
|
b.Property<string>("NormalizedName")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("nvarchar(256)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("NormalizedName")
|
|
.IsUnique()
|
|
.HasDatabaseName("RoleNameIndex")
|
|
.HasFilter("[NormalizedName] IS NOT NULL");
|
|
|
|
b.ToTable("Roles", "usr");
|
|
});
|
|
|
|
modelBuilder.Entity("Domain.Entities.User.RoleClaim", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("ClaimType")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("ClaimValue")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime>("CreatedClaim")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<int>("RoleId")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("RoleId");
|
|
|
|
b.ToTable("RoleClaims", "usr");
|
|
});
|
|
|
|
modelBuilder.Entity("Domain.Entities.User.User", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int")
|
|
.HasColumnName("UserId");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("AccessFailedCount")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("ConcurrencyStamp")
|
|
.IsConcurrencyToken()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Email")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("nvarchar(256)");
|
|
|
|
b.Property<bool>("EmailConfirmed")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("FamilyName")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("GeneratedCode")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<bool>("LockoutEnabled")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<DateTimeOffset?>("LockoutEnd")
|
|
.HasColumnType("datetimeoffset");
|
|
|
|
b.Property<string>("Name")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("NormalizedEmail")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("nvarchar(256)");
|
|
|
|
b.Property<string>("NormalizedUserName")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("nvarchar(256)");
|
|
|
|
b.Property<string>("PasswordHash")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("PhoneNumber")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<bool>("PhoneNumberConfirmed")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("SecurityStamp")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<bool>("TwoFactorEnabled")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("UserName")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("nvarchar(256)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("NormalizedEmail")
|
|
.HasDatabaseName("EmailIndex");
|
|
|
|
b.HasIndex("NormalizedUserName")
|
|
.IsUnique()
|
|
.HasDatabaseName("UserNameIndex")
|
|
.HasFilter("[NormalizedUserName] IS NOT NULL");
|
|
|
|
b.ToTable("Users", "usr");
|
|
});
|
|
|
|
modelBuilder.Entity("Domain.Entities.User.UserClaim", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("ClaimType")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("ClaimValue")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("UserId")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("UserId");
|
|
|
|
b.ToTable("UserClaims", "usr");
|
|
});
|
|
|
|
modelBuilder.Entity("Domain.Entities.User.UserLogin", b =>
|
|
{
|
|
b.Property<string>("LoginProvider")
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.Property<string>("ProviderKey")
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.Property<DateTime>("LoggedOn")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("ProviderDisplayName")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("UserId")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("LoginProvider", "ProviderKey");
|
|
|
|
b.HasIndex("UserId");
|
|
|
|
b.ToTable("UserLogins", "usr");
|
|
});
|
|
|
|
modelBuilder.Entity("Domain.Entities.User.UserRefreshToken", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<DateTime>("CreatedTime")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<bool>("IsValid")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<DateTime?>("ModifiedDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<int>("UserId")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("UserId");
|
|
|
|
b.ToTable("UserRefreshTokens", "usr");
|
|
});
|
|
|
|
modelBuilder.Entity("Domain.Entities.User.UserRole", b =>
|
|
{
|
|
b.Property<int>("UserId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("RoleId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedUserRoleDate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.HasKey("UserId", "RoleId");
|
|
|
|
b.HasIndex("RoleId");
|
|
|
|
b.ToTable("UserRoles", "usr");
|
|
});
|
|
|
|
modelBuilder.Entity("Domain.Entities.User.UserToken", b =>
|
|
{
|
|
b.Property<int>("UserId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("LoginProvider")
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.Property<string>("Name")
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.Property<DateTime>("GeneratedTime")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("Value")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("UserId", "LoginProvider", "Name");
|
|
|
|
b.ToTable("UserTokens", "usr");
|
|
});
|
|
|
|
modelBuilder.Entity("Domain.Entities.Order.Order", b =>
|
|
{
|
|
b.HasOne("Domain.Entities.User.User", "User")
|
|
.WithMany("Orders")
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
modelBuilder.Entity("Domain.Entities.User.RoleClaim", b =>
|
|
{
|
|
b.HasOne("Domain.Entities.User.Role", "Role")
|
|
.WithMany("Claims")
|
|
.HasForeignKey("RoleId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Role");
|
|
});
|
|
|
|
modelBuilder.Entity("Domain.Entities.User.UserClaim", b =>
|
|
{
|
|
b.HasOne("Domain.Entities.User.User", "User")
|
|
.WithMany("Claims")
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
modelBuilder.Entity("Domain.Entities.User.UserLogin", b =>
|
|
{
|
|
b.HasOne("Domain.Entities.User.User", "User")
|
|
.WithMany("Logins")
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
modelBuilder.Entity("Domain.Entities.User.UserRefreshToken", b =>
|
|
{
|
|
b.HasOne("Domain.Entities.User.User", "User")
|
|
.WithMany("UserRefreshTokens")
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
modelBuilder.Entity("Domain.Entities.User.UserRole", b =>
|
|
{
|
|
b.HasOne("Domain.Entities.User.Role", "Role")
|
|
.WithMany("Users")
|
|
.HasForeignKey("RoleId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("Domain.Entities.User.User", "User")
|
|
.WithMany("UserRoles")
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Role");
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
modelBuilder.Entity("Domain.Entities.User.UserToken", b =>
|
|
{
|
|
b.HasOne("Domain.Entities.User.User", "User")
|
|
.WithMany("Tokens")
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
modelBuilder.Entity("Domain.Entities.User.Role", b =>
|
|
{
|
|
b.Navigation("Claims");
|
|
|
|
b.Navigation("Users");
|
|
});
|
|
|
|
modelBuilder.Entity("Domain.Entities.User.User", b =>
|
|
{
|
|
b.Navigation("Claims");
|
|
|
|
b.Navigation("Logins");
|
|
|
|
b.Navigation("Orders");
|
|
|
|
b.Navigation("Tokens");
|
|
|
|
b.Navigation("UserRefreshTokens");
|
|
|
|
b.Navigation("UserRoles");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|