Aggiunta migrazione

This commit is contained in:
Samuele Locatelli
2024-01-18 13:08:33 +01:00
parent 70078533d2
commit 5896862614
6 changed files with 216 additions and 2 deletions
+1 -1
View File
@@ -13,7 +13,7 @@
</providers>
</entityFramework>
<connectionStrings>
<add name="DefaultConnection" connectionString="server=localhost;port=3306;User Id=steamware;password=Egalware_24068!;Persist Security Info=True;database=EgtBwDb_000470;SslMode=none" providerName="MySql.Data.MySqlClient" />
<add name="DefaultConnection" connectionString="server=localhost;port=3306;User Id=steamware;password=steamware_password;Persist Security Info=True;database=EgtBwDb_000470;SslMode=none" providerName="MySql.Data.MySqlClient" />
</connectionStrings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+1 -1
View File
@@ -33,7 +33,7 @@ namespace EgtBEAMWALL.DataLayer
public static string ADMIN_CONNECTION_STRING { get; set; } = "";
/// <summary>
/// DB Connection string, per effettuare migration riportare valore connessione admin cablato (server=localhost;port=3306;database=EgtBwDb_000102;)
/// DB Connection string, per effettuare migration riportare valore connessione admin cablato (server=localhost;port=3306;database=EgtBwDb_000102;uid=root;pwd=Egalware_24068!;)
/// </summary>
public static string CONNECTION_STRING { get; set; } = "";
@@ -189,6 +189,10 @@
<Compile Include="Migrations\202308250853396_AddProjArchivedField.designer.cs">
<DependentUpon>202308250853396_AddProjArchivedField.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\202401181206504_AddMaterialAndRawItems.cs" />
<Compile Include="Migrations\202401181206504_AddMaterialAndRawItems.designer.cs">
<DependentUpon>202401181206504_AddMaterialAndRawItems.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\Configuration.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Utils.cs" />
@@ -237,6 +241,9 @@
<EmbeddedResource Include="Migrations\202308250853396_AddProjArchivedField.resx">
<DependentUpon>202308250853396_AddProjArchivedField.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Migrations\202401181206504_AddMaterialAndRawItems.resx">
<DependentUpon>202401181206504_AddMaterialAndRawItems.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
@@ -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 AddMaterialAndRawItems : IMigrationMetadata
{
private readonly ResourceManager Resources = new ResourceManager(typeof(AddMaterialAndRawItems));
string IMigrationMetadata.Id
{
get { return "202401181206504_AddMaterialAndRawItems"; }
}
string IMigrationMetadata.Source
{
get { return null; }
}
string IMigrationMetadata.Target
{
get { return Resources.GetString("Target"); }
}
}
}
@@ -0,0 +1,52 @@
namespace EgtBEAMWALL.DataLayer.Migrations
{
using System;
using System.Data.Entity.Migrations;
public partial class AddMaterialAndRawItems : DbMigration
{
public override void Up()
{
CreateTable(
"dbo.Materials",
c => new
{
MatId = c.Int(nullable: false, identity: true),
MatExtId = c.Int(nullable: false),
MatCode = c.String(unicode: false),
MatDesc = c.String(unicode: false),
LMm = c.Decimal(nullable: false, precision: 18, scale: 2),
WMm = c.Decimal(nullable: false, precision: 18, scale: 2),
HMm = c.Decimal(nullable: false, precision: 18, scale: 2),
RawItemIdLast = c.Int(nullable: false),
})
.PrimaryKey(t => t.MatId);
CreateTable(
"dbo.RawItemModel",
c => new
{
RawItemId = c.Int(nullable: false, identity: true),
MatId = c.Int(nullable: false),
QtyAvail = c.Int(nullable: false),
IsActive = c.Boolean(nullable: false),
LMm = c.Decimal(nullable: false, precision: 18, scale: 2),
WMm = c.Decimal(nullable: false, precision: 18, scale: 2),
HMm = c.Decimal(nullable: false, precision: 18, scale: 2),
Note = c.String(unicode: false),
})
.PrimaryKey(t => t.RawItemId)
.ForeignKey("dbo.Materials", t => t.MatId, cascadeDelete: true)
.Index(t => t.MatId);
}
public override void Down()
{
DropForeignKey("dbo.RawItemModel", "MatId", "dbo.Materials");
DropIndex("dbo.RawItemModel", new[] { "MatId" });
DropTable("dbo.RawItemModel");
DropTable("dbo.Materials");
}
}
}
File diff suppressed because one or more lines are too long