using Microsoft.EntityFrameworkCore.Migrations; namespace Gateway.POS.Migrations { public partial class FuelItemUseDouble : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_FuelItems_Transactions_TransactionId", table: "FuelItems"); migrationBuilder.DropForeignKey( name: "FK_Payment_Transactions_TransactionId", table: "Payment"); migrationBuilder.AlterColumn( name: "TransactionId", table: "Payment", type: "INTEGER", nullable: false, defaultValue: 0, oldClrType: typeof(int), oldType: "INTEGER", oldNullable: true); migrationBuilder.AlterColumn( name: "TransactionId", table: "FuelItems", type: "INTEGER", nullable: false, defaultValue: 0, oldClrType: typeof(int), oldType: "INTEGER", oldNullable: true); migrationBuilder.AlterColumn( name: "TotalVolume", table: "FuelItems", type: "REAL", nullable: true, oldClrType: typeof(decimal), oldType: "TEXT", oldNullable: true); migrationBuilder.AlterColumn( name: "Qualtity", table: "FuelItems", type: "REAL", nullable: false, oldClrType: typeof(decimal), oldType: "TEXT"); migrationBuilder.AlterColumn( name: "Price", table: "FuelItems", type: "REAL", nullable: false, oldClrType: typeof(decimal), oldType: "TEXT"); migrationBuilder.AlterColumn( name: "Amount", table: "FuelItems", type: "REAL", nullable: false, oldClrType: typeof(decimal), oldType: "TEXT"); migrationBuilder.AddForeignKey( name: "FK_FuelItems_Transactions_TransactionId", table: "FuelItems", column: "TransactionId", principalTable: "Transactions", principalColumn: "Id", onDelete: ReferentialAction.Cascade); migrationBuilder.AddForeignKey( name: "FK_Payment_Transactions_TransactionId", table: "Payment", column: "TransactionId", principalTable: "Transactions", principalColumn: "Id", onDelete: ReferentialAction.Cascade); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_FuelItems_Transactions_TransactionId", table: "FuelItems"); migrationBuilder.DropForeignKey( name: "FK_Payment_Transactions_TransactionId", table: "Payment"); migrationBuilder.AlterColumn( name: "TransactionId", table: "Payment", type: "INTEGER", nullable: true, oldClrType: typeof(int), oldType: "INTEGER"); migrationBuilder.AlterColumn( name: "TransactionId", table: "FuelItems", type: "INTEGER", nullable: true, oldClrType: typeof(int), oldType: "INTEGER"); migrationBuilder.AlterColumn( name: "TotalVolume", table: "FuelItems", type: "TEXT", nullable: true, oldClrType: typeof(double), oldType: "REAL", oldNullable: true); migrationBuilder.AlterColumn( name: "Qualtity", table: "FuelItems", type: "TEXT", nullable: false, oldClrType: typeof(double), oldType: "REAL"); migrationBuilder.AlterColumn( name: "Price", table: "FuelItems", type: "TEXT", nullable: false, oldClrType: typeof(double), oldType: "REAL"); migrationBuilder.AlterColumn( name: "Amount", table: "FuelItems", type: "TEXT", nullable: false, oldClrType: typeof(double), oldType: "REAL"); migrationBuilder.AddForeignKey( name: "FK_FuelItems_Transactions_TransactionId", table: "FuelItems", column: "TransactionId", principalTable: "Transactions", principalColumn: "Id", onDelete: ReferentialAction.Restrict); migrationBuilder.AddForeignKey( name: "FK_Payment_Transactions_TransactionId", table: "Payment", column: "TransactionId", principalTable: "Transactions", principalColumn: "Id", onDelete: ReferentialAction.Restrict); } } }