feat(dal): таблицы Users, Roles

This commit is contained in:
Mikhail Trubnikov
2023-12-01 10:05:54 +10:00
parent e00826c398
commit 78f2310199
12 changed files with 6111 additions and 5 deletions

View File

@@ -2079,6 +2079,44 @@ namespace PARR.DAL.Migrations
});
});
modelBuilder.Entity("PARR.DAL.Models.Role", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<DateTimeOffset>("DateCreated")
.HasColumnType("timestamp with time zone");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("Roles");
b.HasData(
new
{
Id = new Guid("c8f2f144-e6c2-45d7-ba66-5e9bbd376376"),
DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)),
Description = "Администратор",
Name = "administrator"
},
new
{
Id = new Guid("13bca225-7fa4-42fa-9d80-d2d46de261fe"),
DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)),
Description = "Робот ЕСПП",
Name = "espp-robot"
});
});
modelBuilder.Entity("PARR.DAL.Models.Setting", b =>
{
b.Property<string>("Name")
@@ -2301,6 +2339,49 @@ namespace PARR.DAL.Migrations
b.ToTable("Tnks");
});
modelBuilder.Entity("PARR.DAL.Models.User", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<DateTimeOffset>("DateCreated")
.HasColumnType("timestamp with time zone");
b.Property<string>("Description")
.HasColumnType("text");
b.Property<string>("Ip")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("Ip")
.IsUnique();
b.ToTable("Users");
});
modelBuilder.Entity("PARR.DAL.Models.UsersInRole", b =>
{
b.Property<Guid>("RoleId")
.HasColumnType("uuid");
b.Property<Guid>("UserId")
.HasColumnType("uuid");
b.HasKey("RoleId", "UserId");
b.HasIndex("UserId");
b.ToTable("UsersInRoles");
});
modelBuilder.Entity("PARR.DAL.Models.Work", b =>
{
b.Property<Guid>("Id")
@@ -2606,6 +2687,25 @@ namespace PARR.DAL.Migrations
b.Navigation("Subprocess");
});
modelBuilder.Entity("PARR.DAL.Models.UsersInRole", b =>
{
b.HasOne("PARR.DAL.Models.Role", "Role")
.WithMany("Users")
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("PARR.DAL.Models.User", "User")
.WithMany("Roles")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Role");
b.Navigation("User");
});
modelBuilder.Entity("PARR.DAL.Models.Work", b =>
{
b.HasOne("PARR.DAL.Models.Tnk", "Tnk")
@@ -2717,6 +2817,11 @@ namespace PARR.DAL.Migrations
b.Navigation("RobotConfigurations");
});
modelBuilder.Entity("PARR.DAL.Models.Role", b =>
{
b.Navigation("Users");
});
modelBuilder.Entity("PARR.DAL.Models.Subprocess", b =>
{
b.Navigation("Tnks");
@@ -2743,6 +2848,11 @@ namespace PARR.DAL.Migrations
b.Navigation("Works");
});
modelBuilder.Entity("PARR.DAL.Models.User", b =>
{
b.Navigation("Roles");
});
modelBuilder.Entity("PARR.DAL.Models.Work", b =>
{
b.Navigation("ApplicationsInWorks");