//
using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using TeamUp.Modules.OrgBoard.Persistence;
#nullable disable
namespace TeamUp.Modules.OrgBoard.Persistence.Migrations
{
[DbContext(typeof(OrgBoardDbContext))]
[Migration("20260617041239_AddChangeRequests")]
partial class AddChangeRequests
{
///
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasDefaultSchema("orgboard")
.HasAnnotation("ProductVersion", "10.0.8")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("TeamUp.Modules.OrgBoard.Domain.Agent", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property("ApiConfigId")
.HasColumnType("uuid");
b.Property("Autonomy")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("character varying(20)");
b.Property("CreatedAtUtc")
.HasColumnType("timestamp with time zone");
b.PrimitiveCollection>("Docs")
.IsRequired()
.HasColumnType("text[]");
b.Property("FallbackApiConfigId")
.HasColumnType("uuid");
b.PrimitiveCollection>("McpServerIds")
.IsRequired()
.HasColumnType("uuid[]");
b.Property("Monogram")
.HasMaxLength(8)
.HasColumnType("character varying(8)");
b.Property("Name")
.IsRequired()
.HasMaxLength(120)
.HasColumnType("character varying(120)");
b.Property("Persona")
.HasColumnType("text");
b.Property("SeatId")
.HasColumnType("uuid");
b.PrimitiveCollection>("SkillKeys")
.IsRequired()
.HasColumnType("text[]");
b.Property("UpdatedAtUtc")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.HasIndex("SeatId")
.IsUnique();
b.ToTable("agents", "orgboard");
});
modelBuilder.Entity("TeamUp.Modules.OrgBoard.Domain.AgentProfile", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property("AuthoredByMemberId")
.HasColumnType("uuid");
b.Property("Body")
.IsRequired()
.HasColumnType("text");
b.Property("ContentHash")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)");
b.Property("CreatedAtUtc")
.HasColumnType("timestamp with time zone");
b.Property("Monogram")
.HasMaxLength(8)
.HasColumnType("character varying(8)");
b.Property("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("character varying(200)");
b.Property("OrganizationId")
.HasColumnType("uuid");
b.Property("Origin")
.HasColumnType("integer");
b.Property("ProfileKey")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property("RecommendedAutonomy")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("character varying(20)");
b.PrimitiveCollection>("Roles")
.IsRequired()
.HasColumnType("text[]");
b.PrimitiveCollection>("SkillKeys")
.IsRequired()
.HasColumnType("text[]");
b.Property("Status")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("character varying(20)");
b.Property("Summary")
.HasMaxLength(1000)
.HasColumnType("character varying(1000)");
b.Property("UpdatedAtUtc")
.HasColumnType("timestamp with time zone");
b.Property("Version")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)");
b.Property("Visibility")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("character varying(20)");
b.HasKey("Id");
b.HasIndex("OrganizationId");
b.HasIndex("OrganizationId", "ProfileKey", "Version")
.IsUnique();
NpgsqlIndexBuilderExtensions.AreNullsDistinct(b.HasIndex("OrganizationId", "ProfileKey", "Version"), false);
b.ToTable("agent_profiles", "orgboard");
});
modelBuilder.Entity("TeamUp.Modules.OrgBoard.Domain.ChangeRequest", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property("Amount")
.HasPrecision(12, 2)
.HasColumnType("numeric(12,2)");
b.Property("ApprovedAtUtc")
.HasColumnType("timestamp with time zone");
b.Property("CreatedAtUtc")
.HasColumnType("timestamp with time zone");
b.Property("Currency")
.IsRequired()
.HasMaxLength(8)
.HasColumnType("character varying(8)");
b.Property("CustomerName")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("character varying(200)");
b.Property("Description")
.HasColumnType("text");
b.Property("EstimateHours")
.HasPrecision(9, 2)
.HasColumnType("numeric(9,2)");
b.Property("EstimatedAtUtc")
.HasColumnType("timestamp with time zone");
b.Property("LiveAtUtc")
.HasColumnType("timestamp with time zone");
b.Property("OrganizationId")
.HasColumnType("uuid");
b.Property("PaidAtUtc")
.HasColumnType("timestamp with time zone");
b.Property("Status")
.IsRequired()
.HasMaxLength(16)
.HasColumnType("character varying(16)");
b.Property("Title")
.IsRequired()
.HasMaxLength(300)
.HasColumnType("character varying(300)");
b.Property("UpdatedAtUtc")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.HasIndex("OrganizationId");
b.ToTable("change_requests", "orgboard");
});
modelBuilder.Entity("TeamUp.Modules.OrgBoard.Domain.ChangeRequestStep", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property("ChangeRequestId")
.HasColumnType("uuid");
b.Property("CreatedAtUtc")
.HasColumnType("timestamp with time zone");
b.Property("DependsOnStepId")
.HasColumnType("uuid");
b.Property("DivisionId")
.HasColumnType("uuid");
b.Property("EstimateHours")
.HasPrecision(9, 2)
.HasColumnType("numeric(9,2)");
b.Property("Order")
.HasColumnType("integer");
b.Property("Status")
.IsRequired()
.HasMaxLength(16)
.HasColumnType("character varying(16)");
b.Property("Title")
.IsRequired()
.HasMaxLength(300)
.HasColumnType("character varying(300)");
b.Property("UpdatedAtUtc")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.HasIndex("ChangeRequestId");
b.ToTable("change_request_steps", "orgboard");
});
modelBuilder.Entity("TeamUp.Modules.OrgBoard.Domain.Division", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property("CreatedAtUtc")
.HasColumnType("timestamp with time zone");
b.Property("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("character varying(200)");
b.Property("OrganizationId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("OrganizationId");
b.ToTable("divisions", "orgboard");
});
modelBuilder.Entity("TeamUp.Modules.OrgBoard.Domain.Organization", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property("CreatedAtUtc")
.HasColumnType("timestamp with time zone");
b.Property("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("character varying(200)");
b.HasKey("Id");
b.ToTable("organizations", "orgboard");
});
modelBuilder.Entity("TeamUp.Modules.OrgBoard.Domain.Product", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property("CreatedAtUtc")
.HasColumnType("timestamp with time zone");
b.Property("DivisionId")
.HasColumnType("uuid");
b.Property("Identity")
.HasColumnType("text");
b.Property("Kind")
.IsRequired()
.HasMaxLength(16)
.HasColumnType("character varying(16)");
b.Property("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("character varying(200)");
b.Property("OrganizationId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("DivisionId");
b.HasIndex("OrganizationId");
b.ToTable("products", "orgboard");
});
modelBuilder.Entity("TeamUp.Modules.OrgBoard.Domain.ProductProfile", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property("AuthoredByMemberId")
.HasColumnType("uuid");
b.Property("Body")
.IsRequired()
.HasColumnType("text");
b.Property("ContentHash")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)");
b.Property("CreatedAtUtc")
.HasColumnType("timestamp with time zone");
b.Property("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("character varying(200)");
b.Property("OrganizationId")
.HasColumnType("uuid");
b.Property("Origin")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("character varying(20)");
b.Property("ProfileKey")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property("Status")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("character varying(20)");
b.Property("Summary")
.HasMaxLength(1000)
.HasColumnType("character varying(1000)");
b.Property("UpdatedAtUtc")
.HasColumnType("timestamp with time zone");
b.Property("Version")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)");
b.Property("Visibility")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("character varying(20)");
b.HasKey("Id");
b.HasIndex("OrganizationId");
b.HasIndex("OrganizationId", "ProfileKey", "Version")
.IsUnique();
NpgsqlIndexBuilderExtensions.AreNullsDistinct(b.HasIndex("OrganizationId", "ProfileKey", "Version"), false);
b.ToTable("product_profiles", "orgboard");
});
modelBuilder.Entity("TeamUp.Modules.OrgBoard.Domain.Seat", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property("AgentId")
.HasColumnType("uuid");
b.Property("CreatedAtUtc")
.HasColumnType("timestamp with time zone");
b.Property("MemberId")
.HasColumnType("uuid");
b.Property("RoleName")
.IsRequired()
.HasMaxLength(120)
.HasColumnType("character varying(120)");
b.Property("State")
.IsRequired()
.HasMaxLength(16)
.HasColumnType("character varying(16)");
b.Property("TeamId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("TeamId");
b.ToTable("seats", "orgboard");
});
modelBuilder.Entity("TeamUp.Modules.OrgBoard.Domain.Team", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property("CreatedAtUtc")
.HasColumnType("timestamp with time zone");
b.Property("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("character varying(200)");
b.Property("OrganizationId")
.HasColumnType("uuid");
b.Property("ProductId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("OrganizationId");
b.HasIndex("ProductId");
b.ToTable("teams", "orgboard");
});
modelBuilder.Entity("TeamUp.Modules.OrgBoard.Domain.WorkItem", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property("AssigneeId")
.HasColumnType("uuid");
b.Property("AssigneeKind")
.IsRequired()
.HasMaxLength(16)
.HasColumnType("character varying(16)");
b.Property("CreatedAtUtc")
.HasColumnType("timestamp with time zone");
b.Property("CreatedByMemberId")
.HasColumnType("uuid");
b.Property("Description")
.HasColumnType("text");
b.Property("ParentId")
.HasColumnType("uuid");
b.Property("Status")
.IsRequired()
.HasMaxLength(16)
.HasColumnType("character varying(16)");
b.Property("TeamId")
.HasColumnType("uuid");
b.Property("Title")
.IsRequired()
.HasMaxLength(300)
.HasColumnType("character varying(300)");
b.Property("Type")
.IsRequired()
.HasMaxLength(16)
.HasColumnType("character varying(16)");
b.Property("UpdatedAtUtc")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.HasIndex("TeamId");
b.HasIndex("AssigneeKind", "AssigneeId");
b.ToTable("work_items", "orgboard");
});
modelBuilder.Entity("TeamUp.Modules.OrgBoard.Domain.WorkItemTransition", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property("ActorMemberId")
.HasColumnType("uuid");
b.Property("FromStatus")
.IsRequired()
.HasMaxLength(16)
.HasColumnType("character varying(16)");
b.Property("OccurredAtUtc")
.HasColumnType("timestamp with time zone");
b.Property("TeamId")
.HasColumnType("uuid");
b.Property("ToStatus")
.IsRequired()
.HasMaxLength(16)
.HasColumnType("character varying(16)");
b.Property("WorkItemId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("TeamId");
b.HasIndex("WorkItemId");
b.ToTable("work_item_transitions", "orgboard");
});
#pragma warning restore 612, 618
}
}
}