From 72e1df3defbd5c3f89b32bdcb842a8934563c5d9 Mon Sep 17 00:00:00 2001 From: Andre Beging Date: Sat, 2 Apr 2022 15:27:18 +0200 Subject: [PATCH] Database updates --- FSSiegen.Diagram1.view | 39 +++-- FSSiegen.efml | 3 +- .../Entity/Interaction.Generated.cs | 2 +- .../Entity/InteractionType.cs | 2 +- .../Entity/Prospect.Generated.cs | 2 +- .../Entity/Prospect.cs | 11 +- .../Entity/User.Generated.cs | 2 +- .../Entity/UserType.cs | 2 +- .../Data/FsContext.Generated.cs | 4 +- .../20220402121638_memonull.Designer.cs | 156 ++++++++++++++++++ .../Migrations/20220402121638_memonull.cs | 33 ++++ .../Migrations/FsContextModelSnapshot.cs | 1 - FoodsharingSiegen.Server/app.db-shm | Bin 32768 -> 0 bytes FoodsharingSiegen.Server/app.db-wal | Bin 32992 -> 0 bytes 14 files changed, 229 insertions(+), 28 deletions(-) create mode 100644 FoodsharingSiegen.Server/Migrations/20220402121638_memonull.Designer.cs create mode 100644 FoodsharingSiegen.Server/Migrations/20220402121638_memonull.cs delete mode 100644 FoodsharingSiegen.Server/app.db-shm delete mode 100644 FoodsharingSiegen.Server/app.db-wal diff --git a/FSSiegen.Diagram1.view b/FSSiegen.Diagram1.view index 16b9c4d..6d6e126 100644 --- a/FSSiegen.Diagram1.view +++ b/FSSiegen.Diagram1.view @@ -950,14 +950,33 @@ EntityDeveloper.EnumTypeMember + + + 51 + 44 + + + + 0.5 px + 108.5 px + + + 144 px + 18 px + + + 4c471e6c-91e8-489e-8a3d-41bee5acf5e3 + EntityDeveloper.EnumTypeMember + + 145 px - 108 px + 126 px 0 px - 109 px + 127 px @@ -967,15 +986,15 @@ 150 px - 157 px + 175 px 100 px - 157 px + 175 px 800 px - 157 px + 175 px @@ -986,11 +1005,11 @@ - 51 + 52 19 29 - 52 - 53 + 53 + 54 0 @@ -1002,7 +1021,7 @@ Top Bottom Right - 52 + 53 FloatAnchor @@ -1014,7 +1033,7 @@ Top Bottom Left - 53 + 54 FloatAnchor diff --git a/FSSiegen.efml b/FSSiegen.efml index a8cdae6..815d434 100644 --- a/FSSiegen.efml +++ b/FSSiegen.efml @@ -16,6 +16,7 @@ + @@ -54,7 +55,7 @@ - + diff --git a/FoodsharingSiegen.Contracts/Entity/Interaction.Generated.cs b/FoodsharingSiegen.Contracts/Entity/Interaction.Generated.cs index 886bc1a..3da418e 100644 --- a/FoodsharingSiegen.Contracts/Entity/Interaction.Generated.cs +++ b/FoodsharingSiegen.Contracts/Entity/Interaction.Generated.cs @@ -2,7 +2,7 @@ // This is auto-generated code. //------------------------------------------------------------------------------ // This code was generated by Entity Developer tool using EF Core template. -// Code is generated on: 02.04.2022 10:49:14 +// Code is generated on: 02.04.2022 14:16:15 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. diff --git a/FoodsharingSiegen.Contracts/Entity/InteractionType.cs b/FoodsharingSiegen.Contracts/Entity/InteractionType.cs index 289597d..e00ed46 100644 --- a/FoodsharingSiegen.Contracts/Entity/InteractionType.cs +++ b/FoodsharingSiegen.Contracts/Entity/InteractionType.cs @@ -2,7 +2,7 @@ // This is auto-generated code. //------------------------------------------------------------------------------ // This code was generated by Entity Developer tool using EF Core template. -// Code is generated on: 02.04.2022 10:49:14 +// Code is generated on: 02.04.2022 14:16:15 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. diff --git a/FoodsharingSiegen.Contracts/Entity/Prospect.Generated.cs b/FoodsharingSiegen.Contracts/Entity/Prospect.Generated.cs index 798c6a7..5b7e38d 100644 --- a/FoodsharingSiegen.Contracts/Entity/Prospect.Generated.cs +++ b/FoodsharingSiegen.Contracts/Entity/Prospect.Generated.cs @@ -2,7 +2,7 @@ // This is auto-generated code. //------------------------------------------------------------------------------ // This code was generated by Entity Developer tool using EF Core template. -// Code is generated on: 02.04.2022 10:49:14 +// Code is generated on: 02.04.2022 14:16:15 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. diff --git a/FoodsharingSiegen.Contracts/Entity/Prospect.cs b/FoodsharingSiegen.Contracts/Entity/Prospect.cs index 462181d..b045bb9 100644 --- a/FoodsharingSiegen.Contracts/Entity/Prospect.cs +++ b/FoodsharingSiegen.Contracts/Entity/Prospect.cs @@ -1,15 +1,8 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Data.Common; -using System.Linq; -using System.Linq.Expressions; - -namespace FoodsharingSiegen.Contracts.Entity +namespace FoodsharingSiegen.Contracts.Entity { public partial class Prospect { + public bool Complete => Interactions?.Any(x => x.Type == InteractionType.Complete) == true; } } diff --git a/FoodsharingSiegen.Contracts/Entity/User.Generated.cs b/FoodsharingSiegen.Contracts/Entity/User.Generated.cs index 1810ddd..35807f7 100644 --- a/FoodsharingSiegen.Contracts/Entity/User.Generated.cs +++ b/FoodsharingSiegen.Contracts/Entity/User.Generated.cs @@ -2,7 +2,7 @@ // This is auto-generated code. //------------------------------------------------------------------------------ // This code was generated by Entity Developer tool using EF Core template. -// Code is generated on: 02.04.2022 10:49:14 +// Code is generated on: 02.04.2022 14:16:15 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. diff --git a/FoodsharingSiegen.Contracts/Entity/UserType.cs b/FoodsharingSiegen.Contracts/Entity/UserType.cs index cb7a5e2..2ca6fc0 100644 --- a/FoodsharingSiegen.Contracts/Entity/UserType.cs +++ b/FoodsharingSiegen.Contracts/Entity/UserType.cs @@ -2,7 +2,7 @@ // This is auto-generated code. //------------------------------------------------------------------------------ // This code was generated by Entity Developer tool using EF Core template. -// Code is generated on: 02.04.2022 10:49:14 +// Code is generated on: 02.04.2022 14:16:15 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. diff --git a/FoodsharingSiegen.Server/Data/FsContext.Generated.cs b/FoodsharingSiegen.Server/Data/FsContext.Generated.cs index 1bf9874..bf958e0 100644 --- a/FoodsharingSiegen.Server/Data/FsContext.Generated.cs +++ b/FoodsharingSiegen.Server/Data/FsContext.Generated.cs @@ -2,7 +2,7 @@ // This is auto-generated code. //------------------------------------------------------------------------------ // This code was generated by Entity Developer tool using EF Core template. -// Code is generated on: 02.04.2022 10:49:14 +// Code is generated on: 02.04.2022 14:16:15 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -117,7 +117,7 @@ namespace FoodsharingSiegen.Server.Data modelBuilder.Entity().Property(x => x.Name).HasColumnName(@"Name").IsRequired().ValueGeneratedNever(); modelBuilder.Entity().Property(x => x.ProgressId).HasColumnName(@"ProgressId").IsRequired().ValueGeneratedNever(); modelBuilder.Entity().Property(x => x.Created).HasColumnName(@"Created").IsRequired().ValueGeneratedNever(); - modelBuilder.Entity().Property(x => x.Memo).HasColumnName(@"Memo").IsRequired().ValueGeneratedNever(); + modelBuilder.Entity().Property(x => x.Memo).HasColumnName(@"Memo").ValueGeneratedNever(); modelBuilder.Entity().HasKey(@"Id"); } diff --git a/FoodsharingSiegen.Server/Migrations/20220402121638_memonull.Designer.cs b/FoodsharingSiegen.Server/Migrations/20220402121638_memonull.Designer.cs new file mode 100644 index 0000000..1123305 --- /dev/null +++ b/FoodsharingSiegen.Server/Migrations/20220402121638_memonull.Designer.cs @@ -0,0 +1,156 @@ +// +using System; +using FoodsharingSiegen.Server.Data; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace FoodsharingSiegen.Server.Migrations +{ + [DbContext(typeof(FsContext))] + [Migration("20220402121638_memonull")] + partial class memonull + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder.HasAnnotation("ProductVersion", "6.0.1"); + + modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Interaction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT") + .HasColumnName("Id"); + + b.Property("Date") + .HasColumnType("TEXT") + .HasColumnName("Date"); + + b.Property("Info") + .HasColumnType("TEXT") + .HasColumnName("Info"); + + b.Property("ProspectId") + .HasColumnType("TEXT") + .HasColumnName("ProspectId"); + + b.Property("Type") + .HasColumnType("INTEGER") + .HasColumnName("Type"); + + b.Property("UserId") + .HasColumnType("TEXT") + .HasColumnName("UserId"); + + b.HasKey("Id"); + + b.HasIndex("ProspectId"); + + b.HasIndex("UserId"); + + b.ToTable("Interactions", (string)null); + }); + + modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Prospect", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT") + .HasColumnName("Id"); + + b.Property("Created") + .HasColumnType("TEXT") + .HasColumnName("Created"); + + b.Property("FsId") + .HasColumnType("INTEGER") + .HasColumnName("FsId"); + + b.Property("Memo") + .HasColumnType("TEXT") + .HasColumnName("Memo"); + + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT") + .HasColumnName("Name"); + + b.Property("ProgressId") + .HasColumnType("TEXT") + .HasColumnName("ProgressId"); + + b.HasKey("Id"); + + b.ToTable("Prospects", (string)null); + }); + + modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT") + .HasColumnName("Id"); + + b.Property("Created") + .HasColumnType("TEXT") + .HasColumnName("Created"); + + b.Property("Mail") + .IsRequired() + .HasColumnType("TEXT") + .HasColumnName("Mail"); + + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT") + .HasColumnName("Name"); + + b.Property("Type") + .HasColumnType("INTEGER") + .HasColumnName("Type"); + + b.Property("Verified") + .HasColumnType("INTEGER") + .HasColumnName("Verified"); + + b.HasKey("Id"); + + b.ToTable("Users", (string)null); + }); + + modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Interaction", b => + { + b.HasOne("FoodsharingSiegen.Contracts.Entity.Prospect", "Prospect") + .WithMany("Interactions") + .HasForeignKey("ProspectId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("FoodsharingSiegen.Contracts.Entity.User", "User") + .WithMany("Interactions") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Prospect"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Prospect", b => + { + b.Navigation("Interactions"); + }); + + modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.User", b => + { + b.Navigation("Interactions"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/FoodsharingSiegen.Server/Migrations/20220402121638_memonull.cs b/FoodsharingSiegen.Server/Migrations/20220402121638_memonull.cs new file mode 100644 index 0000000..8e9305e --- /dev/null +++ b/FoodsharingSiegen.Server/Migrations/20220402121638_memonull.cs @@ -0,0 +1,33 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace FoodsharingSiegen.Server.Migrations +{ + public partial class memonull : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "Memo", + table: "Prospects", + type: "TEXT", + nullable: true, + oldClrType: typeof(string), + oldType: "TEXT"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "Memo", + table: "Prospects", + type: "TEXT", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "TEXT", + oldNullable: true); + } + } +} diff --git a/FoodsharingSiegen.Server/Migrations/FsContextModelSnapshot.cs b/FoodsharingSiegen.Server/Migrations/FsContextModelSnapshot.cs index f2af9f2..fed5f16 100644 --- a/FoodsharingSiegen.Server/Migrations/FsContextModelSnapshot.cs +++ b/FoodsharingSiegen.Server/Migrations/FsContextModelSnapshot.cs @@ -69,7 +69,6 @@ namespace FoodsharingSiegen.Server.Migrations .HasColumnName("FsId"); b.Property("Memo") - .IsRequired() .HasColumnType("TEXT") .HasColumnName("Memo"); diff --git a/FoodsharingSiegen.Server/app.db-shm b/FoodsharingSiegen.Server/app.db-shm deleted file mode 100644 index f7510565ec5592017d9b75f69f4ee96fc056f0cd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 32768 zcmeI*D-Oay5CG6E<&Qzua0J2~xCF-_Tmgf{;5Y{wg~HM#od5v>1PBlyK!5-N c0t5&UAV7cs0RjXF5FkK+009C72>eIj4PYxPHvj+t diff --git a/FoodsharingSiegen.Server/app.db-wal b/FoodsharingSiegen.Server/app.db-wal deleted file mode 100644 index 77612e4f085b3acdf0258ee3de6b39e61a22f1d7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 32992 zcmeI5O^6&t6vsDivY(l0jS1>OjR#FYYEs`HLx^-$S6@7MS}z(j7!5>JV$hq&cnEkh z7!(O2h>Y5%_Nr7;WiK zFQkPH3wOp8W%5ZdCw*Yrn8a$AYi49#x>(|yWm4@hk_5R7uN7#o4WS3 zjx42UnYO%T9^#p4w2W=iQJ8v;XJcYcneonNGHW3*e!H$(m)6LvVFyrHE@qNi`I5AY};JphQWGsC|d`kE+c}q9$4+Q_?Oo zpgRyHJjGcp@0%(a&xyJdmm;{Vn7ziPZ*Y1Xm-KaM=z3>QR(}cIt z3K%8U8fBPvNim;HV8S%5Q$c9Q)mlYd4viXUYrMzk*(qCXgNuq;UAOQ|Tg_tjHG?mc zWY#J-?Wmd^6SAT)kcEOZj%UcG*o~QH9!B4r9Biu1Dm^?5jVXkj(g6;PB2;#ds+qAO zZDF=4C7D(&C~9G@cxfez#=`kVn%e2h6`6rnR@xh?XnL$D!=D8Vkk>FvA+LjHu~CU- z-U^Xm$ZR7nQKW_%6!~C;78pjmv&=a+P(|us6y!Bb{!ljx(j+v=OD~cOqiSlbsBNR- zWl(G0Ko$u|pqO%E(M8^RCmU;5XHgk7Py|_|gV)|*6iJ+-O=CqMPrxOLDGvoeI{{@* z$;5(n+52d6f{A&tN-il_Tuap+si$~4~-ib zVy0EP+w~z>e1l&g=k5JyBTE|9mmor~Uqh&!#4wQni6c(i@v@mfk zB!-8(2|Q`znD^Sk9oa$2gn7=bf)_Kh>Y5g-CYfC$`l0y`%cHefv6 zehI|*ti2M5@jf?~K#V0hUji{s;amyCSa`D~5aX=Plt7H(HC+NRKGakR#MncdI*ka| zW@8D&m?@Jb5aV&&wqtT(7UMlY_7)3Z#TRIvI{nqb3xCe8_yT(?-9HJgz@Fau-eUhi zbp#xNGu4S|zJKnfXFdra0z`la5CI}U1c(3;AOb{y2oQlnp!~0hc|X7N1u%h~FMxSJ zzVihzkJ$MFnDsrKFMxT(&KJN0F8Kn8MJk;yfO*ru^93+}y7L7vft@da0lwr5Af8O; z3n14El=uDTm)8p{{_)M%Z{G32gDbv3@c@og;0_cgpmPWg!0Lf*#U-HWM+Arf5g-CY zfCvx)B0vO)01+Spw*-OW3t-ljcfJ57u=52lft@da3G93UOyJUb0mP29&KJNuV&@BB z0y|#-6WI9zn83~#zyx-_04A{W1u%h~FMtVz3|`Y;p!e3_pX_?#?T<@;fol5Ty8Q*< z*K`m8B0vO)01+Sp*F|8owOZO+cvot;_0A{OIu3j0y@lNz^%uBe#{=pwaJ9ZLql)?qT(xn=t=?bY zyJtQ<_0c{4y|P}Q>K(tVzd-Lebr`s=mw$8-5g-CYfCvx)B0vO)01+SpMBthUlw|-I z2e~SN)L-CAoja+&z`DH+AuWpqu+m@Pp}qI-d-C%K9$)bV*7O(X9j6Wh*F2Hw0wO>J zhyW2F0z`la5CI}U1c<Y2#TQto zzW^*Jpo0hy0U|&IhyW2F0z`la5CI}U1pYMw*tP+kFM!!fPW=Ve{S4jzXMcfz01y-x ArvLx|