using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Monitoring.Infrastructure.Data.Migrations
{
	/// <inheritdoc />
	public partial class AddLanguageCodeToCheckListTemplateItemTranslations : Migration
	{
		/// <inheritdoc />
		protected override void Up(MigrationBuilder migrationBuilder)
		{
			migrationBuilder.DropIndex(
				name: "IX_CheckListTemplateItemTranslations_ItemId",
				table: "CheckListTemplateItemTranslations"
			);

			migrationBuilder.AddColumn<string>(
				name: "LanguageCode",
				table: "CheckListTemplateItemTranslations",
				type: "character varying(10)",
				maxLength: 10,
				nullable: false,
				defaultValue: ""
			);

			migrationBuilder.CreateIndex(
				name: "IX_CheckListTemplateItemTranslations_ItemId_LanguageCode",
				table: "CheckListTemplateItemTranslations",
				columns: new[] { "ItemId", "LanguageCode" },
				unique: true
			);
		}

		/// <inheritdoc />
		protected override void Down(MigrationBuilder migrationBuilder)
		{
			migrationBuilder.DropIndex(
				name: "IX_CheckListTemplateItemTranslations_ItemId_LanguageCode",
				table: "CheckListTemplateItemTranslations"
			);

			migrationBuilder.DropColumn(
				name: "LanguageCode",
				table: "CheckListTemplateItemTranslations"
			);

			migrationBuilder.CreateIndex(
				name: "IX_CheckListTemplateItemTranslations_ItemId",
				table: "CheckListTemplateItemTranslations",
				column: "ItemId"
			);
		}
	}
}
