using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace ScadaLink.ConfigurationDatabase.Migrations
{
    /// <inheritdoc />
    public partial class AddDerivedTemplateFields : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<bool>(
                name: "IsInherited",
                table: "TemplateScripts",
                type: "bit",
                nullable: false,
                defaultValue: false);

            migrationBuilder.AddColumn<bool>(
                name: "LockedInDerived",
                table: "TemplateScripts",
                type: "bit",
                nullable: false,
                defaultValue: false);

            migrationBuilder.AddColumn<bool>(
                name: "IsDerived",
                table: "Templates",
                type: "bit",
                nullable: false,
                defaultValue: false);

            migrationBuilder.AddColumn<int>(
                name: "OwnerCompositionId",
                table: "Templates",
                type: "int",
                nullable: true);

            migrationBuilder.AddColumn<bool>(
                name: "IsInherited",
                table: "TemplateAttributes",
                type: "bit",
                nullable: false,
                defaultValue: false);

            migrationBuilder.AddColumn<bool>(
                name: "LockedInDerived",
                table: "TemplateAttributes",
                type: "bit",
                nullable: false,
                defaultValue: false);
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "IsInherited",
                table: "TemplateScripts");

            migrationBuilder.DropColumn(
                name: "LockedInDerived",
                table: "TemplateScripts");

            migrationBuilder.DropColumn(
                name: "IsDerived",
                table: "Templates");

            migrationBuilder.DropColumn(
                name: "OwnerCompositionId",
                table: "Templates");

            migrationBuilder.DropColumn(
                name: "IsInherited",
                table: "TemplateAttributes");

            migrationBuilder.DropColumn(
                name: "LockedInDerived",
                table: "TemplateAttributes");
        }
    }
}
