Skip to content

Commit 2bb9661

Browse files
committed
Init
0 parents  commit 2bb9661

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1860
-0
lines changed

.gitignore

+400
Large diffs are not rendered by default.

DodoHack.sln

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebAPI", "WebAPI\WebAPI.csproj", "{F1712FDE-810E-4D88-8B4A-1AF3F1A343AD}"
4+
EndProject
5+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Infrastructure", "Infrastructure\Infrastructure.csproj", "{7EB1E91B-BFDD-427A-A76C-B4DE1FD529CF}"
6+
EndProject
7+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Models", "Models\Models.csproj", "{9B53153A-FC32-4847-A080-0BB4F6FDFDE9}"
8+
EndProject
9+
Global
10+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
11+
Debug|Any CPU = Debug|Any CPU
12+
Release|Any CPU = Release|Any CPU
13+
EndGlobalSection
14+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
15+
{F1712FDE-810E-4D88-8B4A-1AF3F1A343AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
16+
{F1712FDE-810E-4D88-8B4A-1AF3F1A343AD}.Debug|Any CPU.Build.0 = Debug|Any CPU
17+
{F1712FDE-810E-4D88-8B4A-1AF3F1A343AD}.Release|Any CPU.ActiveCfg = Release|Any CPU
18+
{F1712FDE-810E-4D88-8B4A-1AF3F1A343AD}.Release|Any CPU.Build.0 = Release|Any CPU
19+
{7EB1E91B-BFDD-427A-A76C-B4DE1FD529CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
20+
{7EB1E91B-BFDD-427A-A76C-B4DE1FD529CF}.Debug|Any CPU.Build.0 = Debug|Any CPU
21+
{7EB1E91B-BFDD-427A-A76C-B4DE1FD529CF}.Release|Any CPU.ActiveCfg = Release|Any CPU
22+
{7EB1E91B-BFDD-427A-A76C-B4DE1FD529CF}.Release|Any CPU.Build.0 = Release|Any CPU
23+
{9B53153A-FC32-4847-A080-0BB4F6FDFDE9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
24+
{9B53153A-FC32-4847-A080-0BB4F6FDFDE9}.Debug|Any CPU.Build.0 = Debug|Any CPU
25+
{9B53153A-FC32-4847-A080-0BB4F6FDFDE9}.Release|Any CPU.ActiveCfg = Release|Any CPU
26+
{9B53153A-FC32-4847-A080-0BB4F6FDFDE9}.Release|Any CPU.Build.0 = Release|Any CPU
27+
EndGlobalSection
28+
EndGlobal

Infrastructure/Data/Migrations/20210404142113_initial.Designer.cs

+154
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
using Microsoft.EntityFrameworkCore.Migrations;
2+
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
3+
4+
namespace Infrastructure.Data.Migrations
5+
{
6+
public partial class initial : Migration
7+
{
8+
protected override void Up(MigrationBuilder migrationBuilder)
9+
{
10+
migrationBuilder.CreateTable(
11+
name: "Couriers",
12+
columns: table => new
13+
{
14+
Id = table.Column<long>(type: "bigint", nullable: false)
15+
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
16+
Login = table.Column<string>(type: "text", nullable: true),
17+
Password = table.Column<string>(type: "text", nullable: true)
18+
},
19+
constraints: table =>
20+
{
21+
table.PrimaryKey("PK_Couriers", x => x.Id);
22+
});
23+
24+
migrationBuilder.CreateTable(
25+
name: "LatLngs",
26+
columns: table => new
27+
{
28+
Id = table.Column<long>(type: "bigint", nullable: false)
29+
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
30+
Lat = table.Column<float>(type: "real", nullable: false),
31+
Lng = table.Column<float>(type: "real", nullable: false),
32+
CourierId = table.Column<long>(type: "bigint", nullable: true)
33+
},
34+
constraints: table =>
35+
{
36+
table.PrimaryKey("PK_LatLngs", x => x.Id);
37+
table.ForeignKey(
38+
name: "FK_LatLngs_Couriers_CourierId",
39+
column: x => x.CourierId,
40+
principalTable: "Couriers",
41+
principalColumn: "Id",
42+
onDelete: ReferentialAction.Restrict);
43+
});
44+
45+
migrationBuilder.CreateTable(
46+
name: "Orders",
47+
columns: table => new
48+
{
49+
Id = table.Column<long>(type: "bigint", nullable: false)
50+
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
51+
DestinationId = table.Column<long>(type: "bigint", nullable: false),
52+
CourierId = table.Column<long>(type: "bigint", nullable: true)
53+
},
54+
constraints: table =>
55+
{
56+
table.PrimaryKey("PK_Orders", x => x.Id);
57+
table.ForeignKey(
58+
name: "FK_Orders_Couriers_CourierId",
59+
column: x => x.CourierId,
60+
principalTable: "Couriers",
61+
principalColumn: "Id",
62+
onDelete: ReferentialAction.Restrict);
63+
table.ForeignKey(
64+
name: "FK_Orders_LatLngs_DestinationId",
65+
column: x => x.DestinationId,
66+
principalTable: "LatLngs",
67+
principalColumn: "Id",
68+
onDelete: ReferentialAction.Cascade);
69+
});
70+
71+
migrationBuilder.CreateTable(
72+
name: "OrderProducts",
73+
columns: table => new
74+
{
75+
Id = table.Column<long>(type: "bigint", nullable: false)
76+
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
77+
Title = table.Column<string>(type: "text", nullable: true),
78+
OrderId = table.Column<long>(type: "bigint", nullable: false)
79+
},
80+
constraints: table =>
81+
{
82+
table.PrimaryKey("PK_OrderProducts", x => x.Id);
83+
table.ForeignKey(
84+
name: "FK_OrderProducts_Orders_OrderId",
85+
column: x => x.OrderId,
86+
principalTable: "Orders",
87+
principalColumn: "Id",
88+
onDelete: ReferentialAction.Cascade);
89+
});
90+
91+
migrationBuilder.CreateIndex(
92+
name: "IX_LatLngs_CourierId",
93+
table: "LatLngs",
94+
column: "CourierId");
95+
96+
migrationBuilder.CreateIndex(
97+
name: "IX_OrderProducts_OrderId",
98+
table: "OrderProducts",
99+
column: "OrderId");
100+
101+
migrationBuilder.CreateIndex(
102+
name: "IX_Orders_CourierId",
103+
table: "Orders",
104+
column: "CourierId");
105+
106+
migrationBuilder.CreateIndex(
107+
name: "IX_Orders_DestinationId",
108+
table: "Orders",
109+
column: "DestinationId");
110+
}
111+
112+
protected override void Down(MigrationBuilder migrationBuilder)
113+
{
114+
migrationBuilder.DropTable(
115+
name: "OrderProducts");
116+
117+
migrationBuilder.DropTable(
118+
name: "Orders");
119+
120+
migrationBuilder.DropTable(
121+
name: "LatLngs");
122+
123+
migrationBuilder.DropTable(
124+
name: "Couriers");
125+
}
126+
}
127+
}

0 commit comments

Comments
 (0)