//
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using lxc_songlist.Data;
#nullable disable
namespace lxc_songlist.Migrations
{
[DbContext(typeof(SongListDbContext))]
[Migration("20260604022832_InitialCreate")]
partial class InitialCreate
{
///
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "10.0.8")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("lxc_songlist.Models.SiteSetting", b =>
{
b.Property("Key")
.HasMaxLength(80)
.HasColumnType("character varying(80)");
b.Property("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property("Value")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("character varying(500)");
b.HasKey("Key");
b.ToTable("SiteSettings");
});
modelBuilder.Entity("lxc_songlist.Models.Song", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property("IsHidden")
.HasColumnType("boolean");
b.Property("NormalizedTitle")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("character varying(200)");
b.Property("Title")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("character varying(200)");
b.Property("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.HasIndex("NormalizedTitle")
.IsUnique();
b.ToTable("Songs");
});
modelBuilder.Entity("lxc_songlist.Models.SongTag", b =>
{
b.Property("SongId")
.HasColumnType("integer");
b.Property("TagId")
.HasColumnType("integer");
b.Property("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property("CreatedByViewer")
.HasColumnType("boolean");
b.HasKey("SongId", "TagId");
b.HasIndex("TagId");
b.ToTable("SongTags");
});
modelBuilder.Entity("lxc_songlist.Models.Tag", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property("Name")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property("NormalizedName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique();
b.ToTable("Tags");
});
modelBuilder.Entity("lxc_songlist.Models.SongTag", b =>
{
b.HasOne("lxc_songlist.Models.Song", "Song")
.WithMany("SongTags")
.HasForeignKey("SongId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("lxc_songlist.Models.Tag", "Tag")
.WithMany("SongTags")
.HasForeignKey("TagId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Song");
b.Navigation("Tag");
});
modelBuilder.Entity("lxc_songlist.Models.Song", b =>
{
b.Navigation("SongTags");
});
modelBuilder.Entity("lxc_songlist.Models.Tag", b =>
{
b.Navigation("SongTags");
});
#pragma warning restore 612, 618
}
}
}