| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163 |
- 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<int>(
- name: "TransactionId",
- table: "Payment",
- type: "INTEGER",
- nullable: false,
- defaultValue: 0,
- oldClrType: typeof(int),
- oldType: "INTEGER",
- oldNullable: true);
- migrationBuilder.AlterColumn<int>(
- name: "TransactionId",
- table: "FuelItems",
- type: "INTEGER",
- nullable: false,
- defaultValue: 0,
- oldClrType: typeof(int),
- oldType: "INTEGER",
- oldNullable: true);
- migrationBuilder.AlterColumn<double>(
- name: "TotalVolume",
- table: "FuelItems",
- type: "REAL",
- nullable: true,
- oldClrType: typeof(decimal),
- oldType: "TEXT",
- oldNullable: true);
- migrationBuilder.AlterColumn<double>(
- name: "Qualtity",
- table: "FuelItems",
- type: "REAL",
- nullable: false,
- oldClrType: typeof(decimal),
- oldType: "TEXT");
- migrationBuilder.AlterColumn<double>(
- name: "Price",
- table: "FuelItems",
- type: "REAL",
- nullable: false,
- oldClrType: typeof(decimal),
- oldType: "TEXT");
- migrationBuilder.AlterColumn<double>(
- 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<int>(
- name: "TransactionId",
- table: "Payment",
- type: "INTEGER",
- nullable: true,
- oldClrType: typeof(int),
- oldType: "INTEGER");
- migrationBuilder.AlterColumn<int>(
- name: "TransactionId",
- table: "FuelItems",
- type: "INTEGER",
- nullable: true,
- oldClrType: typeof(int),
- oldType: "INTEGER");
- migrationBuilder.AlterColumn<decimal>(
- name: "TotalVolume",
- table: "FuelItems",
- type: "TEXT",
- nullable: true,
- oldClrType: typeof(double),
- oldType: "REAL",
- oldNullable: true);
- migrationBuilder.AlterColumn<decimal>(
- name: "Qualtity",
- table: "FuelItems",
- type: "TEXT",
- nullable: false,
- oldClrType: typeof(double),
- oldType: "REAL");
- migrationBuilder.AlterColumn<decimal>(
- name: "Price",
- table: "FuelItems",
- type: "TEXT",
- nullable: false,
- oldClrType: typeof(double),
- oldType: "REAL");
- migrationBuilder.AlterColumn<decimal>(
- 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);
- }
- }
- }
|