//
using System;
using DownloadManager.Core.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace DownloadManager.Core.Data.Migrations
{
[DbContext(typeof(AppDbContext))]
[Migration("20260501194147_InitialCreate")]
partial class InitialCreate
{
///
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "8.0.26");
modelBuilder.Entity("DownloadManager.Core.Models.AppSetting", b =>
{
b.Property("Key")
.HasColumnType("TEXT");
b.Property("Value")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Key");
b.ToTable("Settings");
});
modelBuilder.Entity("DownloadManager.Core.Models.DownloadCategory", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property("Extensions")
.IsRequired()
.HasColumnType("TEXT");
b.Property("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property("SavePath")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("Categories");
b.HasData(
new
{
Id = 1,
Extensions = "exe,msi,dmg",
Name = "Yazılım",
SavePath = "%USERPROFILE%\\Downloads\\Yazılım"
},
new
{
Id = 2,
Extensions = "pdf,docx,xlsx,pptx",
Name = "Belge",
SavePath = "%USERPROFILE%\\Downloads\\Belgeler"
},
new
{
Id = 3,
Extensions = "mp3,flac,wav,aac",
Name = "Ses",
SavePath = "%USERPROFILE%\\Downloads\\Ses"
},
new
{
Id = 4,
Extensions = "mp4,mkv,avi,mov",
Name = "Video",
SavePath = "%USERPROFILE%\\Downloads\\Video"
},
new
{
Id = 5,
Extensions = "jpg,jpeg,png,gif,webp",
Name = "Görsel",
SavePath = "%USERPROFILE%\\Downloads\\Görseller"
},
new
{
Id = 6,
Extensions = "",
Name = "Diğer",
SavePath = "%USERPROFILE%\\Downloads"
});
});
modelBuilder.Entity("DownloadManager.Core.Models.DownloadItem", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("CategoryId")
.HasColumnType("INTEGER");
b.Property("CompletedAt")
.HasColumnType("TEXT");
b.Property("CreatedAt")
.HasColumnType("TEXT");
b.Property("DownloadedBytes")
.HasColumnType("INTEGER");
b.Property("ETag")
.HasColumnType("TEXT");
b.Property("ErrorMessage")
.HasColumnType("TEXT");
b.Property("FileName")
.IsRequired()
.HasColumnType("TEXT");
b.Property("LastModified")
.HasColumnType("TEXT");
b.Property("PasswordHash")
.HasColumnType("TEXT");
b.Property("Priority")
.HasColumnType("INTEGER");
b.Property("Referrer")
.HasColumnType("TEXT");
b.Property("SavePath")
.IsRequired()
.HasColumnType("TEXT");
b.Property("SegmentCount")
.HasColumnType("INTEGER");
b.Property("Sha256Checksum")
.HasColumnType("TEXT");
b.Property("StartedAt")
.HasColumnType("TEXT");
b.Property("Status")
.HasColumnType("INTEGER");
b.Property("TotalSize")
.HasColumnType("INTEGER");
b.Property("Url")
.IsRequired()
.HasColumnType("TEXT");
b.Property("UserAgent")
.HasColumnType("TEXT");
b.Property("Username")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CategoryId");
b.ToTable("Downloads");
});
modelBuilder.Entity("DownloadManager.Core.Models.DownloadSegment", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property("DownloadItemId")
.HasColumnType("TEXT");
b.Property("Downloaded")
.HasColumnType("INTEGER");
b.Property("EndByte")
.HasColumnType("INTEGER");
b.Property("Index")
.HasColumnType("INTEGER");
b.Property("StartByte")
.HasColumnType("INTEGER");
b.Property("Status")
.HasColumnType("INTEGER");
b.Property("TempFilePath")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("DownloadItemId");
b.ToTable("Segments");
});
modelBuilder.Entity("DownloadManager.Core.Models.GrabberProject", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.HasKey("Id");
b.ToTable("GrabberProjects");
});
modelBuilder.Entity("DownloadManager.Core.Models.ScheduleJob", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.HasKey("Id");
b.ToTable("ScheduleJobs");
});
modelBuilder.Entity("DownloadManager.Core.Models.DownloadItem", b =>
{
b.HasOne("DownloadManager.Core.Models.DownloadCategory", "Category")
.WithMany()
.HasForeignKey("CategoryId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Category");
});
modelBuilder.Entity("DownloadManager.Core.Models.DownloadSegment", b =>
{
b.HasOne("DownloadManager.Core.Models.DownloadItem", null)
.WithMany("Segments")
.HasForeignKey("DownloadItemId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("DownloadManager.Core.Models.DownloadItem", b =>
{
b.Navigation("Segments");
});
#pragma warning restore 612, 618
}
}
}