From 19b2ab1f6e0ee95d0c17c8091703696679fb4991 Mon Sep 17 00:00:00 2001 From: Rick van Dam Date: Wed, 29 May 2024 22:30:26 +0200 Subject: [PATCH] format code --- .../20240526193731_InitialMigration.cs | 149 +++++++++--------- 1 file changed, 74 insertions(+), 75 deletions(-) diff --git a/CleanAspCore/Data/Migrations/20240526193731_InitialMigration.cs b/CleanAspCore/Data/Migrations/20240526193731_InitialMigration.cs index d5a6741..f6468fd 100644 --- a/CleanAspCore/Data/Migrations/20240526193731_InitialMigration.cs +++ b/CleanAspCore/Data/Migrations/20240526193731_InitialMigration.cs @@ -3,90 +3,89 @@ #nullable disable -namespace CleanAspCore.Migrations +namespace CleanAspCore.Migrations; + +/// +public partial class InitialMigration : Migration { /// - public partial class InitialMigration : Migration + protected override void Up(MigrationBuilder migrationBuilder) { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "Departments", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - Name = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), - City = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Departments", x => x.Id); - }); + migrationBuilder.CreateTable( + name: "Departments", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Name = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), + City = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Departments", x => x.Id); + }); - migrationBuilder.CreateTable( - name: "Jobs", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - Name = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Jobs", x => x.Id); - }); + migrationBuilder.CreateTable( + name: "Jobs", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Name = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Jobs", x => x.Id); + }); - migrationBuilder.CreateTable( - name: "Employees", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - FirstName = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), - LastName = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), - Email = table.Column(type: "nvarchar(max)", nullable: false), - Gender = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), - DepartmentId = table.Column(type: "uniqueidentifier", nullable: false), - JobId = table.Column(type: "uniqueidentifier", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Employees", x => x.Id); - table.ForeignKey( - name: "FK_Employees_Departments_DepartmentId", - column: x => x.DepartmentId, - principalTable: "Departments", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_Employees_Jobs_JobId", - column: x => x.JobId, - principalTable: "Jobs", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); + migrationBuilder.CreateTable( + name: "Employees", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + FirstName = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), + LastName = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), + Email = table.Column(type: "nvarchar(max)", nullable: false), + Gender = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), + DepartmentId = table.Column(type: "uniqueidentifier", nullable: false), + JobId = table.Column(type: "uniqueidentifier", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Employees", x => x.Id); + table.ForeignKey( + name: "FK_Employees_Departments_DepartmentId", + column: x => x.DepartmentId, + principalTable: "Departments", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_Employees_Jobs_JobId", + column: x => x.JobId, + principalTable: "Jobs", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); - migrationBuilder.CreateIndex( - name: "IX_Employees_DepartmentId", - table: "Employees", - column: "DepartmentId"); + migrationBuilder.CreateIndex( + name: "IX_Employees_DepartmentId", + table: "Employees", + column: "DepartmentId"); - migrationBuilder.CreateIndex( - name: "IX_Employees_JobId", - table: "Employees", - column: "JobId"); - } + migrationBuilder.CreateIndex( + name: "IX_Employees_JobId", + table: "Employees", + column: "JobId"); + } - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "Employees"); + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "Employees"); - migrationBuilder.DropTable( - name: "Departments"); + migrationBuilder.DropTable( + name: "Departments"); - migrationBuilder.DropTable( - name: "Jobs"); - } + migrationBuilder.DropTable( + name: "Jobs"); } }