[CHANGE] Reworked client creation
This commit is contained in:
@@ -12,10 +12,6 @@ public class ChannelEntity : DateTimeBase
|
||||
public string? Handle { get; set; }
|
||||
[MaxLength(DataConstants.DbContext.DefaultDbDescriptionStringSize)]
|
||||
public string? Description { get; set; }
|
||||
public DateTime JoinedDate { get; set; }
|
||||
public long Subscribers { get; set; }
|
||||
public long TotalVideos { get; set; }
|
||||
public long TotalViews { get; set; }
|
||||
public List<MediaEntity> Media { get; set; } = [];
|
||||
public List<PlaylistEntity> Playlists { get; set; } = [];
|
||||
public ClientAccountEntity? ClientAccount { get; set; }
|
||||
|
@@ -16,7 +16,5 @@ public class HttpCookieEntity : DateTimeBase
|
||||
public bool Secure { get; set; }
|
||||
public bool HttpOnly { get; set; }
|
||||
[MaxLength(DataConstants.DbContext.DefaultDbStringSize)]
|
||||
public string? SameSite { get; set; }
|
||||
[MaxLength(DataConstants.DbContext.DefaultDbStringSize)]
|
||||
public required string ClientId { get; set; }
|
||||
}
|
||||
|
@@ -1,424 +0,0 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Manager.Data.Contexts;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Manager.Data.Migrations
|
||||
{
|
||||
[DbContext(typeof(LibraryDbContext))]
|
||||
[Migration("20250902141251_InitialLibrary")]
|
||||
partial class InitialLibrary
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "8.0.19");
|
||||
|
||||
modelBuilder.Entity("Manager.Data.Entities.LibraryContext.CaptionEntity", b =>
|
||||
{
|
||||
b.Property<string>("MediaId")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("LanguageCode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("CreatedAtUtc")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("LastModifiedUtc")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("MediaId", "LanguageCode");
|
||||
|
||||
b.ToTable("captions", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Manager.Data.Entities.LibraryContext.ChannelEntity", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("CreatedAtUtc")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("JoinedDate")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("LastModifiedUtc")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<long>("Subscribers")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<long>("TotalVideos")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<long>("TotalViews")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("channels", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Manager.Data.Entities.LibraryContext.ClientAccountEntity", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("CreatedAtUtc")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("LastModifiedUtc")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("UserAgent")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("client_accounts", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Manager.Data.Entities.LibraryContext.HttpCookieEntity", b =>
|
||||
{
|
||||
b.Property<string>("Name")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("ClientId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("CreatedAtUtc")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Domain")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTimeOffset?>("ExpiresUtc")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<bool>("HttpOnly")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime>("LastModifiedUtc")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Path")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("SameSite")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<bool>("Secure")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Value")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Name");
|
||||
|
||||
b.HasIndex("ClientId");
|
||||
|
||||
b.ToTable("http_cookies", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Manager.Data.Entities.LibraryContext.Join.PlaylistMedia", b =>
|
||||
{
|
||||
b.Property<string>("PlaylistId")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("MediaId")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("CreatedAtUtc")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("LastModifiedUtc")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("PlaylistId", "MediaId");
|
||||
|
||||
b.HasIndex("MediaId");
|
||||
|
||||
b.ToTable("join_playlist_media", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Manager.Data.Entities.LibraryContext.MediaEntity", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("ChannelId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("CreatedAtUtc")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("ExternalState")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<bool>("IsDownloaded")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime>("LastModifiedUtc")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("State")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("UploadDateUtc")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ChannelId");
|
||||
|
||||
b.ToTable("media", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Manager.Data.Entities.LibraryContext.MediaFormatEntity", b =>
|
||||
{
|
||||
b.Property<string>("MediaId")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("Itag")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<long>("ApproxDurationMs")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int?>("AudioChannels")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("AudioSampleRate")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<long>("AverageBitrate")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<long>("Bitrate")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<long>("ContentLengthBytes")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime>("CreatedAtUtc")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<double?>("Framerate")
|
||||
.HasColumnType("REAL");
|
||||
|
||||
b.Property<int?>("Height")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<bool>("IsAdaptive")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<long>("LastModifiedUnixEpoch")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime>("LastModifiedUtc")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<double?>("LoudnessDb")
|
||||
.HasColumnType("REAL");
|
||||
|
||||
b.Property<string>("MimeType")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Quality")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("QualityLabel")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int?>("Width")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("MediaId", "Itag");
|
||||
|
||||
b.ToTable("media_formats", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Manager.Data.Entities.LibraryContext.PlaylistEntity", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("ChannelId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("CreatedAtUtc")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("LastModifiedUtc")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ChannelId");
|
||||
|
||||
b.ToTable("playlists", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Manager.Data.Entities.LibraryContext.CaptionEntity", b =>
|
||||
{
|
||||
b.HasOne("Manager.Data.Entities.LibraryContext.MediaEntity", null)
|
||||
.WithMany("Captions")
|
||||
.HasForeignKey("MediaId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Manager.Data.Entities.LibraryContext.ClientAccountEntity", b =>
|
||||
{
|
||||
b.HasOne("Manager.Data.Entities.LibraryContext.ChannelEntity", null)
|
||||
.WithOne("ClientAccount")
|
||||
.HasForeignKey("Manager.Data.Entities.LibraryContext.ClientAccountEntity", "Id")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Manager.Data.Entities.LibraryContext.HttpCookieEntity", b =>
|
||||
{
|
||||
b.HasOne("Manager.Data.Entities.LibraryContext.ClientAccountEntity", null)
|
||||
.WithMany("HttpCookies")
|
||||
.HasForeignKey("ClientId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Manager.Data.Entities.LibraryContext.Join.PlaylistMedia", b =>
|
||||
{
|
||||
b.HasOne("Manager.Data.Entities.LibraryContext.MediaEntity", null)
|
||||
.WithMany("PlaylistMedias")
|
||||
.HasForeignKey("MediaId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Manager.Data.Entities.LibraryContext.PlaylistEntity", null)
|
||||
.WithMany("PlaylistMedias")
|
||||
.HasForeignKey("PlaylistId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Manager.Data.Entities.LibraryContext.MediaEntity", b =>
|
||||
{
|
||||
b.HasOne("Manager.Data.Entities.LibraryContext.ChannelEntity", null)
|
||||
.WithMany("Media")
|
||||
.HasForeignKey("ChannelId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Manager.Data.Entities.LibraryContext.MediaFormatEntity", b =>
|
||||
{
|
||||
b.HasOne("Manager.Data.Entities.LibraryContext.MediaEntity", null)
|
||||
.WithMany("Formats")
|
||||
.HasForeignKey("MediaId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Manager.Data.Entities.LibraryContext.PlaylistEntity", b =>
|
||||
{
|
||||
b.HasOne("Manager.Data.Entities.LibraryContext.ChannelEntity", null)
|
||||
.WithMany("Playlists")
|
||||
.HasForeignKey("ChannelId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Manager.Data.Entities.LibraryContext.ChannelEntity", b =>
|
||||
{
|
||||
b.Navigation("ClientAccount");
|
||||
|
||||
b.Navigation("Media");
|
||||
|
||||
b.Navigation("Playlists");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Manager.Data.Entities.LibraryContext.ClientAccountEntity", b =>
|
||||
{
|
||||
b.Navigation("HttpCookies");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Manager.Data.Entities.LibraryContext.MediaEntity", b =>
|
||||
{
|
||||
b.Navigation("Captions");
|
||||
|
||||
b.Navigation("Formats");
|
||||
|
||||
b.Navigation("PlaylistMedias");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Manager.Data.Entities.LibraryContext.PlaylistEntity", b =>
|
||||
{
|
||||
b.Navigation("PlaylistMedias");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,259 +0,0 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Manager.Data.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class InitialLibrary : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "channels",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<string>(type: "TEXT", maxLength: 100, nullable: false),
|
||||
Name = table.Column<string>(type: "TEXT", maxLength: 100, nullable: true),
|
||||
Description = table.Column<string>(type: "TEXT", maxLength: 500, nullable: true),
|
||||
JoinedDate = table.Column<DateTime>(type: "TEXT", nullable: false),
|
||||
Subscribers = table.Column<long>(type: "INTEGER", nullable: false),
|
||||
TotalVideos = table.Column<long>(type: "INTEGER", nullable: false),
|
||||
TotalViews = table.Column<long>(type: "INTEGER", nullable: false),
|
||||
CreatedAtUtc = table.Column<DateTime>(type: "TEXT", nullable: false),
|
||||
LastModifiedUtc = table.Column<DateTime>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_channels", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "client_accounts",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<string>(type: "TEXT", maxLength: 100, nullable: false),
|
||||
UserAgent = table.Column<string>(type: "TEXT", maxLength: 100, nullable: true),
|
||||
CreatedAtUtc = table.Column<DateTime>(type: "TEXT", nullable: false),
|
||||
LastModifiedUtc = table.Column<DateTime>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_client_accounts", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_client_accounts_channels_Id",
|
||||
column: x => x.Id,
|
||||
principalTable: "channels",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "media",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<string>(type: "TEXT", maxLength: 100, nullable: false),
|
||||
Title = table.Column<string>(type: "TEXT", maxLength: 100, nullable: true),
|
||||
Description = table.Column<string>(type: "TEXT", maxLength: 500, nullable: true),
|
||||
UploadDateUtc = table.Column<DateTime>(type: "TEXT", nullable: false),
|
||||
ChannelId = table.Column<string>(type: "TEXT", maxLength: 100, nullable: false),
|
||||
ExternalState = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
IsDownloaded = table.Column<bool>(type: "INTEGER", nullable: false),
|
||||
State = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
CreatedAtUtc = table.Column<DateTime>(type: "TEXT", nullable: false),
|
||||
LastModifiedUtc = table.Column<DateTime>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_media", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_media_channels_ChannelId",
|
||||
column: x => x.ChannelId,
|
||||
principalTable: "channels",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "playlists",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<string>(type: "TEXT", maxLength: 100, nullable: false),
|
||||
Name = table.Column<string>(type: "TEXT", maxLength: 100, nullable: false),
|
||||
Description = table.Column<string>(type: "TEXT", maxLength: 500, nullable: true),
|
||||
ChannelId = table.Column<string>(type: "TEXT", maxLength: 100, nullable: false),
|
||||
CreatedAtUtc = table.Column<DateTime>(type: "TEXT", nullable: false),
|
||||
LastModifiedUtc = table.Column<DateTime>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_playlists", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_playlists_channels_ChannelId",
|
||||
column: x => x.ChannelId,
|
||||
principalTable: "channels",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "http_cookies",
|
||||
columns: table => new
|
||||
{
|
||||
Name = table.Column<string>(type: "TEXT", maxLength: 100, nullable: false),
|
||||
Value = table.Column<string>(type: "TEXT", maxLength: 100, nullable: true),
|
||||
Domain = table.Column<string>(type: "TEXT", maxLength: 100, nullable: true),
|
||||
Path = table.Column<string>(type: "TEXT", maxLength: 100, nullable: true),
|
||||
ExpiresUtc = table.Column<DateTimeOffset>(type: "TEXT", nullable: true),
|
||||
Secure = table.Column<bool>(type: "INTEGER", nullable: false),
|
||||
HttpOnly = table.Column<bool>(type: "INTEGER", nullable: false),
|
||||
SameSite = table.Column<string>(type: "TEXT", maxLength: 100, nullable: true),
|
||||
ClientId = table.Column<string>(type: "TEXT", maxLength: 100, nullable: false),
|
||||
CreatedAtUtc = table.Column<DateTime>(type: "TEXT", nullable: false),
|
||||
LastModifiedUtc = table.Column<DateTime>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_http_cookies", x => x.Name);
|
||||
table.ForeignKey(
|
||||
name: "FK_http_cookies_client_accounts_ClientId",
|
||||
column: x => x.ClientId,
|
||||
principalTable: "client_accounts",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "captions",
|
||||
columns: table => new
|
||||
{
|
||||
MediaId = table.Column<string>(type: "TEXT", maxLength: 100, nullable: false),
|
||||
LanguageCode = table.Column<string>(type: "TEXT", maxLength: 100, nullable: false),
|
||||
Name = table.Column<string>(type: "TEXT", maxLength: 100, nullable: false),
|
||||
CreatedAtUtc = table.Column<DateTime>(type: "TEXT", nullable: false),
|
||||
LastModifiedUtc = table.Column<DateTime>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_captions", x => new { x.MediaId, x.LanguageCode });
|
||||
table.ForeignKey(
|
||||
name: "FK_captions_media_MediaId",
|
||||
column: x => x.MediaId,
|
||||
principalTable: "media",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "media_formats",
|
||||
columns: table => new
|
||||
{
|
||||
MediaId = table.Column<string>(type: "TEXT", maxLength: 100, nullable: false),
|
||||
Itag = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
Quality = table.Column<string>(type: "TEXT", maxLength: 100, nullable: true),
|
||||
IsAdaptive = table.Column<bool>(type: "INTEGER", nullable: false),
|
||||
MimeType = table.Column<string>(type: "TEXT", maxLength: 100, nullable: true),
|
||||
Bitrate = table.Column<long>(type: "INTEGER", nullable: false),
|
||||
AverageBitrate = table.Column<long>(type: "INTEGER", nullable: false),
|
||||
LastModifiedUnixEpoch = table.Column<long>(type: "INTEGER", nullable: false),
|
||||
ContentLengthBytes = table.Column<long>(type: "INTEGER", nullable: false),
|
||||
ApproxDurationMs = table.Column<long>(type: "INTEGER", nullable: false),
|
||||
Width = table.Column<int>(type: "INTEGER", nullable: true),
|
||||
Height = table.Column<int>(type: "INTEGER", nullable: true),
|
||||
Framerate = table.Column<double>(type: "REAL", nullable: true),
|
||||
QualityLabel = table.Column<string>(type: "TEXT", maxLength: 100, nullable: true),
|
||||
AudioChannels = table.Column<int>(type: "INTEGER", nullable: true),
|
||||
AudioSampleRate = table.Column<string>(type: "TEXT", maxLength: 100, nullable: true),
|
||||
LoudnessDb = table.Column<double>(type: "REAL", nullable: true),
|
||||
CreatedAtUtc = table.Column<DateTime>(type: "TEXT", nullable: false),
|
||||
LastModifiedUtc = table.Column<DateTime>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_media_formats", x => new { x.MediaId, x.Itag });
|
||||
table.ForeignKey(
|
||||
name: "FK_media_formats_media_MediaId",
|
||||
column: x => x.MediaId,
|
||||
principalTable: "media",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "join_playlist_media",
|
||||
columns: table => new
|
||||
{
|
||||
PlaylistId = table.Column<string>(type: "TEXT", maxLength: 100, nullable: false),
|
||||
MediaId = table.Column<string>(type: "TEXT", maxLength: 100, nullable: false),
|
||||
CreatedAtUtc = table.Column<DateTime>(type: "TEXT", nullable: false),
|
||||
LastModifiedUtc = table.Column<DateTime>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_join_playlist_media", x => new { x.PlaylistId, x.MediaId });
|
||||
table.ForeignKey(
|
||||
name: "FK_join_playlist_media_media_MediaId",
|
||||
column: x => x.MediaId,
|
||||
principalTable: "media",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_join_playlist_media_playlists_PlaylistId",
|
||||
column: x => x.PlaylistId,
|
||||
principalTable: "playlists",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_http_cookies_ClientId",
|
||||
table: "http_cookies",
|
||||
column: "ClientId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_join_playlist_media_MediaId",
|
||||
table: "join_playlist_media",
|
||||
column: "MediaId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_media_ChannelId",
|
||||
table: "media",
|
||||
column: "ChannelId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_playlists_ChannelId",
|
||||
table: "playlists",
|
||||
column: "ChannelId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "captions");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "http_cookies");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "join_playlist_media");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "media_formats");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "client_accounts");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "playlists");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "media");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "channels");
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,421 +0,0 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Manager.Data.Contexts;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Manager.Data.Migrations
|
||||
{
|
||||
[DbContext(typeof(LibraryDbContext))]
|
||||
partial class LibraryDbContextModelSnapshot : ModelSnapshot
|
||||
{
|
||||
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "8.0.19");
|
||||
|
||||
modelBuilder.Entity("Manager.Data.Entities.LibraryContext.CaptionEntity", b =>
|
||||
{
|
||||
b.Property<string>("MediaId")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("LanguageCode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("CreatedAtUtc")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("LastModifiedUtc")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("MediaId", "LanguageCode");
|
||||
|
||||
b.ToTable("captions", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Manager.Data.Entities.LibraryContext.ChannelEntity", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("CreatedAtUtc")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("JoinedDate")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("LastModifiedUtc")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<long>("Subscribers")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<long>("TotalVideos")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<long>("TotalViews")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("channels", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Manager.Data.Entities.LibraryContext.ClientAccountEntity", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("CreatedAtUtc")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("LastModifiedUtc")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("UserAgent")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("client_accounts", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Manager.Data.Entities.LibraryContext.HttpCookieEntity", b =>
|
||||
{
|
||||
b.Property<string>("Name")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("ClientId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("CreatedAtUtc")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Domain")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTimeOffset?>("ExpiresUtc")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<bool>("HttpOnly")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime>("LastModifiedUtc")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Path")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("SameSite")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<bool>("Secure")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Value")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Name");
|
||||
|
||||
b.HasIndex("ClientId");
|
||||
|
||||
b.ToTable("http_cookies", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Manager.Data.Entities.LibraryContext.Join.PlaylistMedia", b =>
|
||||
{
|
||||
b.Property<string>("PlaylistId")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("MediaId")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("CreatedAtUtc")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("LastModifiedUtc")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("PlaylistId", "MediaId");
|
||||
|
||||
b.HasIndex("MediaId");
|
||||
|
||||
b.ToTable("join_playlist_media", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Manager.Data.Entities.LibraryContext.MediaEntity", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("ChannelId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("CreatedAtUtc")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("ExternalState")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<bool>("IsDownloaded")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime>("LastModifiedUtc")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("State")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("UploadDateUtc")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ChannelId");
|
||||
|
||||
b.ToTable("media", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Manager.Data.Entities.LibraryContext.MediaFormatEntity", b =>
|
||||
{
|
||||
b.Property<string>("MediaId")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("Itag")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<long>("ApproxDurationMs")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int?>("AudioChannels")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("AudioSampleRate")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<long>("AverageBitrate")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<long>("Bitrate")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<long>("ContentLengthBytes")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime>("CreatedAtUtc")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<double?>("Framerate")
|
||||
.HasColumnType("REAL");
|
||||
|
||||
b.Property<int?>("Height")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<bool>("IsAdaptive")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<long>("LastModifiedUnixEpoch")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime>("LastModifiedUtc")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<double?>("LoudnessDb")
|
||||
.HasColumnType("REAL");
|
||||
|
||||
b.Property<string>("MimeType")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Quality")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("QualityLabel")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int?>("Width")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("MediaId", "Itag");
|
||||
|
||||
b.ToTable("media_formats", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Manager.Data.Entities.LibraryContext.PlaylistEntity", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("ChannelId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("CreatedAtUtc")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("LastModifiedUtc")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ChannelId");
|
||||
|
||||
b.ToTable("playlists", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Manager.Data.Entities.LibraryContext.CaptionEntity", b =>
|
||||
{
|
||||
b.HasOne("Manager.Data.Entities.LibraryContext.MediaEntity", null)
|
||||
.WithMany("Captions")
|
||||
.HasForeignKey("MediaId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Manager.Data.Entities.LibraryContext.ClientAccountEntity", b =>
|
||||
{
|
||||
b.HasOne("Manager.Data.Entities.LibraryContext.ChannelEntity", null)
|
||||
.WithOne("ClientAccount")
|
||||
.HasForeignKey("Manager.Data.Entities.LibraryContext.ClientAccountEntity", "Id")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Manager.Data.Entities.LibraryContext.HttpCookieEntity", b =>
|
||||
{
|
||||
b.HasOne("Manager.Data.Entities.LibraryContext.ClientAccountEntity", null)
|
||||
.WithMany("HttpCookies")
|
||||
.HasForeignKey("ClientId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Manager.Data.Entities.LibraryContext.Join.PlaylistMedia", b =>
|
||||
{
|
||||
b.HasOne("Manager.Data.Entities.LibraryContext.MediaEntity", null)
|
||||
.WithMany("PlaylistMedias")
|
||||
.HasForeignKey("MediaId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Manager.Data.Entities.LibraryContext.PlaylistEntity", null)
|
||||
.WithMany("PlaylistMedias")
|
||||
.HasForeignKey("PlaylistId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Manager.Data.Entities.LibraryContext.MediaEntity", b =>
|
||||
{
|
||||
b.HasOne("Manager.Data.Entities.LibraryContext.ChannelEntity", null)
|
||||
.WithMany("Media")
|
||||
.HasForeignKey("ChannelId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Manager.Data.Entities.LibraryContext.MediaFormatEntity", b =>
|
||||
{
|
||||
b.HasOne("Manager.Data.Entities.LibraryContext.MediaEntity", null)
|
||||
.WithMany("Formats")
|
||||
.HasForeignKey("MediaId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Manager.Data.Entities.LibraryContext.PlaylistEntity", b =>
|
||||
{
|
||||
b.HasOne("Manager.Data.Entities.LibraryContext.ChannelEntity", null)
|
||||
.WithMany("Playlists")
|
||||
.HasForeignKey("ChannelId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Manager.Data.Entities.LibraryContext.ChannelEntity", b =>
|
||||
{
|
||||
b.Navigation("ClientAccount");
|
||||
|
||||
b.Navigation("Media");
|
||||
|
||||
b.Navigation("Playlists");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Manager.Data.Entities.LibraryContext.ClientAccountEntity", b =>
|
||||
{
|
||||
b.Navigation("HttpCookies");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Manager.Data.Entities.LibraryContext.MediaEntity", b =>
|
||||
{
|
||||
b.Navigation("Captions");
|
||||
|
||||
b.Navigation("Formats");
|
||||
|
||||
b.Navigation("PlaylistMedias");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Manager.Data.Entities.LibraryContext.PlaylistEntity", b =>
|
||||
{
|
||||
b.Navigation("PlaylistMedias");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user