diff --git a/DAL/DAL.FileSharing/_Migrations/20241029213105_UpdateItemsAndLinksOwner.Designer.cs b/DAL/DAL.FileSharing/_Migrations/20241029213105_UpdateItemsAndLinksOwner.Designer.cs new file mode 100644 index 0000000..3562ed5 --- /dev/null +++ b/DAL/DAL.FileSharing/_Migrations/20241029213105_UpdateItemsAndLinksOwner.Designer.cs @@ -0,0 +1,611 @@ +// +using System; +using DAL.FileSharing.EFStructures; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace DAL.FileSharing._Migrations +{ + [DbContext(typeof(ApplicationDBContext))] + [Migration("20241029213105_UpdateItemsAndLinksOwner")] + partial class UpdateItemsAndLinksOwner + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "8.0.8") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); + + modelBuilder.Entity("MODELS.FileSharing.Entities.FileItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CreatedAt") + .ValueGeneratedOnAdd() + .HasColumnType("datetime2") + .HasDefaultValueSql("GetDate()"); + + b.Property("Display") + .ValueGeneratedOnAddOrUpdate() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)") + .HasComputedColumnSql("[Name]", true); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsFolder") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Owner") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ParentId") + .HasColumnType("int"); + + b.Property("TimeStamp") + .IsConcurrencyToken() + .IsRequired() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("rowversion"); + + b.Property("ValidFrom") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime2") + .HasColumnName("ValidFrom"); + + b.Property("ValidTo") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime2") + .HasColumnName("ValidTo"); + + b.HasKey("Id"); + + b.HasIndex("Owner"); + + b.HasIndex("ParentId"); + + b.HasIndex(new[] { "Name", "ParentId" }, "IX_Items_Path") + .IsUnique() + .HasFilter("[ParentId] IS NOT NULL"); + + b.ToTable("FileItems", "dbo"); + + b.ToTable(tb => tb.IsTemporal(ttb => + { + ttb.UseHistoryTable("FileItemsAudit"); + ttb + .HasPeriodStart("ValidFrom") + .HasColumnName("ValidFrom"); + ttb + .HasPeriodEnd("ValidTo") + .HasColumnName("ValidTo"); + })); + }); + + modelBuilder.Entity("MODELS.FileSharing.Entities.Link", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CreatedAt") + .ValueGeneratedOnAdd() + .HasColumnType("datetime2") + .HasDefaultValueSql("GetDate()"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Display") + .ValueGeneratedOnAddOrUpdate() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)") + .HasComputedColumnSql("[Name]", true); + + b.Property("FileItemId") + .HasColumnType("int"); + + b.Property("IsActive") + .HasColumnType("bit"); + + b.Property("LastChanged") + .HasColumnType("datetime2"); + + b.Property("Name") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Owner") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("TimeStamp") + .IsConcurrencyToken() + .IsRequired() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("rowversion"); + + b.Property("Url") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ValidFrom") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime2") + .HasColumnName("ValidFrom"); + + b.Property("ValidTo") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime2") + .HasColumnName("ValidTo"); + + b.Property("ValidUntil") + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.HasIndex("FileItemId"); + + b.HasIndex("Owner"); + + b.HasIndex(new[] { "Url" }, "IX_Links_Url") + .IsUnique(); + + b.ToTable("Links", "dbo"); + + b.ToTable(tb => tb.IsTemporal(ttb => + { + ttb.UseHistoryTable("LinksAudit"); + ttb + .HasPeriodStart("ValidFrom") + .HasColumnName("ValidFrom"); + ttb + .HasPeriodEnd("ValidTo") + .HasColumnName("ValidTo"); + })); + }); + + modelBuilder.Entity("MODELS.FileSharing.Entities.SeriLogEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ActionName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ApplicationName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Exception") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("FilePath") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Level") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("LineNumber") + .HasColumnType("int"); + + b.Property("LogEvent") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("MachineName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("MemberName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Message") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("MessageTemplate") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Properties") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("Xml"); + + b.Property("RequestPath") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("SourceContext") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("TimeStamp") + .ValueGeneratedOnAdd() + .HasColumnType("datetime2") + .HasDefaultValueSql("GetDate()"); + + b.HasKey("Id"); + + b.ToTable("SeriLogs", "Logging"); + }); + + modelBuilder.Entity("MODELS.FileSharing.Entities.User", b => + { + b.Property("Id") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("AccessFailedCount") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Email") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("EmailConfirmed") + .HasColumnType("bit"); + + b.Property("LockoutEnabled") + .HasColumnType("bit"); + + b.Property("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property("NormalizedEmail") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedUserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("PasswordHash") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("PhoneNumber") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("PhoneNumberConfirmed") + .HasColumnType("bit"); + + b.Property("SecurityStamp") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("TwoFactorEnabled") + .HasColumnType("bit"); + + b.Property("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", "identity"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => + { + b.Property("Id") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Name") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasDatabaseName("RoleNameIndex") + .HasFilter("[NormalizedName] IS NOT NULL"); + + b.ToTable("Roles", "identity"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ClaimType") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ClaimValue") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("RoleId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("RoleClaims", "identity"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ClaimType") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ClaimValue") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("UserId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("UserClaims", "identity"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ProviderKey") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ProviderDisplayName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("UserId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("UserLogins", "identity"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("RoleId") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("UserRoles", "identity"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("LoginProvider") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Name") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Value") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("UserTokens", "identity"); + }); + + modelBuilder.Entity("MODELS.FileSharing.Entities.FileItem", b => + { + b.HasOne("MODELS.FileSharing.Entities.User", "OwnerNavigation") + .WithMany("FileItems") + .HasForeignKey("Owner") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired() + .HasConstraintName("FK_FileItems_User"); + + b.HasOne("MODELS.FileSharing.Entities.FileItem", "ParentNavigation") + .WithMany("FileItems") + .HasForeignKey("ParentId") + .OnDelete(DeleteBehavior.ClientNoAction) + .HasConstraintName("FK_FileItems_Parents"); + + b.Navigation("OwnerNavigation"); + + b.Navigation("ParentNavigation"); + }); + + modelBuilder.Entity("MODELS.FileSharing.Entities.Link", b => + { + b.HasOne("MODELS.FileSharing.Entities.FileItem", "FileItemNavigation") + .WithMany("Links") + .HasForeignKey("FileItemId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("FK_Links_FileItem"); + + b.HasOne("MODELS.FileSharing.Entities.User", "OwnerNavigation") + .WithMany("Links") + .HasForeignKey("Owner") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("FK_Links_User"); + + b.Navigation("FileItemNavigation"); + + b.Navigation("OwnerNavigation"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.HasOne("MODELS.FileSharing.Entities.User", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("MODELS.FileSharing.Entities.User", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("MODELS.FileSharing.Entities.User", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.HasOne("MODELS.FileSharing.Entities.User", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("MODELS.FileSharing.Entities.FileItem", b => + { + b.Navigation("FileItems"); + + b.Navigation("Links"); + }); + + modelBuilder.Entity("MODELS.FileSharing.Entities.User", b => + { + b.Navigation("FileItems"); + + b.Navigation("Links"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/DAL/DAL.FileSharing/_Migrations/20241029213105_UpdateItemsAndLinksOwner.cs b/DAL/DAL.FileSharing/_Migrations/20241029213105_UpdateItemsAndLinksOwner.cs new file mode 100644 index 0000000..8fd846a --- /dev/null +++ b/DAL/DAL.FileSharing/_Migrations/20241029213105_UpdateItemsAndLinksOwner.cs @@ -0,0 +1,102 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace DAL.FileSharing._Migrations +{ + /// + public partial class UpdateItemsAndLinksOwner : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.RenameColumn( + name: "UserId", + schema: "dbo", + table: "Links", + newName: "Owner") + .Annotation("SqlServer:IsTemporal", true) + .Annotation("SqlServer:TemporalHistoryTableName", "LinksAudit") + .Annotation("SqlServer:TemporalHistoryTableSchema", "dbo") + .Annotation("SqlServer:TemporalPeriodEndColumnName", "ValidTo") + .Annotation("SqlServer:TemporalPeriodStartColumnName", "ValidFrom"); + + migrationBuilder.RenameIndex( + name: "IX_Links_UserId", + schema: "dbo", + table: "Links", + newName: "IX_Links_Owner"); + + migrationBuilder.AddColumn( + name: "Owner", + schema: "dbo", + table: "FileItems", + type: "nvarchar(200)", + maxLength: 200, + nullable: false, + defaultValue: "") + .Annotation("SqlServer:IsTemporal", true) + .Annotation("SqlServer:TemporalHistoryTableName", "FileItemsAudit") + .Annotation("SqlServer:TemporalHistoryTableSchema", "dbo") + .Annotation("SqlServer:TemporalPeriodEndColumnName", "ValidTo") + .Annotation("SqlServer:TemporalPeriodStartColumnName", "ValidFrom"); + + migrationBuilder.CreateIndex( + name: "IX_FileItems_Owner", + schema: "dbo", + table: "FileItems", + column: "Owner"); + + migrationBuilder.AddForeignKey( + name: "FK_FileItems_User", + schema: "dbo", + table: "FileItems", + column: "Owner", + principalSchema: "identity", + principalTable: "Users", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_FileItems_User", + schema: "dbo", + table: "FileItems"); + + migrationBuilder.DropIndex( + name: "IX_FileItems_Owner", + schema: "dbo", + table: "FileItems"); + + migrationBuilder.DropColumn( + name: "Owner", + schema: "dbo", + table: "FileItems") + .Annotation("SqlServer:IsTemporal", true) + .Annotation("SqlServer:TemporalHistoryTableName", "FileItemsAudit") + .Annotation("SqlServer:TemporalHistoryTableSchema", "dbo") + .Annotation("SqlServer:TemporalPeriodEndColumnName", "ValidTo") + .Annotation("SqlServer:TemporalPeriodStartColumnName", "ValidFrom"); + + migrationBuilder.RenameColumn( + name: "Owner", + schema: "dbo", + table: "Links", + newName: "UserId") + .Annotation("SqlServer:IsTemporal", true) + .Annotation("SqlServer:TemporalHistoryTableName", "LinksAudit") + .Annotation("SqlServer:TemporalHistoryTableSchema", "dbo") + .Annotation("SqlServer:TemporalPeriodEndColumnName", "ValidTo") + .Annotation("SqlServer:TemporalPeriodStartColumnName", "ValidFrom"); + + migrationBuilder.RenameIndex( + name: "IX_Links_Owner", + schema: "dbo", + table: "Links", + newName: "IX_Links_UserId"); + } + } +} diff --git a/DAL/DAL.FileSharing/_Migrations/ApplicationDBContextModelSnapshot.cs b/DAL/DAL.FileSharing/_Migrations/ApplicationDBContextModelSnapshot.cs index 0c179d9..6b70787 100644 --- a/DAL/DAL.FileSharing/_Migrations/ApplicationDBContextModelSnapshot.cs +++ b/DAL/DAL.FileSharing/_Migrations/ApplicationDBContextModelSnapshot.cs @@ -54,6 +54,11 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasMaxLength(200) .HasColumnType("nvarchar(200)"); + b.Property("Owner") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + b.Property("ParentId") .HasColumnType("int"); @@ -75,6 +80,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); + b.HasIndex("Owner"); + b.HasIndex("ParentId"); b.HasIndex(new[] { "Name", "ParentId" }, "IX_Items_Path") @@ -131,6 +138,11 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasMaxLength(200) .HasColumnType("nvarchar(200)"); + b.Property("Owner") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + b.Property("TimeStamp") .IsConcurrencyToken() .IsRequired() @@ -142,11 +154,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasMaxLength(200) .HasColumnType("nvarchar(200)"); - b.Property("UserId") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - b.Property("ValidFrom") .ValueGeneratedOnAddOrUpdate() .HasColumnType("datetime2") @@ -164,7 +171,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("FileItemId"); - b.HasIndex("UserId"); + b.HasIndex("Owner"); b.HasIndex(new[] { "Url" }, "IX_Links_Url") .IsUnique(); @@ -492,12 +499,21 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("MODELS.FileSharing.Entities.FileItem", b => { + b.HasOne("MODELS.FileSharing.Entities.User", "OwnerNavigation") + .WithMany("FileItems") + .HasForeignKey("Owner") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired() + .HasConstraintName("FK_FileItems_User"); + b.HasOne("MODELS.FileSharing.Entities.FileItem", "ParentNavigation") .WithMany("FileItems") .HasForeignKey("ParentId") .OnDelete(DeleteBehavior.ClientNoAction) .HasConstraintName("FK_FileItems_Parents"); + b.Navigation("OwnerNavigation"); + b.Navigation("ParentNavigation"); }); @@ -510,16 +526,16 @@ protected override void BuildModel(ModelBuilder modelBuilder) .IsRequired() .HasConstraintName("FK_Links_FileItem"); - b.HasOne("MODELS.FileSharing.Entities.User", "UserNavigation") + b.HasOne("MODELS.FileSharing.Entities.User", "OwnerNavigation") .WithMany("Links") - .HasForeignKey("UserId") + .HasForeignKey("Owner") .OnDelete(DeleteBehavior.Cascade) .IsRequired() .HasConstraintName("FK_Links_User"); b.Navigation("FileItemNavigation"); - b.Navigation("UserNavigation"); + b.Navigation("OwnerNavigation"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => @@ -582,6 +598,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("MODELS.FileSharing.Entities.User", b => { + b.Navigation("FileItems"); + b.Navigation("Links"); }); #pragma warning restore 612, 618