using Microsoft.EntityFrameworkCore.Migrations;

namespace DataLayer.Migrations;

/// <inheritdoc />
public partial class MakeDbNullable : Migration
{
	/// <inheritdoc />
	protected override void Up(MigrationBuilder migrationBuilder)
	{
		migrationBuilder.DropColumn(
			name: "Name",
			table: "Categories");

		migrationBuilder.AlterColumn<string>(
			name: "Url",
			table: "Supplement",
			type: "TEXT",
			nullable: false,
			defaultValue: "",
			oldClrType: typeof(string),
			oldType: "TEXT",
			oldNullable: true);

		migrationBuilder.AlterColumn<string>(
			name: "AudibleSeriesId",
			table: "Series",
			type: "TEXT",
			nullable: false,
			defaultValue: "",
			oldClrType: typeof(string),
			oldType: "TEXT",
			oldNullable: true);

		migrationBuilder.AlterColumn<string>(
			name: "Account",
			table: "LibraryBooks",
			type: "TEXT",
			nullable: false,
			defaultValue: "",
			oldClrType: typeof(string),
			oldType: "TEXT",
			oldNullable: true);

		migrationBuilder.AlterColumn<string>(
			name: "Name",
			table: "Contributors",
			type: "TEXT",
			nullable: false,
			defaultValue: "",
			oldClrType: typeof(string),
			oldType: "TEXT",
			oldNullable: true);

		migrationBuilder.AlterColumn<string>(
			name: "AudibleCategoryId",
			table: "Categories",
			type: "TEXT",
			nullable: false,
			defaultValue: "",
			oldClrType: typeof(string),
			oldType: "TEXT",
			oldNullable: true);

		migrationBuilder.AlterColumn<string>(
			name: "Title",
			table: "Books",
			type: "TEXT",
			nullable: false,
			defaultValue: "",
			oldClrType: typeof(string),
			oldType: "TEXT",
			oldNullable: true);

		migrationBuilder.AlterColumn<string>(
			name: "Subtitle",
			table: "Books",
			type: "TEXT",
			nullable: false,
			defaultValue: "",
			oldClrType: typeof(string),
			oldType: "TEXT",
			oldNullable: true);

		migrationBuilder.AlterColumn<float>(
			name: "Rating_StoryRating",
			table: "Books",
			type: "REAL",
			nullable: false,
			defaultValue: 0f,
			oldClrType: typeof(float),
			oldType: "REAL",
			oldNullable: true);

		migrationBuilder.AlterColumn<float>(
			name: "Rating_PerformanceRating",
			table: "Books",
			type: "REAL",
			nullable: false,
			defaultValue: 0f,
			oldClrType: typeof(float),
			oldType: "REAL",
			oldNullable: true);

		migrationBuilder.AlterColumn<float>(
			name: "Rating_OverallRating",
			table: "Books",
			type: "REAL",
			nullable: false,
			defaultValue: 0f,
			oldClrType: typeof(float),
			oldType: "REAL",
			oldNullable: true);

		migrationBuilder.AlterColumn<string>(
			name: "Locale",
			table: "Books",
			type: "TEXT",
			nullable: false,
			defaultValue: "",
			oldClrType: typeof(string),
			oldType: "TEXT",
			oldNullable: true);

		migrationBuilder.AlterColumn<string>(
			name: "Description",
			table: "Books",
			type: "TEXT",
			nullable: false,
			defaultValue: "",
			oldClrType: typeof(string),
			oldType: "TEXT",
			oldNullable: true);

		migrationBuilder.AlterColumn<string>(
			name: "AudibleProductId",
			table: "Books",
			type: "TEXT",
			nullable: false,
			defaultValue: "",
			oldClrType: typeof(string),
			oldType: "TEXT",
			oldNullable: true);
	}

	/// <inheritdoc />
	protected override void Down(MigrationBuilder migrationBuilder)
	{
		migrationBuilder.AlterColumn<string>(
			name: "Url",
			table: "Supplement",
			type: "TEXT",
			nullable: true,
			oldClrType: typeof(string),
			oldType: "TEXT");

		migrationBuilder.AlterColumn<string>(
			name: "AudibleSeriesId",
			table: "Series",
			type: "TEXT",
			nullable: true,
			oldClrType: typeof(string),
			oldType: "TEXT");

		migrationBuilder.AlterColumn<string>(
			name: "Account",
			table: "LibraryBooks",
			type: "TEXT",
			nullable: true,
			oldClrType: typeof(string),
			oldType: "TEXT");

		migrationBuilder.AlterColumn<string>(
			name: "Name",
			table: "Contributors",
			type: "TEXT",
			nullable: true,
			oldClrType: typeof(string),
			oldType: "TEXT");

		migrationBuilder.AlterColumn<string>(
			name: "AudibleCategoryId",
			table: "Categories",
			type: "TEXT",
			nullable: true,
			oldClrType: typeof(string),
			oldType: "TEXT");

		migrationBuilder.AddColumn<string>(
			name: "Name",
			table: "Categories",
			type: "TEXT",
			nullable: true);

		migrationBuilder.AlterColumn<string>(
			name: "Title",
			table: "Books",
			type: "TEXT",
			nullable: true,
			oldClrType: typeof(string),
			oldType: "TEXT");

		migrationBuilder.AlterColumn<string>(
			name: "Subtitle",
			table: "Books",
			type: "TEXT",
			nullable: true,
			oldClrType: typeof(string),
			oldType: "TEXT");

		migrationBuilder.AlterColumn<float>(
			name: "Rating_StoryRating",
			table: "Books",
			type: "REAL",
			nullable: true,
			oldClrType: typeof(float),
			oldType: "REAL");

		migrationBuilder.AlterColumn<float>(
			name: "Rating_PerformanceRating",
			table: "Books",
			type: "REAL",
			nullable: true,
			oldClrType: typeof(float),
			oldType: "REAL");

		migrationBuilder.AlterColumn<float>(
			name: "Rating_OverallRating",
			table: "Books",
			type: "REAL",
			nullable: true,
			oldClrType: typeof(float),
			oldType: "REAL");

		migrationBuilder.AlterColumn<string>(
			name: "Locale",
			table: "Books",
			type: "TEXT",
			nullable: true,
			oldClrType: typeof(string),
			oldType: "TEXT");

		migrationBuilder.AlterColumn<string>(
			name: "Description",
			table: "Books",
			type: "TEXT",
			nullable: true,
			oldClrType: typeof(string),
			oldType: "TEXT");

		migrationBuilder.AlterColumn<string>(
			name: "AudibleProductId",
			table: "Books",
			type: "TEXT",
			nullable: true,
			oldClrType: typeof(string),
			oldType: "TEXT");
	}
}
