using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Hushian.Persistence.Migrations
{
    /// <inheritdoc />
    public partial class chngrtbai : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "UserID",
                table: "AIAs");

            migrationBuilder.AddColumn<string>(
                name: "aiKeyUser",
                table: "AIAs",
                type: "nvarchar(max)",
                nullable: false,
                defaultValue: "");

            migrationBuilder.CreateIndex(
                name: "IX_AIAs_CompanyID",
                table: "AIAs",
                column: "CompanyID");

            migrationBuilder.AddForeignKey(
                name: "FK_AIAs_Companies_CompanyID",
                table: "AIAs",
                column: "CompanyID",
                principalTable: "Companies",
                principalColumn: "ID",
                onDelete: ReferentialAction.Cascade);
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_AIAs_Companies_CompanyID",
                table: "AIAs");

            migrationBuilder.DropIndex(
                name: "IX_AIAs_CompanyID",
                table: "AIAs");

            migrationBuilder.DropColumn(
                name: "aiKeyUser",
                table: "AIAs");

            migrationBuilder.AddColumn<int>(
                name: "UserID",
                table: "AIAs",
                type: "int",
                nullable: false,
                defaultValue: 0);
        }
    }
}
