using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace WebVentaCoche.Migrations { /// public partial class AddAddressEntity : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Addresses", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Street = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), City = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), State = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), ZipCode = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: false), Country = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), UserId = table.Column(type: "nvarchar(450)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Addresses", x => x.Id); table.ForeignKey( name: "FK_Addresses_AspNetUsers_UserId", column: x => x.UserId, principalTable: "AspNetUsers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_Addresses_UserId", table: "Addresses", column: "UserId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Addresses"); } } }