using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace ManagerService.Migrations
{
///
public partial class LotJ_ThemeAggregatesAndCollectionSwitch : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn(
name: "IsVisitorQuestionCollectionEnabled",
table: "Instances",
type: "boolean",
nullable: false,
defaultValue: false);
migrationBuilder.CreateTable(
name: "QuestionThemeMonthlies",
columns: table => new
{
Id = table.Column(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
InstanceId = table.Column(type: "text", nullable: true),
Month = table.Column(type: "timestamp with time zone", nullable: false),
Theme = table.Column(type: "text", nullable: true),
Count = table.Column(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_QuestionThemeMonthlies", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_QuestionThemeMonthlies_InstanceId_Month",
table: "QuestionThemeMonthlies",
columns: new[] { "InstanceId", "Month" });
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "QuestionThemeMonthlies");
migrationBuilder.DropColumn(
name: "IsVisitorQuestionCollectionEnabled",
table: "Instances");
}
}
}