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

57 lines
2.0 KiB
C#
Raw Normal View History

2024-04-20 03:20:30 -04:00
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");
}
}
}