Fixed Database
This commit is contained in:
1967
PyroFetes/Migrations/20251127133430_FixZipCode.Designer.cs
generated
Normal file
1967
PyroFetes/Migrations/20251127133430_FixZipCode.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
52
PyroFetes/Migrations/20251127133430_FixZipCode.cs
Normal file
52
PyroFetes/Migrations/20251127133430_FixZipCode.cs
Normal 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)");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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");
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ public class Supplier
|
||||
[Required, MaxLength(100)] public string? Email { get; set; }
|
||||
[Required, MaxLength(30)] public string? Phone { get; set; }
|
||||
[Required, MaxLength(100)] public string? Address { get; set; }
|
||||
[Required,MaxLength(5),MinLength(5)] public string? ZipCode { get; set; }
|
||||
[Required,Length(5,5)] public string? ZipCode { get; set; }
|
||||
[Required, MaxLength(100)] public string? City { get; set; }
|
||||
[Required] public int DeliveryDelay { get; set; }
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ public class Warehouse
|
||||
[Required] public int Current {get; set;}
|
||||
[Required] public int MinWeight {get; set;}
|
||||
[Required, MaxLength(100)] public string? Address { get; set; }
|
||||
[Required] public int ZipCode { get; set; }
|
||||
[Required, Length(5,5)] public string? ZipCode { get; set; }
|
||||
[Required, MaxLength(100)] public string? City { get; set; }
|
||||
|
||||
public List<WarehouseProduct>? WarehouseProducts { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user