1
0
mirror of https://github.com/CyberL1/MyMcRealms.git synced 2024-09-19 16:02:51 -04:00
MyMcRealms/Minecraft-Realms-Emulator/Migrations/20240203132410_Subscriptions.cs
2024-04-20 09:20:30 +02:00

57 lines
2.0 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace Minecraft_Realms_Emulator.Migrations
{
/// <inheritdoc />
public partial class Subscriptions : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "RemoteSubscriptionId",
table: "Worlds",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.CreateTable(
name: "Subscriptions",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
RemoteId = table.Column<string>(type: "text", nullable: false),
StartDate = table.Column<string>(type: "text", nullable: false),
DaysLeft = table.Column<int>(type: "integer", nullable: false),
SubscriptionType = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Subscriptions", x => x.Id);
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Subscriptions");
migrationBuilder.AlterColumn<string>(
name: "RemoteSubscriptionId",
table: "Worlds",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
}
}
}