-
Notifications
You must be signed in to change notification settings - Fork 519
Expand file tree
/
Copy path20230601184153_MakeSignedAtColumnNullable.cs
More file actions
34 lines (30 loc) · 1.19 KB
/
20230601184153_MakeSignedAtColumnNullable.cs
File metadata and controls
34 lines (30 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#nullable disable
namespace EvolutionaryArchitecture.Fitnet.Contracts.Data.Database.Migrations;
using System;
using System.Diagnostics.CodeAnalysis;
using Microsoft.EntityFrameworkCore.Migrations;
[ExcludeFromCodeCoverage]
public partial class MakeSignedAtColumnNullable : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder) => migrationBuilder.AlterColumn<DateTimeOffset>(
name: "SignedAt",
schema: "Contracts",
table: "Contracts",
type: "timestamp with time zone",
nullable: true,
oldClrType: typeof(DateTimeOffset),
oldType: "timestamp with time zone");
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder) => migrationBuilder.AlterColumn<DateTimeOffset>(
name: "SignedAt",
schema: "Contracts",
table: "Contracts",
type: "timestamp with time zone",
nullable: false,
defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
new TimeSpan(0, 0, 0, 0, 0)),
oldClrType: typeof(DateTimeOffset),
oldType: "timestamp with time zone",
oldNullable: true);
}