-
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.
fixed concurrency tokens in migrations for postgres, added indexes in…
… migrations, added checking for unque constraint, added test for race conditions, additional fixes
- Loading branch information
1 parent
49390f7
commit d0d22d8
Showing
20 changed files
with
448 additions
and
86 deletions.
There are no files selected for viewing
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
51 changes: 0 additions & 51 deletions
51
src/TeamUp.Infrastructure/Persistence/Migrations/20240325160419_FixConcurrency.cs
This file was deleted.
Oops, something went wrong.
31 changes: 20 additions & 11 deletions
31
...20240325160419_FixConcurrency.Designer.cs → ...0351_FixConcurrencyAndIndexes.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
74 changes: 74 additions & 0 deletions
74
src/TeamUp.Infrastructure/Persistence/Migrations/20240327170351_FixConcurrencyAndIndexes.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,74 @@ | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
|
||
#nullable disable | ||
|
||
namespace TeamUp.Infrastructure.Persistence.Migrations | ||
{ | ||
/// <inheritdoc /> | ||
public partial class FixConcurrencyAndIndexes : Migration | ||
{ | ||
/// <inheritdoc /> | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.AddColumn<uint>( | ||
name: "xmin", | ||
table: "Users", | ||
type: "xid", | ||
rowVersion: true, | ||
nullable: false, | ||
defaultValue: 0u); | ||
|
||
migrationBuilder.AddColumn<uint>( | ||
name: "xmin", | ||
table: "TeamMember", | ||
type: "xid", | ||
rowVersion: true, | ||
nullable: false, | ||
defaultValue: 0u); | ||
|
||
migrationBuilder.AddColumn<uint>( | ||
name: "xmin", | ||
table: "Events", | ||
type: "xid", | ||
rowVersion: true, | ||
nullable: false, | ||
defaultValue: 0u); | ||
|
||
migrationBuilder.CreateIndex( | ||
name: "IX_Invitations_TeamId_RecipientId", | ||
table: "Invitations", | ||
columns: new[] { "TeamId", "RecipientId" }, | ||
unique: true); | ||
|
||
migrationBuilder.CreateIndex( | ||
name: "IX_EventResponse_EventId_TeamMemberId", | ||
table: "EventResponse", | ||
columns: new[] { "EventId", "TeamMemberId" }, | ||
unique: true); | ||
} | ||
|
||
/// <inheritdoc /> | ||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropIndex( | ||
name: "IX_Invitations_TeamId_RecipientId", | ||
table: "Invitations"); | ||
|
||
migrationBuilder.DropIndex( | ||
name: "IX_EventResponse_EventId_TeamMemberId", | ||
table: "EventResponse"); | ||
|
||
migrationBuilder.DropColumn( | ||
name: "xmin", | ||
table: "Users"); | ||
|
||
migrationBuilder.DropColumn( | ||
name: "xmin", | ||
table: "TeamMember"); | ||
|
||
migrationBuilder.DropColumn( | ||
name: "xmin", | ||
table: "Events"); | ||
} | ||
} | ||
} |
Oops, something went wrong.