Migration
This commit is contained in:
@@ -9,7 +9,7 @@ public class AppDbContext : DbContext
|
||||
public DbSet<Layer> Layers { get; init; }
|
||||
public DbSet<Record> Records { get; init; }
|
||||
public DbSet<ProcessSource> ProcessSources { get; init; }
|
||||
public DbSet<DataInbox> DataInbox { get; set; }
|
||||
// public DbSet<DataInbox> DataInbox { get; set; }
|
||||
|
||||
public AppDbContext(DbContextOptions<AppDbContext> options) : base(options)
|
||||
{
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace WebAPI.Migrations
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "7.0.13")
|
||||
.HasAnnotation("ProductVersion", "8.0.6")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
@@ -45,7 +45,8 @@ namespace WebAPI.Migrations
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<int>("Number")
|
||||
.HasColumnType("int");
|
||||
@@ -53,10 +54,6 @@ namespace WebAPI.Migrations
|
||||
b.Property<Guid?>("ParentId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Source")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("Type")
|
||||
.HasColumnType("int");
|
||||
|
||||
@@ -94,7 +91,8 @@ namespace WebAPI.Migrations
|
||||
|
||||
b.Property<string>("Code")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime2");
|
||||
@@ -103,19 +101,8 @@ namespace WebAPI.Migrations
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Desc1")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Desc2")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Desc3")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Desc4")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Desc5")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
.HasMaxLength(1000)
|
||||
.HasColumnType("nvarchar(1000)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
@@ -246,7 +233,8 @@ namespace WebAPI.Migrations
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.HasMaxLength(50)
|
||||
@@ -285,7 +273,7 @@ namespace WebAPI.Migrations
|
||||
modelBuilder.Entity("WebAPI.Models.ProcessSource", b =>
|
||||
{
|
||||
b.HasOne("WebAPI.Models.Layer", "Source")
|
||||
.WithMany("Sources")
|
||||
.WithMany()
|
||||
.HasForeignKey("SourceId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
@@ -321,8 +309,6 @@ namespace WebAPI.Migrations
|
||||
modelBuilder.Entity("WebAPI.Models.Layer", b =>
|
||||
{
|
||||
b.Navigation("Records");
|
||||
|
||||
b.Navigation("Sources");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@ public class Layer
|
||||
public Guid Id { get; init; }
|
||||
[Required]
|
||||
public int Number { get; init; }
|
||||
|
||||
[Required]
|
||||
[MaxLength(50)]
|
||||
public string? Name { get; set; }
|
||||
|
||||
@@ -43,17 +43,8 @@ public class Record
|
||||
public double? Value31 { get; set; }
|
||||
public double? Value32 { get; set; }
|
||||
//Description fields
|
||||
[StringLength(50)]
|
||||
[StringLength(1000)]
|
||||
public string? Desc1 { get; init; }
|
||||
[StringLength(50)]
|
||||
public string? Desc2 { get; init; }
|
||||
[StringLength(50)]
|
||||
public string? Desc3 { get; init; }
|
||||
[StringLength(50)]
|
||||
public string? Desc4 { get; init; }
|
||||
[StringLength(50)]
|
||||
public string? Desc5 { get; init; }
|
||||
[StringLength(50)]
|
||||
public DateTime CreatedAt { get; set; }
|
||||
public DateTime ModifiedAt { get; set; }
|
||||
public bool IsDeleted { get; init; }
|
||||
|
||||
Reference in New Issue
Block a user