Skip to content

Usenet streaming with a WebDAV server and a SABnzbd-compatible API

C#
8.3 KB
Raw Blame
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using NzbWebDAV.Database;

#nullable disable

namespace NzbWebDAV.Database.Migrations
{
    [DbContext(typeof(DavDatabaseContext))]
    [Migration("20250710072717_AddConfigItemsTable")]
    partial class AddConfigItemsTable
    {
        /// <inheritdoc />
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder.HasAnnotation("ProductVersion", "9.0.4");

            modelBuilder.Entity("NzbWebDAV.Database.Models.Account", b =>
                {
                    b.Property<int>("Type")
                        .HasColumnType("INTEGER");

                    b.Property<string>("Username")
                        .HasMaxLength(255)
                        .HasColumnType("TEXT");

                    b.Property<string>("PasswordHash")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<string>("RandomSalt")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.HasKey("Type", "Username");

                    b.ToTable("Accounts", (string)null);
                });

            modelBuilder.Entity("NzbWebDAV.Database.Models.ConfigItem", b =>
                {
                    b.Property<string>("ConfigName")
                        .HasColumnType("TEXT");

                    b.Property<string>("ConfigValue")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.HasKey("ConfigName");

                    b.ToTable("ConfigItems", (string)null);
                });

            modelBuilder.Entity("NzbWebDAV.Database.Models.DavItem", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("TEXT");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("TEXT");

                    b.Property<long?>("FileSize")
                        .HasColumnType("INTEGER");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(255)
                        .HasColumnType("TEXT");

                    b.Property<Guid?>("ParentId")
                        .HasColumnType("TEXT");

                    b.Property<int>("Type")
                        .HasColumnType("INTEGER");

                    b.HasKey("Id");

                    b.HasIndex("ParentId", "Name")
                        .IsUnique();

                    b.ToTable("DavItems", (string)null);
                });

            modelBuilder.Entity("NzbWebDAV.Database.Models.DavNzbFile", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("TEXT");

                    b.Property<string>("SegmentIds")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.ToTable("DavNzbFiles", (string)null);
                });

            modelBuilder.Entity("NzbWebDAV.Database.Models.DavRarFile", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("TEXT");

                    b.Property<string>("RarParts")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.ToTable("DavRarFiles", (string)null);
                });

            modelBuilder.Entity("NzbWebDAV.Database.Models.HistoryItem", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("TEXT");

                    b.Property<string>("Category")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("TEXT");

                    b.Property<int>("DownloadStatus")
                        .HasColumnType("INTEGER");

                    b.Property<int>("DownloadTimeSeconds")
                        .HasColumnType("INTEGER");

                    b.Property<string>("FailMessage")
                        .HasColumnType("TEXT");

                    b.Property<string>("FileName")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<string>("JobName")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<long>("TotalSegmentBytes")
                        .HasColumnType("INTEGER");

                    b.HasKey("Id");

                    b.HasIndex("Category");

                    b.HasIndex("CreatedAt");

                    b.HasIndex("Category", "CreatedAt");

                    b.ToTable("HistoryItems", (string)null);
                });

            modelBuilder.Entity("NzbWebDAV.Database.Models.QueueItem", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("TEXT");

                    b.Property<string>("Category")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("TEXT");

                    b.Property<string>("FileName")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<string>("JobName")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<string>("NzbContents")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<long>("NzbFileSize")
                        .HasColumnType("INTEGER");

                    b.Property<DateTime?>("PauseUntil")
                        .HasColumnType("TEXT");

                    b.Property<int>("PostProcessing")
                        .HasColumnType("INTEGER");

                    b.Property<int>("Priority")
                        .HasColumnType("INTEGER");

                    b.Property<long>("TotalSegmentBytes")
                        .HasColumnType("INTEGER");

                    b.HasKey("Id");

                    b.HasIndex("Category");

                    b.HasIndex("CreatedAt");

                    b.HasIndex("FileName")
                        .IsUnique();

                    b.HasIndex("Priority");

                    b.HasIndex("Priority", "CreatedAt");

                    b.HasIndex("Category", "Priority", "CreatedAt");

                    b.ToTable("QueueItems", (string)null);
                });

            modelBuilder.Entity("NzbWebDAV.Database.Models.DavItem", b =>
                {
                    b.HasOne("NzbWebDAV.Database.Models.DavItem", "Parent")
                        .WithMany("Children")
                        .HasForeignKey("ParentId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.Navigation("Parent");
                });

            modelBuilder.Entity("NzbWebDAV.Database.Models.DavNzbFile", b =>
                {
                    b.HasOne("NzbWebDAV.Database.Models.DavItem", "DavItem")
                        .WithOne()
                        .HasForeignKey("NzbWebDAV.Database.Models.DavNzbFile", "Id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("DavItem");
                });

            modelBuilder.Entity("NzbWebDAV.Database.Models.DavRarFile", b =>
                {
                    b.HasOne("NzbWebDAV.Database.Models.DavItem", "DavItem")
                        .WithOne()
                        .HasForeignKey("NzbWebDAV.Database.Models.DavRarFile", "Id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("DavItem");
                });

            modelBuilder.Entity("NzbWebDAV.Database.Models.DavItem", b =>
                {
                    b.Navigation("Children");
                });
#pragma warning restore 612, 618
        }
    }
}