1
0
mirror of https://github.com/CyberL1/MyMcRealms.git synced 2024-11-14 10:28:21 -05:00
MyMcRealms/Minecraft-Realms-Emulator/Migrations/20240213121346_Subscription_v2.cs

61 lines
1.8 KiB
C#
Raw Normal View History

2024-04-20 03:20:30 -04:00
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Minecraft_Realms_Emulator.Migrations
{
/// <inheritdoc />
public partial class Subscription_v2 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "RemoteId",
table: "Subscriptions");
migrationBuilder.RenameColumn(
name: "DaysLeft",
table: "Subscriptions",
newName: "WorldId");
migrationBuilder.CreateIndex(
name: "IX_Subscriptions_WorldId",
table: "Subscriptions",
column: "WorldId");
migrationBuilder.AddForeignKey(
name: "FK_Subscriptions_Worlds_WorldId",
table: "Subscriptions",
column: "WorldId",
principalTable: "Worlds",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Subscriptions_Worlds_WorldId",
table: "Subscriptions");
migrationBuilder.DropIndex(
name: "IX_Subscriptions_WorldId",
table: "Subscriptions");
migrationBuilder.RenameColumn(
name: "WorldId",
table: "Subscriptions",
newName: "DaysLeft");
migrationBuilder.AddColumn<string>(
name: "RemoteId",
table: "Subscriptions",
type: "text",
nullable: false,
defaultValue: "");
}
}
}