From 08819c6738a4f82ccf07ae5ed60835b087f7bb34 Mon Sep 17 00:00:00 2001 From: HombreLaser Date: Sun, 6 Nov 2022 02:10:44 -0600 Subject: Añadidos grupos y usuarios MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Migrations/20221106061015_ConfigureManyToMany.cs | 47 ++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 Migrations/20221106061015_ConfigureManyToMany.cs (limited to 'Migrations/20221106061015_ConfigureManyToMany.cs') diff --git a/Migrations/20221106061015_ConfigureManyToMany.cs b/Migrations/20221106061015_ConfigureManyToMany.cs new file mode 100644 index 0000000..9300ac2 --- /dev/null +++ b/Migrations/20221106061015_ConfigureManyToMany.cs @@ -0,0 +1,47 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace LibraryAPI.Migrations +{ + public partial class ConfigureManyToMany : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "GroupUserAccounts", + columns: table => new + { + GroupId = table.Column(type: "bigint", nullable: false), + UserAccountId = table.Column(type: "bigint", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_GroupUserAccounts", x => new { x.UserAccountId, x.GroupId }); + table.ForeignKey( + name: "FK_GroupUserAccounts_Groups_GroupId", + column: x => x.GroupId, + principalTable: "Groups", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_GroupUserAccounts_Users_UserAccountId", + column: x => x.UserAccountId, + principalTable: "Users", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateIndex( + name: "IX_GroupUserAccounts_GroupId", + table: "GroupUserAccounts", + column: "GroupId"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "GroupUserAccounts"); + } + } +} -- cgit v1.2.3