//
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using SpotiParty.Web;
#nullable disable
namespace SpotiParty.Web.Migrations
{
[DbContext(typeof(DatabaseContext))]
[Migration("20251130175629_Added events")]
partial class Addedevents
{
///
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "10.0.0")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("SpotiParty.Web.Models.Event", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("End")
.HasColumnType("timestamp with time zone");
b.Property("HostUserId")
.HasColumnType("uuid");
b.Property("Name")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b.Property("Start")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.HasIndex("HostUserId");
b.ToTable("Events");
});
modelBuilder.Entity("SpotiParty.Web.Models.User", b =>
{
b.Property("UserId")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property("DisplayName")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b.Property("IsAdmin")
.HasColumnType("boolean");
b.Property("RefreshToken")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b.Property("SpotifyUserId")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b.HasKey("UserId");
b.ToTable("Users");
});
modelBuilder.Entity("SpotiParty.Web.Models.Event", b =>
{
b.HasOne("SpotiParty.Web.Models.User", "Host")
.WithMany()
.HasForeignKey("HostUserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Host");
});
#pragma warning restore 612, 618
}
}
}