From 5a1c79ad205ed63a7d71de79668a4035f63f8e50 Mon Sep 17 00:00:00 2001 From: Andre Beging Date: Fri, 1 Apr 2022 16:35:09 +0200 Subject: [PATCH] Database updates --- FSSiegen.Diagram1.view | 1117 +++++------------ FSSiegen.efml | 105 +- ....Generated.cs => Interaction.Generated.cs} | 12 +- .../Entity/Interaction.cs | 15 + .../Entity/InteractionProcess.Generated.cs | 61 - .../Entity/InteractionType.cs | 28 + .../Entity/Prospect.Generated.cs | 5 +- .../Entity/User.Generated.cs | 6 +- .../Entity/UserType.cs | 2 +- .../Data/FsContext.Generated.cs | 68 +- .../20220124091416_Init.Designer.cs | 234 ---- .../Migrations/20220124091416_Init.cs | 148 --- .../20220401142848_Init.Designer.cs | 144 +++ .../Migrations/20220401142848_Init.cs | 92 ++ .../Migrations/FsContextModelSnapshot.cs | 132 +- 15 files changed, 646 insertions(+), 1523 deletions(-) rename FoodsharingSiegen.Contracts/Entity/{InteractionDate.Generated.cs => Interaction.Generated.cs} (78%) create mode 100644 FoodsharingSiegen.Contracts/Entity/Interaction.cs delete mode 100644 FoodsharingSiegen.Contracts/Entity/InteractionProcess.Generated.cs create mode 100644 FoodsharingSiegen.Contracts/Entity/InteractionType.cs delete mode 100644 FoodsharingSiegen.Server/Migrations/20220124091416_Init.Designer.cs delete mode 100644 FoodsharingSiegen.Server/Migrations/20220124091416_Init.cs create mode 100644 FoodsharingSiegen.Server/Migrations/20220401142848_Init.Designer.cs create mode 100644 FoodsharingSiegen.Server/Migrations/20220401142848_Init.cs diff --git a/FSSiegen.Diagram1.view b/FSSiegen.Diagram1.view index 057755c..569717f 100644 --- a/FSSiegen.Diagram1.view +++ b/FSSiegen.Diagram1.view @@ -31,7 +31,7 @@ 0.5 px - 144 px + 162 px 18 px @@ -50,7 +50,7 @@ 18.5 px - 144 px + 162 px 18 px @@ -69,7 +69,7 @@ 36.5 px - 144 px + 162 px 18 px @@ -88,7 +88,7 @@ 54.5 px - 144 px + 162 px 18 px @@ -107,7 +107,7 @@ 72.5 px - 144 px + 162 px 18 px @@ -126,7 +126,7 @@ 90.5 px - 144 px + 162 px 18 px @@ -136,7 +136,7 @@ - 145 px + 163 px 109 px @@ -157,7 +157,7 @@ - 144 px + 162 px 18 px @@ -171,7 +171,7 @@ 108 px - 145 px + 163 px 37 px @@ -186,7 +186,7 @@ -8 px - 150 px + 168 px 194 px @@ -304,8 +304,8 @@ - -352 px - -200 px + -296 px + -168 px 150 px @@ -353,7 +353,7 @@ 18 px - 638ae9f6-597e-49df-a76e-8931498485a7 + be4ea414-f058-4b82-ab45-43750869702c EntityDeveloper.EntityFrameworkCore.EntityProperty @@ -372,7 +372,7 @@ 18 px - e78ce4d6-fce8-4584-aae0-876425f00323 + 001ad395-f071-4c2d-bb73-420dfbcb4632 EntityDeveloper.EntityFrameworkCore.EntityProperty @@ -391,7 +391,7 @@ 18 px - d41aee11-2f57-406c-bd76-19fdaba89705 + 25eda2da-aff0-45a6-bb11-f19420f21b62 EntityDeveloper.EntityFrameworkCore.EntityProperty @@ -409,332 +409,6 @@ 144 px 18 px - - f1534bb5-c6c4-4022-acb6-9050adeeabb0 - EntityDeveloper.EntityFrameworkCore.EntityProperty - - - - - 23 - 18 - - - - 0.5 px - 72.5 px - - - 144 px - 18 px - - - 8b29b005-41ee-44e8-934b-f2f24a3d371c - EntityDeveloper.EntityFrameworkCore.EntityProperty - - - - - 24 - 18 - - - - 0.5 px - 90.5 px - - - 144 px - 18 px - - - 3113a240-5b76-410b-808f-843ad3d49272 - EntityDeveloper.EntityFrameworkCore.EntityProperty - - - - - 25 - 18 - - - - 0.5 px - 108.5 px - - - 144 px - 18 px - - - d2592a60-356e-49c6-8116-b8bf86791598 - EntityDeveloper.EntityFrameworkCore.EntityProperty - - - - - 145 px - 127 px - - - 0 px - 127 px - - - - - 26 - 17 - - - - - 27 - 26 - - - - 144 px - 18 px - - - 99ed9595-a97a-4fca-9351-0dae95c50666 - EntityDeveloper.EntityFrameworkCore.EntityRelationProperty - - - - - 28 - 26 - - - - 0 px - 18 px - - - 144 px - 18 px - - - fe22740f-bf2c-4fef-8874-11403568789e - EntityDeveloper.EntityFrameworkCore.EntityRelationProperty - - - - - 29 - 26 - - - - 0 px - 36 px - - - 144 px - 18 px - - - 1ddbf2e4-9926-47c7-b8d3-9d5b9c40e577 - EntityDeveloper.EntityFrameworkCore.EntityRelationProperty - - - - - 30 - 26 - - - - 0 px - 54 px - - - 144 px - 18 px - - - 05022c2e-094c-4ee3-b447-9b71bd7af12e - EntityDeveloper.EntityFrameworkCore.EntityRelationProperty - - - - - 31 - 26 - - - - 0 px - 72 px - - - 144 px - 18 px - - - e36eccc6-5945-440f-aa8d-4258e8e0d3a1 - EntityDeveloper.EntityFrameworkCore.EntityRelationProperty - - - - - 32 - 26 - - - - 0 px - 90 px - - - 144 px - 18 px - - - 7358db21-b81d-4e50-bbf6-e2d943d2c374 - EntityDeveloper.EntityFrameworkCore.EntityRelationProperty - - - - - 33 - 26 - - - - 100 px - 18 px - - false - - 121d62f2-b919-40e3-9006-ef35b21fe051 - EntityDeveloper.EntityFrameworkCore.EntityRelationProperty - - - - - 0 px - 126 px - - - 145 px - 127 px - - - 0 px - 127 px - - false - - - - 152 px - 240 px - - - 150 px - 302 px - - - 100 px - 302 px - - - 800 px - 302 px - - - - d23a88ab-08ee-4f2e-af3c-45d8b4c6f5a2 - EntityDeveloper.EntityFrameworkCore.EntityClass - - 22 px - - - - 34 - 0 - - - - - 35 - 34 - - - - - 36 - 35 - - - - 0.5 px - 0.5 px - - - 144 px - 18 px - - - be4ea414-f058-4b82-ab45-43750869702c - EntityDeveloper.EntityFrameworkCore.EntityProperty - - - - - 37 - 35 - - - - 0.5 px - 18.5 px - - - 144 px - 18 px - - - 001ad395-f071-4c2d-bb73-420dfbcb4632 - EntityDeveloper.EntityFrameworkCore.EntityProperty - - - - - 38 - 35 - - - - 0.5 px - 36.5 px - - - 144 px - 18 px - - - 25eda2da-aff0-45a6-bb11-f19420f21b62 - EntityDeveloper.EntityFrameworkCore.EntityProperty - - - - - 39 - 35 - - - - 0.5 px - 54.5 px - - - 144 px - 18 px - db78282f-9001-4e54-a175-fe4391e714fc EntityDeveloper.EntityFrameworkCore.EntityProperty @@ -752,14 +426,14 @@ - 40 - 34 + 23 + 17 - 41 - 40 + 24 + 23 @@ -767,7 +441,7 @@ 18 px - f87c2a20-9f58-443c-91e6-4f1c96f42e67 + a6482ef1-2e42-43f6-a934-c3f507888b12 EntityDeveloper.EntityFrameworkCore.EntityRelationProperty @@ -789,7 +463,7 @@ -128 px - 232 px + 240 px 150 px @@ -812,20 +486,20 @@ - 42 + 25 0 - 43 - 42 + 26 + 25 - 44 - 43 + 27 + 26 @@ -833,7 +507,7 @@ 0.5 px - 144 px + 290 px 18 px @@ -843,8 +517,8 @@ - 45 - 43 + 28 + 26 @@ -852,7 +526,7 @@ 18.5 px - 144 px + 290 px 18 px @@ -862,8 +536,8 @@ - 46 - 43 + 29 + 26 @@ -871,7 +545,7 @@ 36.5 px - 144 px + 290 px 18 px @@ -879,126 +553,68 @@ EntityDeveloper.EntityFrameworkCore.EntityProperty + + + 30 + 26 + + + + 0.5 px + 54.5 px + + + 290 px + 18 px + + + caf3dc53-f6cb-4554-98ac-a700657258e9 + EntityDeveloper.EntityFrameworkCore.EntityProperty + + + + + 31 + 26 + + + + 0.5 px + 72.5 px + + + 290 px + 18 px + + + 55b4bace-d6bd-4e19-8a15-8c34157251b6 + EntityDeveloper.EntityFrameworkCore.EntityProperty + + - 145 px - 55 px + 291 px + 91 px 0 px - 55 px + 91 px - 47 - 42 + 32 + 25 - 48 - 47 + 33 + 32 - 144 px - 18 px - - false - - 842710d5-4c62-4b06-9aae-c325590f29c8 - EntityDeveloper.EntityFrameworkCore.EntityRelationProperty - - - - - 49 - 47 - - - - 100 px - 18 px - - false - - d1cd8317-a7c9-421e-b39a-7a6d9e5a34df - EntityDeveloper.EntityFrameworkCore.EntityRelationProperty - - - - - 50 - 47 - - - - 100 px - 18 px - - false - - 2857c635-1625-4a85-b62f-941d9375b553 - EntityDeveloper.EntityFrameworkCore.EntityRelationProperty - - - - - 51 - 47 - - - - 100 px - 18 px - - false - - 13d8e731-a95c-4e15-9c47-0d9dbe9a1ade - EntityDeveloper.EntityFrameworkCore.EntityRelationProperty - - - - - 52 - 47 - - - - 100 px - 18 px - - false - - ca51296d-51f1-47a0-ab51-8f03f8958c8c - EntityDeveloper.EntityFrameworkCore.EntityRelationProperty - - - - - 53 - 47 - - - - 100 px - 18 px - - false - - ae165858-4164-4fb4-b171-e9e67d00e548 - EntityDeveloper.EntityFrameworkCore.EntityRelationProperty - - - - - 54 - 47 - - - - 144 px + 290 px 18 px @@ -1006,37 +622,56 @@ EntityDeveloper.EntityFrameworkCore.EntityRelationProperty + + + 34 + 32 + + + + 0 px + 18 px + + + 290 px + 18 px + + + 603ec2d2-a38a-4f33-b253-cb150c2985e9 + EntityDeveloper.EntityFrameworkCore.EntityRelationProperty + + 0 px - 54 px + 90 px - 145 px - 37 px + 291 px + 55 px 0 px - 37 px + 55 px false - 504 px - 288 px + 224 px + 256 px - 150 px - 140 px + 296 px + 194 px 100 px - 140 px + 194 px 800 px - 140 px + 194 px @@ -1047,358 +682,11 @@ - 55 - 42 - 17 - 56 - 57 - 0 - - - - - 0 px - 35 px - - Top Bottom - Left - - 56 - FloatAnchor - - - - - 0 px - 82 px - - Top Bottom - Right - - 57 - FloatAnchor - - - - - - 428 px - 323 px - - - 428 px - 322 px - - - false - - 9ba69659-8a8e-4e85-a458-060d4fa3e87f - EntityDeveloper.EntityFrameworkCore.EntityAssociation - - - - - 58 - 42 - 17 - 59 - 60 - 0 - - - - - -0.0645206815618167 px - 43.945406523715 px - - None - Left - - 59 - FixedAnchor - - - - - 0 px - 88.6451591319026 px - - Top Bottom - Right - - 60 - FloatAnchor - - - - - - 428 px - 331.945406523715 px - - - 428 px - 328.645159131903 px - - - false - - e90ffc7d-b8b4-4d9b-86d7-818cde5478c9 - EntityDeveloper.EntityFrameworkCore.EntityAssociation - - - - - 61 - 42 - 17 - 62 - 63 - 0 - - - - - 0 px - 17.5 px - - Top Bottom - Left - - 62 - FloatAnchor - - - - - 0 px - 69 px - - Top Bottom - Right - - 63 - FloatAnchor - - - - - - 428 px - 305.5 px - - - 428 px - 309 px - - - false - - 4b27a5e2-0562-4e5d-b0af-a73d9fbae7fa - EntityDeveloper.EntityFrameworkCore.EntityAssociation - - - - - 64 - 42 - 17 - 65 - 66 - 0 - - - - - 0 px - 131.25 px - - Top Bottom - Left - - 65 - FloatAnchor - - - - - 0 px - 153.5 px - - Top Bottom - Right - - 66 - FloatAnchor - - - - - - 428 px - 419.25 px - - - 428 px - 393.5 px - - - false - - c0d57b35-7be8-4cff-851d-12b31e39e7e8 - EntityDeveloper.EntityFrameworkCore.EntityAssociation - - - - - 67 - 42 - 17 - 68 - 69 - 0 - - - - - 0 px - 122.5 px - - Top Bottom - Left - - 68 - FloatAnchor - - - - - 0 px - 147 px - - Top Bottom - Right - - 69 - FloatAnchor - - - - - - 428 px - 410.5 px - - - 428 px - 387 px - - - false - - 508e9d41-16f4-41c1-aaec-6648bfb5b97e - EntityDeveloper.EntityFrameworkCore.EntityAssociation - - - - - 70 - 42 - 17 - 71 - 72 - 0 - - - - - 0 px - 70 px - - Top Bottom - Left - - 71 - FloatAnchor - - - - - 0 px - 108 px - - Top Bottom - Right - - 72 - FloatAnchor - - - - - - 428 px - 358 px - - - 428 px - 348 px - - - false - - a5e79c5f-77f5-4c77-ae66-ac1ed701917b - EntityDeveloper.EntityFrameworkCore.EntityAssociation - - - - - 73 - 17 - 34 - 74 - 75 - 0 - - - - - 0 px - 75 px - - Top Bottom - Left - - 74 - FloatAnchor - - - - - 0 px - 83 px - - Top Bottom - Right - - 75 - FloatAnchor - - - - false - - 0b330def-bb89-4941-b362-6ecdd68d8f23 - EntityDeveloper.EntityFrameworkCore.EntityAssociation - - - - - 76 + 35 1 - 42 - 77 - 78 + 25 + 36 + 37 0 @@ -1410,26 +698,26 @@ Top Bottom Right - 77 + 36 FloatAnchor - 75 px + 148 px 0 px Left Right Top - 78 + 37 FloatAnchor - 579 px + 372 px 89 px @@ -1439,6 +727,179 @@ EntityDeveloper.EntityFrameworkCore.EntityAssociation + + + 38 + 0 + + + + + 39 + 38 + + + + + 40 + 39 + + + + 0.5 px + 0.5 px + + + 144 px + 18 px + + + f2ad51e2-93c8-4c70-8620-b3f9fc8fe484 + EntityDeveloper.EnumTypeMember + + + + + 41 + 39 + + + + 0.5 px + 18.5 px + + + 144 px + 18 px + + + 1e45cfc5-c222-4c21-b09d-fbfdd68f6006 + EntityDeveloper.EnumTypeMember + + + + + 42 + 39 + + + + 0.5 px + 36.5 px + + + 144 px + 18 px + + + b660c84b-a6ad-456d-b43f-eedca6891ff3 + EntityDeveloper.EnumTypeMember + + + + + 43 + 39 + + + + 0.5 px + 54.5 px + + + 144 px + 18 px + + + c259e9b3-519f-42ba-99f7-80ea5b268a6c + EntityDeveloper.EnumTypeMember + + + + + 145 px + 72 px + + + 0 px + 73 px + + + + + -128 px + -168 px + + + 150 px + 121 px + + + 100 px + 121 px + + + 800 px + 121 px + + + + 93f9359f-3deb-4dbe-9a8b-b8949f833919 + EntityDeveloper.EntityFrameworkCore.EntityEnumType + + 22 px + + + + 44 + 17 + 25 + 45 + 46 + 0 + + + + + 0 px + 79 px + + Top Bottom + Right + + 45 + FloatAnchor + + + + + 0 px + 79 px + + Top Bottom + Left + + 46 + FloatAnchor + + + + + + 42 px + 319 px + + + 42 px + 335 px + + + false + + 8653aabe-ac0e-4c77-a151-ab7d0c71060b + EntityDeveloper.EntityFrameworkCore.EntityAssociation + + 8 px diff --git a/FSSiegen.efml b/FSSiegen.efml index d81187d..b473f07 100644 --- a/FSSiegen.efml +++ b/FSSiegen.efml @@ -7,6 +7,12 @@ + + + + + + @@ -28,29 +34,6 @@ - - - - - - - - - - - - - - - - - - - - - - - @@ -65,7 +48,7 @@ - + @@ -75,71 +58,29 @@ + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + + + + + + + + + \ No newline at end of file diff --git a/FoodsharingSiegen.Contracts/Entity/InteractionDate.Generated.cs b/FoodsharingSiegen.Contracts/Entity/Interaction.Generated.cs similarity index 78% rename from FoodsharingSiegen.Contracts/Entity/InteractionDate.Generated.cs rename to FoodsharingSiegen.Contracts/Entity/Interaction.Generated.cs index b5bd0cf..6369c47 100644 --- a/FoodsharingSiegen.Contracts/Entity/InteractionDate.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: 24.01.2022 08:57:25 +// Code is generated on: 01.04.2022 16:25:00 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -18,9 +18,9 @@ using System.Linq.Expressions; namespace FoodsharingSiegen.Contracts.Entity { - public partial class InteractionDate { + public partial class Interaction { - public InteractionDate() + public Interaction() { OnCreated(); } @@ -31,8 +31,14 @@ namespace FoodsharingSiegen.Contracts.Entity public virtual Guid UserId { get; set; } + public virtual InteractionType Type { get; set; } + + public virtual Guid ProspectId { get; set; } + public virtual User User { get; set; } + public virtual Prospect Prospect { get; set; } + #region Extensibility Method Definitions partial void OnCreated(); diff --git a/FoodsharingSiegen.Contracts/Entity/Interaction.cs b/FoodsharingSiegen.Contracts/Entity/Interaction.cs new file mode 100644 index 0000000..7c21a2e --- /dev/null +++ b/FoodsharingSiegen.Contracts/Entity/Interaction.cs @@ -0,0 +1,15 @@ +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 +{ + + public partial class Interaction + { + } +} diff --git a/FoodsharingSiegen.Contracts/Entity/InteractionProcess.Generated.cs b/FoodsharingSiegen.Contracts/Entity/InteractionProcess.Generated.cs deleted file mode 100644 index 94f618d..0000000 --- a/FoodsharingSiegen.Contracts/Entity/InteractionProcess.Generated.cs +++ /dev/null @@ -1,61 +0,0 @@ -//------------------------------------------------------------------------------ -// This is auto-generated code. -//------------------------------------------------------------------------------ -// This code was generated by Entity Developer tool using EF Core template. -// Code is generated on: 24.01.2022 08:57:25 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -//------------------------------------------------------------------------------ - -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 -{ - public partial class InteractionProcess { - - public InteractionProcess() - { - OnCreated(); - } - - public virtual Guid Id { get; set; } - - public virtual Guid EinAb1Id { get; set; } - - public virtual Guid EinAb2Id { get; set; } - - public virtual Guid EinAb3Id { get; set; } - - public virtual Guid WelcomeId { get; set; } - - public virtual Guid VerifyId { get; set; } - - public virtual Guid PassId { get; set; } - - public virtual InteractionDate EinAb1 { get; set; } - - public virtual InteractionDate EinAb2 { get; set; } - - public virtual InteractionDate EinAb3 { get; set; } - - public virtual InteractionDate Welcome { get; set; } - - public virtual InteractionDate Verify { get; set; } - - public virtual InteractionDate Pass { get; set; } - - #region Extensibility Method Definitions - - partial void OnCreated(); - - #endregion - } - -} diff --git a/FoodsharingSiegen.Contracts/Entity/InteractionType.cs b/FoodsharingSiegen.Contracts/Entity/InteractionType.cs new file mode 100644 index 0000000..5c9ff27 --- /dev/null +++ b/FoodsharingSiegen.Contracts/Entity/InteractionType.cs @@ -0,0 +1,28 @@ +//------------------------------------------------------------------------------ +// This is auto-generated code. +//------------------------------------------------------------------------------ +// This code was generated by Entity Developer tool using EF Core template. +// Code is generated on: 01.04.2022 16:25:00 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +//------------------------------------------------------------------------------ + +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 +{ + public enum InteractionType : int + { + EinAb = 10, + Welcome = 20, + Verify = 30, + Pass = 40 + } +} diff --git a/FoodsharingSiegen.Contracts/Entity/Prospect.Generated.cs b/FoodsharingSiegen.Contracts/Entity/Prospect.Generated.cs index bba25ac..e4ab12f 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: 24.01.2022 08:57:25 +// Code is generated on: 01.04.2022 16:25:00 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -22,6 +22,7 @@ namespace FoodsharingSiegen.Contracts.Entity public Prospect() { + this.Interactions = new List(); OnCreated(); } @@ -33,7 +34,7 @@ namespace FoodsharingSiegen.Contracts.Entity public virtual Guid ProgressId { get; set; } - public virtual InteractionProcess Progress { get; set; } + public virtual IList Interactions { get; set; } #region Extensibility Method Definitions diff --git a/FoodsharingSiegen.Contracts/Entity/User.Generated.cs b/FoodsharingSiegen.Contracts/Entity/User.Generated.cs index 0db6660..8af9808 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: 24.01.2022 08:57:25 +// Code is generated on: 01.04.2022 16:25:00 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -22,7 +22,7 @@ namespace FoodsharingSiegen.Contracts.Entity public User() { - this.InteractionDates = new List(); + this.Interactions = new List(); OnCreated(); } @@ -38,7 +38,7 @@ namespace FoodsharingSiegen.Contracts.Entity public virtual DateTime Created { get; set; } - public virtual IList InteractionDates { get; set; } + public virtual IList Interactions { get; set; } #region Extensibility Method Definitions diff --git a/FoodsharingSiegen.Contracts/Entity/UserType.cs b/FoodsharingSiegen.Contracts/Entity/UserType.cs index 547f4fb..c382866 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: 24.01.2022 08:57:25 +// Code is generated on: 01.04.2022 16:25:00 // // 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 dc390ea..22b96b9 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: 24.01.2022 08:57:25 +// Code is generated on: 01.04.2022 16:25:00 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -60,19 +60,13 @@ namespace FoodsharingSiegen.Server.Data set; } - public virtual DbSet InteractionProcesses - { - get; - set; - } - public virtual DbSet Prospects { get; set; } - public virtual DbSet InteractionDates + public virtual DbSet Interactions { get; set; @@ -85,14 +79,11 @@ namespace FoodsharingSiegen.Server.Data this.UserMapping(modelBuilder); this.CustomizeUserMapping(modelBuilder); - this.InteractionProcessMapping(modelBuilder); - this.CustomizeInteractionProcessMapping(modelBuilder); - this.ProspectMapping(modelBuilder); this.CustomizeProspectMapping(modelBuilder); - this.InteractionDateMapping(modelBuilder); - this.CustomizeInteractionDateMapping(modelBuilder); + this.InteractionMapping(modelBuilder); + this.CustomizeInteractionMapping(modelBuilder); RelationshipsMapping(modelBuilder); CustomizeMapping(ref modelBuilder); @@ -116,25 +107,6 @@ namespace FoodsharingSiegen.Server.Data #endregion - #region InteractionProcess Mapping - - private void InteractionProcessMapping(ModelBuilder modelBuilder) - { - modelBuilder.Entity().ToTable(@"InteractionProcesses"); - modelBuilder.Entity().Property(x => x.Id).HasColumnName(@"Id").IsRequired().ValueGeneratedOnAdd(); - modelBuilder.Entity().Property(x => x.EinAb1Id).HasColumnName(@"EinAb1Id").IsRequired().ValueGeneratedNever(); - modelBuilder.Entity().Property(x => x.EinAb2Id).HasColumnName(@"EinAb2Id").IsRequired().ValueGeneratedNever(); - modelBuilder.Entity().Property(x => x.EinAb3Id).HasColumnName(@"EinAb3Id").IsRequired().ValueGeneratedNever(); - modelBuilder.Entity().Property(x => x.WelcomeId).HasColumnName(@"WelcomeId").IsRequired().ValueGeneratedNever(); - modelBuilder.Entity().Property(x => x.VerifyId).HasColumnName(@"VerifyId").IsRequired().ValueGeneratedNever(); - modelBuilder.Entity().Property(x => x.PassId).HasColumnName(@"PassId").IsRequired().ValueGeneratedNever(); - modelBuilder.Entity().HasKey(@"Id"); - } - - partial void CustomizeInteractionProcessMapping(ModelBuilder modelBuilder); - - #endregion - #region Prospect Mapping private void ProspectMapping(ModelBuilder modelBuilder) @@ -151,35 +123,31 @@ namespace FoodsharingSiegen.Server.Data #endregion - #region InteractionDate Mapping + #region Interaction Mapping - private void InteractionDateMapping(ModelBuilder modelBuilder) + private void InteractionMapping(ModelBuilder modelBuilder) { - modelBuilder.Entity().ToTable(@"InteractionDates"); - modelBuilder.Entity().Property(x => x.Id).HasColumnName(@"Id").IsRequired().ValueGeneratedOnAdd(); - modelBuilder.Entity().Property(x => x.Date).HasColumnName(@"Date").IsRequired().ValueGeneratedNever(); - modelBuilder.Entity().Property(x => x.UserId).HasColumnName(@"UserId").ValueGeneratedNever(); - modelBuilder.Entity().HasKey(@"Id"); + modelBuilder.Entity().ToTable(@"Interactions"); + modelBuilder.Entity().Property(x => x.Id).HasColumnName(@"Id").IsRequired().ValueGeneratedOnAdd(); + modelBuilder.Entity().Property(x => x.Date).HasColumnName(@"Date").IsRequired().ValueGeneratedNever(); + modelBuilder.Entity().Property(x => x.UserId).HasColumnName(@"UserId").ValueGeneratedNever(); + modelBuilder.Entity().Property(x => x.Type).HasColumnName(@"Type").IsRequired().ValueGeneratedNever(); + modelBuilder.Entity().Property(x => x.ProspectId).HasColumnName(@"ProspectId").ValueGeneratedNever(); + modelBuilder.Entity().HasKey(@"Id"); } - partial void CustomizeInteractionDateMapping(ModelBuilder modelBuilder); + partial void CustomizeInteractionMapping(ModelBuilder modelBuilder); #endregion private void RelationshipsMapping(ModelBuilder modelBuilder) { - modelBuilder.Entity().HasMany(x => x.InteractionDates).WithOne(op => op.User).HasForeignKey(@"UserId").IsRequired(true); + modelBuilder.Entity().HasMany(x => x.Interactions).WithOne(op => op.User).HasForeignKey(@"UserId").IsRequired(true); - modelBuilder.Entity().HasOne(x => x.EinAb1).WithOne().HasPrincipalKey(typeof(InteractionProcess), @"EinAb1Id").HasForeignKey(typeof(InteractionDate), @"Id").IsRequired(true); - modelBuilder.Entity().HasOne(x => x.EinAb2).WithOne().HasPrincipalKey(typeof(InteractionProcess), @"EinAb2Id").HasForeignKey(typeof(InteractionDate), @"Id").IsRequired(true); - modelBuilder.Entity().HasOne(x => x.EinAb3).WithOne().HasPrincipalKey(typeof(InteractionProcess), @"EinAb3Id").HasForeignKey(typeof(InteractionDate), @"Id").IsRequired(true); - modelBuilder.Entity().HasOne(x => x.Welcome).WithOne().HasPrincipalKey(typeof(InteractionProcess), @"WelcomeId").HasForeignKey(typeof(InteractionDate), @"Id").IsRequired(true); - modelBuilder.Entity().HasOne(x => x.Verify).WithOne().HasPrincipalKey(typeof(InteractionProcess), @"VerifyId").HasForeignKey(typeof(InteractionDate), @"Id").IsRequired(true); - modelBuilder.Entity().HasOne(x => x.Pass).WithOne().HasPrincipalKey(typeof(InteractionProcess), @"PassId").HasForeignKey(typeof(InteractionDate), @"Id").IsRequired(true); + modelBuilder.Entity().HasMany(x => x.Interactions).WithOne(op => op.Prospect).HasForeignKey(@"ProspectId").IsRequired(true); - modelBuilder.Entity().HasOne(x => x.Progress).WithOne().HasPrincipalKey(typeof(Prospect), @"ProgressId").HasForeignKey(typeof(InteractionProcess), @"Id").IsRequired(true); - - modelBuilder.Entity().HasOne(x => x.User).WithMany(op => op.InteractionDates).HasForeignKey(@"UserId").IsRequired(true); + modelBuilder.Entity().HasOne(x => x.User).WithMany(op => op.Interactions).HasForeignKey(@"UserId").IsRequired(true); + modelBuilder.Entity().HasOne(x => x.Prospect).WithMany(op => op.Interactions).HasForeignKey(@"ProspectId").IsRequired(true); } partial void CustomizeMapping(ref ModelBuilder modelBuilder); diff --git a/FoodsharingSiegen.Server/Migrations/20220124091416_Init.Designer.cs b/FoodsharingSiegen.Server/Migrations/20220124091416_Init.Designer.cs deleted file mode 100644 index 2b2ebb2..0000000 --- a/FoodsharingSiegen.Server/Migrations/20220124091416_Init.Designer.cs +++ /dev/null @@ -1,234 +0,0 @@ -// -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("20220124091416_Init")] - partial class Init - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "6.0.1"); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.InteractionDate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("Id"); - - b.Property("Date") - .HasColumnType("TEXT") - .HasColumnName("Date"); - - b.Property("UserId") - .HasColumnType("TEXT") - .HasColumnName("UserId"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("InteractionDates", (string)null); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.InteractionProcess", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("Id"); - - b.Property("EinAb1Id") - .HasColumnType("TEXT") - .HasColumnName("EinAb1Id"); - - b.Property("EinAb2Id") - .HasColumnType("TEXT") - .HasColumnName("EinAb2Id"); - - b.Property("EinAb3Id") - .HasColumnType("TEXT") - .HasColumnName("EinAb3Id"); - - b.Property("PassId") - .HasColumnType("TEXT") - .HasColumnName("PassId"); - - b.Property("VerifyId") - .HasColumnType("TEXT") - .HasColumnName("VerifyId"); - - b.Property("WelcomeId") - .HasColumnType("TEXT") - .HasColumnName("WelcomeId"); - - b.HasKey("Id"); - - b.ToTable("InteractionProcesses", (string)null); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Prospect", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("Id"); - - b.Property("FsId") - .HasColumnType("INTEGER") - .HasColumnName("FsId"); - - 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.InteractionDate", b => - { - b.HasOne("FoodsharingSiegen.Contracts.Entity.InteractionProcess", null) - .WithOne("EinAb1") - .HasForeignKey("FoodsharingSiegen.Contracts.Entity.InteractionDate", "Id") - .HasPrincipalKey("FoodsharingSiegen.Contracts.Entity.InteractionProcess", "EinAb1Id") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("FoodsharingSiegen.Contracts.Entity.InteractionProcess", null) - .WithOne("EinAb2") - .HasForeignKey("FoodsharingSiegen.Contracts.Entity.InteractionDate", "Id") - .HasPrincipalKey("FoodsharingSiegen.Contracts.Entity.InteractionProcess", "EinAb2Id") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_InteractionDates_InteractionProcesses_Id1"); - - b.HasOne("FoodsharingSiegen.Contracts.Entity.InteractionProcess", null) - .WithOne("EinAb3") - .HasForeignKey("FoodsharingSiegen.Contracts.Entity.InteractionDate", "Id") - .HasPrincipalKey("FoodsharingSiegen.Contracts.Entity.InteractionProcess", "EinAb3Id") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_InteractionDates_InteractionProcesses_Id2"); - - b.HasOne("FoodsharingSiegen.Contracts.Entity.InteractionProcess", null) - .WithOne("Pass") - .HasForeignKey("FoodsharingSiegen.Contracts.Entity.InteractionDate", "Id") - .HasPrincipalKey("FoodsharingSiegen.Contracts.Entity.InteractionProcess", "PassId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_InteractionDates_InteractionProcesses_Id3"); - - b.HasOne("FoodsharingSiegen.Contracts.Entity.InteractionProcess", null) - .WithOne("Verify") - .HasForeignKey("FoodsharingSiegen.Contracts.Entity.InteractionDate", "Id") - .HasPrincipalKey("FoodsharingSiegen.Contracts.Entity.InteractionProcess", "VerifyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_InteractionDates_InteractionProcesses_Id4"); - - b.HasOne("FoodsharingSiegen.Contracts.Entity.InteractionProcess", null) - .WithOne("Welcome") - .HasForeignKey("FoodsharingSiegen.Contracts.Entity.InteractionDate", "Id") - .HasPrincipalKey("FoodsharingSiegen.Contracts.Entity.InteractionProcess", "WelcomeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_InteractionDates_InteractionProcesses_Id5"); - - b.HasOne("FoodsharingSiegen.Contracts.Entity.User", "User") - .WithMany("InteractionDates") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.InteractionProcess", b => - { - b.HasOne("FoodsharingSiegen.Contracts.Entity.Prospect", null) - .WithOne("Progress") - .HasForeignKey("FoodsharingSiegen.Contracts.Entity.InteractionProcess", "Id") - .HasPrincipalKey("FoodsharingSiegen.Contracts.Entity.Prospect", "ProgressId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.InteractionProcess", b => - { - b.Navigation("EinAb1"); - - b.Navigation("EinAb2"); - - b.Navigation("EinAb3"); - - b.Navigation("Pass"); - - b.Navigation("Verify"); - - b.Navigation("Welcome"); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Prospect", b => - { - b.Navigation("Progress"); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.User", b => - { - b.Navigation("InteractionDates"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/FoodsharingSiegen.Server/Migrations/20220124091416_Init.cs b/FoodsharingSiegen.Server/Migrations/20220124091416_Init.cs deleted file mode 100644 index ecc5812..0000000 --- a/FoodsharingSiegen.Server/Migrations/20220124091416_Init.cs +++ /dev/null @@ -1,148 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace FoodsharingSiegen.Server.Migrations -{ - public partial class Init : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "Prospects", - columns: table => new - { - Id = table.Column(type: "TEXT", nullable: false), - FsId = table.Column(type: "INTEGER", nullable: false), - Name = table.Column(type: "TEXT", nullable: false), - ProgressId = table.Column(type: "TEXT", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Prospects", x => x.Id); - table.UniqueConstraint("AK_Prospects_ProgressId", x => x.ProgressId); - }); - - migrationBuilder.CreateTable( - name: "Users", - columns: table => new - { - Id = table.Column(type: "TEXT", nullable: false), - Mail = table.Column(type: "TEXT", nullable: false), - Type = table.Column(type: "INTEGER", nullable: false), - Verified = table.Column(type: "INTEGER", nullable: false), - Name = table.Column(type: "TEXT", nullable: false), - Created = table.Column(type: "TEXT", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Users", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "InteractionProcesses", - columns: table => new - { - Id = table.Column(type: "TEXT", nullable: false), - EinAb1Id = table.Column(type: "TEXT", nullable: false), - EinAb2Id = table.Column(type: "TEXT", nullable: false), - EinAb3Id = table.Column(type: "TEXT", nullable: false), - WelcomeId = table.Column(type: "TEXT", nullable: false), - VerifyId = table.Column(type: "TEXT", nullable: false), - PassId = table.Column(type: "TEXT", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_InteractionProcesses", x => x.Id); - table.UniqueConstraint("AK_InteractionProcesses_EinAb1Id", x => x.EinAb1Id); - table.UniqueConstraint("AK_InteractionProcesses_EinAb2Id", x => x.EinAb2Id); - table.UniqueConstraint("AK_InteractionProcesses_EinAb3Id", x => x.EinAb3Id); - table.UniqueConstraint("AK_InteractionProcesses_PassId", x => x.PassId); - table.UniqueConstraint("AK_InteractionProcesses_VerifyId", x => x.VerifyId); - table.UniqueConstraint("AK_InteractionProcesses_WelcomeId", x => x.WelcomeId); - table.ForeignKey( - name: "FK_InteractionProcesses_Prospects_Id", - column: x => x.Id, - principalTable: "Prospects", - principalColumn: "ProgressId", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "InteractionDates", - columns: table => new - { - Id = table.Column(type: "TEXT", nullable: false), - Date = table.Column(type: "TEXT", nullable: false), - UserId = table.Column(type: "TEXT", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_InteractionDates", x => x.Id); - table.ForeignKey( - name: "FK_InteractionDates_InteractionProcesses_Id", - column: x => x.Id, - principalTable: "InteractionProcesses", - principalColumn: "EinAb1Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_InteractionDates_InteractionProcesses_Id1", - column: x => x.Id, - principalTable: "InteractionProcesses", - principalColumn: "EinAb2Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_InteractionDates_InteractionProcesses_Id2", - column: x => x.Id, - principalTable: "InteractionProcesses", - principalColumn: "EinAb3Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_InteractionDates_InteractionProcesses_Id3", - column: x => x.Id, - principalTable: "InteractionProcesses", - principalColumn: "PassId", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_InteractionDates_InteractionProcesses_Id4", - column: x => x.Id, - principalTable: "InteractionProcesses", - principalColumn: "VerifyId", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_InteractionDates_InteractionProcesses_Id5", - column: x => x.Id, - principalTable: "InteractionProcesses", - principalColumn: "WelcomeId", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_InteractionDates_Users_UserId", - column: x => x.UserId, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_InteractionDates_UserId", - table: "InteractionDates", - column: "UserId"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "InteractionDates"); - - migrationBuilder.DropTable( - name: "InteractionProcesses"); - - migrationBuilder.DropTable( - name: "Users"); - - migrationBuilder.DropTable( - name: "Prospects"); - } - } -} diff --git a/FoodsharingSiegen.Server/Migrations/20220401142848_Init.Designer.cs b/FoodsharingSiegen.Server/Migrations/20220401142848_Init.Designer.cs new file mode 100644 index 0000000..ff924f8 --- /dev/null +++ b/FoodsharingSiegen.Server/Migrations/20220401142848_Init.Designer.cs @@ -0,0 +1,144 @@ +// +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("20220401142848_Init")] + partial class Init + { + 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("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("FsId") + .HasColumnType("INTEGER") + .HasColumnName("FsId"); + + 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/20220401142848_Init.cs b/FoodsharingSiegen.Server/Migrations/20220401142848_Init.cs new file mode 100644 index 0000000..a3fc540 --- /dev/null +++ b/FoodsharingSiegen.Server/Migrations/20220401142848_Init.cs @@ -0,0 +1,92 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace FoodsharingSiegen.Server.Migrations +{ + public partial class Init : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "Prospects", + columns: table => new + { + Id = table.Column(type: "TEXT", nullable: false), + FsId = table.Column(type: "INTEGER", nullable: false), + Name = table.Column(type: "TEXT", nullable: false), + ProgressId = table.Column(type: "TEXT", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Prospects", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Users", + columns: table => new + { + Id = table.Column(type: "TEXT", nullable: false), + Mail = table.Column(type: "TEXT", nullable: false), + Type = table.Column(type: "INTEGER", nullable: false), + Verified = table.Column(type: "INTEGER", nullable: false), + Name = table.Column(type: "TEXT", nullable: false), + Created = table.Column(type: "TEXT", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Users", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Interactions", + columns: table => new + { + Id = table.Column(type: "TEXT", nullable: false), + Date = table.Column(type: "TEXT", nullable: false), + UserId = table.Column(type: "TEXT", nullable: false), + Type = table.Column(type: "INTEGER", nullable: false), + ProspectId = table.Column(type: "TEXT", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Interactions", x => x.Id); + table.ForeignKey( + name: "FK_Interactions_Prospects_ProspectId", + column: x => x.ProspectId, + principalTable: "Prospects", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_Interactions_Users_UserId", + column: x => x.UserId, + principalTable: "Users", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateIndex( + name: "IX_Interactions_ProspectId", + table: "Interactions", + column: "ProspectId"); + + migrationBuilder.CreateIndex( + name: "IX_Interactions_UserId", + table: "Interactions", + column: "UserId"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "Interactions"); + + migrationBuilder.DropTable( + name: "Prospects"); + + migrationBuilder.DropTable( + name: "Users"); + } + } +} diff --git a/FoodsharingSiegen.Server/Migrations/FsContextModelSnapshot.cs b/FoodsharingSiegen.Server/Migrations/FsContextModelSnapshot.cs index 9ef995f..3ca0c4d 100644 --- a/FoodsharingSiegen.Server/Migrations/FsContextModelSnapshot.cs +++ b/FoodsharingSiegen.Server/Migrations/FsContextModelSnapshot.cs @@ -17,7 +17,7 @@ namespace FoodsharingSiegen.Server.Migrations #pragma warning disable 612, 618 modelBuilder.HasAnnotation("ProductVersion", "6.0.1"); - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.InteractionDate", b => + modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Interaction", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -28,51 +28,25 @@ namespace FoodsharingSiegen.Server.Migrations .HasColumnType("TEXT") .HasColumnName("Date"); + 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("InteractionDates", (string)null); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.InteractionProcess", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("Id"); - - b.Property("EinAb1Id") - .HasColumnType("TEXT") - .HasColumnName("EinAb1Id"); - - b.Property("EinAb2Id") - .HasColumnType("TEXT") - .HasColumnName("EinAb2Id"); - - b.Property("EinAb3Id") - .HasColumnType("TEXT") - .HasColumnName("EinAb3Id"); - - b.Property("PassId") - .HasColumnType("TEXT") - .HasColumnName("PassId"); - - b.Property("VerifyId") - .HasColumnType("TEXT") - .HasColumnName("VerifyId"); - - b.Property("WelcomeId") - .HasColumnType("TEXT") - .HasColumnName("WelcomeId"); - - b.HasKey("Id"); - - b.ToTable("InteractionProcesses", (string)null); + b.ToTable("Interactions", (string)null); }); modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Prospect", b => @@ -134,97 +108,33 @@ namespace FoodsharingSiegen.Server.Migrations b.ToTable("Users", (string)null); }); - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.InteractionDate", b => + modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Interaction", b => { - b.HasOne("FoodsharingSiegen.Contracts.Entity.InteractionProcess", null) - .WithOne("EinAb1") - .HasForeignKey("FoodsharingSiegen.Contracts.Entity.InteractionDate", "Id") - .HasPrincipalKey("FoodsharingSiegen.Contracts.Entity.InteractionProcess", "EinAb1Id") + b.HasOne("FoodsharingSiegen.Contracts.Entity.Prospect", "Prospect") + .WithMany("Interactions") + .HasForeignKey("ProspectId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("FoodsharingSiegen.Contracts.Entity.InteractionProcess", null) - .WithOne("EinAb2") - .HasForeignKey("FoodsharingSiegen.Contracts.Entity.InteractionDate", "Id") - .HasPrincipalKey("FoodsharingSiegen.Contracts.Entity.InteractionProcess", "EinAb2Id") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_InteractionDates_InteractionProcesses_Id1"); - - b.HasOne("FoodsharingSiegen.Contracts.Entity.InteractionProcess", null) - .WithOne("EinAb3") - .HasForeignKey("FoodsharingSiegen.Contracts.Entity.InteractionDate", "Id") - .HasPrincipalKey("FoodsharingSiegen.Contracts.Entity.InteractionProcess", "EinAb3Id") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_InteractionDates_InteractionProcesses_Id2"); - - b.HasOne("FoodsharingSiegen.Contracts.Entity.InteractionProcess", null) - .WithOne("Pass") - .HasForeignKey("FoodsharingSiegen.Contracts.Entity.InteractionDate", "Id") - .HasPrincipalKey("FoodsharingSiegen.Contracts.Entity.InteractionProcess", "PassId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_InteractionDates_InteractionProcesses_Id3"); - - b.HasOne("FoodsharingSiegen.Contracts.Entity.InteractionProcess", null) - .WithOne("Verify") - .HasForeignKey("FoodsharingSiegen.Contracts.Entity.InteractionDate", "Id") - .HasPrincipalKey("FoodsharingSiegen.Contracts.Entity.InteractionProcess", "VerifyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_InteractionDates_InteractionProcesses_Id4"); - - b.HasOne("FoodsharingSiegen.Contracts.Entity.InteractionProcess", null) - .WithOne("Welcome") - .HasForeignKey("FoodsharingSiegen.Contracts.Entity.InteractionDate", "Id") - .HasPrincipalKey("FoodsharingSiegen.Contracts.Entity.InteractionProcess", "WelcomeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_InteractionDates_InteractionProcesses_Id5"); - b.HasOne("FoodsharingSiegen.Contracts.Entity.User", "User") - .WithMany("InteractionDates") + .WithMany("Interactions") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); + b.Navigation("Prospect"); + b.Navigation("User"); }); - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.InteractionProcess", b => - { - b.HasOne("FoodsharingSiegen.Contracts.Entity.Prospect", null) - .WithOne("Progress") - .HasForeignKey("FoodsharingSiegen.Contracts.Entity.InteractionProcess", "Id") - .HasPrincipalKey("FoodsharingSiegen.Contracts.Entity.Prospect", "ProgressId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.InteractionProcess", b => - { - b.Navigation("EinAb1"); - - b.Navigation("EinAb2"); - - b.Navigation("EinAb3"); - - b.Navigation("Pass"); - - b.Navigation("Verify"); - - b.Navigation("Welcome"); - }); - modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Prospect", b => { - b.Navigation("Progress"); + b.Navigation("Interactions"); }); modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.User", b => { - b.Navigation("InteractionDates"); + b.Navigation("Interactions"); }); #pragma warning restore 612, 618 }