30 lines
908 B
C#
30 lines
908 B
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace FinlyticEngine.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class AddUniqueIndexUserIdProposalId : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_engine_trades_UserId_ProposalId",
|
|
table: "engine_trades",
|
|
columns: new[] { "UserId", "ProposalId" },
|
|
unique: true,
|
|
filter: "\"ProposalId\" <> '00000000-0000-0000-0000-000000000000'");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_engine_trades_UserId_ProposalId",
|
|
table: "engine_trades");
|
|
}
|
|
}
|
|
}
|