using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Watcher.Migrations { /// public partial class containerattribute : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropColumn( name: "Hostname", table: "Containers"); migrationBuilder.RenameColumn( name: "Type", table: "Containers", newName: "Health"); migrationBuilder.AlterColumn( name: "Name", table: "Containers", type: "TEXT", nullable: true, oldClrType: typeof(string), oldType: "TEXT"); migrationBuilder.AddColumn( name: "ExposedPort", table: "Containers", type: "INTEGER", nullable: false, defaultValue: 0); migrationBuilder.AddColumn( name: "HostServerId", table: "Containers", type: "INTEGER", nullable: true); migrationBuilder.AddColumn( name: "Image", table: "Containers", type: "TEXT", nullable: true); migrationBuilder.AddColumn( name: "InternalPort", table: "Containers", type: "INTEGER", nullable: false, defaultValue: 0); migrationBuilder.CreateIndex( name: "IX_Containers_HostServerId", table: "Containers", column: "HostServerId"); migrationBuilder.AddForeignKey( name: "FK_Containers_Servers_HostServerId", table: "Containers", column: "HostServerId", principalTable: "Servers", principalColumn: "Id"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_Containers_Servers_HostServerId", table: "Containers"); migrationBuilder.DropIndex( name: "IX_Containers_HostServerId", table: "Containers"); migrationBuilder.DropColumn( name: "ExposedPort", table: "Containers"); migrationBuilder.DropColumn( name: "HostServerId", table: "Containers"); migrationBuilder.DropColumn( name: "Image", table: "Containers"); migrationBuilder.DropColumn( name: "InternalPort", table: "Containers"); migrationBuilder.RenameColumn( name: "Health", table: "Containers", newName: "Type"); migrationBuilder.AlterColumn( name: "Name", table: "Containers", type: "TEXT", nullable: false, defaultValue: "", oldClrType: typeof(string), oldType: "TEXT", oldNullable: true); migrationBuilder.AddColumn( name: "Hostname", table: "Containers", type: "TEXT", nullable: false, defaultValue: ""); } } }