using Microsoft.EntityFrameworkCore.Migrations;

namespace FamilyBudget.Data.Migrations
{
    public partial class mig5 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<int>(
                name: "id_utilisateur",
                table: "bugdet",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.CreateIndex(
                name: "IX_bugdet_id_utilisateur",
                table: "bugdet",
                column: "id_utilisateur");

            migrationBuilder.AddForeignKey(
                name: "FK_bugdet_utilisateur",
                table: "bugdet",
                column: "id_utilisateur",
                principalTable: "utilisateur",
                principalColumn: "id_utilisateur",
                onDelete: ReferentialAction.Restrict);
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_bugdet_utilisateur",
                table: "bugdet");

            migrationBuilder.DropIndex(
                name: "IX_bugdet_id_utilisateur",
                table: "bugdet");

            migrationBuilder.DropColumn(
                name: "id_utilisateur",
                table: "bugdet");
        }
    }
}
