Altro update migration, ora ok (SENZA FK, da rivedere...)

This commit is contained in:
Samuele Locatelli
2026-01-16 16:21:35 +01:00
parent 5a04589b32
commit 2c0675eef4
14 changed files with 3947 additions and 58 deletions
-12
View File
@@ -73,9 +73,6 @@ namespace EgwCoreLib.Lux.Data
public virtual DbSet<JobStepModel> DbSetJobStep { get; set; }
public virtual DbSet<JobStepItemModel> DbSetJobStepItem { get; set; }
public virtual DbSet<ProductionItemModel> DbSetProdItem { get; set; }
#if false
public virtual DbSet<ProductionItemStepModel> DbSetProdItemRow { get; set; }
#endif
public virtual DbSet<StockStatusModel> DbSetStockStatus { get; set; }
public virtual DbSet<MovTypeModel> DbSetMovType { get; set; }
public virtual DbSet<StockMovModel> DbSetStockMov { get; set; }
@@ -83,20 +80,11 @@ namespace EgwCoreLib.Lux.Data
public virtual DbSet<GenValueModel> DbSetGenVal { get; set; }
public virtual DbSet<StatsDetailModel> DbSetStatsDet { get; set; }
public virtual DbSet<StatsAggregatedModel> DbSetStatsAggr { get; set; }
#if false
public virtual DbSet<ProductionAssignModel> DbSetProdAssign { get; set; }
#endif
public virtual DbSet<ProductionGroupModel> DbSetProdGroup { get; set; }
public virtual DbSet<ProductionPlantModel> DbSetProdPlant { get; set; }
#if false
public virtual DbSet<ProductionPlannerModel> DbSetProdPlanner { get; set; }
#endif
public virtual DbSet<ProductionBatchModel> DbSetProdBatch { get; set; }
// FixMe ToDo
#if false
public virtual DbSet<ProductionODLModel> DbSetProdODL { get; set; }
#endif
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
@@ -56,7 +56,7 @@ namespace EgwCoreLib.Lux.Data.DbModel.Production
public double EstimTime { get; set; } = 0;
/// <summary>
/// Codice calcolato da chiave ProdItemID, cambiare con generazione da counter tipo
/// Codice calcolato da chiave ProdItemID, cambiare con generazione da count4er tipo
/// PI.2025.000000x8
/// </summary>
[NotMapped]
@@ -37,7 +37,7 @@ namespace EgwCoreLib.Lux.Data.DbModel.Production
/// <summary>
/// BatchID di appartenenza
/// </summary>
public int ProdBatchID { get; set; }
public int? ProdBatchID { get; set; }
/// <summary>
/// Indice della fase all'interno del Job x produrre item
@@ -89,11 +89,12 @@ namespace EgwCoreLib.Lux.Data.DbModel.Production
/// </summary>
public decimal WorkTime { get; set; } = 0;
#if false
/// <summary>
/// Navigazione sui Batch
/// </summary>
[ForeignKey("ProdBatchID")]
public virtual ProductionBatchModel ProdBatchNav { get; set; } = null!;
public virtual ProductionBatchModel? ProdBatchNav { get; set; }
/// <summary>
/// Navigazione Job/Cicli
@@ -110,6 +111,7 @@ namespace EgwCoreLib.Lux.Data.DbModel.Production
/// <summary>
/// Navigazione verso tabella Item2Odl
/// </summary>
public ICollection<ProductionItem2ODLModel> Item2OdlNav { get; set; } = new List<ProductionItem2ODLModel>();
public ICollection<ProductionItem2ODLModel> Item2OdlNav { get; set; } = new List<ProductionItem2ODLModel>();
#endif
}
}
@@ -77,12 +77,12 @@ namespace EgwCoreLib.Lux.Data.DbModel.Sales
/// <summary>
/// DataOra inserimento
/// </summary>
public DateTime Inserted { get; set; } = DateTime.Now;
public DateTime Inserted { get; set; }
/// <summary>
/// DataOra ultima modifica
/// </summary>
public DateTime Modified { get; set; } = DateTime.Now;
public DateTime Modified { get; set; }
/// <summary>
/// DataOra richiesta per il completamento dell'ordine
@@ -32,12 +32,12 @@ namespace EgwCoreLib.Lux.Data.DbModel.Stock
/// <summary>
/// DateTime di creazione record
/// </summary>
public DateTime DtCreate { get; set; } = DateTime.Now;
public DateTime DtCreate { get; set; }
/// <summary>
/// DateTime registrazione dato
/// </summary>
public DateTime DtMod { get; set; } = DateTime.Now;
public DateTime DtMod { get; set; }
/// <summary>
/// ProductivityRate movimento registrato (delta +/-)
@@ -21,7 +21,6 @@
<Compile Remove="DbModel\Production\ProductionAssignModel.cs" />
<Compile Remove="DbModel\Production\ProductionItem2ODLModel.cs" />
<Compile Remove="DbModel\Production\ProductionItemStepModel.cs" />
<Compile Remove="DbModel\Production\ProductionODLModel.cs" />
<Compile Remove="Services\ExternalMessageProcessor.cs" />
<Compile Remove="Services\RedisSubscriberServiceOld.cs" />
</ItemGroup>
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,69 @@
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using System;
using System.Reflection;
#nullable disable
namespace EgwCoreLib.Lux.Data.Migrations
{
/// <inheritdoc />
public partial class ProdOdlAndStored : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
// aggiunta stored
addStored(migrationBuilder, "stp_counterGetNext");
migrationBuilder.CreateTable(
name: "production_odl",
columns: table => new
{
ProdODLID = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
OdlTag = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ProdBatchID = table.Column<int>(type: "int", nullable: true),
Index = table.Column<int>(type: "int", nullable: false),
PhaseID = table.Column<int>(type: "int", nullable: true),
ResourceID = table.Column<int>(type: "int", nullable: true),
ProdPlantCod = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Qty = table.Column<double>(type: "double", nullable: false),
DateStart = table.Column<DateTime>(type: "datetime(6)", nullable: true),
DateEnd = table.Column<DateTime>(type: "datetime(6)", nullable: true),
EstimTime = table.Column<decimal>(type: "decimal(65,30)", nullable: false),
WorkTime = table.Column<decimal>(type: "decimal(65,30)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_production_odl", x => x.ProdODLID);
})
.Annotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
// rimozione stored
remStored(migrationBuilder, "stp_counterGetNext");
migrationBuilder.DropTable(
name: "production_odl");
}
private void addStored(MigrationBuilder migrationBuilder, string objName)
{
string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "SqlScripts", "Stored", $"{objName}.sql");
string viewBody = File.ReadAllText(path);
migrationBuilder.Sql(viewBody);
}
private void remStored(MigrationBuilder migrationBuilder, string objName)
{
migrationBuilder.Sql($"DROP PROCEDURE IF EXISTS {objName};");
}
}
}
@@ -1139,6 +1139,58 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.ToTable("production_item");
});
modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Production.ProductionODLModel", b =>
{
b.Property<int>("ProdODLID")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("ProdODLID"));
b.Property<DateTime?>("DateEnd")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("DateStart")
.HasColumnType("datetime(6)");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("longtext");
b.Property<decimal>("EstimTime")
.HasColumnType("decimal(65,30)");
b.Property<int>("Index")
.HasColumnType("int");
b.Property<string>("OdlTag")
.IsRequired()
.HasColumnType("longtext");
b.Property<int?>("PhaseID")
.HasColumnType("int");
b.Property<int?>("ProdBatchID")
.HasColumnType("int");
b.Property<string>("ProdPlantCod")
.IsRequired()
.HasColumnType("longtext");
b.Property<double>("Qty")
.HasColumnType("double");
b.Property<int?>("ResourceID")
.HasColumnType("int");
b.Property<decimal>("WorkTime")
.HasColumnType("decimal(65,30)");
b.HasKey("ProdODLID");
b.ToTable("production_odl");
});
modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Production.ProductionPlantModel", b =>
{
b.Property<string>("ProdPlantCod")
@@ -1363,13 +1415,13 @@ namespace EgwCoreLib.Lux.Data.Migrations
DueDateProm = new DateTime(2026, 3, 17, 0, 0, 0, 0, DateTimeKind.Local),
DueDateReq = new DateTime(2026, 2, 15, 0, 0, 0, 0, DateTimeKind.Local),
Envir = 1,
Inserted = new DateTime(2026, 1, 16, 15, 43, 53, 119, DateTimeKind.Local).AddTicks(1252),
Modified = new DateTime(2026, 1, 16, 15, 43, 53, 119, DateTimeKind.Local).AddTicks(1254),
Inserted = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
Modified = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
OffertState = 0,
RefNum = 1,
RefRev = 1,
RefYear = 2025,
ValidUntil = new DateTime(2026, 2, 16, 15, 43, 53, 119, DateTimeKind.Local).AddTicks(1249)
ValidUntil = new DateTime(2026, 2, 16, 16, 19, 27, 98, DateTimeKind.Local).AddTicks(6949)
},
new
{
@@ -1383,13 +1435,13 @@ namespace EgwCoreLib.Lux.Data.Migrations
DueDateProm = new DateTime(2026, 3, 17, 0, 0, 0, 0, DateTimeKind.Local),
DueDateReq = new DateTime(2026, 2, 15, 0, 0, 0, 0, DateTimeKind.Local),
Envir = 2,
Inserted = new DateTime(2026, 1, 16, 15, 43, 53, 119, DateTimeKind.Local).AddTicks(1268),
Modified = new DateTime(2026, 1, 16, 15, 43, 53, 119, DateTimeKind.Local).AddTicks(1270),
Inserted = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
Modified = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
OffertState = 0,
RefNum = 2,
RefRev = 1,
RefYear = 2025,
ValidUntil = new DateTime(2026, 2, 16, 15, 43, 53, 119, DateTimeKind.Local).AddTicks(1266)
ValidUntil = new DateTime(2026, 2, 16, 16, 19, 27, 98, DateTimeKind.Local).AddTicks(6973)
},
new
{
@@ -1403,13 +1455,13 @@ namespace EgwCoreLib.Lux.Data.Migrations
DueDateProm = new DateTime(2026, 3, 17, 0, 0, 0, 0, DateTimeKind.Local),
DueDateReq = new DateTime(2026, 2, 15, 0, 0, 0, 0, DateTimeKind.Local),
Envir = 4,
Inserted = new DateTime(2026, 1, 16, 15, 43, 53, 119, DateTimeKind.Local).AddTicks(1280),
Modified = new DateTime(2026, 1, 16, 15, 43, 53, 119, DateTimeKind.Local).AddTicks(1282),
Inserted = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
Modified = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
OffertState = 0,
RefNum = 3,
RefRev = 1,
RefYear = 2025,
ValidUntil = new DateTime(2026, 2, 16, 15, 43, 53, 119, DateTimeKind.Local).AddTicks(1278)
ValidUntil = new DateTime(2026, 2, 16, 16, 19, 27, 98, DateTimeKind.Local).AddTicks(6981)
},
new
{
@@ -1423,13 +1475,13 @@ namespace EgwCoreLib.Lux.Data.Migrations
DueDateProm = new DateTime(2026, 3, 17, 0, 0, 0, 0, DateTimeKind.Local),
DueDateReq = new DateTime(2026, 2, 15, 0, 0, 0, 0, DateTimeKind.Local),
Envir = 3,
Inserted = new DateTime(2026, 1, 16, 15, 43, 53, 119, DateTimeKind.Local).AddTicks(1292),
Modified = new DateTime(2026, 1, 16, 15, 43, 53, 119, DateTimeKind.Local).AddTicks(1294),
Inserted = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
Modified = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
OffertState = 0,
RefNum = 4,
RefRev = 1,
RefYear = 2025,
ValidUntil = new DateTime(2026, 2, 16, 15, 43, 53, 119, DateTimeKind.Local).AddTicks(1290)
ValidUntil = new DateTime(2026, 2, 16, 16, 19, 27, 98, DateTimeKind.Local).AddTicks(6988)
});
});
@@ -2208,8 +2260,8 @@ namespace EgwCoreLib.Lux.Data.Migrations
{
StockMovID = 1,
CodDoc = "",
DtCreate = new DateTime(2026, 1, 16, 15, 43, 53, 115, DateTimeKind.Local).AddTicks(7298),
DtMod = new DateTime(2026, 1, 16, 15, 43, 53, 115, DateTimeKind.Local).AddTicks(7358),
DtCreate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
DtMod = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
MovCod = "CAR",
Note = "DEMO",
QtyRec = 5.0,
@@ -2221,8 +2273,8 @@ namespace EgwCoreLib.Lux.Data.Migrations
{
StockMovID = 2,
CodDoc = "",
DtCreate = new DateTime(2026, 1, 16, 15, 43, 53, 115, DateTimeKind.Local).AddTicks(7361),
DtMod = new DateTime(2026, 1, 16, 15, 43, 53, 115, DateTimeKind.Local).AddTicks(7363),
DtCreate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
DtMod = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
MovCod = "CAR",
Note = "DEMO",
QtyRec = 8.0,
@@ -2234,8 +2286,8 @@ namespace EgwCoreLib.Lux.Data.Migrations
{
StockMovID = 3,
CodDoc = "",
DtCreate = new DateTime(2026, 1, 16, 15, 43, 53, 115, DateTimeKind.Local).AddTicks(7365),
DtMod = new DateTime(2026, 1, 16, 15, 43, 53, 115, DateTimeKind.Local).AddTicks(7366),
DtCreate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
DtMod = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
MovCod = "CAR",
Note = "DEMO",
QtyRec = 5.0,
@@ -2247,8 +2299,8 @@ namespace EgwCoreLib.Lux.Data.Migrations
{
StockMovID = 4,
CodDoc = "",
DtCreate = new DateTime(2026, 1, 16, 15, 43, 53, 115, DateTimeKind.Local).AddTicks(7368),
DtMod = new DateTime(2026, 1, 16, 15, 43, 53, 115, DateTimeKind.Local).AddTicks(7370),
DtCreate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
DtMod = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
MovCod = "CAR",
Note = "DEMO",
QtyRec = 1.0,
@@ -2260,8 +2312,8 @@ namespace EgwCoreLib.Lux.Data.Migrations
{
StockMovID = 5,
CodDoc = "",
DtCreate = new DateTime(2026, 1, 16, 15, 43, 53, 115, DateTimeKind.Local).AddTicks(7372),
DtMod = new DateTime(2026, 1, 16, 15, 43, 53, 115, DateTimeKind.Local).AddTicks(7373),
DtCreate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
DtMod = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
MovCod = "CAR",
Note = "DEMO",
QtyRec = 10.0,
@@ -2273,8 +2325,8 @@ namespace EgwCoreLib.Lux.Data.Migrations
{
StockMovID = 6,
CodDoc = "",
DtCreate = new DateTime(2026, 1, 16, 15, 43, 53, 115, DateTimeKind.Local).AddTicks(7375),
DtMod = new DateTime(2026, 1, 16, 15, 43, 53, 115, DateTimeKind.Local).AddTicks(7377),
DtCreate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
DtMod = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
MovCod = "CAR",
Note = "DEMO",
QtyRec = 1.0,
@@ -2286,8 +2338,8 @@ namespace EgwCoreLib.Lux.Data.Migrations
{
StockMovID = 7,
CodDoc = "",
DtCreate = new DateTime(2026, 1, 16, 15, 43, 53, 115, DateTimeKind.Local).AddTicks(7379),
DtMod = new DateTime(2026, 1, 16, 15, 43, 53, 115, DateTimeKind.Local).AddTicks(7380),
DtCreate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
DtMod = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
MovCod = "CAR",
Note = "DEMO",
QtyRec = 50.0,
@@ -2299,8 +2351,8 @@ namespace EgwCoreLib.Lux.Data.Migrations
{
StockMovID = 8,
CodDoc = "",
DtCreate = new DateTime(2026, 1, 16, 15, 43, 53, 115, DateTimeKind.Local).AddTicks(7382),
DtMod = new DateTime(2026, 1, 16, 15, 43, 53, 115, DateTimeKind.Local).AddTicks(7384),
DtCreate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
DtMod = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
MovCod = "CAR",
Note = "DEMO",
QtyRec = 1.0,
@@ -2312,8 +2364,8 @@ namespace EgwCoreLib.Lux.Data.Migrations
{
StockMovID = 9,
CodDoc = "",
DtCreate = new DateTime(2026, 1, 16, 15, 43, 53, 115, DateTimeKind.Local).AddTicks(7386),
DtMod = new DateTime(2026, 1, 16, 15, 43, 53, 115, DateTimeKind.Local).AddTicks(7387),
DtCreate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
DtMod = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
MovCod = "CAR",
Note = "DEMO",
QtyRec = 1.0,
@@ -2325,8 +2377,8 @@ namespace EgwCoreLib.Lux.Data.Migrations
{
StockMovID = 10,
CodDoc = "",
DtCreate = new DateTime(2026, 1, 16, 15, 43, 53, 115, DateTimeKind.Local).AddTicks(7389),
DtMod = new DateTime(2026, 1, 16, 15, 43, 53, 115, DateTimeKind.Local).AddTicks(7390),
DtCreate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
DtMod = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
MovCod = "CAR",
Note = "DEMO",
QtyRec = 1.0,
+1 -1
View File
@@ -4,7 +4,7 @@
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Version>0.9.2601.1615</Version>
<Version>0.9.2601.1616</Version>
</PropertyGroup>
<ItemGroup>
+1 -1
View File
@@ -5,7 +5,7 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>aspnet-Lux.UI-a758c101-a2f4-4e38-977d-1c4887dbbd50</UserSecretsId>
<Version>0.9.2601.1615</Version>
<Version>0.9.2601.1616</Version>
</PropertyGroup>
<ItemGroup>
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>LUX - Web Windows MES</i>
<h4>Versione: 0.9.2601.1615</h4>
<h4>Versione: 0.9.2601.1616</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
0.9.2601.1615
0.9.2601.1616
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>0.9.2601.1615</version>
<version>0.9.2601.1616</version>
<url>http://nexus.steamware.net/repository/SWS/GPW/stable/GPW.UI.zip</url>
<changelog>http://nexus.steamware.net/repository/SWS/GPW/stable/ChangeLog.html</changelog>
<mandatory>false</mandatory>