Skip to content

Commit

Permalink
database code changes for postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
violet committed Oct 14, 2024
1 parent 8ed862d commit 3aa082b
Show file tree
Hide file tree
Showing 13 changed files with 178 additions and 177 deletions.
1 change: 1 addition & 0 deletions server/5dDiplomacyWithMultiverseTimeTravel.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.7" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.7">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
44 changes: 22 additions & 22 deletions server/Migrations/20240722230109_Initial.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 23 additions & 23 deletions server/Migrations/20240722230109_Initial.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
name: "Connections",
columns: table => new
{
Id = table.Column<string>(type: "nvarchar(11)", maxLength: 11, nullable: false),
Id = table.Column<string>(type: "varchar(11)", maxLength: 11, nullable: false),
Type = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
Expand All @@ -28,10 +28,10 @@ protected override void Up(MigrationBuilder migrationBuilder)
name: "Games",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
Id = table.Column<int>(type: "serial", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Players = table.Column<string>(type: "nvarchar(max)", nullable: false),
PlayersSubmitted = table.Column<string>(type: "nvarchar(max)", nullable: false)
Players = table.Column<int[]>(type: "int[]", nullable: false),
PlayersSubmitted = table.Column<int[]>(type: "int[]", nullable: false)
},
constraints: table =>
{
Expand All @@ -42,10 +42,10 @@ protected override void Up(MigrationBuilder migrationBuilder)
name: "Regions",
columns: table => new
{
Id = table.Column<string>(type: "nvarchar(5)", maxLength: 5, nullable: false),
ParentId = table.Column<string>(type: "nvarchar(5)", nullable: true),
Id = table.Column<string>(type: "varchar(5)", maxLength: 5, nullable: false),
ParentId = table.Column<string>(type: "varchar(5)", nullable: true),
Type = table.Column<int>(type: "int", nullable: false),
Name = table.Column<string>(type: "nvarchar(max)", nullable: false)
Name = table.Column<string>(type: "varchar", nullable: false)
},
constraints: table =>
{
Expand All @@ -61,7 +61,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
name: "Worlds",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
Id = table.Column<int>(type: "serial", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
GameId = table.Column<int>(type: "int", nullable: false),
Iteration = table.Column<int>(type: "int", nullable: false),
Expand All @@ -82,8 +82,8 @@ protected override void Up(MigrationBuilder migrationBuilder)
name: "ConnectionMappings",
columns: table => new
{
ConnectionsId = table.Column<string>(type: "nvarchar(11)", nullable: false),
RegionsId = table.Column<string>(type: "nvarchar(5)", nullable: false)
ConnectionsId = table.Column<string>(type: "varchar(11)", nullable: false),
RegionsId = table.Column<string>(type: "varchar(5)", nullable: false)
},
constraints: table =>
{
Expand All @@ -106,13 +106,13 @@ protected override void Up(MigrationBuilder migrationBuilder)
name: "Boards",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
Id = table.Column<int>(type: "serial", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
WorldId = table.Column<int>(type: "int", nullable: false),
Timeline = table.Column<int>(type: "int", nullable: false),
Year = table.Column<int>(type: "int", nullable: false),
Phase = table.Column<int>(type: "int", nullable: false),
ChildTimelines = table.Column<string>(type: "nvarchar(max)", nullable: false)
ChildTimelines = table.Column<string>(type: "int[]", nullable: false)
},
constraints: table =>
{
Expand All @@ -129,12 +129,12 @@ protected override void Up(MigrationBuilder migrationBuilder)
name: "Centres",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
Id = table.Column<int>(type: "serial", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
BoardId = table.Column<int>(type: "int", nullable: false),
Owner = table.Column<int>(type: "int", nullable: true),
Location_Phase = table.Column<int>(type: "int", nullable: false),
Location_RegionId = table.Column<string>(type: "nvarchar(5)", maxLength: 5, nullable: false),
Location_RegionId = table.Column<string>(type: "varchar(5)", maxLength: 5, nullable: false),
Location_Timeline = table.Column<int>(type: "int", nullable: false),
Location_Year = table.Column<int>(type: "int", nullable: false)
},
Expand All @@ -153,14 +153,14 @@ protected override void Up(MigrationBuilder migrationBuilder)
name: "Units",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
Id = table.Column<int>(type: "serial", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
BoardId = table.Column<int>(type: "int", nullable: false),
Owner = table.Column<int>(type: "int", nullable: false),
Type = table.Column<int>(type: "int", nullable: false),
MustRetreat = table.Column<bool>(type: "bit", nullable: false),
MustRetreat = table.Column<bool>(type: "bool", nullable: false),
Location_Phase = table.Column<int>(type: "int", nullable: false),
Location_RegionId = table.Column<string>(type: "nvarchar(5)", maxLength: 5, nullable: false),
Location_RegionId = table.Column<string>(type: "varchar(5)", maxLength: 5, nullable: false),
Location_Timeline = table.Column<int>(type: "int", nullable: false),
Location_Year = table.Column<int>(type: "int", nullable: false)
},
Expand All @@ -179,22 +179,22 @@ protected override void Up(MigrationBuilder migrationBuilder)
name: "Orders",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
Id = table.Column<int>(type: "serial", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
WorldId = table.Column<int>(type: "int", nullable: false),
Status = table.Column<int>(type: "int", nullable: false),
UnitId = table.Column<int>(type: "int", nullable: true),
Discriminator = table.Column<string>(type: "nvarchar(8)", maxLength: 8, nullable: false),
Discriminator = table.Column<string>(type: "varchar(8)", maxLength: 8, nullable: false),
Location_Phase = table.Column<int>(type: "int", nullable: false),
Location_RegionId = table.Column<string>(type: "nvarchar(5)", maxLength: 5, nullable: false),
Location_RegionId = table.Column<string>(type: "varchar(5)", maxLength: 5, nullable: false),
Location_Timeline = table.Column<int>(type: "int", nullable: false),
Location_Year = table.Column<int>(type: "int", nullable: false),
Destination_Phase = table.Column<int>(type: "int", nullable: true),
Destination_RegionId = table.Column<string>(type: "nvarchar(5)", maxLength: 5, nullable: true),
Destination_RegionId = table.Column<string>(type: "varchar(5)", maxLength: 5, nullable: true),
Destination_Timeline = table.Column<int>(type: "int", nullable: true),
Destination_Year = table.Column<int>(type: "int", nullable: true),
Midpoint_Phase = table.Column<int>(type: "int", nullable: true),
Midpoint_RegionId = table.Column<string>(type: "nvarchar(5)", maxLength: 5, nullable: true),
Midpoint_RegionId = table.Column<string>(type: "varchar(5)", maxLength: 5, nullable: true),
Midpoint_Timeline = table.Column<int>(type: "int", nullable: true),
Midpoint_Year = table.Column<int>(type: "int", nullable: true)
},
Expand Down Expand Up @@ -1004,7 +1004,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
table: "Orders",
column: "UnitId",
unique: true,
filter: "[UnitId] IS NOT NULL");
filter: "\"UnitId\" IS NOT NULL");

migrationBuilder.CreateIndex(
name: "IX_Orders_WorldId",
Expand Down
Loading

0 comments on commit 3aa082b

Please sign in to comment.