using System; using Microsoft.EntityFrameworkCore.Migrations; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable namespace ManagerService.Migrations { /// public partial class AddVisitorQuestion : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "VisitorQuestions", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), ConversationId = table.Column(type: "text", nullable: true), InstanceId = table.Column(type: "text", nullable: true), ConfigurationId = table.Column(type: "text", nullable: true), AppType = table.Column(type: "integer", nullable: false), IsVoice = table.Column(type: "boolean", nullable: false), Language = table.Column(type: "character varying(5)", maxLength: 5, nullable: true), Question = table.Column(type: "text", nullable: true), Reply = table.Column(type: "text", nullable: true), TokensUsed = table.Column(type: "bigint", nullable: false), HasAnswer = table.Column(type: "boolean", nullable: false), TopScore = table.Column(type: "double precision", nullable: false), CitedContentIds = table.Column(type: "jsonb", nullable: true), ThemeId = table.Column(type: "text", nullable: true), CreatedAt = table.Column(type: "timestamp with time zone", nullable: false) }, constraints: table => { table.PrimaryKey("PK_VisitorQuestions", x => x.Id); }); migrationBuilder.CreateIndex( name: "IX_VisitorQuestions_ConversationId", table: "VisitorQuestions", column: "ConversationId"); migrationBuilder.CreateIndex( name: "IX_VisitorQuestions_InstanceId_CreatedAt", table: "VisitorQuestions", columns: new[] { "InstanceId", "CreatedAt" }); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "VisitorQuestions"); } } }