From e53c3a6eeb4a6be5a9318897b49191b72afc7bfd Mon Sep 17 00:00:00 2001 From: githubjimmeicatt Date: Mon, 18 Sep 2023 12:20:35 +0200 Subject: [PATCH] migrations naam to titel --- ...NameChangeVragenSetNaamToTitel.Designer.cs | 319 ++++++++++++++++++ ...18100251_NameChangeVragenSetNaamToTitel.cs | 25 ++ .../BeheerDbContextModelSnapshot.cs | 2 +- .../ContactVerzoekVragenSet.cs | 2 +- .../WriteContactverzoekenVragenSets.cs | 2 +- .../ContactverzoekFormulier.vue | 2 +- src/features/contactverzoek/service.ts | 4 +- src/features/contactverzoek/types.ts | 2 +- .../ContactverzoekFormulierBeheer.vue | 2 +- 9 files changed, 352 insertions(+), 8 deletions(-) create mode 100644 Kiss.Bff/Beheer/Data/Migrations/20230918100251_NameChangeVragenSetNaamToTitel.Designer.cs create mode 100644 Kiss.Bff/Beheer/Data/Migrations/20230918100251_NameChangeVragenSetNaamToTitel.cs diff --git a/Kiss.Bff/Beheer/Data/Migrations/20230918100251_NameChangeVragenSetNaamToTitel.Designer.cs b/Kiss.Bff/Beheer/Data/Migrations/20230918100251_NameChangeVragenSetNaamToTitel.Designer.cs new file mode 100644 index 000000000..f8d443b2c --- /dev/null +++ b/Kiss.Bff/Beheer/Data/Migrations/20230918100251_NameChangeVragenSetNaamToTitel.Designer.cs @@ -0,0 +1,319 @@ +// +using System; +using Kiss.Bff.Beheer.Data; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace Kiss.Bff.NieuwsEnWerkinstructies.Migrations +{ + [DbContext(typeof(BeheerDbContext))] + [Migration("20230918100251_NameChangeVragenSetNaamToTitel")] + partial class NameChangeVragenSetNaamToTitel + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "6.0.16") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("BerichtSkill", b => + { + b.Property("BerichtenId") + .HasColumnType("integer"); + + b.Property("SkillsId") + .HasColumnType("integer"); + + b.HasKey("BerichtenId", "SkillsId"); + + b.HasIndex("SkillsId"); + + b.ToTable("BerichtSkill"); + }); + + modelBuilder.Entity("Kiss.Bff.Beheer.Gespreksresultaten.Data.Entities.Gespreksresultaat", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateUpdated") + .HasColumnType("timestamp with time zone"); + + b.Property("Definitie") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("Definitie") + .IsUnique(); + + b.ToTable("Gespreksresultaten"); + }); + + modelBuilder.Entity("Kiss.Bff.Beheer.Links.Data.Entities.Link", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Categorie") + .IsRequired() + .HasColumnType("text"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateUpdated") + .HasColumnType("timestamp with time zone"); + + b.Property("Titel") + .IsRequired() + .HasColumnType("text"); + + b.Property("Url") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Links"); + }); + + modelBuilder.Entity("Kiss.Bff.Beheer.Verwerking.VerwerkingsLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ApiEndpoint") + .IsRequired() + .HasColumnType("text"); + + b.Property("InsertedAt") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("NOW()"); + + b.Property("Method") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("VerwerkingsLogs"); + }); + + modelBuilder.Entity("Kiss.Bff.NieuwsEnWerkinstructies.Data.Entities.Bericht", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateUpdated") + .HasColumnType("timestamp with time zone"); + + b.Property("Inhoud") + .IsRequired() + .HasColumnType("text"); + + b.Property("IsBelangrijk") + .HasColumnType("boolean"); + + b.Property("PublicatieDatum") + .HasColumnType("timestamp with time zone"); + + b.Property("PublicatieEinddatum") + .HasColumnType("timestamp with time zone"); + + b.Property("Titel") + .IsRequired() + .HasColumnType("text"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.HasKey("Id"); + + b.HasIndex("Type"); + + b.ToTable("Berichten"); + }); + + modelBuilder.Entity("Kiss.Bff.NieuwsEnWerkinstructies.Data.Entities.BerichtGelezen", b => + { + b.Property("UserId") + .HasColumnType("text"); + + b.Property("BerichtId") + .HasColumnType("integer"); + + b.Property("GelezenOp") + .HasColumnType("timestamp with time zone"); + + b.HasKey("UserId", "BerichtId"); + + b.HasIndex("BerichtId"); + + b.ToTable("Gelezen"); + }); + + modelBuilder.Entity("Kiss.Bff.NieuwsEnWerkinstructies.Data.Entities.Skill", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateUpdated") + .HasColumnType("timestamp with time zone"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("Naam") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Skills"); + }); + + modelBuilder.Entity("Kiss.Bff.ZaakGerichtWerken.Contactmomenten.ContactmomentDetails", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("Einddatum") + .HasColumnType("timestamp with time zone"); + + b.Property("EmailadresKcm") + .HasColumnType("text"); + + b.Property("Gespreksresultaat") + .HasColumnType("text"); + + b.Property("SpecifiekeVraag") + .HasColumnType("text"); + + b.Property("Startdatum") + .HasColumnType("timestamp with time zone"); + + b.Property("VerantwoordelijkeAfdeling") + .HasColumnType("text"); + + b.Property("Vraag") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("VerantwoordelijkeAfdeling"); + + b.HasIndex("Vraag"); + + b.ToTable("ContactMomentDetails"); + }); + + modelBuilder.Entity("Kiss.Bff.ZaakGerichtWerken.Contactverzoeken.ContactVerzoekVragenSet", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AfdelingId") + .HasColumnType("text"); + + b.Property("JsonVragen") + .HasColumnType("json"); + + b.Property("Titel") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("ContactVerzoekVragenSets"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("FriendlyName") + .HasColumnType("text"); + + b.Property("Xml") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("DataProtectionKeys"); + }); + + modelBuilder.Entity("BerichtSkill", b => + { + b.HasOne("Kiss.Bff.NieuwsEnWerkinstructies.Data.Entities.Bericht", null) + .WithMany() + .HasForeignKey("BerichtenId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Kiss.Bff.NieuwsEnWerkinstructies.Data.Entities.Skill", null) + .WithMany() + .HasForeignKey("SkillsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Kiss.Bff.NieuwsEnWerkinstructies.Data.Entities.BerichtGelezen", b => + { + b.HasOne("Kiss.Bff.NieuwsEnWerkinstructies.Data.Entities.Bericht", null) + .WithMany("Gelezen") + .HasForeignKey("BerichtId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Kiss.Bff.NieuwsEnWerkinstructies.Data.Entities.Bericht", b => + { + b.Navigation("Gelezen"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Kiss.Bff/Beheer/Data/Migrations/20230918100251_NameChangeVragenSetNaamToTitel.cs b/Kiss.Bff/Beheer/Data/Migrations/20230918100251_NameChangeVragenSetNaamToTitel.cs new file mode 100644 index 000000000..3dd668952 --- /dev/null +++ b/Kiss.Bff/Beheer/Data/Migrations/20230918100251_NameChangeVragenSetNaamToTitel.cs @@ -0,0 +1,25 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Kiss.Bff.NieuwsEnWerkinstructies.Migrations +{ + public partial class NameChangeVragenSetNaamToTitel : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.RenameColumn( + name: "Naam", + table: "ContactVerzoekVragenSets", + newName: "Titel"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.RenameColumn( + name: "Titel", + table: "ContactVerzoekVragenSets", + newName: "Naam"); + } + } +} diff --git a/Kiss.Bff/Beheer/Data/Migrations/BeheerDbContextModelSnapshot.cs b/Kiss.Bff/Beheer/Data/Migrations/BeheerDbContextModelSnapshot.cs index ee6e0463f..f44ec442c 100644 --- a/Kiss.Bff/Beheer/Data/Migrations/BeheerDbContextModelSnapshot.cs +++ b/Kiss.Bff/Beheer/Data/Migrations/BeheerDbContextModelSnapshot.cs @@ -255,7 +255,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("JsonVragen") .HasColumnType("json"); - b.Property("Naam") + b.Property("Titel") .IsRequired() .HasColumnType("text"); diff --git a/Kiss.Bff/ZaakGerichtWerken/Contactverzoeken/ContactVerzoekVragenSet.cs b/Kiss.Bff/ZaakGerichtWerken/Contactverzoeken/ContactVerzoekVragenSet.cs index 8c69be625..e9bc38325 100644 --- a/Kiss.Bff/ZaakGerichtWerken/Contactverzoeken/ContactVerzoekVragenSet.cs +++ b/Kiss.Bff/ZaakGerichtWerken/Contactverzoeken/ContactVerzoekVragenSet.cs @@ -7,7 +7,7 @@ public class ContactVerzoekVragenSet [Required] public int Id { get; set; } = default!; [Required] - public string Naam { get; set; } = default!; + public string Titel { get; set; } = default!; public string? JsonVragen { get; set; } public string? AfdelingId { get; set; } } diff --git a/Kiss.Bff/ZaakGerichtWerken/Contactverzoeken/WriteContactverzoekenVragenSets.cs b/Kiss.Bff/ZaakGerichtWerken/Contactverzoeken/WriteContactverzoekenVragenSets.cs index cde0ddc79..74377b3c8 100644 --- a/Kiss.Bff/ZaakGerichtWerken/Contactverzoeken/WriteContactverzoekenVragenSets.cs +++ b/Kiss.Bff/ZaakGerichtWerken/Contactverzoeken/WriteContactverzoekenVragenSets.cs @@ -44,7 +44,7 @@ public async Task Put(int id, ContactVerzoekVragenSet model, Canc return NotFound(); } - contactVerzoekVragenSet.Naam = model.Naam; + contactVerzoekVragenSet.Titel = model.Titel; contactVerzoekVragenSet.JsonVragen = model.JsonVragen; contactVerzoekVragenSet.AfdelingId = model.AfdelingId; diff --git a/src/features/contactverzoek/ContactverzoekFormulier.vue b/src/features/contactverzoek/ContactverzoekFormulier.vue index 6a8423a85..8735a847f 100644 --- a/src/features/contactverzoek/ContactverzoekFormulier.vue +++ b/src/features/contactverzoek/ContactverzoekFormulier.vue @@ -109,7 +109,7 @@ > diff --git a/src/features/contactverzoek/service.ts b/src/features/contactverzoek/service.ts index fab577ffa..b60cb8652 100644 --- a/src/features/contactverzoek/service.ts +++ b/src/features/contactverzoek/service.ts @@ -23,7 +23,7 @@ const contactMomentVragenSets = "/api/contactverzoekvragensets"; type ServerContactVerzoekVragenSet = { id: string; - naam: string; + titel: string; jsonVragen: string; afdelingId: string; }; @@ -277,7 +277,7 @@ function mapToClientContactVerzoekVragenSets( ); return { id: serverData.id, - naam: serverData.naam, + titel: serverData.titel, vraagAntwoord: parsedQuestions, afdelingId: serverData.afdelingId, }; diff --git a/src/features/contactverzoek/types.ts b/src/features/contactverzoek/types.ts index eed981b64..c66894b0c 100644 --- a/src/features/contactverzoek/types.ts +++ b/src/features/contactverzoek/types.ts @@ -23,7 +23,7 @@ export interface CheckboxVraag extends Vraag { export interface ContactVerzoekVragenSet { id: string; - naam: string; + titel: string; vraagAntwoord: Vraag[]; afdelingId: string; } diff --git a/src/views/Beheer/contactverzoek-formulieren/ContactverzoekFormulierBeheer.vue b/src/views/Beheer/contactverzoek-formulieren/ContactverzoekFormulierBeheer.vue index 33539687c..d062a11a8 100644 --- a/src/views/Beheer/contactverzoek-formulieren/ContactverzoekFormulierBeheer.vue +++ b/src/views/Beheer/contactverzoek-formulieren/ContactverzoekFormulierBeheer.vue @@ -451,7 +451,7 @@ async function load() { ); const data = await response.json(); - title.value = data.naam; + title.value = data.titel; selectedAfdeling.value = data.afdelingId; vragen.value = ToSchemaFromVragen(JSON.parse(data.jsonVragen)); }