51 lines
2.0 KiB
C#
51 lines
2.0 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
|
|
#nullable disable
|
|
|
|
namespace AAIntegration.SimmonsBank.API.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class EnvelopeFundingMethodEntity : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "EnvelopeFundingMethods",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<int>(type: "integer", nullable: false)
|
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
EnvelopeId = table.Column<int>(type: "integer", nullable: false),
|
|
Order = table.Column<int>(type: "integer", nullable: false),
|
|
Mode = table.Column<int>(type: "integer", nullable: false),
|
|
Value = table.Column<string>(type: "text", nullable: false),
|
|
PeriodsToLookback = table.Column<int>(type: "integer", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_EnvelopeFundingMethods", x => x.Id);
|
|
table.ForeignKey(
|
|
name: "FK_EnvelopeFundingMethods_Envelopes_EnvelopeId",
|
|
column: x => x.EnvelopeId,
|
|
principalTable: "Envelopes",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_EnvelopeFundingMethods_EnvelopeId",
|
|
table: "EnvelopeFundingMethods",
|
|
column: "EnvelopeId");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "EnvelopeFundingMethods");
|
|
}
|
|
}
|
|
}
|