164 lines
5.5 KiB
C#
164 lines
5.5 KiB
C#
// <auto-generated />
|
|
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
|
|
{
|
|
/// <inheritdoc />
|
|
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<string>("Key")
|
|
.HasMaxLength(80)
|
|
.HasColumnType("character varying(80)");
|
|
|
|
b.Property<DateTimeOffset>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("Value")
|
|
.IsRequired()
|
|
.HasMaxLength(500)
|
|
.HasColumnType("character varying(500)");
|
|
|
|
b.HasKey("Key");
|
|
|
|
b.ToTable("SiteSettings");
|
|
});
|
|
|
|
modelBuilder.Entity("lxc_songlist.Models.Song", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<DateTimeOffset>("CreatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<bool>("IsHidden")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<string>("NormalizedTitle")
|
|
.IsRequired()
|
|
.HasMaxLength(200)
|
|
.HasColumnType("character varying(200)");
|
|
|
|
b.Property<string>("Title")
|
|
.IsRequired()
|
|
.HasMaxLength(200)
|
|
.HasColumnType("character varying(200)");
|
|
|
|
b.Property<DateTimeOffset>("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<int>("SongId")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("TagId")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<DateTimeOffset>("CreatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<bool>("CreatedByViewer")
|
|
.HasColumnType("boolean");
|
|
|
|
b.HasKey("SongId", "TagId");
|
|
|
|
b.HasIndex("TagId");
|
|
|
|
b.ToTable("SongTags");
|
|
});
|
|
|
|
modelBuilder.Entity("lxc_songlist.Models.Tag", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<DateTimeOffset>("CreatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasMaxLength(50)
|
|
.HasColumnType("character varying(50)");
|
|
|
|
b.Property<string>("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
|
|
}
|
|
}
|
|
}
|