From 1b2c6c406267f626f319abed18b6f35b324635a4 Mon Sep 17 00:00:00 2001 From: Andre Beging Date: Mon, 11 Apr 2022 15:50:09 +0200 Subject: [PATCH] Database update --- .../Entity/Interaction.Generated.cs | 2 +- .../Entity/InteractionType.cs | 2 +- .../Entity/Prospect.Generated.cs | 2 +- .../Entity/User.Generated.cs | 4 +- FoodsharingSiegen.Contracts/Entity/User.cs | 10 + .../Entity/UserGroup.cs | 2 +- .../Entity/UserType.cs | 2 +- .../Data/FsContext.Generated.cs | 3 +- .../20220411114633_forcelogout.Designer.cs | 182 ++++++++++++++++++ .../Migrations/20220411114633_forcelogout.cs | 26 +++ .../Migrations/FsContextModelSnapshot.cs | 4 + FoodsharingSiegen.Server/app.db-shm | Bin 0 -> 32768 bytes FoodsharingSiegen.Server/app.db-wal | Bin 0 -> 32992 bytes 13 files changed, 232 insertions(+), 7 deletions(-) create mode 100644 FoodsharingSiegen.Server/Migrations/20220411114633_forcelogout.Designer.cs create mode 100644 FoodsharingSiegen.Server/Migrations/20220411114633_forcelogout.cs create mode 100644 FoodsharingSiegen.Server/app.db-shm create mode 100644 FoodsharingSiegen.Server/app.db-wal diff --git a/FoodsharingSiegen.Contracts/Entity/Interaction.Generated.cs b/FoodsharingSiegen.Contracts/Entity/Interaction.Generated.cs index 80dfbff..406f1e2 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: 05.04.2022 16:38:00 +// Code is generated on: 11.04.2022 13:40:57 // // 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 251de19..2b0dbde 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: 05.04.2022 16:38:00 +// Code is generated on: 11.04.2022 13:40:57 // // 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 52dc143..d539e7b 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: 05.04.2022 16:38:00 +// Code is generated on: 11.04.2022 13:40:57 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. diff --git a/FoodsharingSiegen.Contracts/Entity/User.Generated.cs b/FoodsharingSiegen.Contracts/Entity/User.Generated.cs index cb3b5ed..e448c67 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: 05.04.2022 16:38:00 +// Code is generated on: 11.04.2022 13:40:57 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -42,6 +42,8 @@ namespace FoodsharingSiegen.Contracts.Entity public virtual string Groups { get; set; } + public virtual bool ForceLogout { get; set; } + public virtual IList Interactions { get; set; } #region Extensibility Method Definitions diff --git a/FoodsharingSiegen.Contracts/Entity/User.cs b/FoodsharingSiegen.Contracts/Entity/User.cs index e93600a..9a10e8a 100644 --- a/FoodsharingSiegen.Contracts/Entity/User.cs +++ b/FoodsharingSiegen.Contracts/Entity/User.cs @@ -38,5 +38,15 @@ namespace FoodsharingSiegen.Contracts.Entity } #endregion + + #region Public Method Clone + + /// + /// Clones this instance (a. beging, 11.04.2022) + /// + /// The user + public User Clone() => (User) MemberwiseClone(); + + #endregion } } diff --git a/FoodsharingSiegen.Contracts/Entity/UserGroup.cs b/FoodsharingSiegen.Contracts/Entity/UserGroup.cs index 5006407..35a1e93 100644 --- a/FoodsharingSiegen.Contracts/Entity/UserGroup.cs +++ b/FoodsharingSiegen.Contracts/Entity/UserGroup.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: 05.04.2022 16:38:00 +// Code is generated on: 11.04.2022 13:40:57 // // 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 2a64384..52a1bd9 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: 05.04.2022 16:38:00 +// Code is generated on: 11.04.2022 13:40:57 // // 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 fffcd0a..c548310 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: 05.04.2022 16:38:00 +// Code is generated on: 11.04.2022 13:40:57 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -102,6 +102,7 @@ namespace FoodsharingSiegen.Server.Data modelBuilder.Entity().Property(x => x.Created).HasColumnName(@"Created").IsRequired().ValueGeneratedNever(); modelBuilder.Entity().Property(x => x.EncryptedPassword).HasColumnName(@"EncryptedPassword").IsRequired().ValueGeneratedNever(); modelBuilder.Entity().Property(x => x.Groups).HasColumnName(@"Groups").IsRequired().ValueGeneratedNever(); + modelBuilder.Entity().Property(x => x.ForceLogout).HasColumnName(@"ForceLogout").IsRequired().ValueGeneratedNever(); modelBuilder.Entity().HasKey(@"Id"); } diff --git a/FoodsharingSiegen.Server/Migrations/20220411114633_forcelogout.Designer.cs b/FoodsharingSiegen.Server/Migrations/20220411114633_forcelogout.Designer.cs new file mode 100644 index 0000000..9ca8c00 --- /dev/null +++ b/FoodsharingSiegen.Server/Migrations/20220411114633_forcelogout.Designer.cs @@ -0,0 +1,182 @@ +// +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("20220411114633_forcelogout")] + partial class forcelogout + { + 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("Alert") + .HasColumnType("INTEGER") + .HasColumnName("Alert"); + + b.Property("Created") + .HasColumnType("TEXT") + .HasColumnName("Created"); + + b.Property("Date") + .HasColumnType("TEXT") + .HasColumnName("Date"); + + b.Property("Info") + .HasColumnType("TEXT") + .HasColumnName("Info"); + + b.Property("NotNeeded") + .HasColumnType("INTEGER") + .HasColumnName("NotNeeded"); + + 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("EncryptedPassword") + .IsRequired() + .HasColumnType("TEXT") + .HasColumnName("EncryptedPassword"); + + b.Property("ForceLogout") + .HasColumnType("INTEGER") + .HasColumnName("ForceLogout"); + + b.Property("Groups") + .IsRequired() + .HasColumnType("TEXT") + .HasColumnName("Groups"); + + 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/20220411114633_forcelogout.cs b/FoodsharingSiegen.Server/Migrations/20220411114633_forcelogout.cs new file mode 100644 index 0000000..ab7c78c --- /dev/null +++ b/FoodsharingSiegen.Server/Migrations/20220411114633_forcelogout.cs @@ -0,0 +1,26 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace FoodsharingSiegen.Server.Migrations +{ + public partial class forcelogout : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "ForceLogout", + table: "Users", + type: "INTEGER", + nullable: false, + defaultValue: false); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "ForceLogout", + table: "Users"); + } + } +} diff --git a/FoodsharingSiegen.Server/Migrations/FsContextModelSnapshot.cs b/FoodsharingSiegen.Server/Migrations/FsContextModelSnapshot.cs index be49047..11dbf03 100644 --- a/FoodsharingSiegen.Server/Migrations/FsContextModelSnapshot.cs +++ b/FoodsharingSiegen.Server/Migrations/FsContextModelSnapshot.cs @@ -114,6 +114,10 @@ namespace FoodsharingSiegen.Server.Migrations .HasColumnType("TEXT") .HasColumnName("EncryptedPassword"); + b.Property("ForceLogout") + .HasColumnType("INTEGER") + .HasColumnName("ForceLogout"); + b.Property("Groups") .IsRequired() .HasColumnType("TEXT") diff --git a/FoodsharingSiegen.Server/app.db-shm b/FoodsharingSiegen.Server/app.db-shm new file mode 100644 index 0000000000000000000000000000000000000000..b8fc390510f7231a5214f038db6c3cb81d6ea714 GIT binary patch literal 32768 zcmeI)u?fOJ6b9gnQDdQCna%-%U}x_ZV($*FAXo@?A~=*2hznQ>g5HTpT1(CM;OFjz zaL4-wxbi#>sk$*)2*X}n2QkOdZhGHVvsF1+o~p}cecd1Ci~Lr8`F}j>Rq5PEt=^wM zOS->^>Bpq|Q(sSP6#)VS2oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C7 z2oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK;UNt zve1cdD;6QW$*2f4OQ6-PaZO8r009C72oNAZfB*pkjS|QkHLYO@)CJo0#-0EH0t5&U aAV7cs0RjXF5FkK+009C72oNCf*8)#to+beR literal 0 HcmV?d00001 diff --git a/FoodsharingSiegen.Server/app.db-wal b/FoodsharingSiegen.Server/app.db-wal new file mode 100644 index 0000000000000000000000000000000000000000..2dc3a3fce82ec244aaf34d81acc425f97393f8fb GIT binary patch literal 32992 zcmeI*ziSg=9LMpyTHCakM(B`=LhVo->J#p{yX3h<3+D0z6m&6x;$%b8*1?7*3dTio ztHePR2PbiGaqRz~B2J>{tWHH;M4_VKb7<1EQ;IYt@P4>l;7Q=_dEGO8_~sjRW9XJ4 zK1>+KK_eKA32Wia%%?jiqKBI|KTht~Q$wBeb5EaN{Ji@0Sy)e+kq3r87ziMM00Iag zfB*srAb1%}xRdvQYJFAy9 ztY6_)UNG{du`yOC6-M=>8F_E$gMk172q1s}0tg_000IagfB*u0CU9(Daip6>K`-k- zu(Vb#@b1an;14nN_HVsF(}*J3v?4N=&uI- z1=_j5S~)t_xOe*-{RP-Y2q1s}0tg_000IagfB*sr?3F-Ae}S%k4ba(Nz<9C4{sLQa zf$^p5>$5MvpClL9t7p%35kLR|1Q0*~0R#|0009IL=*R_j+;{N*a)GtbtLl-*8zK4& zunQ4D009ILKmY**5I_I{1Q6)0K&|~R1XH_QC6K;cny=UA%hj4*;g)&