Files
Mapo-IOB-WIN/EgwProxy.SqlDb/Migrations/ConfigurationInit.cs
T

41 lines
2.2 KiB
C#

namespace EgwProxy.SqlDb.Migrations
{
using EgwProxy.SqlDb.DbModels;
using System;
using System.Data.Entity;
using System.Data.Entity.Migrations;
using System.Linq;
//public class ConfigurationInit : DropCreateDatabaseAlways<SyncStateDbContext>
public class ConfigurationInit : DbMigrationsConfiguration<SyncStateDbContext>
{
public ConfigurationInit()
{
AutomaticMigrationsEnabled = false;
}
protected override void Seed(SyncStateDbContext context)
{
// aggiunta preliminare tipo attività sync ammessi
context.DbSetActListType.AddOrUpdate<ActTypeModel>(
new ActTypeModel() { Action = "SetPodlData", Description = "Sincronizzazione dati PODL | MES --> MACH" },
new ActTypeModel() { Action = "GetPodlData", Description = "Lettura stato macchina x avvio prod ODL da PODL e sync relativa | MACH --> MES" },
new ActTypeModel() { Action = "GetEvList", Description = "Lettura info da impianto e decodifica come EvList | MACH --> MES" },
new ActTypeModel() { Action = "GetFluxLog", Description = "Lettura info da impianto e decodifica come FluxLog | MACH --> MES" },
new ActTypeModel() { Action = "GetSigLog", Description = "Lettura info da impianto e decodifica come SignalLog | MACH --> MES" },
new ActTypeModel() { Action = "StartProd", Description = "Dichiarazione inizio lavorazione (commessa) | MACH --> MES" },
new ActTypeModel() { Action = "EndProd", Description = "Dichiarazione fine lavorazione (commessa) | MACH --> MES" }
);
context.DbSetSyncState.AddOrUpdate<SyncStateModel>(
new SyncStateModel() { TableName = "ActList", LastIdx = 0, Note = "NO EXEC", LastUpdate = DateTime.Today },
new SyncStateModel() { TableName = "PODL_req", LastIdx = 0, Note = "NO EXEC", LastUpdate = DateTime.Today },
new SyncStateModel() { TableName = "EvList", LastIdx = 0, Note = "NO EXEC", LastUpdate = DateTime.Today },
new SyncStateModel() { TableName = "FluxLog", LastIdx = 0, Note = "NO EXEC", LastUpdate = DateTime.Today }
);
base.Seed(context);
}
}
}