From f7583738d71608f9379777fff2bb9536bab5e093 Mon Sep 17 00:00:00 2001 From: eee4 <41441600+eee4@users.noreply.github.com> Date: Mon, 2 Jun 2025 03:01:10 +0200 Subject: [PATCH] feat: image url migration registrations can now store image urls, which will be shown at view.html --- WebApp/DTOs/EventCreateDto.cs | 3 +- WebApp/DTOs/EventDetailsDto.cs | 1 + WebApp/DTOs/EventSummaryDto.cs | 1 + WebApp/DTOs/EventSummaryNoErDto.cs | 1 + WebApp/DTOs/EventUpdateDto.cs | 3 +- WebApp/Endpoints/GeneralUseHelperFunctions.cs | 11 +- WebApp/Entities/Event.cs | 3 +- WebApp/Mapping/EventMapping.cs | 9 +- .../20250602005444_EventImageURL.Designer.cs | 625 ++++++++++++++++++ .../20250602005444_EventImageURL.cs | 28 + .../ApplicationDbContextModelSnapshot.cs | 3 + WebApp/wwwroot/view.html | 1 + 12 files changed, 675 insertions(+), 14 deletions(-) create mode 100644 WebApp/Migrations/20250602005444_EventImageURL.Designer.cs create mode 100644 WebApp/Migrations/20250602005444_EventImageURL.cs diff --git a/WebApp/DTOs/EventCreateDto.cs b/WebApp/DTOs/EventCreateDto.cs index 9a64aa9..16715d1 100644 --- a/WebApp/DTOs/EventCreateDto.cs +++ b/WebApp/DTOs/EventCreateDto.cs @@ -1,4 +1,4 @@ -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using WebApp.Entities; namespace WebApp.DTOs; @@ -8,6 +8,7 @@ public record class EventCreateDto ( [Required][StringLength(50)] string Title, [StringLength(500)] string Description, + string? ImageURL, [Required][StringLength(100)] string Location, [Required] DateTime? EventDate, ICollection EventSkills diff --git a/WebApp/DTOs/EventDetailsDto.cs b/WebApp/DTOs/EventDetailsDto.cs index 1ea780d..a411c85 100644 --- a/WebApp/DTOs/EventDetailsDto.cs +++ b/WebApp/DTOs/EventDetailsDto.cs @@ -11,6 +11,7 @@ public record class EventDetailsDto [Required] public string? OrganisationName { get; set; } [Required][StringLength(50)] public string Title { get; set; } [StringLength(500)] public string Description { get; set; } + public string? ImageURL { get; set; } [Required][StringLength(100)] public string Location { get; set; } [Required] public DateTime? EventDate { get; set; } //ICollection EventSkills, diff --git a/WebApp/DTOs/EventSummaryDto.cs b/WebApp/DTOs/EventSummaryDto.cs index 09d6ecb..a6c8eb2 100644 --- a/WebApp/DTOs/EventSummaryDto.cs +++ b/WebApp/DTOs/EventSummaryDto.cs @@ -10,6 +10,7 @@ public record class EventSummaryDto { [Required] public int OrganisationId { get; set; } [Required] [StringLength(50)] public string Title { get; set; } [StringLength(500)] public string Description { get; set; } + public string? ImageURL { get; set; } [Required] [StringLength(100)] public string Location { get; set; } [Required] public DateTime? EventDate { get; set; } public ICollection EventSkills { get; set; } diff --git a/WebApp/DTOs/EventSummaryNoErDto.cs b/WebApp/DTOs/EventSummaryNoErDto.cs index 74b171d..67a54ba 100644 --- a/WebApp/DTOs/EventSummaryNoErDto.cs +++ b/WebApp/DTOs/EventSummaryNoErDto.cs @@ -10,6 +10,7 @@ public record class EventSummaryNoErDto( [Required] int OrganisationId, [Required][StringLength(50)] string Title, [StringLength(500)] string Description, + string? ImageURL, [Required][StringLength(100)] string Location, [Required] DateTime? EventDate, ICollection EventSkills diff --git a/WebApp/DTOs/EventUpdateDto.cs b/WebApp/DTOs/EventUpdateDto.cs index 1d0047e..abac93f 100644 --- a/WebApp/DTOs/EventUpdateDto.cs +++ b/WebApp/DTOs/EventUpdateDto.cs @@ -1,4 +1,4 @@ -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using WebApp.Entities; namespace WebApp.DTOs; @@ -8,6 +8,7 @@ public record class EventUpdateDto ( [Required][StringLength(50)] string Title, [StringLength(500)] string Description, + string? ImageURL, [Required][StringLength(100)] string Location, [Required] DateTime? EventDate, ICollection EventSkills diff --git a/WebApp/Endpoints/GeneralUseHelperFunctions.cs b/WebApp/Endpoints/GeneralUseHelperFunctions.cs index 987aa2b..780898f 100644 --- a/WebApp/Endpoints/GeneralUseHelperFunctions.cs +++ b/WebApp/Endpoints/GeneralUseHelperFunctions.cs @@ -5,15 +5,10 @@ using WebApp.Entities; namespace WebApp.Endpoints; -public class GeneralUseHelpers +public class GeneralUseHelpers(ApplicationDbContext context) { - private readonly ApplicationDbContext _context; - - public GeneralUseHelpers(ApplicationDbContext context) - { - _context = context; - } + private readonly ApplicationDbContext _context = context; async public Task FindTokenFromString(string token_str) { @@ -129,6 +124,7 @@ public class GeneralUseHelpers OrganisationName = e.Organisation!.Name, Title = e.Title, Description = e.Description ?? "", + ImageURL = e.ImageURL, Location = e.Location, EventDate = e.EventDate, EventSkills = e @@ -175,6 +171,7 @@ public class GeneralUseHelpers Organisation = e.Organisation!.Name, Title = e.Title, Description = e.Description ?? "", + ImageURL = e.ImageURL, Location = e.Location, EventDate = e.EventDate, EventSkills = e diff --git a/WebApp/Entities/Event.cs b/WebApp/Entities/Event.cs index 402d0f3..29dc413 100644 --- a/WebApp/Entities/Event.cs +++ b/WebApp/Entities/Event.cs @@ -1,4 +1,4 @@ -namespace WebApp.Entities +namespace WebApp.Entities { public class Event { @@ -6,6 +6,7 @@ public int OrganisationId { get; set; } public required string Title { get; set; } public string? Description { get; set; } + public string? ImageURL { get; set; } public required string Location { get; set; } public required DateTime EventDate { get; set; } diff --git a/WebApp/Mapping/EventMapping.cs b/WebApp/Mapping/EventMapping.cs index 9ccdf85..bb4292e 100644 --- a/WebApp/Mapping/EventMapping.cs +++ b/WebApp/Mapping/EventMapping.cs @@ -35,8 +35,8 @@ public static class EventMapping public static EventSummaryDto ToEventSummaryDto(this Event myEvent) { - List ssdto = new List(); - List erdto = new List(); + List ssdto = []; + List erdto = []; foreach (EventSkill es in myEvent.EventSkills) { @@ -69,6 +69,7 @@ public static class EventMapping myEvent.OrganisationId, myEvent.Title, myEvent.Description ?? "", + myEvent.ImageURL, myEvent.Location, myEvent.EventDate, myEvent.EventSkills @@ -88,8 +89,8 @@ public static class EventMapping public static EventDetailsDto ToEventDetailsDto(this Event myEvent) { - List ssdto = new List(); - List erdto = new List(); + List ssdto = []; + List erdto = []; foreach (EventSkill es in myEvent.EventSkills) { diff --git a/WebApp/Migrations/20250602005444_EventImageURL.Designer.cs b/WebApp/Migrations/20250602005444_EventImageURL.Designer.cs new file mode 100644 index 0000000..649479d --- /dev/null +++ b/WebApp/Migrations/20250602005444_EventImageURL.Designer.cs @@ -0,0 +1,625 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using WebApp.Data; + +#nullable disable + +namespace WebApp.Migrations +{ + [DbContext(typeof(ApplicationDbContext))] + [Migration("20250602005444_EventImageURL")] + partial class EventImageURL + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "9.0.3") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("text"); + + b.Property("Name") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("NormalizedName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasDatabaseName("RoleNameIndex"); + + b.ToTable("AspNetRoles", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ClaimType") + .HasColumnType("text"); + + b.Property("ClaimValue") + .HasColumnType("text"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetRoleClaims", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("AccessFailedCount") + .HasColumnType("integer"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("text"); + + b.Property("Email") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("EmailConfirmed") + .HasColumnType("boolean"); + + b.Property("LockoutEnabled") + .HasColumnType("boolean"); + + b.Property("LockoutEnd") + .HasColumnType("timestamp with time zone"); + + b.Property("NormalizedEmail") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("NormalizedUserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("PasswordHash") + .HasColumnType("text"); + + b.Property("PhoneNumber") + .HasColumnType("text"); + + b.Property("PhoneNumberConfirmed") + .HasColumnType("boolean"); + + b.Property("SecurityStamp") + .HasColumnType("text"); + + b.Property("TwoFactorEnabled") + .HasColumnType("boolean"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEmail") + .HasDatabaseName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasDatabaseName("UserNameIndex"); + + b.ToTable("AspNetUsers", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ClaimType") + .HasColumnType("text"); + + b.Property("ClaimValue") + .HasColumnType("text"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserClaims", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider") + .HasColumnType("text"); + + b.Property("ProviderKey") + .HasColumnType("text"); + + b.Property("ProviderDisplayName") + .HasColumnType("text"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserLogins", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("text"); + + b.Property("RoleId") + .HasColumnType("text"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetUserRoles", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("text"); + + b.Property("LoginProvider") + .HasColumnType("text"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("Value") + .HasColumnType("text"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AspNetUserTokens", (string)null); + }); + + modelBuilder.Entity("WebApp.Entities.Event", b => + { + b.Property("EventId") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("EventId")); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("EventDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ImageURL") + .HasColumnType("text"); + + b.Property("Location") + .IsRequired() + .HasColumnType("text"); + + b.Property("OrganisationId") + .HasColumnType("integer"); + + b.Property("Title") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("EventId"); + + b.HasIndex("OrganisationId"); + + b.ToTable("Events"); + }); + + modelBuilder.Entity("WebApp.Entities.EventRegistration", b => + { + b.Property("UserId") + .HasColumnType("integer"); + + b.Property("EventId") + .HasColumnType("integer"); + + b.Property("RegisteredAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("UserId", "EventId"); + + b.HasIndex("EventId"); + + b.ToTable("EventRegistrations"); + }); + + modelBuilder.Entity("WebApp.Entities.EventSkill", b => + { + b.Property("EventId") + .HasColumnType("integer"); + + b.Property("SkillId") + .HasColumnType("integer"); + + b.HasKey("EventId", "SkillId"); + + b.HasIndex("SkillId"); + + b.ToTable("EventSkills"); + }); + + modelBuilder.Entity("WebApp.Entities.Message", b => + { + b.Property("MessageId") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("MessageId")); + + b.Property("Content") + .HasColumnType("text"); + + b.Property("EventType") + .HasColumnType("integer"); + + b.Property("IsMsgFromVolunteer") + .HasColumnType("boolean"); + + b.Property("IsoDate") + .HasColumnType("timestamp with time zone"); + + b.Property("OrganizationId") + .HasColumnType("integer"); + + b.Property("VolunteerId") + .HasColumnType("integer"); + + b.HasKey("MessageId"); + + b.ToTable("Messages"); + }); + + modelBuilder.Entity("WebApp.Entities.MessageActivity", b => + { + b.Property("Sender") + .HasColumnType("integer"); + + b.Property("Recipient") + .HasColumnType("integer"); + + b.Property("RecipientLastActive") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Sender", "Recipient"); + + b.ToTable("MessagesActivities"); + }); + + modelBuilder.Entity("WebApp.Entities.Organisation", b => + { + b.Property("OrganisationId") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("OrganisationId")); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserId") + .HasColumnType("integer"); + + b.Property("Website") + .HasColumnType("text"); + + b.HasKey("OrganisationId"); + + b.HasIndex("UserId"); + + b.ToTable("Organisations"); + }); + + modelBuilder.Entity("WebApp.Entities.Skill", b => + { + b.Property("SkillId") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("SkillId")); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("SkillId"); + + b.ToTable("Skills"); + }); + + modelBuilder.Entity("WebApp.Entities.Token", b => + { + b.Property("TokenId") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("TokenId")); + + b.Property("UserId") + .HasColumnType("integer"); + + b.Property("ValidUntil") + .HasColumnType("timestamp with time zone"); + + b.Property("Value") + .HasColumnType("text"); + + b.HasKey("TokenId"); + + b.HasIndex("UserId"); + + b.ToTable("Tokens"); + }); + + modelBuilder.Entity("WebApp.Entities.User", b => + { + b.Property("UserId") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("UserId")); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Email") + .HasColumnType("text"); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("text"); + + b.Property("IsOrganisation") + .HasColumnType("boolean"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("text"); + + b.Property("Password") + .HasColumnType("text"); + + b.HasKey("UserId"); + + b.ToTable("WebUsers"); + }); + + modelBuilder.Entity("WebApp.Entities.VolunteerSkill", b => + { + b.Property("UserId") + .HasColumnType("integer"); + + b.Property("SkillId") + .HasColumnType("integer"); + + b.HasKey("UserId", "SkillId"); + + b.HasIndex("SkillId"); + + b.ToTable("VolunteerSkills"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("WebApp.Entities.Event", b => + { + b.HasOne("WebApp.Entities.Organisation", "Organisation") + .WithMany("Events") + .HasForeignKey("OrganisationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Organisation"); + }); + + modelBuilder.Entity("WebApp.Entities.EventRegistration", b => + { + b.HasOne("WebApp.Entities.Event", "Event") + .WithMany("EventRegistrations") + .HasForeignKey("EventId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("WebApp.Entities.User", "User") + .WithMany("EventRegistrations") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Event"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("WebApp.Entities.EventSkill", b => + { + b.HasOne("WebApp.Entities.Event", "Event") + .WithMany("EventSkills") + .HasForeignKey("EventId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("WebApp.Entities.Skill", "Skill") + .WithMany("EventSkills") + .HasForeignKey("SkillId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Event"); + + b.Navigation("Skill"); + }); + + modelBuilder.Entity("WebApp.Entities.Organisation", b => + { + b.HasOne("WebApp.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("WebApp.Entities.Token", b => + { + b.HasOne("WebApp.Entities.User", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("WebApp.Entities.VolunteerSkill", b => + { + b.HasOne("WebApp.Entities.Skill", "Skill") + .WithMany("VolunteerSkills") + .HasForeignKey("SkillId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("WebApp.Entities.User", "User") + .WithMany("VolunteerSkills") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Skill"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("WebApp.Entities.Event", b => + { + b.Navigation("EventRegistrations"); + + b.Navigation("EventSkills"); + }); + + modelBuilder.Entity("WebApp.Entities.Organisation", b => + { + b.Navigation("Events"); + }); + + modelBuilder.Entity("WebApp.Entities.Skill", b => + { + b.Navigation("EventSkills"); + + b.Navigation("VolunteerSkills"); + }); + + modelBuilder.Entity("WebApp.Entities.User", b => + { + b.Navigation("EventRegistrations"); + + b.Navigation("Tokens"); + + b.Navigation("VolunteerSkills"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/WebApp/Migrations/20250602005444_EventImageURL.cs b/WebApp/Migrations/20250602005444_EventImageURL.cs new file mode 100644 index 0000000..0dfe06e --- /dev/null +++ b/WebApp/Migrations/20250602005444_EventImageURL.cs @@ -0,0 +1,28 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace WebApp.Migrations +{ + /// + public partial class EventImageURL : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "ImageURL", + table: "Events", + type: "text", + nullable: true); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "ImageURL", + table: "Events"); + } + } +} diff --git a/WebApp/Migrations/ApplicationDbContextModelSnapshot.cs b/WebApp/Migrations/ApplicationDbContextModelSnapshot.cs index af1c340..ede28ec 100644 --- a/WebApp/Migrations/ApplicationDbContextModelSnapshot.cs +++ b/WebApp/Migrations/ApplicationDbContextModelSnapshot.cs @@ -232,6 +232,9 @@ namespace WebApp.Migrations b.Property("EventDate") .HasColumnType("timestamp with time zone"); + b.Property("ImageURL") + .HasColumnType("text"); + b.Property("Location") .IsRequired() .HasColumnType("text"); diff --git a/WebApp/wwwroot/view.html b/WebApp/wwwroot/view.html index 3f804b0..fd72330 100644 --- a/WebApp/wwwroot/view.html +++ b/WebApp/wwwroot/view.html @@ -74,6 +74,7 @@ +