120 lines
3.5 KiB
C#
120 lines
3.5 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace Watcher.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class containerattribute : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropColumn(
|
|
name: "Hostname",
|
|
table: "Containers");
|
|
|
|
migrationBuilder.RenameColumn(
|
|
name: "Type",
|
|
table: "Containers",
|
|
newName: "Health");
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "Name",
|
|
table: "Containers",
|
|
type: "TEXT",
|
|
nullable: true,
|
|
oldClrType: typeof(string),
|
|
oldType: "TEXT");
|
|
|
|
migrationBuilder.AddColumn<int>(
|
|
name: "ExposedPort",
|
|
table: "Containers",
|
|
type: "INTEGER",
|
|
nullable: false,
|
|
defaultValue: 0);
|
|
|
|
migrationBuilder.AddColumn<int>(
|
|
name: "HostServerId",
|
|
table: "Containers",
|
|
type: "INTEGER",
|
|
nullable: true);
|
|
|
|
migrationBuilder.AddColumn<string>(
|
|
name: "Image",
|
|
table: "Containers",
|
|
type: "TEXT",
|
|
nullable: true);
|
|
|
|
migrationBuilder.AddColumn<int>(
|
|
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");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
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<string>(
|
|
name: "Name",
|
|
table: "Containers",
|
|
type: "TEXT",
|
|
nullable: false,
|
|
defaultValue: "",
|
|
oldClrType: typeof(string),
|
|
oldType: "TEXT",
|
|
oldNullable: true);
|
|
|
|
migrationBuilder.AddColumn<string>(
|
|
name: "Hostname",
|
|
table: "Containers",
|
|
type: "TEXT",
|
|
nullable: false,
|
|
defaultValue: "");
|
|
}
|
|
}
|
|
}
|