Aggiunta migrazione x dato UserAppr
This commit is contained in:
@@ -28,6 +28,7 @@ namespace MP.FileData.DatabaseModels
|
||||
public string Name { get; set; } = "";
|
||||
public int Rev { get; set; } = 0;
|
||||
public DateTime LastMod { get; set; }
|
||||
public string UserAppr { get; set; } = "";
|
||||
public long Size { get; set; } = 0;
|
||||
public string Path { get; set; } = "";
|
||||
public string MimeType { get; set; } = "";
|
||||
|
||||
@@ -0,0 +1,181 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using MP.FileData;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace MP.FileData.Migrations
|
||||
{
|
||||
[DbContext(typeof(MoonPro_ProgContext))]
|
||||
[Migration("20241022090211_AddUserAppr")]
|
||||
partial class AddUserAppr
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.UseCollation("SQL_Latin1_General_CP1_CI_AS")
|
||||
.HasAnnotation("ProductVersion", "6.0.33")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);
|
||||
|
||||
modelBuilder.Entity("FileModelTagModel", b =>
|
||||
{
|
||||
b.Property<int>("FilesFileId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("TagsTagId")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("FilesFileId", "TagsTagId");
|
||||
|
||||
b.HasIndex("TagsTagId");
|
||||
|
||||
b.ToTable("FileModelTagModel");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("MP.FileData.DatabaseModels.ArchMaccModel", b =>
|
||||
{
|
||||
b.Property<string>("IdxMacchina")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("BasePath")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Descrizione")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("ImgUrl")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Nome")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Note")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("RuleName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("ShowOrder")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("IdxMacchina");
|
||||
|
||||
b.ToTable("Macchine");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
IdxMacchina = "0",
|
||||
BasePath = "",
|
||||
Descrizione = "--- Tutte ---",
|
||||
ImgUrl = "",
|
||||
Nome = "--- Tutte ---",
|
||||
Note = "",
|
||||
RuleName = "0",
|
||||
ShowOrder = 0
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("MP.FileData.DatabaseModels.FileModel", b =>
|
||||
{
|
||||
b.Property<int>("FileId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("FileId"), 1L, 1);
|
||||
|
||||
b.Property<bool>("Active")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<int>("DiskStatus")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<byte[]>("FileContent")
|
||||
.HasColumnType("varbinary(max)");
|
||||
|
||||
b.Property<string>("IdxMacchina")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<DateTime>("LastCheck")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime>("LastMod")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("MD5")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("MimeType")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Path")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("Rev")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<long>("Size")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<string>("UserAppr")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("nvarchar(250)")
|
||||
.HasDefaultValueSql("('')");
|
||||
|
||||
b.HasKey("FileId");
|
||||
|
||||
b.HasIndex("IdxMacchina", "Active", "DiskStatus");
|
||||
|
||||
b.ToTable("Files");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("MP.FileData.DatabaseModels.TagModel", b =>
|
||||
{
|
||||
b.Property<string>("TagId")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("TagId");
|
||||
|
||||
b.ToTable("Tags");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FileModelTagModel", b =>
|
||||
{
|
||||
b.HasOne("MP.FileData.DatabaseModels.FileModel", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("FilesFileId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("MP.FileData.DatabaseModels.TagModel", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("TagsTagId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("MP.FileData.DatabaseModels.FileModel", b =>
|
||||
{
|
||||
b.HasOne("MP.FileData.DatabaseModels.ArchMaccModel", "Macchina")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdxMacchina");
|
||||
|
||||
b.Navigation("Macchina");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace MP.FileData.Migrations
|
||||
{
|
||||
public partial class AddUserAppr : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "UserAppr",
|
||||
table: "Files",
|
||||
type: "nvarchar(250)",
|
||||
maxLength: 250,
|
||||
nullable: false,
|
||||
defaultValueSql: "('')");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "UserAppr",
|
||||
table: "Files");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,8 @@ using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace MP.FileData.Migrations
|
||||
{
|
||||
[DbContext(typeof(MoonPro_ProgContext))]
|
||||
@@ -15,10 +17,11 @@ namespace MP.FileData.Migrations
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("Relational:Collation", "SQL_Latin1_General_CP1_CI_AS")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128)
|
||||
.HasAnnotation("ProductVersion", "5.0.9")
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
.UseCollation("SQL_Latin1_General_CP1_CI_AS")
|
||||
.HasAnnotation("ProductVersion", "6.0.33")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);
|
||||
|
||||
modelBuilder.Entity("FileModelTagModel", b =>
|
||||
{
|
||||
@@ -35,57 +38,7 @@ namespace MP.FileData.Migrations
|
||||
b.ToTable("FileModelTagModel");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("MP.FileData.DatabaseModels.FileModel", b =>
|
||||
{
|
||||
b.Property<int>("FileId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
b.Property<bool>("Active")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<int>("DiskStatus")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<byte[]>("FileContent")
|
||||
.HasColumnType("varbinary(max)");
|
||||
|
||||
b.Property<string>("IdxMacchina")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<DateTime>("LastCheck")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime>("LastMod")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("MD5")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("MimeType")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Path")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("Rev")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<long>("Size")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.HasKey("FileId");
|
||||
|
||||
b.HasIndex("IdxMacchina", "Active", "DiskStatus");
|
||||
|
||||
b.ToTable("Files");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("MP.FileData.DatabaseModels.MacchinaModel", b =>
|
||||
modelBuilder.Entity("MP.FileData.DatabaseModels.ArchMaccModel", b =>
|
||||
{
|
||||
b.Property<string>("IdxMacchina")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
@@ -129,6 +82,64 @@ namespace MP.FileData.Migrations
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("MP.FileData.DatabaseModels.FileModel", b =>
|
||||
{
|
||||
b.Property<int>("FileId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("FileId"), 1L, 1);
|
||||
|
||||
b.Property<bool>("Active")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<int>("DiskStatus")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<byte[]>("FileContent")
|
||||
.HasColumnType("varbinary(max)");
|
||||
|
||||
b.Property<string>("IdxMacchina")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<DateTime>("LastCheck")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime>("LastMod")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("MD5")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("MimeType")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Path")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("Rev")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<long>("Size")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<string>("UserAppr")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("nvarchar(250)")
|
||||
.HasDefaultValueSql("('')");
|
||||
|
||||
b.HasKey("FileId");
|
||||
|
||||
b.HasIndex("IdxMacchina", "Active", "DiskStatus");
|
||||
|
||||
b.ToTable("Files");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("MP.FileData.DatabaseModels.TagModel", b =>
|
||||
{
|
||||
b.Property<string>("TagId")
|
||||
@@ -156,7 +167,7 @@ namespace MP.FileData.Migrations
|
||||
|
||||
modelBuilder.Entity("MP.FileData.DatabaseModels.FileModel", b =>
|
||||
{
|
||||
b.HasOne("MP.FileData.DatabaseModels.MacchinaModel", "Macchina")
|
||||
b.HasOne("MP.FileData.DatabaseModels.ArchMaccModel", "Macchina")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdxMacchina");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user