using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace line_gestao_api.Migrations { /// public partial class RemoveParcelamentoV2 : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "ParcelamentoMonthValues"); migrationBuilder.DropTable( name: "ParcelamentoLines"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "ParcelamentoLines", columns: table => new { Id = table.Column(type: "uuid", nullable: false), Ano = table.Column(type: "integer", nullable: false), Cliente = table.Column(type: "text", nullable: true), CreatedAt = table.Column(type: "timestamp with time zone", nullable: false), Desconto = table.Column(type: "numeric", nullable: true), Item = table.Column(type: "integer", nullable: false), Linha = table.Column(type: "text", nullable: true), QtParcelas = table.Column(type: "text", nullable: true), UpdatedAt = table.Column(type: "timestamp with time zone", nullable: false), ValorCheio = table.Column(type: "numeric", nullable: true), ValorComDesconto = table.Column(type: "numeric", nullable: true) }, constraints: table => { table.PrimaryKey("PK_ParcelamentoLines", x => x.Id); }); migrationBuilder.CreateTable( name: "ParcelamentoMonthValues", columns: table => new { Id = table.Column(type: "uuid", nullable: false), ParcelamentoLineId = table.Column(type: "uuid", nullable: false), Ano = table.Column(type: "integer", nullable: false), CreatedAt = table.Column(type: "timestamp with time zone", nullable: false), Mes = table.Column(type: "integer", nullable: false), Valor = table.Column(type: "numeric", nullable: false) }, constraints: table => { table.PrimaryKey("PK_ParcelamentoMonthValues", x => x.Id); table.ForeignKey( name: "FK_ParcelamentoMonthValues_ParcelamentoLines_ParcelamentoLineId", column: x => x.ParcelamentoLineId, principalTable: "ParcelamentoLines", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_ParcelamentoLines_Cliente", table: "ParcelamentoLines", column: "Cliente"); migrationBuilder.CreateIndex( name: "IX_ParcelamentoLines_Linha", table: "ParcelamentoLines", column: "Linha"); migrationBuilder.CreateIndex( name: "IX_ParcelamentoMonthValues_Ano_Mes", table: "ParcelamentoMonthValues", columns: new[] { "Ano", "Mes" }); migrationBuilder.CreateIndex( name: "IX_ParcelamentoMonthValues_ParcelamentoLineId", table: "ParcelamentoMonthValues", column: "ParcelamentoLineId"); } } }