Fix lunghezza dati 18.2 -->18.3 x decimal

This commit is contained in:
Samuele Locatelli
2021-11-18 18:43:00 +01:00
parent 17528bec75
commit 30034aea7c
4 changed files with 235 additions and 1 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ namespace NKC.Data.DbModels
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
//[Index(nameof(Installazione), nameof(Active), nameof(DiskStatus))]
[Table("Remnants")]
[Table("RemnantsList")]
public partial class RemnantsModel
{
/// <summary>
@@ -0,0 +1,132 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using NKC.Data;
#nullable disable
namespace NKC.Data.Migrations
{
[DbContext(typeof(NKCContext))]
[Migration("20211118173720_AddRemnantsTable")]
partial class AddRemnantsTable
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "6.0.0")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);
modelBuilder.Entity("NKC.Data.DbModels.MaterialModel", b =>
{
b.Property<int>("MatID")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("MatID"), 1L, 1);
b.Property<DateTime>("ApprovDate")
.ValueGeneratedOnAdd()
.HasColumnType("datetime")
.HasDefaultValueSql("(getdate())");
b.Property<string>("ApprovUser")
.IsRequired()
.ValueGeneratedOnAdd()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)")
.HasDefaultValueSql("('')");
b.Property<decimal>("LMm")
.HasColumnType("decimal(18,3)")
.HasColumnName("L_mm");
b.Property<string>("MatDesc")
.IsRequired()
.ValueGeneratedOnAdd()
.HasMaxLength(500)
.HasColumnType("nvarchar(500)")
.HasDefaultValueSql("('')")
.HasComment("Description");
b.Property<int>("MatExtCode")
.HasColumnType("int");
b.Property<decimal>("TMm")
.HasColumnType("decimal(18,3)")
.HasColumnName("T_mm");
b.Property<decimal>("WMm")
.HasColumnType("decimal(18,3)")
.HasColumnName("W_mm");
b.HasKey("MatID");
b.HasIndex(new[] { "MatExtCode" }, "Idx_Materials_MatExtCode_Unique")
.IsUnique();
b.ToTable("Materials");
});
modelBuilder.Entity("NKC.Data.DbModels.RemnantsModel", b =>
{
b.Property<int>("RemnID")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("RemnID"), 1L, 1);
b.Property<DateTime>("DtMod")
.HasColumnType("datetime2");
b.Property<decimal>("LMm")
.HasColumnType("decimal(18,3)");
b.Property<string>("Location")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("MatID")
.HasColumnType("int");
b.Property<string>("Note")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("QtyAvail")
.HasColumnType("int");
b.Property<decimal>("TMm")
.HasColumnType("decimal(18,3)");
b.Property<decimal>("WMm")
.HasColumnType("decimal(18,3)");
b.HasKey("RemnID");
b.HasIndex("MatID");
b.ToTable("RemnantsList");
});
modelBuilder.Entity("NKC.Data.DbModels.RemnantsModel", b =>
{
b.HasOne("NKC.Data.DbModels.MaterialModel", "MaterialNav")
.WithMany()
.HasForeignKey("MatID")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("MaterialNav");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,50 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace NKC.Data.Migrations
{
public partial class AddRemnantsTable : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "RemnantsList",
columns: table => new
{
RemnID = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
MatID = table.Column<int>(type: "int", nullable: false),
Location = table.Column<string>(type: "nvarchar(max)", nullable: false),
QtyAvail = table.Column<int>(type: "int", nullable: false),
DtMod = table.Column<DateTime>(type: "datetime2", nullable: false),
LMm = table.Column<decimal>(type: "decimal(18,3)", nullable: false),
WMm = table.Column<decimal>(type: "decimal(18,3)", nullable: false),
TMm = table.Column<decimal>(type: "decimal(18,3)", nullable: false),
Note = table.Column<string>(type: "nvarchar(max)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_RemnantsList", x => x.RemnID);
table.ForeignKey(
name: "FK_RemnantsList_Materials_MatID",
column: x => x.MatID,
principalTable: "Materials",
principalColumn: "MatID",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_RemnantsList_MatID",
table: "RemnantsList",
column: "MatID");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "RemnantsList");
}
}
}
@@ -72,6 +72,58 @@ namespace NKC.Data.Migrations
b.ToTable("Materials");
});
modelBuilder.Entity("NKC.Data.DbModels.RemnantsModel", b =>
{
b.Property<int>("RemnID")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("RemnID"), 1L, 1);
b.Property<DateTime>("DtMod")
.HasColumnType("datetime2");
b.Property<decimal>("LMm")
.HasColumnType("decimal(18,3)");
b.Property<string>("Location")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("MatID")
.HasColumnType("int");
b.Property<string>("Note")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("QtyAvail")
.HasColumnType("int");
b.Property<decimal>("TMm")
.HasColumnType("decimal(18,3)");
b.Property<decimal>("WMm")
.HasColumnType("decimal(18,3)");
b.HasKey("RemnID");
b.HasIndex("MatID");
b.ToTable("RemnantsList");
});
modelBuilder.Entity("NKC.Data.DbModels.RemnantsModel", b =>
{
b.HasOne("NKC.Data.DbModels.MaterialModel", "MaterialNav")
.WithMany()
.HasForeignKey("MatID")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("MaterialNav");
});
#pragma warning restore 612, 618
}
}