using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace MaBibli.Api.Data.Migrations
{
    /// <inheritdoc />
    public partial class ListeDEnvies : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "LivresSouhaites",
                columns: table => new
                {
                    Id = table.Column<int>(type: "INTEGER", nullable: false)
                        .Annotation("Sqlite:Autoincrement", true),
                    Utilisateur = table.Column<string>(type: "TEXT", nullable: false),
                    Titre = table.Column<string>(type: "TEXT", nullable: false),
                    TitreNormalise = table.Column<string>(type: "TEXT", nullable: false),
                    Auteur = table.Column<string>(type: "TEXT", nullable: true),
                    AuteurNormalise = table.Column<string>(type: "TEXT", nullable: false, defaultValue: ""),
                    Editeur = table.Column<string>(type: "TEXT", nullable: true),
                    Annee = table.Column<string>(type: "TEXT", nullable: true),
                    Isbn = table.Column<string>(type: "TEXT", nullable: true),
                    CoverUrl = table.Column<string>(type: "TEXT", nullable: true),
                    Note = table.Column<string>(type: "TEXT", nullable: true),
                    DateAjout = table.Column<DateTime>(type: "TEXT", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_LivresSouhaites", x => x.Id);
                });

            migrationBuilder.CreateIndex(
                name: "IX_LivresSouhaites_Utilisateur",
                table: "LivresSouhaites",
                column: "Utilisateur");

            migrationBuilder.CreateIndex(
                name: "IX_LivresSouhaites_Utilisateur_Oeuvre",
                table: "LivresSouhaites",
                columns: new[] { "Utilisateur", "TitreNormalise", "AuteurNormalise" },
                unique: true);
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "LivresSouhaites");
        }
    }
}
