Fix Type errors

This commit is contained in:
Cristiano
2025-11-20 16:45:44 +01:00
parent 3ad506f869
commit d537051bea
8 changed files with 2053 additions and 16 deletions

File diff suppressed because it is too large Load Diff

View File

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

View File

@@ -503,11 +503,12 @@ namespace PyroFetes.Migrations
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("ApprovalNumber")
.HasColumnType("int");
b.Property<string>("ApprovalNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<decimal>("Caliber")
.HasColumnType("decimal(18,2)");
b.Property<int>("Caliber")
.HasColumnType("int");
b.Property<int>("ClassificationId")
.HasColumnType("int");
@@ -1113,8 +1114,10 @@ namespace PyroFetes.Migrations
.HasMaxLength(30)
.HasColumnType("nvarchar(30)");
b.Property<int>("ZipCode")
.HasColumnType("int");
b.Property<string>("ZipCode")
.IsRequired()
.HasMaxLength(5)
.HasColumnType("nvarchar(5)");
b.HasKey("Id");