summaryrefslogtreecommitdiff
path: root/Migrations/20221106061015_ConfigureManyToMany.cs
diff options
context:
space:
mode:
authorHombreLaser <sebastian-440@live.com>2022-11-06 02:10:44 -0600
committerHombreLaser <sebastian-440@live.com>2022-11-06 02:10:44 -0600
commit08819c6738a4f82ccf07ae5ed60835b087f7bb34 (patch)
tree9c0c77626587136d41002769fb5a030e1be2f5b8 /Migrations/20221106061015_ConfigureManyToMany.cs
parentf060c4f88f635af3295ea7652cbbbd08dbf1c6cf (diff)
Añadidos grupos y usuarios
Diffstat (limited to 'Migrations/20221106061015_ConfigureManyToMany.cs')
-rw-r--r--Migrations/20221106061015_ConfigureManyToMany.cs47
1 files changed, 47 insertions, 0 deletions
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<long>(type: "bigint", nullable: false),
+ UserAccountId = table.Column<long>(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");
+ }
+ }
+}