Skip to content

Commit

Permalink
Store round start date in the database (space-wizards#21153)
Browse files Browse the repository at this point in the history
  • Loading branch information
DrSmugleaf authored Oct 23, 2023
1 parent 190b1f6 commit 43d5c00
Show file tree
Hide file tree
Showing 8 changed files with 3,584 additions and 0 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#nullable disable

using System;
using Microsoft.EntityFrameworkCore.Migrations;

namespace Content.Server.Database.Migrations.Postgres
{
/// <inheritdoc />
public partial class RoundStartDate : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<DateTime>(
name: "start_date",
table: "round",
type: "timestamp with time zone",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));

migrationBuilder.CreateIndex(
name: "IX_round_start_date",
table: "round",
column: "start_date");
}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_round_start_date",
table: "round");

migrationBuilder.DropColumn(
name: "start_date",
table: "round");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -856,12 +856,20 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.HasColumnType("integer")
.HasColumnName("server_id");
b.Property<DateTime>("StartDate")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValue(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified))
.HasColumnName("start_date");
b.HasKey("Id")
.HasName("PK_round");
b.HasIndex("ServerId")
.HasDatabaseName("IX_round_server_id");
b.HasIndex("StartDate");
b.ToTable("round", (string)null);
});

Expand Down
Loading

0 comments on commit 43d5c00

Please sign in to comment.