diff --git a/Knots/Migrations/20260610224254_RemoveDiscussionFromGroup.cs b/Knots/Migrations/20260610224254_RemoveDiscussionFromGroup.cs deleted file mode 100644 index f1b949e..0000000 --- a/Knots/Migrations/20260610224254_RemoveDiscussionFromGroup.cs +++ /dev/null @@ -1,160 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Knots.Migrations -{ - /// - public partial class RemoveDiscussionFromGroup : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Groups_Discussions_DiscussionId", - table: "Groups"); - - migrationBuilder.DropForeignKey( - name: "FK_UserDiscussions_Users_UserId", - table: "UserDiscussions"); - - migrationBuilder.DropIndex( - name: "IX_Groups_DiscussionId", - table: "Groups"); - - migrationBuilder.DropColumn( - name: "DiscussionId", - table: "Groups"); - - migrationBuilder.DropColumn( - name: "KeyId", - table: "Groups"); - - migrationBuilder.AddColumn( - name: "GroupId", - table: "Discussions", - type: "int", - nullable: true); - - migrationBuilder.CreateTable( - name: "GroupUsers", - columns: table => new - { - GroupId = table.Column(type: "int", nullable: false), - UserId = table.Column(type: "int", nullable: false), - RoleId = table.Column(type: "int", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_GroupUsers", x => new { x.GroupId, x.UserId }); - table.ForeignKey( - name: "FK_GroupUsers_Groups_GroupId", - column: x => x.GroupId, - principalTable: "Groups", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_GroupUsers_Roles_RoleId", - column: x => x.RoleId, - principalTable: "Roles", - principalColumn: "Id"); - table.ForeignKey( - name: "FK_GroupUsers_Users_UserId", - column: x => x.UserId, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateIndex( - name: "IX_Discussions_GroupId", - table: "Discussions", - column: "GroupId"); - - migrationBuilder.CreateIndex( - name: "IX_GroupUsers_RoleId", - table: "GroupUsers", - column: "RoleId"); - - migrationBuilder.CreateIndex( - name: "IX_GroupUsers_UserId", - table: "GroupUsers", - column: "UserId"); - - migrationBuilder.AddForeignKey( - name: "FK_Discussions_Groups_GroupId", - table: "Discussions", - column: "GroupId", - principalTable: "Groups", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - - migrationBuilder.AddForeignKey( - name: "FK_UserDiscussions_Users_UserId", - table: "UserDiscussions", - column: "UserId", - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Discussions_Groups_GroupId", - table: "Discussions"); - - migrationBuilder.DropForeignKey( - name: "FK_UserDiscussions_Users_UserId", - table: "UserDiscussions"); - - migrationBuilder.DropTable( - name: "GroupUsers"); - - migrationBuilder.DropIndex( - name: "IX_Discussions_GroupId", - table: "Discussions"); - - migrationBuilder.DropColumn( - name: "GroupId", - table: "Discussions"); - - migrationBuilder.AddColumn( - name: "DiscussionId", - table: "Groups", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "KeyId", - table: "Groups", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.CreateIndex( - name: "IX_Groups_DiscussionId", - table: "Groups", - column: "DiscussionId", - unique: true); - - migrationBuilder.AddForeignKey( - name: "FK_Groups_Discussions_DiscussionId", - table: "Groups", - column: "DiscussionId", - principalTable: "Discussions", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_UserDiscussions_Users_UserId", - table: "UserDiscussions", - column: "UserId", - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - } - } -} diff --git a/Knots/Migrations/20260610224254_RemoveDiscussionFromGroup.Designer.cs b/Knots/Migrations/20260610224937_FixGroupDiscussion.Designer.cs similarity index 94% rename from Knots/Migrations/20260610224254_RemoveDiscussionFromGroup.Designer.cs rename to Knots/Migrations/20260610224937_FixGroupDiscussion.Designer.cs index 6529e68..ddfe896 100644 --- a/Knots/Migrations/20260610224254_RemoveDiscussionFromGroup.Designer.cs +++ b/Knots/Migrations/20260610224937_FixGroupDiscussion.Designer.cs @@ -12,8 +12,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace Knots.Migrations { [DbContext(typeof(KnotsDbContext))] - [Migration("20260610224254_RemoveDiscussionFromGroup")] - partial class RemoveDiscussionFromGroup + [Migration("20260610224937_FixGroupDiscussion")] + partial class FixGroupDiscussion { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -57,6 +57,9 @@ namespace Knots.Migrations SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + b.Property("DiscussionId") + .HasColumnType("int"); + b.Property("MembersAmount") .HasColumnType("int"); @@ -70,6 +73,8 @@ namespace Knots.Migrations b.HasKey("Id"); + b.HasIndex("DiscussionId"); + b.ToTable("Groups"); }); @@ -119,6 +124,9 @@ namespace Knots.Migrations SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + b.Property("AuthorId") + .HasColumnType("int"); + b.Property("Contenu") .IsRequired() .HasMaxLength(1000) @@ -241,6 +249,17 @@ namespace Knots.Migrations b.Navigation("Group"); }); + modelBuilder.Entity("Knots.Models.Group", b => + { + b.HasOne("Knots.Models.Discussion", "Discussion") + .WithMany() + .HasForeignKey("DiscussionId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Discussion"); + }); + modelBuilder.Entity("Knots.Models.GroupUser", b => { b.HasOne("Knots.Models.Group", "Group") diff --git a/Knots/Migrations/20260610224937_FixGroupDiscussion.cs b/Knots/Migrations/20260610224937_FixGroupDiscussion.cs new file mode 100644 index 0000000..3b64786 --- /dev/null +++ b/Knots/Migrations/20260610224937_FixGroupDiscussion.cs @@ -0,0 +1,21 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Knots.Migrations +{ + /// + public partial class FixGroupDiscussion : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "AuthorId", + table: "Messages", + type: "int", + nullable: false, + defaultValue: 0); + } + + } +} diff --git a/Knots/Migrations/KnotsDbContextModelSnapshot.cs b/Knots/Migrations/KnotsDbContextModelSnapshot.cs index 091c06e..ba31ee3 100644 --- a/Knots/Migrations/KnotsDbContextModelSnapshot.cs +++ b/Knots/Migrations/KnotsDbContextModelSnapshot.cs @@ -54,6 +54,9 @@ namespace Knots.Migrations SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + b.Property("DiscussionId") + .HasColumnType("int"); + b.Property("MembersAmount") .HasColumnType("int"); @@ -67,6 +70,8 @@ namespace Knots.Migrations b.HasKey("Id"); + b.HasIndex("DiscussionId"); + b.ToTable("Groups"); }); @@ -116,6 +121,9 @@ namespace Knots.Migrations SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + b.Property("AuthorId") + .HasColumnType("int"); + b.Property("Contenu") .IsRequired() .HasMaxLength(1000) @@ -238,6 +246,17 @@ namespace Knots.Migrations b.Navigation("Group"); }); + modelBuilder.Entity("Knots.Models.Group", b => + { + b.HasOne("Knots.Models.Discussion", "Discussion") + .WithMany() + .HasForeignKey("DiscussionId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Discussion"); + }); + modelBuilder.Entity("Knots.Models.GroupUser", b => { b.HasOne("Knots.Models.Group", "Group") diff --git a/Knots/bin/Debug/net8.0/Knots.dll b/Knots/bin/Debug/net8.0/Knots.dll index ba7ec4c..94203fd 100644 Binary files a/Knots/bin/Debug/net8.0/Knots.dll and b/Knots/bin/Debug/net8.0/Knots.dll differ diff --git a/Knots/bin/Debug/net8.0/Knots.exe b/Knots/bin/Debug/net8.0/Knots.exe index ed5d014..eeb4ee1 100644 Binary files a/Knots/bin/Debug/net8.0/Knots.exe and b/Knots/bin/Debug/net8.0/Knots.exe differ diff --git a/Knots/bin/Debug/net8.0/Knots.pdb b/Knots/bin/Debug/net8.0/Knots.pdb index 3c9398e..97574ec 100644 Binary files a/Knots/bin/Debug/net8.0/Knots.pdb and b/Knots/bin/Debug/net8.0/Knots.pdb differ diff --git a/Knots/obj/Debug/net8.0/Knots.AssemblyInfo.cs b/Knots/obj/Debug/net8.0/Knots.AssemblyInfo.cs index 4243247..41493c7 100644 --- a/Knots/obj/Debug/net8.0/Knots.AssemblyInfo.cs +++ b/Knots/obj/Debug/net8.0/Knots.AssemblyInfo.cs @@ -13,7 +13,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("Knots")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+4f994ba183ab4a079dd7e762d3b7cacca26f8f75")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+4e06dc5f235e9c9c699b247eb56dccf3eeed81f8")] [assembly: System.Reflection.AssemblyProductAttribute("Knots")] [assembly: System.Reflection.AssemblyTitleAttribute("Knots")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/Knots/obj/Debug/net8.0/Knots.AssemblyInfoInputs.cache b/Knots/obj/Debug/net8.0/Knots.AssemblyInfoInputs.cache index e2541b2..d24a3eb 100644 --- a/Knots/obj/Debug/net8.0/Knots.AssemblyInfoInputs.cache +++ b/Knots/obj/Debug/net8.0/Knots.AssemblyInfoInputs.cache @@ -1 +1 @@ -aa1c1119a88f3e3b5738f6ea6f67686474d5c6d7e7b2612859a07f3ee65ef199 +45989a1b023b2a60770db7a1baceef9c56c487cca0e44ae9d0d75cdde668b8cc diff --git a/Knots/obj/Debug/net8.0/Knots.csproj.CoreCompileInputs.cache b/Knots/obj/Debug/net8.0/Knots.csproj.CoreCompileInputs.cache index 6e6fa9a..6fdabe8 100644 --- a/Knots/obj/Debug/net8.0/Knots.csproj.CoreCompileInputs.cache +++ b/Knots/obj/Debug/net8.0/Knots.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -bab9e1ed6ec5ae3422f4377cfa8a1795b3c9881cbfdada74a84426e15b5819ff +1afb5c57f375954b5501d52f6ccbfcdd0c9a4a7d75abca85439c878c12264607 diff --git a/Knots/obj/Debug/net8.0/Knots.csproj.FileListAbsolute.txt b/Knots/obj/Debug/net8.0/Knots.csproj.FileListAbsolute.txt index 178a047..702bcdf 100644 --- a/Knots/obj/Debug/net8.0/Knots.csproj.FileListAbsolute.txt +++ b/Knots/obj/Debug/net8.0/Knots.csproj.FileListAbsolute.txt @@ -519,3 +519,4 @@ C:\Users\dogge\RiderProjects\Knots\Knots\obj\Debug\net8.0\Knots.pdb C:\Users\dogge\RiderProjects\Knots\Knots\obj\Debug\net8.0\Knots.genruntimeconfig.cache C:\Users\dogge\RiderProjects\Knots\Knots\obj\Debug\net8.0\ref\Knots.dll C:\Users\dogge\RiderProjects\Knots\Knots\bin\Debug\net8.0\System.Net.WebSockets.WebSocketProtocol.dll +C:\Users\Carte\RiderProjects\Knots\Knots\bin\Debug\net8.0\System.Net.WebSockets.WebSocketProtocol.dll diff --git a/Knots/obj/Debug/net8.0/Knots.dll b/Knots/obj/Debug/net8.0/Knots.dll index ba7ec4c..94203fd 100644 Binary files a/Knots/obj/Debug/net8.0/Knots.dll and b/Knots/obj/Debug/net8.0/Knots.dll differ diff --git a/Knots/obj/Debug/net8.0/Knots.pdb b/Knots/obj/Debug/net8.0/Knots.pdb index 3c9398e..97574ec 100644 Binary files a/Knots/obj/Debug/net8.0/Knots.pdb and b/Knots/obj/Debug/net8.0/Knots.pdb differ diff --git a/Knots/obj/Debug/net8.0/apphost.exe b/Knots/obj/Debug/net8.0/apphost.exe index ed5d014..eeb4ee1 100644 Binary files a/Knots/obj/Debug/net8.0/apphost.exe and b/Knots/obj/Debug/net8.0/apphost.exe differ diff --git a/Knots/obj/Debug/net8.0/ref/Knots.dll b/Knots/obj/Debug/net8.0/ref/Knots.dll index 5e72baf..ff20eee 100644 Binary files a/Knots/obj/Debug/net8.0/ref/Knots.dll and b/Knots/obj/Debug/net8.0/ref/Knots.dll differ diff --git a/Knots/obj/Debug/net8.0/refint/Knots.dll b/Knots/obj/Debug/net8.0/refint/Knots.dll index 5e72baf..ff20eee 100644 Binary files a/Knots/obj/Debug/net8.0/refint/Knots.dll and b/Knots/obj/Debug/net8.0/refint/Knots.dll differ