using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace ClaudeDo.Data.Migrations
{
    /// <inheritdoc />
    public partial class AddAppSettings : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "app_settings",
                columns: table => new
                {
                    id = table.Column<int>(type: "INTEGER", nullable: false),
                    default_claude_instructions = table.Column<string>(type: "TEXT", nullable: false, defaultValue: ""),
                    default_model = table.Column<string>(type: "TEXT", nullable: false, defaultValue: "sonnet"),
                    default_max_turns = table.Column<int>(type: "INTEGER", nullable: false, defaultValue: 30),
                    default_permission_mode = table.Column<string>(type: "TEXT", nullable: false, defaultValue: "bypassPermissions"),
                    worktree_strategy = table.Column<string>(type: "TEXT", nullable: false, defaultValue: "sibling"),
                    central_worktree_root = table.Column<string>(type: "TEXT", nullable: true),
                    worktree_auto_cleanup_enabled = table.Column<bool>(type: "INTEGER", nullable: false, defaultValue: false),
                    worktree_auto_cleanup_days = table.Column<int>(type: "INTEGER", nullable: false, defaultValue: 7)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_app_settings", x => x.id);
                });

            migrationBuilder.InsertData(
                table: "app_settings",
                columns: new[] { "id", "central_worktree_root", "default_claude_instructions", "default_max_turns", "default_model", "default_permission_mode", "worktree_auto_cleanup_days", "worktree_strategy" },
                values: new object[] { 1, null, "", 30, "sonnet", "bypassPermissions", 7, "sibling" });
        }

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