Fix init DB

This commit is contained in:
Samuele Locatelli
2021-09-03 14:58:55 +02:00
parent e54a77d85d
commit 17ca3eee8e
6 changed files with 109 additions and 3 deletions
@@ -10,7 +10,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace MP.FileData.Migrations
{
[DbContext(typeof(MoonPro_ProgContext))]
[Migration("20210903094836_InitDb")]
[Migration("20210903125648_InitDb")]
partial class InitDb
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
@@ -39,6 +39,15 @@ namespace MP.FileData.Migrations
b.HasKey("CodArticolo");
b.ToTable("Articoli");
b.HasData(
new
{
CodArticolo = "ND",
DescArticolo = "--- Tutti ---",
Disegno = "",
Tipo = "ND"
});
});
modelBuilder.Entity("MP.FileData.DatabaseModels.FileModel", b =>
@@ -122,6 +131,19 @@ namespace MP.FileData.Migrations
b.HasKey("IdxMacchina");
b.ToTable("Macchine");
b.HasData(
new
{
IdxMacchina = "0",
BasePath = "",
CodMacchina = "0",
Descrizione = "--- Tutte ---",
ImgUrl = "",
Nome = "--- Tutte ---",
Note = "",
ShowOrder = 0
});
});
modelBuilder.Entity("MP.FileData.DatabaseModels.FileModel", b =>
@@ -75,6 +75,16 @@ namespace MP.FileData.Migrations
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.InsertData(
table: "Articoli",
columns: new[] { "CodArticolo", "DescArticolo", "Disegno", "Tipo" },
values: new object[] { "ND", "--- Tutti ---", "", "ND" });
migrationBuilder.InsertData(
table: "Macchine",
columns: new[] { "IdxMacchina", "BasePath", "CodMacchina", "Descrizione", "ImgUrl", "Nome", "Note", "ShowOrder" },
values: new object[] { "0", "", "0", "--- Tutte ---", "", "--- Tutte ---", "", 0 });
migrationBuilder.CreateIndex(
name: "IX_Files_CodArticolo",
table: "Files",
@@ -37,6 +37,15 @@ namespace MP.FileData.Migrations
b.HasKey("CodArticolo");
b.ToTable("Articoli");
b.HasData(
new
{
CodArticolo = "ND",
DescArticolo = "--- Tutti ---",
Disegno = "",
Tipo = "ND"
});
});
modelBuilder.Entity("MP.FileData.DatabaseModels.FileModel", b =>
@@ -120,6 +129,19 @@ namespace MP.FileData.Migrations
b.HasKey("IdxMacchina");
b.ToTable("Macchine");
b.HasData(
new
{
IdxMacchina = "0",
BasePath = "",
CodMacchina = "0",
Descrizione = "--- Tutte ---",
ImgUrl = "",
Nome = "--- Tutte ---",
Note = "",
ShowOrder = 0
});
});
modelBuilder.Entity("MP.FileData.DatabaseModels.FileModel", b =>