// using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; using w4c_workflows.Data; #nullable disable namespace w4c_workflows.Data.Migrations { [DbContext(typeof(WorkflowsDbContext))] [Migration("20260828130001_InitialCreate")] partial class InitialCreate { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasDefaultSchema("workflows") .HasAnnotation("ProductVersion", "10.0.10") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); modelBuilder.Entity("w4c_workflows.Models.ApiKey", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("KeyHash") .IsRequired() .HasMaxLength(64) .HasColumnType("character varying(64)"); b.Property("Label") .IsRequired() .HasMaxLength(200) .HasColumnType("character varying(200)"); b.Property("LastUsedAt") .HasColumnType("timestamp with time zone"); b.Property("RevokedAt") .HasColumnType("timestamp with time zone"); b.Property("ScopesJson") .HasColumnType("jsonb"); b.Property("TenantId") .IsRequired() .HasColumnType("text"); b.HasKey("Id"); b.HasIndex("TenantId"); b.ToTable("ApiKeys", "workflows"); }); modelBuilder.Entity("w4c_workflows.Models.DurableState", b => { b.Property("InstanceId") .HasMaxLength(128) .HasColumnType("character varying(128)"); b.Property("CheckpointAt") .HasColumnType("timestamp with time zone"); b.Property("CorrelationId") .HasMaxLength(128) .HasColumnType("character varying(128)"); b.Property("StateJson") .HasColumnType("jsonb"); b.Property("TaskId") .HasColumnType("uuid"); b.HasKey("InstanceId"); b.HasIndex("CorrelationId"); b.ToTable("DurableStates", "workflows"); }); modelBuilder.Entity("w4c_workflows.Models.TaskRun", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("Attempt") .HasColumnType("integer"); b.Property("Error") .HasColumnType("text"); b.Property("FinishedAt") .HasColumnType("timestamp with time zone"); b.Property("InputJson") .HasColumnType("jsonb"); b.Property("OutputJson") .HasColumnType("jsonb"); b.Property("RetryCount") .HasColumnType("integer"); b.Property("RunId") .HasColumnType("uuid"); b.Property("StartedAt") .HasColumnType("timestamp with time zone"); b.Property("Status") .IsRequired() .HasMaxLength(32) .HasColumnType("character varying(32)"); b.Property("TaskId") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("RunId"); b.HasIndex("TaskId"); b.ToTable("TaskRuns", "workflows"); }); modelBuilder.Entity("w4c_workflows.Models.Workflow", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("CompiledAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("GitSha") .HasMaxLength(64) .HasColumnType("character varying(64)"); b.Property("Mode") .IsRequired() .HasMaxLength(32) .HasColumnType("character varying(32)"); b.Property("Name") .IsRequired() .HasMaxLength(200) .HasColumnType("character varying(200)"); b.Property("Path") .IsRequired() .HasMaxLength(500) .HasColumnType("character varying(500)"); b.Property("Status") .IsRequired() .HasMaxLength(32) .HasColumnType("character varying(32)"); b.Property("Target") .IsRequired() .HasMaxLength(100) .HasColumnType("character varying(100)"); b.Property("TenantId") .IsRequired() .HasColumnType("text"); b.Property("TriggerJson") .HasColumnType("jsonb"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.HasKey("Id"); b.HasIndex("TenantId"); b.HasIndex("TenantId", "Name") .IsUnique(); b.ToTable("Workflows", "workflows"); }); modelBuilder.Entity("w4c_workflows.Models.WorkflowRun", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("CorrelationId") .HasMaxLength(128) .HasColumnType("character varying(128)"); b.Property("Error") .HasColumnType("text"); b.Property("FinishedAt") .HasColumnType("timestamp with time zone"); b.Property("InputJson") .HasColumnType("jsonb"); b.Property("OutputJson") .HasColumnType("jsonb"); b.Property("StartedAt") .HasColumnType("timestamp with time zone"); b.Property("Status") .IsRequired() .HasMaxLength(32) .HasColumnType("character varying(32)"); b.Property("TenantId") .IsRequired() .HasColumnType("text"); b.Property("TriggerJson") .HasColumnType("jsonb"); b.Property("WorkflowId") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("CorrelationId"); b.HasIndex("TenantId"); b.HasIndex("WorkflowId"); b.ToTable("WorkflowRuns", "workflows"); }); modelBuilder.Entity("w4c_workflows.Models.WorkflowTask", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("EntryJson") .HasColumnType("jsonb"); b.Property("EnvJson") .HasColumnType("jsonb"); b.Property("Language") .IsRequired() .HasMaxLength(32) .HasColumnType("character varying(32)"); b.Property("Mode") .IsRequired() .HasMaxLength(32) .HasColumnType("character varying(32)"); b.Property("NextId") .HasColumnType("uuid"); b.Property("OnErrorId") .HasColumnType("uuid"); b.Property("Order") .HasColumnType("integer"); b.Property("ParentId") .HasColumnType("uuid"); b.Property("WorkflowId") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("WorkflowId"); b.ToTable("Tasks", "workflows"); }); modelBuilder.Entity("w4c_workflows.Models.TaskRun", b => { b.HasOne("w4c_workflows.Models.WorkflowRun", "Run") .WithMany("TaskRuns") .HasForeignKey("RunId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("w4c_workflows.Models.WorkflowTask", "Task") .WithMany() .HasForeignKey("TaskId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.Navigation("Run"); b.Navigation("Task"); }); modelBuilder.Entity("w4c_workflows.Models.WorkflowRun", b => { b.HasOne("w4c_workflows.Models.Workflow", "Workflow") .WithMany() .HasForeignKey("WorkflowId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.Navigation("Workflow"); }); modelBuilder.Entity("w4c_workflows.Models.WorkflowTask", b => { b.HasOne("w4c_workflows.Models.Workflow", "Workflow") .WithMany("Tasks") .HasForeignKey("WorkflowId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Workflow"); }); modelBuilder.Entity("w4c_workflows.Models.Workflow", b => { b.Navigation("Tasks"); }); modelBuilder.Entity("w4c_workflows.Models.WorkflowRun", b => { b.Navigation("TaskRuns"); }); #pragma warning restore 612, 618 } } }