// using System; using ColaFlow.Modules.ProjectManagement.Infrastructure.Persistence; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable namespace ColaFlow.Modules.ProjectManagement.Infrastructure.Migrations { [DbContext(typeof(PMDbContext))] [Migration("20251104231026_AddSprintEntity")] partial class AddSprintEntity { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasDefaultSchema("project_management") .HasAnnotation("ProductVersion", "9.0.10") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); modelBuilder.Entity("ColaFlow.Modules.ProjectManagement.Domain.Aggregates.ProjectAggregate.Epic", b => { b.Property("Id") .HasColumnType("uuid"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("Description") .IsRequired() .HasMaxLength(2000) .HasColumnType("character varying(2000)"); b.Property("Name") .IsRequired() .HasMaxLength(200) .HasColumnType("character varying(200)"); b.Property("Priority") .IsRequired() .HasMaxLength(50) .HasColumnType("character varying(50)"); b.Property("ProjectId") .HasColumnType("uuid"); b.Property("Status") .IsRequired() .HasMaxLength(50) .HasColumnType("character varying(50)"); b.Property("TenantId") .HasColumnType("uuid") .HasColumnName("tenant_id"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.HasKey("Id"); b.HasIndex("CreatedAt"); b.HasIndex("ProjectId"); b.HasIndex("TenantId") .HasDatabaseName("ix_epics_tenant_id"); b.ToTable("Epics", "project_management"); }); modelBuilder.Entity("ColaFlow.Modules.ProjectManagement.Domain.Aggregates.ProjectAggregate.Project", b => { b.Property("Id") .HasColumnType("uuid"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("Description") .IsRequired() .HasMaxLength(2000) .HasColumnType("character varying(2000)"); b.Property("Name") .IsRequired() .HasMaxLength(200) .HasColumnType("character varying(200)"); b.Property("OwnerId") .HasColumnType("uuid"); b.Property("Status") .IsRequired() .HasMaxLength(50) .HasColumnType("character varying(50)"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.HasKey("Id"); b.HasIndex("CreatedAt"); b.HasIndex("OwnerId"); b.HasIndex("TenantId"); b.ToTable("Projects", "project_management"); }); modelBuilder.Entity("ColaFlow.Modules.ProjectManagement.Domain.Aggregates.ProjectAggregate.Sprint", b => { b.Property("Id") .HasColumnType("uuid"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("EndDate") .HasColumnType("timestamp with time zone"); b.Property("Goal") .HasMaxLength(1000) .HasColumnType("character varying(1000)"); b.Property("Name") .IsRequired() .HasMaxLength(200) .HasColumnType("character varying(200)"); b.Property("ProjectId") .HasColumnType("uuid"); b.Property("StartDate") .HasColumnType("timestamp with time zone"); b.Property("Status") .IsRequired() .HasMaxLength(20) .HasColumnType("character varying(20)"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("_taskIds") .IsRequired() .HasColumnType("jsonb") .HasColumnName("TaskIds"); b.HasKey("Id"); b.HasIndex("EndDate") .HasDatabaseName("IX_Sprints_EndDate"); b.HasIndex("StartDate") .HasDatabaseName("IX_Sprints_StartDate"); b.HasIndex("TenantId", "ProjectId") .HasDatabaseName("IX_Sprints_TenantId_ProjectId"); b.HasIndex("TenantId", "Status") .HasDatabaseName("IX_Sprints_TenantId_Status"); b.ToTable("Sprints", "project_management"); }); modelBuilder.Entity("ColaFlow.Modules.ProjectManagement.Domain.Aggregates.ProjectAggregate.Story", b => { b.Property("Id") .HasColumnType("uuid"); b.Property("ActualHours") .HasColumnType("numeric"); b.Property("AssigneeId") .HasColumnType("uuid"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("Description") .IsRequired() .HasMaxLength(4000) .HasColumnType("character varying(4000)"); b.Property("EpicId") .HasColumnType("uuid"); b.Property("EstimatedHours") .HasColumnType("numeric"); b.Property("Priority") .IsRequired() .HasMaxLength(50) .HasColumnType("character varying(50)"); b.Property("Status") .IsRequired() .HasMaxLength(50) .HasColumnType("character varying(50)"); b.Property("TenantId") .HasColumnType("uuid") .HasColumnName("tenant_id"); b.Property("Title") .IsRequired() .HasMaxLength(200) .HasColumnType("character varying(200)"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.HasKey("Id"); b.HasIndex("AssigneeId"); b.HasIndex("CreatedAt"); b.HasIndex("EpicId"); b.HasIndex("TenantId") .HasDatabaseName("ix_stories_tenant_id"); b.ToTable("Stories", "project_management"); }); modelBuilder.Entity("ColaFlow.Modules.ProjectManagement.Domain.Aggregates.ProjectAggregate.WorkTask", b => { b.Property("Id") .HasColumnType("uuid"); b.Property("ActualHours") .HasColumnType("numeric"); b.Property("AssigneeId") .HasColumnType("uuid"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("CreatedBy") .HasColumnType("uuid"); b.Property("Description") .IsRequired() .HasMaxLength(4000) .HasColumnType("character varying(4000)"); b.Property("EstimatedHours") .HasColumnType("numeric"); b.Property("Priority") .IsRequired() .HasMaxLength(50) .HasColumnType("character varying(50)"); b.Property("Status") .IsRequired() .HasMaxLength(50) .HasColumnType("character varying(50)"); b.Property("StoryId") .HasColumnType("uuid"); b.Property("TenantId") .HasColumnType("uuid") .HasColumnName("tenant_id"); b.Property("Title") .IsRequired() .HasMaxLength(200) .HasColumnType("character varying(200)"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.HasKey("Id"); b.HasIndex("AssigneeId"); b.HasIndex("CreatedAt"); b.HasIndex("StoryId"); b.HasIndex("TenantId") .HasDatabaseName("ix_tasks_tenant_id"); b.ToTable("Tasks", "project_management"); }); modelBuilder.Entity("ColaFlow.Modules.ProjectManagement.Domain.Entities.AuditLog", b => { b.Property("Id") .HasColumnType("uuid"); b.Property("Action") .IsRequired() .HasMaxLength(20) .HasColumnType("character varying(20)"); b.Property("EntityId") .HasColumnType("uuid"); b.Property("EntityType") .IsRequired() .HasMaxLength(100) .HasColumnType("character varying(100)"); b.Property("NewValues") .HasColumnType("jsonb"); b.Property("OldValues") .HasColumnType("jsonb"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("Timestamp") .HasColumnType("timestamp with time zone"); b.Property("UserId") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("Timestamp") .IsDescending() .HasDatabaseName("IX_AuditLogs_Timestamp"); b.HasIndex("UserId") .HasDatabaseName("IX_AuditLogs_UserId"); b.HasIndex("TenantId", "EntityType", "EntityId") .HasDatabaseName("IX_AuditLogs_TenantId_EntityType_EntityId"); b.ToTable("AuditLogs", "project_management"); }); modelBuilder.Entity("ColaFlow.Modules.ProjectManagement.Domain.Aggregates.ProjectAggregate.Epic", b => { b.HasOne("ColaFlow.Modules.ProjectManagement.Domain.Aggregates.ProjectAggregate.Project", null) .WithMany("Epics") .HasForeignKey("ProjectId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("ColaFlow.Modules.ProjectManagement.Domain.Aggregates.ProjectAggregate.Project", b => { b.OwnsOne("ColaFlow.Modules.ProjectManagement.Domain.ValueObjects.ProjectKey", "Key", b1 => { b1.Property("ProjectId") .HasColumnType("uuid"); b1.Property("Value") .IsRequired() .HasMaxLength(20) .HasColumnType("character varying(20)") .HasColumnName("Key"); b1.HasKey("ProjectId"); b1.HasIndex("Value") .IsUnique(); b1.ToTable("Projects", "project_management"); b1.WithOwner() .HasForeignKey("ProjectId"); }); b.Navigation("Key") .IsRequired(); }); modelBuilder.Entity("ColaFlow.Modules.ProjectManagement.Domain.Aggregates.ProjectAggregate.Story", b => { b.HasOne("ColaFlow.Modules.ProjectManagement.Domain.Aggregates.ProjectAggregate.Epic", null) .WithMany("Stories") .HasForeignKey("EpicId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("ColaFlow.Modules.ProjectManagement.Domain.Aggregates.ProjectAggregate.WorkTask", b => { b.HasOne("ColaFlow.Modules.ProjectManagement.Domain.Aggregates.ProjectAggregate.Story", null) .WithMany("Tasks") .HasForeignKey("StoryId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("ColaFlow.Modules.ProjectManagement.Domain.Aggregates.ProjectAggregate.Epic", b => { b.Navigation("Stories"); }); modelBuilder.Entity("ColaFlow.Modules.ProjectManagement.Domain.Aggregates.ProjectAggregate.Project", b => { b.Navigation("Epics"); }); modelBuilder.Entity("ColaFlow.Modules.ProjectManagement.Domain.Aggregates.ProjectAggregate.Story", b => { b.Navigation("Tasks"); }); #pragma warning restore 612, 618 } } }