Infrastructure upgrades

This commit is contained in:
daniel-c-harvey
2025-09-04 19:58:00 -04:00
parent 5e02d004e3
commit 9de2063ea3
11 changed files with 559 additions and 192 deletions
@@ -16,10 +16,10 @@ public class TrackConfiguration : IEntityTypeConfiguration<TrackEntity>
.HasColumnName("id")
.IsRequired();
builder.Property(x => x.MediaPath)
.HasColumnName("media_path")
builder.Property(x => x.EntryKey)
.HasColumnName("entry_key")
.IsRequired()
.HasMaxLength(500);
.HasMaxLength(100);
builder.Property(x => x.TrackName)
.HasColumnName("track_name")
@@ -1,74 +0,0 @@
// <auto-generated />
using System;
using DeepDrftWeb.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace DeepDrftWeb.Data.Migrations
{
[DbContext(typeof(DeepDrftContext))]
[Migration("20250831000622_Initial")]
partial class Initial
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "9.0.8");
modelBuilder.Entity("DeepDrftModels.Entities.TrackEntity", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasColumnName("id");
b.Property<string>("Album")
.HasMaxLength(200)
.HasColumnType("TEXT")
.HasColumnName("album");
b.Property<string>("Artist")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("TEXT")
.HasColumnName("artist");
b.Property<string>("Genre")
.HasMaxLength(100)
.HasColumnType("TEXT")
.HasColumnName("genre");
b.Property<string>("ImagePath")
.HasMaxLength(500)
.HasColumnType("TEXT")
.HasColumnName("image_path");
b.Property<string>("MediaPath")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("TEXT")
.HasColumnName("media_path");
b.Property<DateOnly?>("ReleaseDate")
.HasColumnType("TEXT")
.HasColumnName("release_date");
b.Property<string>("TrackName")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("TEXT")
.HasColumnName("track_name");
b.HasKey("Id");
b.ToTable("track", (string)null);
});
#pragma warning restore 612, 618
}
}
}
@@ -1,41 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace DeepDrftWeb.Data.Migrations
{
/// <inheritdoc />
public partial class Initial : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "track",
columns: table => new
{
id = table.Column<long>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
media_path = table.Column<string>(type: "TEXT", maxLength: 500, nullable: false),
track_name = table.Column<string>(type: "TEXT", maxLength: 200, nullable: false),
artist = table.Column<string>(type: "TEXT", maxLength: 200, nullable: false),
album = table.Column<string>(type: "TEXT", maxLength: 200, nullable: true),
genre = table.Column<string>(type: "TEXT", maxLength: 100, nullable: true),
release_date = table.Column<DateOnly>(type: "TEXT", nullable: true),
image_path = table.Column<string>(type: "TEXT", maxLength: 500, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_track", x => x.id);
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "track");
}
}
}
@@ -1,71 +0,0 @@
// <auto-generated />
using System;
using DeepDrftWeb.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace DeepDrftWeb.Data.Migrations
{
[DbContext(typeof(DeepDrftContext))]
partial class DeepDrftContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "9.0.8");
modelBuilder.Entity("DeepDrftModels.Entities.TrackEntity", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasColumnName("id");
b.Property<string>("Album")
.HasMaxLength(200)
.HasColumnType("TEXT")
.HasColumnName("album");
b.Property<string>("Artist")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("TEXT")
.HasColumnName("artist");
b.Property<string>("Genre")
.HasMaxLength(100)
.HasColumnType("TEXT")
.HasColumnName("genre");
b.Property<string>("ImagePath")
.HasMaxLength(500)
.HasColumnType("TEXT")
.HasColumnName("image_path");
b.Property<string>("MediaPath")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("TEXT")
.HasColumnName("media_path");
b.Property<DateOnly?>("ReleaseDate")
.HasColumnType("TEXT")
.HasColumnName("release_date");
b.Property<string>("TrackName")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("TEXT")
.HasColumnName("track_name");
b.HasKey("Id");
b.ToTable("track", (string)null);
});
#pragma warning restore 612, 618
}
}
}
@@ -56,7 +56,7 @@ public class TrackRepository
trackEntity.Artist = track.Artist;
trackEntity.Genre = track.Genre;
trackEntity.ImagePath = track.ImagePath;
trackEntity.MediaPath = track.MediaPath;
trackEntity.EntryKey = track.EntryKey;
trackEntity.ReleaseDate = track.ReleaseDate;
trackEntity.TrackName = track.TrackName;