Aggiunta modelli + migrations

This commit is contained in:
Samuele Locatelli
2024-03-12 09:04:31 +01:00
parent dbbfef35a9
commit 0ed6719508
8 changed files with 421 additions and 0 deletions
@@ -0,0 +1,58 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EgtBEAMWALL.DataLayer.DatabaseModels
{
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
[Table("MagmanSync")]
public partial class MagmanSyncModel
{
/// <summary>
/// Primary Key AUTO
/// </summary>
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int SyncId { get; set; }
/// <summary>
/// Tipologia Sync
/// </summary>
public string SyncType { get; set; } = "";
/// <summary>
/// Id riferimento remoto cloud x invio (es ProjCloudId)
/// </summary>
public int CloudId { get; set; } = 0;
/// <summary>
/// DataOra inserimento richiesta
/// </summary>
public DateTime DtReq { get; set; } = DateTime.Now;
/// <summary>
/// DataOra esecuzione richiesta
/// </summary>
public DateTime? DtExe { get; set; } = null;
/// <summary>
/// Payload trasmesso/da trasmettere (serializzato)
/// </summary>
public string Payload { get; set; } = "";
/// <summary>
/// Record inviato se DtExe != null && >= dtReq
/// </summary>
[NotMapped]
public bool Sent
{
get => DtExe != null && DtExe > DtReq;
}
}
}
@@ -71,6 +71,11 @@ namespace EgtBEAMWALL.DataLayer.DatabaseModels
/// </summary>
public bool UseQty { get; set; } = false;
/// <summary>
/// DataOra ultimo aggiornamento dal cloud dei dati (in particolare giacenza)
/// </summary>
public DateTime LastSync { get; set; } = DateTime.Now;
#if false
[NotMapped]
public decimal LIn
@@ -0,0 +1,29 @@
// <auto-generated />
namespace EgtBEAMWALL.DataLayer.Migrations
{
using System.CodeDom.Compiler;
using System.Data.Entity.Migrations;
using System.Data.Entity.Migrations.Infrastructure;
using System.Resources;
[GeneratedCode("EntityFramework.Migrations", "6.4.4")]
public sealed partial class RawItemAddLastSync : IMigrationMetadata
{
private readonly ResourceManager Resources = new ResourceManager(typeof(RawItemAddLastSync));
string IMigrationMetadata.Id
{
get { return "202403120645357_RawItemAddLastSync"; }
}
string IMigrationMetadata.Source
{
get { return null; }
}
string IMigrationMetadata.Target
{
get { return Resources.GetString("Target"); }
}
}
}
@@ -0,0 +1,18 @@
namespace EgtBEAMWALL.DataLayer.Migrations
{
using System;
using System.Data.Entity.Migrations;
public partial class RawItemAddLastSync : DbMigration
{
public override void Up()
{
AddColumn("dbo.RawItemList", "LastSync", c => c.DateTime(nullable: false, precision: 0));
}
public override void Down()
{
DropColumn("dbo.RawItemList", "LastSync");
}
}
}
File diff suppressed because one or more lines are too long
@@ -0,0 +1,29 @@
// <auto-generated />
namespace EgtBEAMWALL.DataLayer.Migrations
{
using System.CodeDom.Compiler;
using System.Data.Entity.Migrations;
using System.Data.Entity.Migrations.Infrastructure;
using System.Resources;
[GeneratedCode("EntityFramework.Migrations", "6.4.4")]
public sealed partial class AddMagmanSyncTab : IMigrationMetadata
{
private readonly ResourceManager Resources = new ResourceManager(typeof(AddMagmanSyncTab));
string IMigrationMetadata.Id
{
get { return "202403120803297_AddMagmanSyncTab"; }
}
string IMigrationMetadata.Source
{
get { return null; }
}
string IMigrationMetadata.Target
{
get { return Resources.GetString("Target"); }
}
}
}
@@ -0,0 +1,30 @@
namespace EgtBEAMWALL.DataLayer.Migrations
{
using System;
using System.Data.Entity.Migrations;
public partial class AddMagmanSyncTab : DbMigration
{
public override void Up()
{
CreateTable(
"dbo.MagmanSync",
c => new
{
SyncId = c.Int(nullable: false, identity: true),
SyncType = c.String(unicode: false),
CloudId = c.Int(nullable: false),
DtReq = c.DateTime(nullable: false, precision: 0),
DtExe = c.DateTime(precision: 0),
Payload = c.String(unicode: false),
})
.PrimaryKey(t => t.SyncId);
}
public override void Down()
{
DropTable("dbo.MagmanSync");
}
}
}
File diff suppressed because one or more lines are too long