-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
180 additions
and
41 deletions.
There are no files selected for viewing
75 changes: 75 additions & 0 deletions
75
...Service.MssqlRepository/Migrations/20240102204018_OptimizeValidationTimestamp.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
60 changes: 60 additions & 0 deletions
60
...nticationService.MssqlRepository/Migrations/20240102204018_OptimizeValidationTimestamp.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
using System; | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
|
||
#nullable disable | ||
|
||
namespace Nager.AuthenticationService.MssqlRepository.Migrations | ||
{ | ||
/// <inheritdoc /> | ||
public partial class OptimizeValidationTimestamp : Migration | ||
{ | ||
/// <inheritdoc /> | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropColumn( | ||
name: "LastValidationTimestamp", | ||
table: "Users"); | ||
|
||
migrationBuilder.AlterColumn<DateTime>( | ||
name: "LastSuccessfulValidationTimestamp", | ||
table: "Users", | ||
type: "datetime2", | ||
nullable: true, | ||
oldClrType: typeof(DateTime), | ||
oldType: "datetime2"); | ||
|
||
migrationBuilder.AddColumn<DateTime>( | ||
name: "LastFailedValidationTimestamp", | ||
table: "Users", | ||
type: "datetime2", | ||
nullable: true); | ||
|
||
migrationBuilder.Sql("UPDATE Users SET LastSuccessfulValidationTimestamp = NULL"); | ||
} | ||
|
||
/// <inheritdoc /> | ||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropColumn( | ||
name: "LastFailedValidationTimestamp", | ||
table: "Users"); | ||
|
||
migrationBuilder.AlterColumn<DateTime>( | ||
name: "LastSuccessfulValidationTimestamp", | ||
table: "Users", | ||
type: "datetime2", | ||
nullable: false, | ||
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), | ||
oldClrType: typeof(DateTime), | ||
oldType: "datetime2", | ||
oldNullable: true); | ||
|
||
migrationBuilder.AddColumn<DateTime>( | ||
name: "LastValidationTimestamp", | ||
table: "Users", | ||
type: "datetime2", | ||
nullable: false, | ||
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters