mirror of
				https://github.com/Kareadita/Kavita.git
				synced 2025-11-03 19:17:05 -05:00 
			
		
		
		
	
		
			
				
	
	
		
			46 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			46 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
using Microsoft.EntityFrameworkCore.Migrations;
 | 
						|
 | 
						|
namespace API.Data.Migrations
 | 
						|
{
 | 
						|
    public partial class UserPreferences : Migration
 | 
						|
    {
 | 
						|
        protected override void Up(MigrationBuilder migrationBuilder)
 | 
						|
        {
 | 
						|
            migrationBuilder.CreateTable(
 | 
						|
                name: "AppUserPreferences",
 | 
						|
                columns: table => new
 | 
						|
                {
 | 
						|
                    Id = table.Column<int>(type: "INTEGER", nullable: false)
 | 
						|
                        .Annotation("Sqlite:Autoincrement", true),
 | 
						|
                    ReadingDirection = table.Column<int>(type: "INTEGER", nullable: false),
 | 
						|
                    ScalingOption = table.Column<int>(type: "INTEGER", nullable: false),
 | 
						|
                    PageSplitOption = table.Column<int>(type: "INTEGER", nullable: false),
 | 
						|
                    HideReadOnDetails = table.Column<bool>(type: "INTEGER", nullable: false),
 | 
						|
                    AppUserId = table.Column<int>(type: "INTEGER", nullable: false)
 | 
						|
                },
 | 
						|
                constraints: table =>
 | 
						|
                {
 | 
						|
                    table.PrimaryKey("PK_AppUserPreferences", x => x.Id);
 | 
						|
                    table.ForeignKey(
 | 
						|
                        name: "FK_AppUserPreferences_AspNetUsers_AppUserId",
 | 
						|
                        column: x => x.AppUserId,
 | 
						|
                        principalTable: "AspNetUsers",
 | 
						|
                        principalColumn: "Id",
 | 
						|
                        onDelete: ReferentialAction.Cascade);
 | 
						|
                });
 | 
						|
 | 
						|
            migrationBuilder.CreateIndex(
 | 
						|
                name: "IX_AppUserPreferences_AppUserId",
 | 
						|
                table: "AppUserPreferences",
 | 
						|
                column: "AppUserId",
 | 
						|
                unique: true);
 | 
						|
        }
 | 
						|
 | 
						|
        protected override void Down(MigrationBuilder migrationBuilder)
 | 
						|
        {
 | 
						|
            migrationBuilder.DropTable(
 | 
						|
                name: "AppUserPreferences");
 | 
						|
        }
 | 
						|
    }
 | 
						|
}
 |