diff --git a/GWMS.Data/DatabaseModels/TableCount.cs b/GWMS.Data/DatabaseModels/TableCount.cs index 618f54b..a86a551 100644 --- a/GWMS.Data/DatabaseModels/TableCount.cs +++ b/GWMS.Data/DatabaseModels/TableCount.cs @@ -1,6 +1,7 @@ using Microsoft.EntityFrameworkCore; using System; using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; @@ -11,13 +12,14 @@ namespace GWMS.Data.DatabaseModels /// /// Classe fake x il conteggio tabelle e check preliminari /// - [NotMapped] + [Table("DbSetCounts")] public class TableCount { #region Public Properties - public int Count { get; set; } - public string TableName { get; set; } + [Key] + public string TableName { get; set; } = "ND"; + public int Count { get; set; } = 0; #endregion Public Properties } diff --git a/GWMS.Data/DbConfig.cs b/GWMS.Data/DbConfig.cs index 0bc5898..d350030 100644 --- a/GWMS.Data/DbConfig.cs +++ b/GWMS.Data/DbConfig.cs @@ -1,4 +1,5 @@ using Microsoft.EntityFrameworkCore; +using NLog; using System.Threading.Tasks; namespace GWMS.Data @@ -43,17 +44,21 @@ namespace GWMS.Data public static bool ExecMigrationIdentity() { + Log.Info($"ExecMigrationIdentity: Start"); // esecuzione migrazione var migrateTask = Task.Run(async () => await DbAdmin.migrateDbIdentity()); migrateTask.Wait(); + Log.Info($"ExecMigrationIdentity: Completed"); return migrateTask.Result; } public static bool ExecMigrationMain() { + Log.Info($"ExecMigrationMain: Start"); // esecuzione migrazione var migrateTask = Task.Run(async () => await DbAdmin.migrateDbMain()); migrateTask.Wait(); + Log.Info($"ExecMigrationMain: Completed"); return migrateTask.Result; } @@ -74,6 +79,8 @@ namespace GWMS.Data return serverVersion; } + private static Logger Log = LogManager.GetCurrentClassLogger(); + #endregion Public Methods } } \ No newline at end of file diff --git a/GWMS.Data/Migrations/20240418104749_ReAddTableCounter4Identity.Designer.cs b/GWMS.Data/Migrations/20240418104749_ReAddTableCounter4Identity.Designer.cs new file mode 100644 index 0000000..da8b293 --- /dev/null +++ b/GWMS.Data/Migrations/20240418104749_ReAddTableCounter4Identity.Designer.cs @@ -0,0 +1,39 @@ +// +using System; +using GWMS.Data; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace GWMS.User.Migrations +{ + [DbContext(typeof(UserIdentityDbContext))] + [Migration("20240418104749_ReAddTableCounter4Identity")] + partial class ReAddTableCounter4Identity + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "6.0.2") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("GWMS.Data.DatabaseModels.TableCount", b => + { + b.Property("TableName") + .HasColumnType("varchar(255)"); + + b.Property("Count") + .HasColumnType("int"); + + b.HasKey("TableName"); + + b.ToTable("DbSetCounts"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/GWMS.Data/Migrations/20240418104749_ReAddTableCounter4Identity.cs b/GWMS.Data/Migrations/20240418104749_ReAddTableCounter4Identity.cs new file mode 100644 index 0000000..9b0bfe7 --- /dev/null +++ b/GWMS.Data/Migrations/20240418104749_ReAddTableCounter4Identity.cs @@ -0,0 +1,33 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace GWMS.User.Migrations +{ + public partial class ReAddTableCounter4Identity : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "DbSetCounts", + columns: table => new + { + TableName = table.Column(type: "varchar(255)", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Count = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_DbSetCounts", x => x.TableName); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "DbSetCounts"); + } + } +} diff --git a/GWMS.Data/Migrations/UserIdentityDbContextModelSnapshot.cs b/GWMS.Data/Migrations/UserIdentityDbContextModelSnapshot.cs index 6ab71fb..a262f01 100644 --- a/GWMS.Data/Migrations/UserIdentityDbContextModelSnapshot.cs +++ b/GWMS.Data/Migrations/UserIdentityDbContextModelSnapshot.cs @@ -19,6 +19,19 @@ namespace GWMS.User.Migrations .HasAnnotation("ProductVersion", "6.0.2") .HasAnnotation("Relational:MaxIdentifierLength", 64); + modelBuilder.Entity("GWMS.Data.DatabaseModels.TableCount", b => + { + b.Property("TableName") + .HasColumnType("varchar(255)"); + + b.Property("Count") + .HasColumnType("int"); + + b.HasKey("TableName"); + + b.ToTable("DbSetCounts"); + }); + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => { b.Property("Id") diff --git a/GWMS.UI/Components/SetupDiagnostics.razor b/GWMS.UI/Components/SetupDiagnostics.razor index 838ae54..670750a 100644 --- a/GWMS.UI/Components/SetupDiagnostics.razor +++ b/GWMS.UI/Components/SetupDiagnostics.razor @@ -78,6 +78,8 @@ protected async Task Processing() { processRunning = true; + DbConfig.ExecMigrationMain(); + DbConfig.ExecMigrationIdentity(); await ReloadData(); } diff --git a/GWMS.UI/GWMS.UI.csproj b/GWMS.UI/GWMS.UI.csproj index 8eeffc2..2baedb8 100644 --- a/GWMS.UI/GWMS.UI.csproj +++ b/GWMS.UI/GWMS.UI.csproj @@ -2,7 +2,7 @@ net6.0 - 1.0.2404.1117 + 1.0.2404.1816 95c9f021-52d1-4390-a670-5810b7b777b0 true true diff --git a/Resources/ChangeLog.html b/Resources/ChangeLog.html index 7fc31c4..2ccfe3a 100644 --- a/Resources/ChangeLog.html +++ b/Resources/ChangeLog.html @@ -1,6 +1,6 @@ GWMS - Gas Warehouse Management System -

Versione: 1.0.2404.1117

+

Versione: 1.0.2404.1816


Note di rilascio:
  • diff --git a/Resources/VersNum.txt b/Resources/VersNum.txt index 3551ccd..7b4d59f 100644 --- a/Resources/VersNum.txt +++ b/Resources/VersNum.txt @@ -1 +1 @@ -1.0.2404.1117 +1.0.2404.1816 diff --git a/Resources/manifest.xml b/Resources/manifest.xml index 9faab04..4b4fcba 100644 --- a/Resources/manifest.xml +++ b/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.0.2404.1117 + 1.0.2404.1816 http://nexus.steamware.net/repository/SWS/GWMS/stable/0/GWMS.UI.zip http://nexus.steamware.net/repository/SWS/GWMS/stable/0/ChangeLog.html false