Skip to content

Commit

Permalink
Run Visual Studio code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
romandykyi committed Mar 3, 2024
1 parent 0f1d3d9 commit ed36df3
Show file tree
Hide file tree
Showing 21 changed files with 187 additions and 209 deletions.
1 change: 0 additions & 1 deletion AdvancedTodoList.Core/Mapping/MappingGlobalSettings.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using AdvancedTodoList.Core.Dtos;
using AdvancedTodoList.Core.Models.TodoLists.Members;
using Mapster;
using System.Text.RegularExpressions;

namespace AdvancedTodoList.Core.Mapping;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using AdvancedTodoList.Core.Models.Auth;
using AdvancedTodoList.Core.Models.TodoLists.Members;
using AdvancedTodoList.Core.Models.TodoLists.Members;

namespace AdvancedTodoList.Core.Repositories;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,103 +2,102 @@

#nullable disable

namespace AdvancedTodoList.Infrastructure.Migrations
namespace AdvancedTodoList.Infrastructure.Migrations;

/// <inheritdoc />
public partial class AddMembersAndRolesEntities : Migration
{
/// <inheritdoc />
public partial class AddMembersAndRolesEntities : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "TodoListRoles",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Name = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false),
TodoListId = table.Column<string>(type: "nvarchar(450)", nullable: false),
Permissions_AddItems = table.Column<bool>(type: "bit", nullable: false),
Permissions_AddMembers = table.Column<bool>(type: "bit", nullable: false),
Permissions_AssignRoles = table.Column<bool>(type: "bit", nullable: false),
Permissions_DeleteItems = table.Column<bool>(type: "bit", nullable: false),
Permissions_EditItems = table.Column<bool>(type: "bit", nullable: false),
Permissions_EditRoles = table.Column<bool>(type: "bit", nullable: false),
Permissions_RemoveMembers = table.Column<bool>(type: "bit", nullable: false),
Permissions_SetItemsState = table.Column<bool>(type: "bit", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_TodoListRoles", x => x.Id);
table.ForeignKey(
name: "FK_TodoListRoles_TodoLists_TodoListId",
column: x => x.TodoListId,
principalTable: "TodoLists",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "TodoListRoles",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Name = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false),
TodoListId = table.Column<string>(type: "nvarchar(450)", nullable: false),
Permissions_AddItems = table.Column<bool>(type: "bit", nullable: false),
Permissions_AddMembers = table.Column<bool>(type: "bit", nullable: false),
Permissions_AssignRoles = table.Column<bool>(type: "bit", nullable: false),
Permissions_DeleteItems = table.Column<bool>(type: "bit", nullable: false),
Permissions_EditItems = table.Column<bool>(type: "bit", nullable: false),
Permissions_EditRoles = table.Column<bool>(type: "bit", nullable: false),
Permissions_RemoveMembers = table.Column<bool>(type: "bit", nullable: false),
Permissions_SetItemsState = table.Column<bool>(type: "bit", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_TodoListRoles", x => x.Id);
table.ForeignKey(
name: "FK_TodoListRoles_TodoLists_TodoListId",
column: x => x.TodoListId,
principalTable: "TodoLists",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});

migrationBuilder.CreateTable(
name: "TodoListsMembers",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
UserId = table.Column<string>(type: "nvarchar(450)", nullable: false),
TodoListId = table.Column<string>(type: "nvarchar(450)", nullable: false),
RoleId = table.Column<int>(type: "int", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_TodoListsMembers", x => x.Id);
table.ForeignKey(
name: "FK_TodoListsMembers_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_TodoListsMembers_TodoListRoles_RoleId",
column: x => x.RoleId,
principalTable: "TodoListRoles",
principalColumn: "Id");
table.ForeignKey(
name: "FK_TodoListsMembers_TodoLists_TodoListId",
column: x => x.TodoListId,
principalTable: "TodoLists",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "TodoListsMembers",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
UserId = table.Column<string>(type: "nvarchar(450)", nullable: false),
TodoListId = table.Column<string>(type: "nvarchar(450)", nullable: false),
RoleId = table.Column<int>(type: "int", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_TodoListsMembers", x => x.Id);
table.ForeignKey(
name: "FK_TodoListsMembers_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_TodoListsMembers_TodoListRoles_RoleId",
column: x => x.RoleId,
principalTable: "TodoListRoles",
principalColumn: "Id");
table.ForeignKey(
name: "FK_TodoListsMembers_TodoLists_TodoListId",
column: x => x.TodoListId,
principalTable: "TodoLists",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});

migrationBuilder.CreateIndex(
name: "IX_TodoListRoles_TodoListId",
table: "TodoListRoles",
column: "TodoListId");
migrationBuilder.CreateIndex(
name: "IX_TodoListRoles_TodoListId",
table: "TodoListRoles",
column: "TodoListId");

migrationBuilder.CreateIndex(
name: "IX_TodoListsMembers_RoleId",
table: "TodoListsMembers",
column: "RoleId");
migrationBuilder.CreateIndex(
name: "IX_TodoListsMembers_RoleId",
table: "TodoListsMembers",
column: "RoleId");

migrationBuilder.CreateIndex(
name: "IX_TodoListsMembers_TodoListId",
table: "TodoListsMembers",
column: "TodoListId");
migrationBuilder.CreateIndex(
name: "IX_TodoListsMembers_TodoListId",
table: "TodoListsMembers",
column: "TodoListId");

migrationBuilder.CreateIndex(
name: "IX_TodoListsMembers_UserId",
table: "TodoListsMembers",
column: "UserId");
}
migrationBuilder.CreateIndex(
name: "IX_TodoListsMembers_UserId",
table: "TodoListsMembers",
column: "UserId");
}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "TodoListsMembers");
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "TodoListsMembers");

migrationBuilder.DropTable(
name: "TodoListRoles");
}
}
migrationBuilder.DropTable(
name: "TodoListRoles");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,27 @@

#nullable disable

namespace AdvancedTodoList.Infrastructure.Migrations
namespace AdvancedTodoList.Infrastructure.Migrations;

/// <inheritdoc />
public partial class AddRolePriorityColumn : Migration
{
/// <inheritdoc />
public partial class AddRolePriorityColumn : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "Priority",
table: "TodoListRoles",
type: "int",
nullable: false,
defaultValue: 0);
}
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "Priority",
table: "TodoListRoles",
type: "int",
nullable: false,
defaultValue: 0);
}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Priority",
table: "TodoListRoles");
}
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Priority",
table: "TodoListRoles");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,77 +2,76 @@

#nullable disable

namespace AdvancedTodoList.Infrastructure.Migrations
namespace AdvancedTodoList.Infrastructure.Migrations;

/// <inheritdoc />
public partial class AddListsAndItemsOwners : Migration
{
/// <inheritdoc />
public partial class AddListsAndItemsOwners : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "OwnerId",
table: "TodoLists",
type: "nvarchar(450)",
nullable: true);
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "OwnerId",
table: "TodoLists",
type: "nvarchar(450)",
nullable: true);

migrationBuilder.AddColumn<string>(
name: "OwnerId",
table: "TodoItems",
type: "nvarchar(450)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "OwnerId",
table: "TodoItems",
type: "nvarchar(450)",
nullable: true);

migrationBuilder.CreateIndex(
name: "IX_TodoLists_OwnerId",
table: "TodoLists",
column: "OwnerId");
migrationBuilder.CreateIndex(
name: "IX_TodoLists_OwnerId",
table: "TodoLists",
column: "OwnerId");

migrationBuilder.CreateIndex(
name: "IX_TodoItems_OwnerId",
table: "TodoItems",
column: "OwnerId");
migrationBuilder.CreateIndex(
name: "IX_TodoItems_OwnerId",
table: "TodoItems",
column: "OwnerId");

migrationBuilder.AddForeignKey(
name: "FK_TodoItems_AspNetUsers_OwnerId",
table: "TodoItems",
column: "OwnerId",
principalTable: "AspNetUsers",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_TodoItems_AspNetUsers_OwnerId",
table: "TodoItems",
column: "OwnerId",
principalTable: "AspNetUsers",
principalColumn: "Id");

migrationBuilder.AddForeignKey(
name: "FK_TodoLists_AspNetUsers_OwnerId",
table: "TodoLists",
column: "OwnerId",
principalTable: "AspNetUsers",
principalColumn: "Id");
}
migrationBuilder.AddForeignKey(
name: "FK_TodoLists_AspNetUsers_OwnerId",
table: "TodoLists",
column: "OwnerId",
principalTable: "AspNetUsers",
principalColumn: "Id");
}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_TodoItems_AspNetUsers_OwnerId",
table: "TodoItems");
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_TodoItems_AspNetUsers_OwnerId",
table: "TodoItems");

migrationBuilder.DropForeignKey(
name: "FK_TodoLists_AspNetUsers_OwnerId",
table: "TodoLists");
migrationBuilder.DropForeignKey(
name: "FK_TodoLists_AspNetUsers_OwnerId",
table: "TodoLists");

migrationBuilder.DropIndex(
name: "IX_TodoLists_OwnerId",
table: "TodoLists");
migrationBuilder.DropIndex(
name: "IX_TodoLists_OwnerId",
table: "TodoLists");

migrationBuilder.DropIndex(
name: "IX_TodoItems_OwnerId",
table: "TodoItems");
migrationBuilder.DropIndex(
name: "IX_TodoItems_OwnerId",
table: "TodoItems");

migrationBuilder.DropColumn(
name: "OwnerId",
table: "TodoLists");
migrationBuilder.DropColumn(
name: "OwnerId",
table: "TodoLists");

migrationBuilder.DropColumn(
name: "OwnerId",
table: "TodoItems");
}
}
migrationBuilder.DropColumn(
name: "OwnerId",
table: "TodoItems");
}
}
Loading

0 comments on commit ed36df3

Please sign in to comment.