Fix migrazioni e naming

This commit is contained in:
Samuele Locatelli
2024-01-18 16:35:04 +01:00
parent 819928805f
commit 559206cd70
9 changed files with 157 additions and 331 deletions
@@ -8,6 +8,10 @@ using System.Threading.Tasks;
namespace EgtBEAMWALL.DataLayer.DatabaseModels
{
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
[Table("AliasList")]
public class AliasModel
{
/// <summary>
@@ -190,13 +190,9 @@
<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\202401181425519_AddAliasModel.cs" />
<Compile Include="Migrations\202401181425519_AddAliasModel.designer.cs">
<DependentUpon>202401181425519_AddAliasModel.cs</DependentUpon>
<Compile Include="Migrations\202401181534084_AddAliasMaterialRawItemsModel.cs" />
<Compile Include="Migrations\202401181534084_AddAliasMaterialRawItemsModel.designer.cs">
<DependentUpon>202401181534084_AddAliasMaterialRawItemsModel.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\Configuration.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
@@ -246,11 +242,8 @@
<EmbeddedResource Include="Migrations\202308250853396_AddProjArchivedField.resx">
<DependentUpon>202308250853396_AddProjArchivedField.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Migrations\202401181206504_AddMaterialAndRawItems.resx">
<DependentUpon>202401181206504_AddMaterialAndRawItems.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Migrations\202401181425519_AddAliasModel.resx">
<DependentUpon>202401181425519_AddAliasModel.cs</DependentUpon>
<EmbeddedResource Include="Migrations\202401181534084_AddAliasMaterialRawItemsModel.resx">
<DependentUpon>202401181534084_AddAliasMaterialRawItemsModel.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
File diff suppressed because one or more lines are too long
@@ -1,29 +0,0 @@
// <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 AddAliasModel : IMigrationMetadata
{
private readonly ResourceManager Resources = new ResourceManager(typeof(AddAliasModel));
string IMigrationMetadata.Id
{
get { return "202401181425519_AddAliasModel"; }
}
string IMigrationMetadata.Source
{
get { return null; }
}
string IMigrationMetadata.Target
{
get { return Resources.GetString("Target"); }
}
}
}
@@ -1,27 +0,0 @@
namespace EgtBEAMWALL.DataLayer.Migrations
{
using System;
using System.Data.Entity.Migrations;
public partial class AddAliasModel : DbMigration
{
public override void Up()
{
CreateTable(
"dbo.AliasModels",
c => new
{
Family = c.String(nullable: false, maxLength: 128, storeType: "nvarchar"),
ValueOriginal = c.String(nullable: false, maxLength: 128, storeType: "nvarchar"),
ValueAlias = c.String(unicode: false),
})
.PrimaryKey(t => new { t.Family, t.ValueOriginal });
}
public override void Down()
{
DropTable("dbo.AliasModels");
}
}
}
File diff suppressed because one or more lines are too long
@@ -7,13 +7,13 @@ namespace EgtBEAMWALL.DataLayer.Migrations
using System.Resources;
[GeneratedCode("EntityFramework.Migrations", "6.4.4")]
public sealed partial class AddMaterialAndRawItems : IMigrationMetadata
public sealed partial class AddAliasMaterialRawItemsModel : IMigrationMetadata
{
private readonly ResourceManager Resources = new ResourceManager(typeof(AddMaterialAndRawItems));
private readonly ResourceManager Resources = new ResourceManager(typeof(AddAliasMaterialRawItemsModel));
string IMigrationMetadata.Id
{
get { return "202401181206504_AddMaterialAndRawItems"; }
get { return "202401181534084_AddAliasMaterialRawItemsModel"; }
}
string IMigrationMetadata.Source
@@ -3,12 +3,22 @@
using System;
using System.Data.Entity.Migrations;
public partial class AddMaterialAndRawItems : DbMigration
public partial class AddAliasMaterialRawItemsModel : DbMigration
{
public override void Up()
{
CreateTable(
"dbo.Materials",
"dbo.AliasList",
c => new
{
Family = c.String(nullable: false, maxLength: 128, storeType: "nvarchar"),
ValueOriginal = c.String(nullable: false, maxLength: 128, storeType: "nvarchar"),
ValueAlias = c.String(unicode: false),
})
.PrimaryKey(t => new { t.Family, t.ValueOriginal });
CreateTable(
"dbo.MaterialsList",
c => new
{
MatId = c.Int(nullable: false, identity: true),
@@ -23,7 +33,7 @@
.PrimaryKey(t => t.MatId);
CreateTable(
"dbo.RawItemModel",
"dbo.RawItemList",
c => new
{
RawItemId = c.Int(nullable: false, identity: true),
@@ -36,17 +46,18 @@
Note = c.String(unicode: false),
})
.PrimaryKey(t => t.RawItemId)
.ForeignKey("dbo.Materials", t => t.MatId, cascadeDelete: true)
.ForeignKey("dbo.MaterialsList", 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");
DropForeignKey("dbo.RawItemList", "MatId", "dbo.MaterialsList");
DropIndex("dbo.RawItemList", new[] { "MatId" });
DropTable("dbo.RawItemList");
DropTable("dbo.MaterialsList");
DropTable("dbo.AliasList");
}
}
}
File diff suppressed because one or more lines are too long