using System; using Microsoft.EntityFrameworkCore.Migrations; namespace FarmatikoData.Migrations { public partial class SecondMigration : Migration { protected override void Up(MigrationBuilder migrationBuilder) { } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_MedicineLists_Medicines_MedicineId", table: "MedicineLists"); migrationBuilder.DropIndex( name: "IX_MedicineLists_MedicineId", table: "MedicineLists"); migrationBuilder.DropColumn( name: "MedicineId", table: "MedicineLists"); migrationBuilder.AlterColumn( name: "DeletedOn", table: "PharmacyHeads", type: "timestamp without time zone", nullable: false, oldClrType: typeof(DateTime), oldNullable: true); migrationBuilder.AlterColumn( name: "DeletedOn", table: "Pharmacies", type: "timestamp without time zone", nullable: false, oldClrType: typeof(DateTime), oldNullable: true); migrationBuilder.AlterColumn( name: "TotalGlobal", table: "Pandemics", type: "integer", nullable: false, oldClrType: typeof(long)); migrationBuilder.AlterColumn( name: "DeletedOn", table: "Pandemics", type: "timestamp without time zone", nullable: false, oldClrType: typeof(DateTime), oldNullable: true); migrationBuilder.AlterColumn( name: "DeathsGlobal", table: "Pandemics", type: "integer", nullable: false, oldClrType: typeof(long)); migrationBuilder.AlterColumn( name: "ActiveGlobal", table: "Pandemics", type: "integer", nullable: false, oldClrType: typeof(long)); migrationBuilder.AlterColumn( name: "DeletedOn", table: "Medicines", type: "timestamp without time zone", nullable: false, oldClrType: typeof(DateTime), oldNullable: true); migrationBuilder.AddColumn( name: "MedicineListId", table: "Medicines", type: "integer", nullable: true); migrationBuilder.AlterColumn( name: "DeletedOn", table: "MedicineLists", type: "timestamp without time zone", nullable: false, oldClrType: typeof(DateTime), oldNullable: true); migrationBuilder.AddColumn( name: "MedicinesId", table: "MedicineLists", type: "integer", nullable: true); migrationBuilder.AlterColumn( name: "DeletedOn", table: "HealthFacilities", type: "timestamp without time zone", nullable: false, oldClrType: typeof(DateTime), oldNullable: true); migrationBuilder.AlterColumn( name: "DeletedOn", table: "HealthcareWorkers", type: "timestamp without time zone", nullable: false, oldClrType: typeof(DateTime), oldNullable: true); migrationBuilder.CreateIndex( name: "IX_Medicines_MedicineListId", table: "Medicines", column: "MedicineListId"); migrationBuilder.CreateIndex( name: "IX_MedicineLists_MedicinesId", table: "MedicineLists", column: "MedicinesId"); migrationBuilder.AddForeignKey( name: "FK_MedicineLists_Medicines_MedicinesId", table: "MedicineLists", column: "MedicinesId", principalTable: "Medicines", principalColumn: "Id", onDelete: ReferentialAction.Restrict); migrationBuilder.AddForeignKey( name: "FK_Medicines_MedicineLists_MedicineListId", table: "Medicines", column: "MedicineListId", principalTable: "MedicineLists", principalColumn: "Id", onDelete: ReferentialAction.Restrict); } } }