using System; using System.Collections.Generic; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace TeamUp.Modules.OrgBoard.Persistence.Migrations { /// public partial class AddAgentProfiles : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn( name: "Persona", schema: "orgboard", table: "agents", type: "text", nullable: true); migrationBuilder.CreateTable( name: "agent_profiles", schema: "orgboard", columns: table => new { Id = table.Column(type: "uuid", nullable: false), OrganizationId = table.Column(type: "uuid", nullable: true), Origin = table.Column(type: "integer", nullable: false), AuthoredByMemberId = table.Column(type: "uuid", nullable: true), ProfileKey = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), Name = table.Column(type: "character varying(200)", maxLength: 200, nullable: false), Version = table.Column(type: "character varying(32)", maxLength: 32, nullable: false), Summary = table.Column(type: "character varying(1000)", maxLength: 1000, nullable: true), Roles = table.Column>(type: "text[]", nullable: false), Monogram = table.Column(type: "character varying(8)", maxLength: 8, nullable: true), RecommendedAutonomy = table.Column(type: "character varying(20)", maxLength: 20, nullable: false), SkillKeys = table.Column>(type: "text[]", nullable: false), Body = table.Column(type: "text", nullable: false), Visibility = table.Column(type: "character varying(20)", maxLength: 20, nullable: false), Status = table.Column(type: "character varying(20)", maxLength: 20, nullable: false), ContentHash = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), CreatedAtUtc = table.Column(type: "timestamp with time zone", nullable: false), UpdatedAtUtc = table.Column(type: "timestamp with time zone", nullable: false) }, constraints: table => { table.PrimaryKey("PK_agent_profiles", x => x.Id); }); migrationBuilder.CreateIndex( name: "IX_agent_profiles_OrganizationId", schema: "orgboard", table: "agent_profiles", column: "OrganizationId"); migrationBuilder.CreateIndex( name: "IX_agent_profiles_OrganizationId_ProfileKey_Version", schema: "orgboard", table: "agent_profiles", columns: new[] { "OrganizationId", "ProfileKey", "Version" }, unique: true) .Annotation("Npgsql:NullsDistinct", false); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "agent_profiles", schema: "orgboard"); migrationBuilder.DropColumn( name: "Persona", schema: "orgboard", table: "agents"); } } }