Torrent v1 done

This commit is contained in:
Elias Jansson
2025-08-24 21:16:03 +02:00
parent 1306736838
commit 1a3418cf37
15 changed files with 2790 additions and 48 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,37 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Aberwyn.Migrations
{
public partial class AddUserTorrentSeen : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "UserTorrentSeen",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
UserId = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
TorrentId = table.Column<int>(type: "int", nullable: false),
SeenDate = table.Column<DateTime>(type: "datetime(6)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_UserTorrentSeen", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "UserTorrentSeen");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,37 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Aberwyn.Migrations
{
public partial class AddUserTorrentSeenv2 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "TorrentId",
table: "UserTorrentSeen");
migrationBuilder.AddColumn<string>(
name: "InfoHash",
table: "UserTorrentSeen",
type: "longtext",
nullable: false)
.Annotation("MySql:CharSet", "utf8mb4");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "InfoHash",
table: "UserTorrentSeen");
migrationBuilder.AddColumn<int>(
name: "TorrentId",
table: "UserTorrentSeen",
type: "int",
nullable: false,
defaultValue: 0);
}
}
}

View File

@@ -950,6 +950,28 @@ namespace Aberwyn.Migrations
b.ToTable("TorrentItems");
});
modelBuilder.Entity("UserTorrentSeen", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("InfoHash")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime>("SeenDate")
.HasColumnType("datetime(6)");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("Id");
b.ToTable("UserTorrentSeen");
});
modelBuilder.Entity("Aberwyn.Models.BudgetCategory", b =>
{
b.HasOne("Aberwyn.Models.BudgetCategoryDefinition", "Definition")