using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace FiscalOS.Infra.Migrations { /// public partial class AddBalancesWithConnectionToAccounts : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Balance", columns: table => new { Id = table.Column(type: "TEXT", nullable: false), AccountId = table.Column(type: "TEXT", nullable: false), Current = table.Column(type: "TEXT", nullable: false), Available = table.Column(type: "TEXT", nullable: false), CreatedAt = table.Column(type: "TEXT", nullable: false), UpdatedAt = table.Column(type: "TEXT", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Balance", x => x.Id); table.ForeignKey( name: "FK_Balance_Account_AccountId", column: x => x.AccountId, principalTable: "Account", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_Balance_AccountId", table: "Balance", column: "AccountId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Balance"); } } }