Bläddra i källkod

As Published

master
George Williams 4 år sedan
förälder
incheckning
c936fed254

+ 1535
- 0
UnivateProperties_API/Migrations/20200624064952_publish-2020-06-24.Designer.cs
Filskillnaden har hållits tillbaka eftersom den är för stor
Visa fil


+ 200
- 0
UnivateProperties_API/Migrations/20200624064952_publish-2020-06-24.cs Visa fil

@@ -0,0 +1,200 @@
1
+using System;
2
+using Microsoft.EntityFrameworkCore.Migrations;
3
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
4
+
5
+namespace UnivateProperties_API.Migrations
6
+{
7
+    public partial class publish20200624 : Migration
8
+    {
9
+        protected override void Up(MigrationBuilder migrationBuilder)
10
+        {
11
+            migrationBuilder.AddColumn<DateTime>(
12
+                name: "StatusDate",
13
+                table: "Properties",
14
+                nullable: false,
15
+                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
16
+
17
+            migrationBuilder.CreateTable(
18
+                name: "Campaigns",
19
+                columns: table => new
20
+                {
21
+                    Id = table.Column<int>(nullable: false)
22
+                        .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn),
23
+                    Created = table.Column<DateTime>(nullable: false),
24
+                    Modified = table.Column<DateTime>(nullable: false),
25
+                    ModifiedBy = table.Column<string>(nullable: true),
26
+                    IsDeleted = table.Column<bool>(nullable: false),
27
+                    StartDate = table.Column<DateTime>(nullable: false),
28
+                    EndDate = table.Column<DateTime>(nullable: false),
29
+                    Name = table.Column<string>(nullable: true),
30
+                    Subject = table.Column<string>(nullable: true),
31
+                    Body = table.Column<string>(nullable: true),
32
+                    ItemBody = table.Column<string>(nullable: true),
33
+                    ItemsPerRow = table.Column<int>(nullable: false)
34
+                },
35
+                constraints: table =>
36
+                {
37
+                    table.PrimaryKey("PK_Campaigns", x => x.Id);
38
+                });
39
+
40
+            migrationBuilder.CreateTable(
41
+                name: "Defaults",
42
+                columns: table => new
43
+                {
44
+                    Id = table.Column<string>(nullable: false),
45
+                    Value = table.Column<string>(nullable: true)
46
+                },
47
+                constraints: table =>
48
+                {
49
+                    table.PrimaryKey("PK_Defaults", x => x.Id);
50
+                });
51
+
52
+            migrationBuilder.CreateTable(
53
+                name: "PlaceHolderFormats",
54
+                columns: table => new
55
+                {
56
+                    Id = table.Column<int>(nullable: false)
57
+                        .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn),
58
+                    Created = table.Column<DateTime>(nullable: false),
59
+                    Modified = table.Column<DateTime>(nullable: false),
60
+                    ModifiedBy = table.Column<string>(nullable: true),
61
+                    IsDeleted = table.Column<bool>(nullable: false),
62
+                    DisplayName = table.Column<string>(nullable: true),
63
+                    Format = table.Column<string>(nullable: true)
64
+                },
65
+                constraints: table =>
66
+                {
67
+                    table.PrimaryKey("PK_PlaceHolderFormats", x => x.Id);
68
+                });
69
+
70
+            migrationBuilder.CreateTable(
71
+                name: "CampaignItems",
72
+                columns: table => new
73
+                {
74
+                    Id = table.Column<int>(nullable: false)
75
+                        .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn),
76
+                    Created = table.Column<DateTime>(nullable: false),
77
+                    Modified = table.Column<DateTime>(nullable: false),
78
+                    ModifiedBy = table.Column<string>(nullable: true),
79
+                    IsDeleted = table.Column<bool>(nullable: false),
80
+                    CampaignId = table.Column<int>(nullable: false),
81
+                    WeekId = table.Column<int>(nullable: false),
82
+                    Image = table.Column<string>(nullable: true)
83
+                },
84
+                constraints: table =>
85
+                {
86
+                    table.PrimaryKey("PK_CampaignItems", x => x.Id);
87
+                    table.ForeignKey(
88
+                        name: "FK_CampaignItems_Campaigns_CampaignId",
89
+                        column: x => x.CampaignId,
90
+                        principalTable: "Campaigns",
91
+                        principalColumn: "Id",
92
+                        onDelete: ReferentialAction.Cascade);
93
+                    table.ForeignKey(
94
+                        name: "FK_CampaignItems_Weeks_WeekId",
95
+                        column: x => x.WeekId,
96
+                        principalTable: "Weeks",
97
+                        principalColumn: "Id",
98
+                        onDelete: ReferentialAction.Cascade);
99
+                });
100
+
101
+            migrationBuilder.CreateTable(
102
+                name: "CampaignPlaceHolders",
103
+                columns: table => new
104
+                {
105
+                    Id = table.Column<int>(nullable: false)
106
+                        .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn),
107
+                    Created = table.Column<DateTime>(nullable: false),
108
+                    Modified = table.Column<DateTime>(nullable: false),
109
+                    ModifiedBy = table.Column<string>(nullable: true),
110
+                    IsDeleted = table.Column<bool>(nullable: false),
111
+                    Name = table.Column<string>(nullable: true),
112
+                    BoundToClass = table.Column<string>(nullable: true),
113
+                    BoundToClassDisplay = table.Column<string>(nullable: true),
114
+                    BoundTo = table.Column<string>(nullable: true),
115
+                    Format = table.Column<string>(nullable: true),
116
+                    CampaignId = table.Column<int>(nullable: false)
117
+                },
118
+                constraints: table =>
119
+                {
120
+                    table.PrimaryKey("PK_CampaignPlaceHolders", x => x.Id);
121
+                    table.ForeignKey(
122
+                        name: "FK_CampaignPlaceHolders_Campaigns_CampaignId",
123
+                        column: x => x.CampaignId,
124
+                        principalTable: "Campaigns",
125
+                        principalColumn: "Id",
126
+                        onDelete: ReferentialAction.Cascade);
127
+                });
128
+
129
+            migrationBuilder.CreateTable(
130
+                name: "CampaignItemPlaceHolders",
131
+                columns: table => new
132
+                {
133
+                    Id = table.Column<int>(nullable: false)
134
+                        .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn),
135
+                    Created = table.Column<DateTime>(nullable: false),
136
+                    Modified = table.Column<DateTime>(nullable: false),
137
+                    ModifiedBy = table.Column<string>(nullable: true),
138
+                    IsDeleted = table.Column<bool>(nullable: false),
139
+                    CampaignItemId = table.Column<int>(nullable: false),
140
+                    PlaceHolder = table.Column<string>(nullable: true),
141
+                    Value = table.Column<string>(nullable: true)
142
+                },
143
+                constraints: table =>
144
+                {
145
+                    table.PrimaryKey("PK_CampaignItemPlaceHolders", x => x.Id);
146
+                    table.ForeignKey(
147
+                        name: "FK_CampaignItemPlaceHolders_CampaignItems_CampaignItemId",
148
+                        column: x => x.CampaignItemId,
149
+                        principalTable: "CampaignItems",
150
+                        principalColumn: "Id",
151
+                        onDelete: ReferentialAction.Cascade);
152
+                });
153
+
154
+            migrationBuilder.CreateIndex(
155
+                name: "IX_CampaignItemPlaceHolders_CampaignItemId",
156
+                table: "CampaignItemPlaceHolders",
157
+                column: "CampaignItemId");
158
+
159
+            migrationBuilder.CreateIndex(
160
+                name: "IX_CampaignItems_CampaignId",
161
+                table: "CampaignItems",
162
+                column: "CampaignId");
163
+
164
+            migrationBuilder.CreateIndex(
165
+                name: "IX_CampaignItems_WeekId",
166
+                table: "CampaignItems",
167
+                column: "WeekId");
168
+
169
+            migrationBuilder.CreateIndex(
170
+                name: "IX_CampaignPlaceHolders_CampaignId",
171
+                table: "CampaignPlaceHolders",
172
+                column: "CampaignId");
173
+        }
174
+
175
+        protected override void Down(MigrationBuilder migrationBuilder)
176
+        {
177
+            migrationBuilder.DropTable(
178
+                name: "CampaignItemPlaceHolders");
179
+
180
+            migrationBuilder.DropTable(
181
+                name: "CampaignPlaceHolders");
182
+
183
+            migrationBuilder.DropTable(
184
+                name: "Defaults");
185
+
186
+            migrationBuilder.DropTable(
187
+                name: "PlaceHolderFormats");
188
+
189
+            migrationBuilder.DropTable(
190
+                name: "CampaignItems");
191
+
192
+            migrationBuilder.DropTable(
193
+                name: "Campaigns");
194
+
195
+            migrationBuilder.DropColumn(
196
+                name: "StatusDate",
197
+                table: "Properties");
198
+        }
199
+    }
200
+}

+ 184
- 1
UnivateProperties_API/Migrations/DataContextModelSnapshot.cs Visa fil

@@ -16,7 +16,7 @@ namespace UnivateProperties_API.Migrations
16 16
 #pragma warning disable 612, 618
17 17
             modelBuilder
18 18
                 .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn)
19
-                .HasAnnotation("ProductVersion", "2.2.6-servicing-10079")
19
+                .HasAnnotation("ProductVersion", "2.2.4-servicing-10062")
20 20
                 .HasAnnotation("Relational:MaxIdentifierLength", 63);
21 21
 
22 22
             modelBuilder.Entity("UnivateProperties_API.Model.Banks.Bank", b =>
@@ -71,6 +71,124 @@ namespace UnivateProperties_API.Migrations
71 71
                     b.ToTable("BankAccounts");
72 72
                 });
73 73
 
74
+            modelBuilder.Entity("UnivateProperties_API.Model.Campaigns.Campaign", b =>
75
+                {
76
+                    b.Property<int>("Id")
77
+                        .ValueGeneratedOnAdd();
78
+
79
+                    b.Property<string>("Body");
80
+
81
+                    b.Property<DateTime>("Created");
82
+
83
+                    b.Property<DateTime>("EndDate");
84
+
85
+                    b.Property<bool>("IsDeleted");
86
+
87
+                    b.Property<string>("ItemBody");
88
+
89
+                    b.Property<int>("ItemsPerRow");
90
+
91
+                    b.Property<DateTime>("Modified");
92
+
93
+                    b.Property<string>("ModifiedBy");
94
+
95
+                    b.Property<string>("Name");
96
+
97
+                    b.Property<DateTime>("StartDate");
98
+
99
+                    b.Property<string>("Subject");
100
+
101
+                    b.HasKey("Id");
102
+
103
+                    b.ToTable("Campaigns");
104
+                });
105
+
106
+            modelBuilder.Entity("UnivateProperties_API.Model.Campaigns.CampaignItem", b =>
107
+                {
108
+                    b.Property<int>("Id")
109
+                        .ValueGeneratedOnAdd();
110
+
111
+                    b.Property<int>("CampaignId");
112
+
113
+                    b.Property<DateTime>("Created");
114
+
115
+                    b.Property<string>("Image");
116
+
117
+                    b.Property<bool>("IsDeleted");
118
+
119
+                    b.Property<DateTime>("Modified");
120
+
121
+                    b.Property<string>("ModifiedBy");
122
+
123
+                    b.Property<int>("WeekId");
124
+
125
+                    b.HasKey("Id");
126
+
127
+                    b.HasIndex("CampaignId");
128
+
129
+                    b.HasIndex("WeekId");
130
+
131
+                    b.ToTable("CampaignItems");
132
+                });
133
+
134
+            modelBuilder.Entity("UnivateProperties_API.Model.Campaigns.CampaignItemPlaceHolder", b =>
135
+                {
136
+                    b.Property<int>("Id")
137
+                        .ValueGeneratedOnAdd();
138
+
139
+                    b.Property<int>("CampaignItemId");
140
+
141
+                    b.Property<DateTime>("Created");
142
+
143
+                    b.Property<bool>("IsDeleted");
144
+
145
+                    b.Property<DateTime>("Modified");
146
+
147
+                    b.Property<string>("ModifiedBy");
148
+
149
+                    b.Property<string>("PlaceHolder");
150
+
151
+                    b.Property<string>("Value");
152
+
153
+                    b.HasKey("Id");
154
+
155
+                    b.HasIndex("CampaignItemId");
156
+
157
+                    b.ToTable("CampaignItemPlaceHolders");
158
+                });
159
+
160
+            modelBuilder.Entity("UnivateProperties_API.Model.Campaigns.CampaignPlaceHolder", b =>
161
+                {
162
+                    b.Property<int>("Id")
163
+                        .ValueGeneratedOnAdd();
164
+
165
+                    b.Property<string>("BoundTo");
166
+
167
+                    b.Property<string>("BoundToClass");
168
+
169
+                    b.Property<string>("BoundToClassDisplay");
170
+
171
+                    b.Property<int>("CampaignId");
172
+
173
+                    b.Property<DateTime>("Created");
174
+
175
+                    b.Property<string>("Format");
176
+
177
+                    b.Property<bool>("IsDeleted");
178
+
179
+                    b.Property<DateTime>("Modified");
180
+
181
+                    b.Property<string>("ModifiedBy");
182
+
183
+                    b.Property<string>("Name");
184
+
185
+                    b.HasKey("Id");
186
+
187
+                    b.HasIndex("CampaignId");
188
+
189
+                    b.ToTable("CampaignPlaceHolders");
190
+                });
191
+
74 192
             modelBuilder.Entity("UnivateProperties_API.Model.Communication.Email", b =>
75 193
                 {
76 194
                     b.Property<int>("Id")
@@ -341,6 +459,18 @@ namespace UnivateProperties_API.Migrations
341 459
                     b.ToTable("Carousel");
342 460
                 });
343 461
 
462
+            modelBuilder.Entity("UnivateProperties_API.Model.Misc.Default", b =>
463
+                {
464
+                    b.Property<string>("Id")
465
+                        .ValueGeneratedOnAdd();
466
+
467
+                    b.Property<string>("Value");
468
+
469
+                    b.HasKey("Id");
470
+
471
+                    b.ToTable("Defaults");
472
+                });
473
+
344 474
             modelBuilder.Entity("UnivateProperties_API.Model.Misc.Location", b =>
345 475
                 {
346 476
                     b.Property<int>("Id")
@@ -363,6 +493,28 @@ namespace UnivateProperties_API.Migrations
363 493
                     b.ToTable("Location");
364 494
                 });
365 495
 
496
+            modelBuilder.Entity("UnivateProperties_API.Model.Misc.PlaceHolderFormat", b =>
497
+                {
498
+                    b.Property<int>("Id")
499
+                        .ValueGeneratedOnAdd();
500
+
501
+                    b.Property<DateTime>("Created");
502
+
503
+                    b.Property<string>("DisplayName");
504
+
505
+                    b.Property<string>("Format");
506
+
507
+                    b.Property<bool>("IsDeleted");
508
+
509
+                    b.Property<DateTime>("Modified");
510
+
511
+                    b.Property<string>("ModifiedBy");
512
+
513
+                    b.HasKey("Id");
514
+
515
+                    b.ToTable("PlaceHolderFormats");
516
+                });
517
+
366 518
             modelBuilder.Entity("UnivateProperties_API.Model.ProcessFlow.BidItem", b =>
367 519
                 {
368 520
                     b.Property<int>("Id")
@@ -484,6 +636,8 @@ namespace UnivateProperties_API.Migrations
484 636
 
485 637
                     b.Property<string>("ShortDescription");
486 638
 
639
+                    b.Property<DateTime>("StatusDate");
640
+
487 641
                     b.Property<int?>("StatusId");
488 642
 
489 643
                     b.Property<int>("SuburbId");
@@ -1097,6 +1251,35 @@ namespace UnivateProperties_API.Migrations
1097 1251
                         .HasForeignKey("OwnerId");
1098 1252
                 });
1099 1253
 
1254
+            modelBuilder.Entity("UnivateProperties_API.Model.Campaigns.CampaignItem", b =>
1255
+                {
1256
+                    b.HasOne("UnivateProperties_API.Model.Campaigns.Campaign", "Campaign")
1257
+                        .WithMany("Items")
1258
+                        .HasForeignKey("CampaignId")
1259
+                        .OnDelete(DeleteBehavior.Cascade);
1260
+
1261
+                    b.HasOne("UnivateProperties_API.Model.Timeshare.TimeshareWeek", "Week")
1262
+                        .WithMany()
1263
+                        .HasForeignKey("WeekId")
1264
+                        .OnDelete(DeleteBehavior.Cascade);
1265
+                });
1266
+
1267
+            modelBuilder.Entity("UnivateProperties_API.Model.Campaigns.CampaignItemPlaceHolder", b =>
1268
+                {
1269
+                    b.HasOne("UnivateProperties_API.Model.Campaigns.CampaignItem", "CampaignItem")
1270
+                        .WithMany("CampaignItemPlaceHolder")
1271
+                        .HasForeignKey("CampaignItemId")
1272
+                        .OnDelete(DeleteBehavior.Cascade);
1273
+                });
1274
+
1275
+            modelBuilder.Entity("UnivateProperties_API.Model.Campaigns.CampaignPlaceHolder", b =>
1276
+                {
1277
+                    b.HasOne("UnivateProperties_API.Model.Campaigns.Campaign", "Campaign")
1278
+                        .WithMany("PlaceHolders")
1279
+                        .HasForeignKey("CampaignId")
1280
+                        .OnDelete(DeleteBehavior.Cascade);
1281
+                });
1282
+
1100 1283
             modelBuilder.Entity("UnivateProperties_API.Model.Communication.Email", b =>
1101 1284
                 {
1102 1285
                     b.HasOne("UnivateProperties_API.Model.Communication.SMTPAccount", "Sender")

+ 1
- 1
UnivateProperties_API/appsettings.json Visa fil

@@ -9,7 +9,7 @@
9 9
   },
10 10
   "AllowedHosts": "*",
11 11
   "ConnectionStrings": {
12
-    "DefaultConnection": "Server=localhost;Port=5432;Database=Univate;User Id=postgres;Password=prov1s1on;",
12
+    "DefaultConnection": "Server=localhost;Port=5432;Database=UnivateDemo;User Id=postgres;Password=prov1s1on;",
13 13
     "TenderConnection": "http://www.unipoint-consoft.co.za/nph-srep.exe?cluvavail_test.sch&CLUB=LPA&RESORT=ALL&SUMMARY=N&HEAD=N"
14 14
   }
15 15
 }

Laddar…
Avbryt
Spara