mirror of
				https://github.com/Kareadita/Kavita.git
				synced 2025-11-03 19:17:05 -05:00 
			
		
		
		
	
		
			
				
	
	
		
			47 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			47 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
using Microsoft.EntityFrameworkCore.Migrations;
 | 
						|
 | 
						|
#nullable disable
 | 
						|
 | 
						|
namespace API.Data.Migrations
 | 
						|
{
 | 
						|
    /// <inheritdoc />
 | 
						|
    public partial class LibraryExcludePatterns : Migration
 | 
						|
    {
 | 
						|
        /// <inheritdoc />
 | 
						|
        protected override void Up(MigrationBuilder migrationBuilder)
 | 
						|
        {
 | 
						|
            migrationBuilder.CreateTable(
 | 
						|
                name: "LibraryExcludePattern",
 | 
						|
                columns: table => new
 | 
						|
                {
 | 
						|
                    Id = table.Column<int>(type: "INTEGER", nullable: false)
 | 
						|
                        .Annotation("Sqlite:Autoincrement", true),
 | 
						|
                    Pattern = table.Column<string>(type: "TEXT", nullable: true),
 | 
						|
                    LibraryId = table.Column<int>(type: "INTEGER", nullable: false)
 | 
						|
                },
 | 
						|
                constraints: table =>
 | 
						|
                {
 | 
						|
                    table.PrimaryKey("PK_LibraryExcludePattern", x => x.Id);
 | 
						|
                    table.ForeignKey(
 | 
						|
                        name: "FK_LibraryExcludePattern_Library_LibraryId",
 | 
						|
                        column: x => x.LibraryId,
 | 
						|
                        principalTable: "Library",
 | 
						|
                        principalColumn: "Id",
 | 
						|
                        onDelete: ReferentialAction.Cascade);
 | 
						|
                });
 | 
						|
 | 
						|
            migrationBuilder.CreateIndex(
 | 
						|
                name: "IX_LibraryExcludePattern_LibraryId",
 | 
						|
                table: "LibraryExcludePattern",
 | 
						|
                column: "LibraryId");
 | 
						|
        }
 | 
						|
 | 
						|
        /// <inheritdoc />
 | 
						|
        protected override void Down(MigrationBuilder migrationBuilder)
 | 
						|
        {
 | 
						|
            migrationBuilder.DropTable(
 | 
						|
                name: "LibraryExcludePattern");
 | 
						|
        }
 | 
						|
    }
 | 
						|
}
 |