mirror of
https://github.com/CyberL1/MyMcRealms.git
synced 2024-11-13 18:08:23 -05:00
57 lines
2.0 KiB
C#
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");
|
|
}
|
|
}
|
|
}
|