JobQueue for import layers

This commit is contained in:
Michał Zieliński
2025-06-07 12:33:33 +02:00
parent e56be55274
commit 787df8b838
8 changed files with 972 additions and 114 deletions

View File

@@ -1,11 +1,10 @@
// <auto-generated />
using System;
using DiunaBI.Core.Database.Context;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using DiunaBI.Core.Models;
using DiunaBI.Core.Database.Context;
#nullable disable
@@ -18,12 +17,12 @@ namespace DiunaBI.Core.Migrations
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "9.0.0")
.HasAnnotation("ProductVersion", "8.0.0")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("WebAPI.Models.DataInbox", b =>
modelBuilder.Entity("DiunaBI.Core.Models.DataInbox", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
@@ -52,7 +51,7 @@ namespace DiunaBI.Core.Migrations
b.ToTable("DataInbox");
});
modelBuilder.Entity("WebAPI.Models.Layer", b =>
modelBuilder.Entity("DiunaBI.Core.Models.Layer", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
@@ -101,7 +100,7 @@ namespace DiunaBI.Core.Migrations
b.ToTable("Layers");
});
modelBuilder.Entity("WebAPI.Models.ProcessSource", b =>
modelBuilder.Entity("DiunaBI.Core.Models.ProcessSource", b =>
{
b.Property<Guid>("LayerId")
.HasColumnType("uniqueidentifier");
@@ -116,32 +115,63 @@ namespace DiunaBI.Core.Migrations
b.ToTable("ProcessSources");
});
modelBuilder.Entity("WebAPI.Models.QueueJob", b =>
modelBuilder.Entity("DiunaBI.Core.Models.QueueJob", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<int>("Attempts")
.HasColumnType("int");
b.Property<DateTime?>("CompletedAt")
.HasColumnType("datetime2");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<DateTime>("CreatedAtUtc")
.HasColumnType("datetime2");
b.Property<Guid>("CreatedById")
.HasColumnType("uniqueidentifier");
b.Property<int>("JobType")
.HasColumnType("int");
b.Property<DateTime?>("LastAttemptAt")
.HasColumnType("datetime2");
b.Property<string>("LastError")
.HasMaxLength(1000)
.HasColumnType("nvarchar(1000)");
b.Property<Guid>("LayerId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Message")
b.Property<string>("LayerName")
.IsRequired()
.HasColumnType("nvarchar(max)");
.HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<DateTime>("ModifiedAt")
.HasColumnType("datetime2");
b.Property<int>("Status")
b.Property<int>("MaxRetries")
.HasColumnType("int");
b.Property<int>("Type")
b.Property<DateTime>("ModifiedAtUtc")
.HasColumnType("datetime2");
b.Property<Guid>("ModifiedById")
.HasColumnType("uniqueidentifier");
b.Property<string>("PluginName")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<int>("Priority")
.HasColumnType("int");
b.Property<int>("RetryCount")
.HasColumnType("int");
b.Property<int>("Status")
.HasColumnType("int");
b.HasKey("Id");
@@ -149,7 +179,7 @@ namespace DiunaBI.Core.Migrations
b.ToTable("QueueJobs");
});
modelBuilder.Entity("WebAPI.Models.Record", b =>
modelBuilder.Entity("DiunaBI.Core.Models.Record", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
@@ -289,7 +319,7 @@ namespace DiunaBI.Core.Migrations
b.ToTable("Records");
});
modelBuilder.Entity("WebAPI.Models.User", b =>
modelBuilder.Entity("DiunaBI.Core.Models.User", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
@@ -311,21 +341,21 @@ namespace DiunaBI.Core.Migrations
b.ToTable("Users");
});
modelBuilder.Entity("WebAPI.Models.Layer", b =>
modelBuilder.Entity("DiunaBI.Core.Models.Layer", b =>
{
b.HasOne("WebAPI.Models.User", "CreatedBy")
b.HasOne("DiunaBI.Core.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WebAPI.Models.User", "ModifiedBy")
b.HasOne("DiunaBI.Core.Models.User", "ModifiedBy")
.WithMany()
.HasForeignKey("ModifiedById")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WebAPI.Models.Layer", "Parent")
b.HasOne("DiunaBI.Core.Models.Layer", "Parent")
.WithMany()
.HasForeignKey("ParentId");
@@ -336,9 +366,9 @@ namespace DiunaBI.Core.Migrations
b.Navigation("Parent");
});
modelBuilder.Entity("WebAPI.Models.ProcessSource", b =>
modelBuilder.Entity("DiunaBI.Core.Models.ProcessSource", b =>
{
b.HasOne("WebAPI.Models.Layer", "Source")
b.HasOne("DiunaBI.Core.Models.Layer", "Source")
.WithMany()
.HasForeignKey("SourceId")
.OnDelete(DeleteBehavior.Cascade)
@@ -347,21 +377,21 @@ namespace DiunaBI.Core.Migrations
b.Navigation("Source");
});
modelBuilder.Entity("WebAPI.Models.Record", b =>
modelBuilder.Entity("DiunaBI.Core.Models.Record", b =>
{
b.HasOne("WebAPI.Models.User", "CreatedBy")
b.HasOne("DiunaBI.Core.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WebAPI.Models.Layer", null)
b.HasOne("DiunaBI.Core.Models.Layer", null)
.WithMany("Records")
.HasForeignKey("LayerId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WebAPI.Models.User", "ModifiedBy")
b.HasOne("DiunaBI.Core.Models.User", "ModifiedBy")
.WithMany()
.HasForeignKey("ModifiedById")
.OnDelete(DeleteBehavior.Cascade)
@@ -372,7 +402,7 @@ namespace DiunaBI.Core.Migrations
b.Navigation("ModifiedBy");
});
modelBuilder.Entity("WebAPI.Models.Layer", b =>
modelBuilder.Entity("DiunaBI.Core.Models.Layer", b =>
{
b.Navigation("Records");
});