@@ -109,7 +109,30 @@ protected override void BuildModel(ModelBuilder modelBuilder)
109
109
b . ToTable ( "AccountToRoles" ) ;
110
110
} ) ;
111
111
112
- modelBuilder . Entity ( "Models.Db.IngredientTemplate" , b =>
112
+ modelBuilder . Entity ( "Models.Db.LatLng" , b =>
113
+ {
114
+ b . Property < long > ( "Id" )
115
+ . ValueGeneratedOnAdd ( )
116
+ . HasColumnType ( "bigint" )
117
+ . HasAnnotation ( "Npgsql:ValueGenerationStrategy" , NpgsqlValueGenerationStrategy . IdentityByDefaultColumn ) ;
118
+
119
+ b . Property < long > ( "AccountId" )
120
+ . HasColumnType ( "bigint" ) ;
121
+
122
+ b . Property < float > ( "Lat" )
123
+ . HasColumnType ( "real" ) ;
124
+
125
+ b . Property < float > ( "Lng" )
126
+ . HasColumnType ( "real" ) ;
127
+
128
+ b . HasKey ( "Id" ) ;
129
+
130
+ b . HasIndex ( "AccountId" ) ;
131
+
132
+ b . ToTable ( "LatLngs" ) ;
133
+ } ) ;
134
+
135
+ modelBuilder . Entity ( "Models.Db.MenuIngredient" , b =>
113
136
{
114
137
b . Property < long > ( "Id" )
115
138
. ValueGeneratedOnAdd ( )
@@ -132,22 +155,50 @@ protected override void BuildModel(ModelBuilder modelBuilder)
132
155
b . ToTable ( "IngredientTemplates" ) ;
133
156
} ) ;
134
157
135
- modelBuilder . Entity ( "Models.Db.LatLng " , b =>
158
+ modelBuilder . Entity ( "Models.Db.MenuProduct " , b =>
136
159
{
137
160
b . Property < long > ( "Id" )
138
161
. ValueGeneratedOnAdd ( )
139
162
. HasColumnType ( "bigint" )
140
163
. HasAnnotation ( "Npgsql:ValueGenerationStrategy" , NpgsqlValueGenerationStrategy . IdentityByDefaultColumn ) ;
141
164
142
- b . Property < float > ( "Lat " )
165
+ b . Property < float > ( "Price " )
143
166
. HasColumnType ( "real" ) ;
144
167
145
- b . Property < float > ( "Lng" )
168
+ b . Property < long > ( "ProductCategoryId" )
169
+ . HasColumnType ( "bigint" ) ;
170
+
171
+ b . Property < long > ( "ProductPackId" )
172
+ . HasColumnType ( "bigint" ) ;
173
+
174
+ b . Property < string > ( "Title" )
175
+ . HasColumnType ( "text" ) ;
176
+
177
+ b . HasKey ( "Id" ) ;
178
+
179
+ b . HasIndex ( "ProductCategoryId" ) ;
180
+
181
+ b . HasIndex ( "ProductPackId" ) ;
182
+
183
+ b . ToTable ( "ProductTemplates" ) ;
184
+ } ) ;
185
+
186
+ modelBuilder . Entity ( "Models.Db.MenuProductPack" , b =>
187
+ {
188
+ b . Property < long > ( "Id" )
189
+ . ValueGeneratedOnAdd ( )
190
+ . HasColumnType ( "bigint" )
191
+ . HasAnnotation ( "Npgsql:ValueGenerationStrategy" , NpgsqlValueGenerationStrategy . IdentityByDefaultColumn ) ;
192
+
193
+ b . Property < float > ( "Price" )
146
194
. HasColumnType ( "real" ) ;
147
195
196
+ b . Property < string > ( "Title" )
197
+ . HasColumnType ( "text" ) ;
198
+
148
199
b . HasKey ( "Id" ) ;
149
200
150
- b . ToTable ( "LatLngs " ) ;
201
+ b . ToTable ( "ProductPackTemplates " ) ;
151
202
} ) ;
152
203
153
204
modelBuilder . Entity ( "Models.Db.Order" , b =>
@@ -157,11 +208,16 @@ protected override void BuildModel(ModelBuilder modelBuilder)
157
208
. HasColumnType ( "bigint" )
158
209
. HasAnnotation ( "Npgsql:ValueGenerationStrategy" , NpgsqlValueGenerationStrategy . IdentityByDefaultColumn ) ;
159
210
211
+ b . Property < long > ( "AccountId" )
212
+ . HasColumnType ( "bigint" ) ;
213
+
160
214
b . Property < DateTime > ( "CreationDateTime" )
161
215
. HasColumnType ( "timestamp without time zone" ) ;
162
216
163
217
b . HasKey ( "Id" ) ;
164
218
219
+ b . HasIndex ( "AccountId" ) ;
220
+
165
221
b . ToTable ( "Orders" ) ;
166
222
} ) ;
167
223
@@ -257,52 +313,6 @@ protected override void BuildModel(ModelBuilder modelBuilder)
257
313
b . ToTable ( "ProductCategories" ) ;
258
314
} ) ;
259
315
260
- modelBuilder . Entity ( "Models.Db.ProductPackTemplate" , b =>
261
- {
262
- b . Property < long > ( "Id" )
263
- . ValueGeneratedOnAdd ( )
264
- . HasColumnType ( "bigint" )
265
- . HasAnnotation ( "Npgsql:ValueGenerationStrategy" , NpgsqlValueGenerationStrategy . IdentityByDefaultColumn ) ;
266
-
267
- b . Property < float > ( "Price" )
268
- . HasColumnType ( "real" ) ;
269
-
270
- b . Property < string > ( "Title" )
271
- . HasColumnType ( "text" ) ;
272
-
273
- b . HasKey ( "Id" ) ;
274
-
275
- b . ToTable ( "ProductPackTemplates" ) ;
276
- } ) ;
277
-
278
- modelBuilder . Entity ( "Models.Db.ProductTemplate" , b =>
279
- {
280
- b . Property < long > ( "Id" )
281
- . ValueGeneratedOnAdd ( )
282
- . HasColumnType ( "bigint" )
283
- . HasAnnotation ( "Npgsql:ValueGenerationStrategy" , NpgsqlValueGenerationStrategy . IdentityByDefaultColumn ) ;
284
-
285
- b . Property < float > ( "Price" )
286
- . HasColumnType ( "real" ) ;
287
-
288
- b . Property < long > ( "ProductCategoryId" )
289
- . HasColumnType ( "bigint" ) ;
290
-
291
- b . Property < long > ( "ProductPackId" )
292
- . HasColumnType ( "bigint" ) ;
293
-
294
- b . Property < string > ( "Title" )
295
- . HasColumnType ( "text" ) ;
296
-
297
- b . HasKey ( "Id" ) ;
298
-
299
- b . HasIndex ( "ProductCategoryId" ) ;
300
-
301
- b . HasIndex ( "ProductPackId" ) ;
302
-
303
- b . ToTable ( "ProductTemplates" ) ;
304
- } ) ;
305
-
306
316
modelBuilder . Entity ( "Models.Db.ScheduledWorkSession" , b =>
307
317
{
308
318
b . Property < long > ( "Id" )
@@ -452,67 +462,78 @@ protected override void BuildModel(ModelBuilder modelBuilder)
452
462
b . Navigation ( "Role" ) ;
453
463
} ) ;
454
464
455
- modelBuilder . Entity ( "Models.Db.IngredientTemplate " , b =>
465
+ modelBuilder . Entity ( "Models.Db.LatLng " , b =>
456
466
{
457
- b . HasOne ( "Models.Db.ProductTemplate " , "Product " )
458
- . WithMany ( "Ingredients " )
459
- . HasForeignKey ( "ProductId " )
467
+ b . HasOne ( "Models.Db.Account " , "Account " )
468
+ . WithMany ( "LatLngs " )
469
+ . HasForeignKey ( "AccountId " )
460
470
. OnDelete ( DeleteBehavior . Cascade )
461
471
. IsRequired ( ) ;
462
472
463
- b . Navigation ( "Product " ) ;
473
+ b . Navigation ( "Account " ) ;
464
474
} ) ;
465
475
466
- modelBuilder . Entity ( "Models.Db.OrderIngredient " , b =>
476
+ modelBuilder . Entity ( "Models.Db.MenuIngredient " , b =>
467
477
{
468
- b . HasOne ( "Models.Db.OrderProduct " , "Product " )
478
+ b . HasOne ( "Models.Db.MenuProduct " , "MenuProduct " )
469
479
. WithMany ( "Ingredients" )
470
480
. HasForeignKey ( "ProductId" )
471
481
. OnDelete ( DeleteBehavior . Cascade )
472
482
. IsRequired ( ) ;
473
483
474
- b . Navigation ( "Product " ) ;
484
+ b . Navigation ( "MenuProduct " ) ;
475
485
} ) ;
476
486
477
- modelBuilder . Entity ( "Models.Db.OrderProduct " , b =>
487
+ modelBuilder . Entity ( "Models.Db.MenuProduct " , b =>
478
488
{
479
489
b . HasOne ( "Models.Db.ProductCategory" , "ProductCategory" )
480
- . WithMany ( "OrderProducts " )
490
+ . WithMany ( "ProductTemplates " )
481
491
. HasForeignKey ( "ProductCategoryId" )
482
492
. OnDelete ( DeleteBehavior . Cascade )
483
493
. IsRequired ( ) ;
484
494
485
- b . HasOne ( "Models.Db.OrderProductPack " , "ProductPack " )
495
+ b . HasOne ( "Models.Db.MenuProductPack " , "MenuProductPack " )
486
496
. WithMany ( "Products" )
487
497
. HasForeignKey ( "ProductPackId" )
488
498
. OnDelete ( DeleteBehavior . Cascade )
489
499
. IsRequired ( ) ;
490
500
501
+ b . Navigation ( "MenuProductPack" ) ;
502
+
491
503
b . Navigation ( "ProductCategory" ) ;
504
+ } ) ;
492
505
493
- b . Navigation ( "ProductPack" ) ;
506
+ modelBuilder . Entity ( "Models.Db.Order" , b =>
507
+ {
508
+ b . HasOne ( "Models.Db.Account" , "Account" )
509
+ . WithMany ( )
510
+ . HasForeignKey ( "AccountId" )
511
+ . OnDelete ( DeleteBehavior . Cascade )
512
+ . IsRequired ( ) ;
513
+
514
+ b . Navigation ( "Account" ) ;
494
515
} ) ;
495
516
496
- modelBuilder . Entity ( "Models.Db.OrderProductPack " , b =>
517
+ modelBuilder . Entity ( "Models.Db.OrderIngredient " , b =>
497
518
{
498
- b . HasOne ( "Models.Db.Order " , "Order " )
499
- . WithMany ( "ProductPacks " )
500
- . HasForeignKey ( "OrderId " )
519
+ b . HasOne ( "Models.Db.OrderProduct " , "Product " )
520
+ . WithMany ( "Ingredients " )
521
+ . HasForeignKey ( "ProductId " )
501
522
. OnDelete ( DeleteBehavior . Cascade )
502
523
. IsRequired ( ) ;
503
524
504
- b . Navigation ( "Order " ) ;
525
+ b . Navigation ( "Product " ) ;
505
526
} ) ;
506
527
507
- modelBuilder . Entity ( "Models.Db.ProductTemplate " , b =>
528
+ modelBuilder . Entity ( "Models.Db.OrderProduct " , b =>
508
529
{
509
530
b . HasOne ( "Models.Db.ProductCategory" , "ProductCategory" )
510
- . WithMany ( "ProductTemplates " )
531
+ . WithMany ( "OrderProducts " )
511
532
. HasForeignKey ( "ProductCategoryId" )
512
533
. OnDelete ( DeleteBehavior . Cascade )
513
534
. IsRequired ( ) ;
514
535
515
- b . HasOne ( "Models.Db.ProductPackTemplate " , "ProductPack" )
536
+ b . HasOne ( "Models.Db.OrderProductPack " , "ProductPack" )
516
537
. WithMany ( "Products" )
517
538
. HasForeignKey ( "ProductPackId" )
518
539
. OnDelete ( DeleteBehavior . Cascade )
@@ -523,6 +544,17 @@ protected override void BuildModel(ModelBuilder modelBuilder)
523
544
b . Navigation ( "ProductPack" ) ;
524
545
} ) ;
525
546
547
+ modelBuilder . Entity ( "Models.Db.OrderProductPack" , b =>
548
+ {
549
+ b . HasOne ( "Models.Db.Order" , "Order" )
550
+ . WithMany ( "ProductPacks" )
551
+ . HasForeignKey ( "OrderId" )
552
+ . OnDelete ( DeleteBehavior . Cascade )
553
+ . IsRequired ( ) ;
554
+
555
+ b . Navigation ( "Order" ) ;
556
+ } ) ;
557
+
526
558
modelBuilder . Entity ( "Models.Db.ScheduledWorkSession" , b =>
527
559
{
528
560
b . HasOne ( "Models.Db.Account" , "Account" )
@@ -580,6 +612,8 @@ protected override void BuildModel(ModelBuilder modelBuilder)
580
612
581
613
modelBuilder . Entity ( "Models.Db.Account" , b =>
582
614
{
615
+ b . Navigation ( "LatLngs" ) ;
616
+
583
617
b . Navigation ( "Roles" ) ;
584
618
} ) ;
585
619
@@ -588,6 +622,16 @@ protected override void BuildModel(ModelBuilder modelBuilder)
588
622
b . Navigation ( "Users" ) ;
589
623
} ) ;
590
624
625
+ modelBuilder . Entity ( "Models.Db.MenuProduct" , b =>
626
+ {
627
+ b . Navigation ( "Ingredients" ) ;
628
+ } ) ;
629
+
630
+ modelBuilder . Entity ( "Models.Db.MenuProductPack" , b =>
631
+ {
632
+ b . Navigation ( "Products" ) ;
633
+ } ) ;
634
+
591
635
modelBuilder . Entity ( "Models.Db.Order" , b =>
592
636
{
593
637
b . Navigation ( "ProductPacks" ) ;
@@ -610,16 +654,6 @@ protected override void BuildModel(ModelBuilder modelBuilder)
610
654
b . Navigation ( "ProductTemplates" ) ;
611
655
} ) ;
612
656
613
- modelBuilder . Entity ( "Models.Db.ProductPackTemplate" , b =>
614
- {
615
- b . Navigation ( "Products" ) ;
616
- } ) ;
617
-
618
- modelBuilder . Entity ( "Models.Db.ProductTemplate" , b =>
619
- {
620
- b . Navigation ( "Ingredients" ) ;
621
- } ) ;
622
-
623
657
modelBuilder . Entity ( "Models.Db.ScheduledWorkSession" , b =>
624
658
{
625
659
b . Navigation ( "OpenedWorkSessions" ) ;
0 commit comments