Fixed Database

This commit is contained in:
Cristiano
2025-11-27 14:35:35 +01:00
parent 86c5d6ae7b
commit 50a5f371dd
5 changed files with 2025 additions and 6 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,52 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace PyroFetes.Migrations
{
/// <inheritdoc />
public partial class FixZipCode : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "ZipCode",
table: "Warehouses",
type: "nvarchar(max)",
nullable: false,
oldClrType: typeof(int),
oldType: "int");
migrationBuilder.AlterColumn<string>(
name: "ZipCode",
table: "Suppliers",
type: "nvarchar(max)",
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(5)",
oldMaxLength: 5);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<int>(
name: "ZipCode",
table: "Warehouses",
type: "int",
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(max)");
migrationBuilder.AlterColumn<string>(
name: "ZipCode",
table: "Suppliers",
type: "nvarchar(5)",
maxLength: 5,
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(max)");
}
}
}

View File

@@ -1117,8 +1117,7 @@ namespace PyroFetes.Migrations
b.Property<string>("ZipCode")
.IsRequired()
.HasMaxLength(5)
.HasColumnType("nvarchar(5)");
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
@@ -1227,8 +1226,9 @@ namespace PyroFetes.Migrations
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<int>("ZipCode")
.HasColumnType("int");
b.Property<string>("ZipCode")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");