// using System; using System.Collections.Generic; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; using RacePlannerApi.Data; #nullable disable namespace RacePlannerApi.Data.Migrations { [DbContext(typeof(RacePlannerDbContext))] [Migration("20260403185515_InitialCreate")] partial class InitialCreate { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "10.0.5") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); modelBuilder.Entity("RacePlannerApi.Models.Announcement", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("AuthorId") .HasColumnType("uuid"); b.Property("Content") .IsRequired() .HasMaxLength(5000) .HasColumnType("character varying(5000)"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("EventId") .HasColumnType("uuid"); b.Property("IsPublished") .HasColumnType("boolean"); b.Property("Title") .IsRequired() .HasMaxLength(200) .HasColumnType("character varying(200)"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.HasKey("Id"); b.HasIndex("AuthorId"); b.HasIndex("CreatedAt"); b.HasIndex("EventId"); b.ToTable("Announcements"); }); modelBuilder.Entity("RacePlannerApi.Models.Event", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("Category") .HasMaxLength(100) .HasColumnType("character varying(100)"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("Description") .IsRequired() .HasMaxLength(2000) .HasColumnType("character varying(2000)"); b.Property("EventDate") .HasColumnType("timestamp with time zone"); b.Property("Location") .IsRequired() .HasMaxLength(500) .HasColumnType("character varying(500)"); b.Property("MaxParticipants") .HasColumnType("integer"); b.Property("Name") .IsRequired() .HasMaxLength(200) .HasColumnType("character varying(200)"); b.Property("OrganizerId") .HasColumnType("uuid"); b.Property("Status") .IsRequired() .HasColumnType("text"); b.PrimitiveCollection>("Tags") .IsRequired() .HasColumnType("text[]"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.HasKey("Id"); b.HasIndex("Category"); b.HasIndex("EventDate"); b.HasIndex("OrganizerId"); b.HasIndex("Status"); b.ToTable("Events"); }); modelBuilder.Entity("RacePlannerApi.Models.Payment", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("Amount") .HasPrecision(18, 2) .HasColumnType("numeric(18,2)"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("Method") .IsRequired() .HasColumnType("text"); b.Property("Notes") .HasMaxLength(500) .HasColumnType("character varying(500)"); b.Property("PaymentDate") .HasColumnType("timestamp with time zone"); b.Property("RegistrationId") .HasColumnType("uuid"); b.Property("TransactionId") .HasMaxLength(100) .HasColumnType("character varying(100)"); b.HasKey("Id"); b.HasIndex("PaymentDate"); b.HasIndex("RegistrationId"); b.ToTable("Payments"); }); modelBuilder.Entity("RacePlannerApi.Models.Registration", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("Category") .HasMaxLength(100) .HasColumnType("character varying(100)"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("EmergencyContact") .HasMaxLength(200) .HasColumnType("character varying(200)"); b.Property("EventId") .HasColumnType("uuid"); b.Property("ParticipantId") .HasColumnType("uuid"); b.Property("Status") .IsRequired() .HasColumnType("text"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.HasKey("Id"); b.HasIndex("ParticipantId"); b.HasIndex("Status"); b.HasIndex("EventId", "ParticipantId") .IsUnique(); b.ToTable("Registrations"); }); modelBuilder.Entity("RacePlannerApi.Models.User", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("Email") .IsRequired() .HasColumnType("text"); b.Property("Name") .IsRequired() .HasMaxLength(100) .HasColumnType("character varying(100)"); b.Property("PasswordHash") .IsRequired() .HasColumnType("text"); b.Property("Role") .IsRequired() .HasColumnType("text"); b.HasKey("Id"); b.HasIndex("Email") .IsUnique(); b.ToTable("Users"); }); modelBuilder.Entity("RacePlannerApi.Models.Announcement", b => { b.HasOne("RacePlannerApi.Models.User", "Author") .WithMany() .HasForeignKey("AuthorId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("RacePlannerApi.Models.Event", "Event") .WithMany("Announcements") .HasForeignKey("EventId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Author"); b.Navigation("Event"); }); modelBuilder.Entity("RacePlannerApi.Models.Event", b => { b.HasOne("RacePlannerApi.Models.User", "Organizer") .WithMany("OrganizedEvents") .HasForeignKey("OrganizerId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.Navigation("Organizer"); }); modelBuilder.Entity("RacePlannerApi.Models.Payment", b => { b.HasOne("RacePlannerApi.Models.Registration", "Registration") .WithMany("Payments") .HasForeignKey("RegistrationId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Registration"); }); modelBuilder.Entity("RacePlannerApi.Models.Registration", b => { b.HasOne("RacePlannerApi.Models.Event", "Event") .WithMany("Registrations") .HasForeignKey("EventId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("RacePlannerApi.Models.User", "Participant") .WithMany("Registrations") .HasForeignKey("ParticipantId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.Navigation("Event"); b.Navigation("Participant"); }); modelBuilder.Entity("RacePlannerApi.Models.Event", b => { b.Navigation("Announcements"); b.Navigation("Registrations"); }); modelBuilder.Entity("RacePlannerApi.Models.Registration", b => { b.Navigation("Payments"); }); modelBuilder.Entity("RacePlannerApi.Models.User", b => { b.Navigation("OrganizedEvents"); b.Navigation("Registrations"); }); #pragma warning restore 612, 618 } } }