♻️ Re-create the migrations for the Pass
This commit is contained in:
@@ -132,4 +132,8 @@
|
|||||||
<AdditionalFiles Include="Resources\Emails\PasswordResetEmail.razor" />
|
<AdditionalFiles Include="Resources\Emails\PasswordResetEmail.razor" />
|
||||||
<AdditionalFiles Include="Resources\Emails\RegistrationConfirmEmail.razor" />
|
<AdditionalFiles Include="Resources\Emails\RegistrationConfirmEmail.razor" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Folder Include="Migrations\" />
|
||||||
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -1,40 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace DysonNetwork.Pass.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class ReinitalMigration : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "background_id",
|
|
||||||
table: "account_profiles");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "picture_id",
|
|
||||||
table: "account_profiles");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AddColumn<string>(
|
|
||||||
name: "background_id",
|
|
||||||
table: "account_profiles",
|
|
||||||
type: "character varying(32)",
|
|
||||||
maxLength: 32,
|
|
||||||
nullable: true);
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<string>(
|
|
||||||
name: "picture_id",
|
|
||||||
table: "account_profiles",
|
|
||||||
type: "character varying(32)",
|
|
||||||
maxLength: 32,
|
|
||||||
nullable: true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,94 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using NodaTime;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace DysonNetwork.Pass.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class RemoveNotification : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "notification_push_subscriptions");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "notifications");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "notification_push_subscriptions",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
account_id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
|
||||||
device_id = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: false),
|
|
||||||
device_token = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: false),
|
|
||||||
last_used_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
|
||||||
provider = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_notification_push_subscriptions", x => x.id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_notification_push_subscriptions_accounts_account_id",
|
|
||||||
column: x => x.account_id,
|
|
||||||
principalTable: "accounts",
|
|
||||||
principalColumn: "id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "notifications",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
account_id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
content = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: true),
|
|
||||||
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
|
||||||
meta = table.Column<Dictionary<string, object>>(type: "jsonb", nullable: true),
|
|
||||||
priority = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
subtitle = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true),
|
|
||||||
title = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: true),
|
|
||||||
topic = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
|
|
||||||
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
viewed_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_notifications", x => x.id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_notifications_accounts_account_id",
|
|
||||||
column: x => x.account_id,
|
|
||||||
principalTable: "accounts",
|
|
||||||
principalColumn: "id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_notification_push_subscriptions_account_id",
|
|
||||||
table: "notification_push_subscriptions",
|
|
||||||
column: "account_id");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_notification_push_subscriptions_device_token_device_id_acco",
|
|
||||||
table: "notification_push_subscriptions",
|
|
||||||
columns: new[] { "device_token", "device_id", "account_id" },
|
|
||||||
unique: true);
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_notifications_account_id",
|
|
||||||
table: "notifications",
|
|
||||||
column: "account_id");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using NodaTime;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace DysonNetwork.Pass.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class AddCheckInBackdated : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AddColumn<Instant>(
|
|
||||||
name: "backdated_from",
|
|
||||||
table: "account_check_in_results",
|
|
||||||
type: "timestamp with time zone",
|
|
||||||
nullable: true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "backdated_from",
|
|
||||||
table: "account_check_in_results");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,130 +0,0 @@
|
|||||||
using DysonNetwork.Shared.Models;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using NodaTime;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace DysonNetwork.Pass.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class RemoveDevelopers : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "fk_auth_sessions_custom_apps_app_id",
|
|
||||||
table: "auth_sessions");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "custom_app_secrets");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "custom_apps");
|
|
||||||
|
|
||||||
migrationBuilder.DropIndex(
|
|
||||||
name: "ix_auth_sessions_app_id",
|
|
||||||
table: "auth_sessions");
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "punishments",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
reason = table.Column<string>(type: "character varying(8192)", maxLength: 8192, nullable: false),
|
|
||||||
expired_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
|
||||||
type = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
blocked_permissions = table.Column<List<string>>(type: "jsonb", nullable: true),
|
|
||||||
account_id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_punishments", x => x.id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_punishments_accounts_account_id",
|
|
||||||
column: x => x.account_id,
|
|
||||||
principalTable: "accounts",
|
|
||||||
principalColumn: "id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_punishments_account_id",
|
|
||||||
table: "punishments",
|
|
||||||
column: "account_id");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "punishments");
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "custom_apps",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
background = table.Column<SnCloudFileReferenceObject>(type: "jsonb", nullable: true),
|
|
||||||
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
|
||||||
description = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: true),
|
|
||||||
name = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
|
|
||||||
picture = table.Column<SnCloudFileReferenceObject>(type: "jsonb", nullable: true),
|
|
||||||
slug = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
|
|
||||||
status = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
verification = table.Column<SnVerificationMark>(type: "jsonb", nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_custom_apps", x => x.id);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "custom_app_secrets",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
app_id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
|
||||||
description = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: true),
|
|
||||||
expired_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
|
||||||
is_oidc = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
secret = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
|
|
||||||
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_custom_app_secrets", x => x.id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_custom_app_secrets_custom_apps_app_id",
|
|
||||||
column: x => x.app_id,
|
|
||||||
principalTable: "custom_apps",
|
|
||||||
principalColumn: "id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_auth_sessions_app_id",
|
|
||||||
table: "auth_sessions",
|
|
||||||
column: "app_id");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_custom_app_secrets_app_id",
|
|
||||||
table: "custom_app_secrets",
|
|
||||||
column: "app_id");
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "fk_auth_sessions_custom_apps_app_id",
|
|
||||||
table: "auth_sessions",
|
|
||||||
column: "app_id",
|
|
||||||
principalTable: "custom_apps",
|
|
||||||
principalColumn: "id");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace DysonNetwork.Pass.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class AddProfileLinks : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AddColumn<Dictionary<string, string>>(
|
|
||||||
name: "links",
|
|
||||||
table: "account_profiles",
|
|
||||||
type: "jsonb",
|
|
||||||
nullable: true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "links",
|
|
||||||
table: "account_profiles");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace DysonNetwork.Pass.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class AddPublicContact : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AddColumn<bool>(
|
|
||||||
name: "is_public",
|
|
||||||
table: "account_contacts",
|
|
||||||
type: "boolean",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "is_public",
|
|
||||||
table: "account_contacts");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,109 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using NodaTime;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace DysonNetwork.Pass.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class AddAuthorizeDevice : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AlterColumn<string>(
|
|
||||||
name: "device_id",
|
|
||||||
table: "auth_challenges",
|
|
||||||
type: "character varying(1024)",
|
|
||||||
maxLength: 1024,
|
|
||||||
nullable: true,
|
|
||||||
oldClrType: typeof(string),
|
|
||||||
oldType: "character varying(256)",
|
|
||||||
oldMaxLength: 256,
|
|
||||||
oldNullable: true);
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<Guid>(
|
|
||||||
name: "client_id",
|
|
||||||
table: "auth_challenges",
|
|
||||||
type: "uuid",
|
|
||||||
nullable: true);
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "auth_clients",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
device_name = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
|
|
||||||
device_label = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: true),
|
|
||||||
device_id = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
|
|
||||||
account_id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_auth_clients", x => x.id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_auth_clients_accounts_account_id",
|
|
||||||
column: x => x.account_id,
|
|
||||||
principalTable: "accounts",
|
|
||||||
principalColumn: "id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_auth_challenges_client_id",
|
|
||||||
table: "auth_challenges",
|
|
||||||
column: "client_id");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_auth_clients_account_id",
|
|
||||||
table: "auth_clients",
|
|
||||||
column: "account_id");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_auth_clients_device_id",
|
|
||||||
table: "auth_clients",
|
|
||||||
column: "device_id",
|
|
||||||
unique: true);
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "fk_auth_challenges_auth_clients_client_id",
|
|
||||||
table: "auth_challenges",
|
|
||||||
column: "client_id",
|
|
||||||
principalTable: "auth_clients",
|
|
||||||
principalColumn: "id");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "fk_auth_challenges_auth_clients_client_id",
|
|
||||||
table: "auth_challenges");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "auth_clients");
|
|
||||||
|
|
||||||
migrationBuilder.DropIndex(
|
|
||||||
name: "ix_auth_challenges_client_id",
|
|
||||||
table: "auth_challenges");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "client_id",
|
|
||||||
table: "auth_challenges");
|
|
||||||
|
|
||||||
migrationBuilder.AlterColumn<string>(
|
|
||||||
name: "device_id",
|
|
||||||
table: "auth_challenges",
|
|
||||||
type: "character varying(256)",
|
|
||||||
maxLength: 256,
|
|
||||||
nullable: true,
|
|
||||||
oldClrType: typeof(string),
|
|
||||||
oldType: "character varying(1024)",
|
|
||||||
oldMaxLength: 1024,
|
|
||||||
oldNullable: true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace DysonNetwork.Pass.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class AddAuthDevicePlatform : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "platform",
|
|
||||||
table: "auth_challenges");
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<int>(
|
|
||||||
name: "platform",
|
|
||||||
table: "auth_clients",
|
|
||||||
type: "integer",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "platform",
|
|
||||||
table: "auth_clients");
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<int>(
|
|
||||||
name: "platform",
|
|
||||||
table: "auth_challenges",
|
|
||||||
type: "integer",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace DysonNetwork.Pass.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class RemoveAuthClientIndex : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropIndex(
|
|
||||||
name: "ix_auth_clients_device_id",
|
|
||||||
table: "auth_clients");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_auth_clients_device_id",
|
|
||||||
table: "auth_clients",
|
|
||||||
column: "device_id",
|
|
||||||
unique: true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace DysonNetwork.Pass.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class RemoveChallengeOldDeviceId : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "device_id",
|
|
||||||
table: "auth_challenges");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AddColumn<string>(
|
|
||||||
name: "device_id",
|
|
||||||
table: "auth_challenges",
|
|
||||||
type: "character varying(1024)",
|
|
||||||
maxLength: 1024,
|
|
||||||
nullable: true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace DysonNetwork.Pass.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class AddBotAccount : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AddColumn<Guid>(
|
|
||||||
name: "automated_id",
|
|
||||||
table: "accounts",
|
|
||||||
type: "uuid",
|
|
||||||
nullable: true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "automated_id",
|
|
||||||
table: "accounts");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,113 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using NodaTime;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace DysonNetwork.Pass.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class AddApiKeys : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "fk_auth_sessions_auth_challenges_challenge_id",
|
|
||||||
table: "auth_sessions");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "label",
|
|
||||||
table: "auth_sessions");
|
|
||||||
|
|
||||||
migrationBuilder.AlterColumn<Guid>(
|
|
||||||
name: "challenge_id",
|
|
||||||
table: "auth_sessions",
|
|
||||||
type: "uuid",
|
|
||||||
nullable: true,
|
|
||||||
oldClrType: typeof(Guid),
|
|
||||||
oldType: "uuid");
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "api_keys",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
label = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
|
|
||||||
account_id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
session_id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_api_keys", x => x.id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_api_keys_accounts_account_id",
|
|
||||||
column: x => x.account_id,
|
|
||||||
principalTable: "accounts",
|
|
||||||
principalColumn: "id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_api_keys_auth_sessions_session_id",
|
|
||||||
column: x => x.session_id,
|
|
||||||
principalTable: "auth_sessions",
|
|
||||||
principalColumn: "id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_api_keys_account_id",
|
|
||||||
table: "api_keys",
|
|
||||||
column: "account_id");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_api_keys_session_id",
|
|
||||||
table: "api_keys",
|
|
||||||
column: "session_id");
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "fk_auth_sessions_auth_challenges_challenge_id",
|
|
||||||
table: "auth_sessions",
|
|
||||||
column: "challenge_id",
|
|
||||||
principalTable: "auth_challenges",
|
|
||||||
principalColumn: "id");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "fk_auth_sessions_auth_challenges_challenge_id",
|
|
||||||
table: "auth_sessions");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "api_keys");
|
|
||||||
|
|
||||||
migrationBuilder.AlterColumn<Guid>(
|
|
||||||
name: "challenge_id",
|
|
||||||
table: "auth_sessions",
|
|
||||||
type: "uuid",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
|
|
||||||
oldClrType: typeof(Guid),
|
|
||||||
oldType: "uuid",
|
|
||||||
oldNullable: true);
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<string>(
|
|
||||||
name: "label",
|
|
||||||
table: "auth_sessions",
|
|
||||||
type: "character varying(1024)",
|
|
||||||
maxLength: 1024,
|
|
||||||
nullable: true);
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "fk_auth_sessions_auth_challenges_challenge_id",
|
|
||||||
table: "auth_sessions",
|
|
||||||
column: "challenge_id",
|
|
||||||
principalTable: "auth_challenges",
|
|
||||||
principalColumn: "id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,84 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using NodaTime;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace DysonNetwork.Pass.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class AddCreditAndLevelingRecords : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "experience_records",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
reason_type = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
|
|
||||||
reason = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
|
|
||||||
delta = table.Column<long>(type: "bigint", nullable: false),
|
|
||||||
account_id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_experience_records", x => x.id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_experience_records_accounts_account_id",
|
|
||||||
column: x => x.account_id,
|
|
||||||
principalTable: "accounts",
|
|
||||||
principalColumn: "id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "social_credit_records",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
reason_type = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
|
|
||||||
reason = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
|
|
||||||
delta = table.Column<double>(type: "double precision", nullable: false),
|
|
||||||
expired_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
|
||||||
account_id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_social_credit_records", x => x.id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_social_credit_records_accounts_account_id",
|
|
||||||
column: x => x.account_id,
|
|
||||||
principalTable: "accounts",
|
|
||||||
principalColumn: "id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_experience_records_account_id",
|
|
||||||
table: "experience_records",
|
|
||||||
column: "account_id");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_social_credit_records_account_id",
|
|
||||||
table: "social_credit_records",
|
|
||||||
column: "account_id");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "experience_records");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "social_credit_records");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace DysonNetwork.Pass.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class AddLevelingBonusMultiplier : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AddColumn<double>(
|
|
||||||
name: "bonus_multiplier",
|
|
||||||
table: "experience_records",
|
|
||||||
type: "double precision",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: 0.0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "bonus_multiplier",
|
|
||||||
table: "experience_records");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace DysonNetwork.Pass.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class CacheSocialCreditsInProfile : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AddColumn<double>(
|
|
||||||
name: "social_credits",
|
|
||||||
table: "account_profiles",
|
|
||||||
type: "double precision",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: 0.0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "social_credits",
|
|
||||||
table: "account_profiles");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace DysonNetwork.Pass.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class AddOrderProductIdentifier : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AddColumn<string>(
|
|
||||||
name: "product_identifier",
|
|
||||||
table: "payment_orders",
|
|
||||||
type: "character varying(4096)",
|
|
||||||
maxLength: 4096,
|
|
||||||
nullable: true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "product_identifier",
|
|
||||||
table: "payment_orders");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace DysonNetwork.Pass.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class AddAccountRegion : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AddColumn<string>(
|
|
||||||
name: "region",
|
|
||||||
table: "accounts",
|
|
||||||
type: "character varying(32)",
|
|
||||||
maxLength: 32,
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: "");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "region",
|
|
||||||
table: "accounts");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
using DysonNetwork.Shared.Geometry;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using NetTopologySuite.Geometries;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace DysonNetwork.Pass.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class RefactorGeoIpPoint : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.Sql("UPDATE auth_challenges SET location = NULL;");
|
|
||||||
migrationBuilder.Sql("UPDATE action_logs SET location = NULL;");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "location",
|
|
||||||
table: "auth_challenges");
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<GeoPoint>(
|
|
||||||
name: "location",
|
|
||||||
table: "auth_challenges",
|
|
||||||
type: "jsonb",
|
|
||||||
nullable: true);
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "location",
|
|
||||||
table: "action_logs");
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<GeoPoint>(
|
|
||||||
name: "location",
|
|
||||||
table: "action_logs",
|
|
||||||
type: "jsonb",
|
|
||||||
nullable: true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "location",
|
|
||||||
table: "auth_challenges");
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<Point>(
|
|
||||||
name: "location",
|
|
||||||
table: "auth_challenges",
|
|
||||||
type: "geometry",
|
|
||||||
nullable: true);
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "location",
|
|
||||||
table: "action_logs");
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<Point>(
|
|
||||||
name: "location",
|
|
||||||
table: "action_logs",
|
|
||||||
type: "geometry",
|
|
||||||
nullable: true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace DysonNetwork.Pass.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class RemoveNetTopo : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AlterDatabase()
|
|
||||||
.OldAnnotation("Npgsql:PostgresExtension:postgis", ",,");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AlterDatabase()
|
|
||||||
.Annotation("Npgsql:PostgresExtension:postgis", ",,");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace DysonNetwork.Pass.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class AddAutomatedStatus : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AddColumn<string>(
|
|
||||||
name: "app_identifier",
|
|
||||||
table: "account_statuses",
|
|
||||||
type: "character varying(4096)",
|
|
||||||
maxLength: 4096,
|
|
||||||
nullable: true);
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<bool>(
|
|
||||||
name: "is_automated",
|
|
||||||
table: "account_statuses",
|
|
||||||
type: "boolean",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "app_identifier",
|
|
||||||
table: "account_statuses");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "is_automated",
|
|
||||||
table: "account_statuses");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace DysonNetwork.Pass.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class AddStatusMeta : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AddColumn<Dictionary<string, object>>(
|
|
||||||
name: "meta",
|
|
||||||
table: "account_statuses",
|
|
||||||
type: "jsonb",
|
|
||||||
nullable: true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "meta",
|
|
||||||
table: "account_statuses");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,132 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text.Json;
|
|
||||||
using DysonNetwork.Shared.Models;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using NodaTime;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace DysonNetwork.Pass.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class AddSubscriptionGift : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "wallet_gifts",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
gifter_id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
recipient_id = table.Column<Guid>(type: "uuid", nullable: true),
|
|
||||||
gift_code = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
|
|
||||||
message = table.Column<string>(type: "character varying(1000)", maxLength: 1000, nullable: true),
|
|
||||||
subscription_identifier = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: false),
|
|
||||||
base_price = table.Column<decimal>(type: "numeric", nullable: false),
|
|
||||||
final_price = table.Column<decimal>(type: "numeric", nullable: false),
|
|
||||||
status = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
redeemed_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
|
||||||
redeemer_id = table.Column<Guid>(type: "uuid", nullable: true),
|
|
||||||
expires_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
is_open_gift = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
payment_method = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: false),
|
|
||||||
payment_details = table.Column<SnPaymentDetails>(type: "jsonb", nullable: false),
|
|
||||||
coupon_id = table.Column<Guid>(type: "uuid", nullable: true),
|
|
||||||
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_wallet_gifts", x => x.id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_wallet_gifts_accounts_gifter_id",
|
|
||||||
column: x => x.gifter_id,
|
|
||||||
principalTable: "accounts",
|
|
||||||
principalColumn: "id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_wallet_gifts_accounts_recipient_id",
|
|
||||||
column: x => x.recipient_id,
|
|
||||||
principalTable: "accounts",
|
|
||||||
principalColumn: "id");
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_wallet_gifts_accounts_redeemer_id",
|
|
||||||
column: x => x.redeemer_id,
|
|
||||||
principalTable: "accounts",
|
|
||||||
principalColumn: "id");
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_wallet_gifts_wallet_coupons_coupon_id",
|
|
||||||
column: x => x.coupon_id,
|
|
||||||
principalTable: "wallet_coupons",
|
|
||||||
principalColumn: "id");
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<Guid>(
|
|
||||||
name: "gift_id",
|
|
||||||
table: "wallet_subscriptions",
|
|
||||||
type: "uuid",
|
|
||||||
nullable: true);
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_wallet_gifts_coupon_id",
|
|
||||||
table: "wallet_gifts",
|
|
||||||
column: "coupon_id");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_wallet_gifts_gift_code",
|
|
||||||
table: "wallet_gifts",
|
|
||||||
column: "gift_code");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_wallet_gifts_gifter_id",
|
|
||||||
table: "wallet_gifts",
|
|
||||||
column: "gifter_id");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_wallet_gifts_recipient_id",
|
|
||||||
table: "wallet_gifts",
|
|
||||||
column: "recipient_id");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_wallet_gifts_redeemer_id",
|
|
||||||
table: "wallet_gifts",
|
|
||||||
column: "redeemer_id");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_wallet_subscriptions_gift_id",
|
|
||||||
table: "wallet_subscriptions",
|
|
||||||
column: "gift_id",
|
|
||||||
unique: true);
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "fk_wallet_subscriptions_wallet_gifts_gift_id",
|
|
||||||
table: "wallet_subscriptions",
|
|
||||||
column: "gift_id",
|
|
||||||
principalTable: "wallet_gifts",
|
|
||||||
principalColumn: "id");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "fk_wallet_subscriptions_wallet_gifts_gift_id",
|
|
||||||
table: "wallet_subscriptions");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "wallet_gifts");
|
|
||||||
|
|
||||||
migrationBuilder.DropIndex(
|
|
||||||
name: "ix_wallet_subscriptions_gift_id",
|
|
||||||
table: "wallet_subscriptions");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "gift_id",
|
|
||||||
table: "wallet_subscriptions");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,81 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace DysonNetwork.Pass.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class RefactorSubscriptionRelation : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "fk_wallet_subscriptions_wallet_gifts_gift_id",
|
|
||||||
table: "wallet_subscriptions");
|
|
||||||
|
|
||||||
migrationBuilder.DropIndex(
|
|
||||||
name: "ix_wallet_subscriptions_gift_id",
|
|
||||||
table: "wallet_subscriptions");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "gift_id",
|
|
||||||
table: "wallet_subscriptions");
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<Guid>(
|
|
||||||
name: "subscription_id",
|
|
||||||
table: "wallet_gifts",
|
|
||||||
type: "uuid",
|
|
||||||
nullable: true);
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_wallet_gifts_subscription_id",
|
|
||||||
table: "wallet_gifts",
|
|
||||||
column: "subscription_id",
|
|
||||||
unique: true);
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "fk_wallet_gifts_wallet_subscriptions_subscription_id",
|
|
||||||
table: "wallet_gifts",
|
|
||||||
column: "subscription_id",
|
|
||||||
principalTable: "wallet_subscriptions",
|
|
||||||
principalColumn: "id");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "fk_wallet_gifts_wallet_subscriptions_subscription_id",
|
|
||||||
table: "wallet_gifts");
|
|
||||||
|
|
||||||
migrationBuilder.DropIndex(
|
|
||||||
name: "ix_wallet_gifts_subscription_id",
|
|
||||||
table: "wallet_gifts");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "subscription_id",
|
|
||||||
table: "wallet_gifts");
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<Guid>(
|
|
||||||
name: "gift_id",
|
|
||||||
table: "wallet_subscriptions",
|
|
||||||
type: "uuid",
|
|
||||||
nullable: true);
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_wallet_subscriptions_gift_id",
|
|
||||||
table: "wallet_subscriptions",
|
|
||||||
column: "gift_id",
|
|
||||||
unique: true);
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "fk_wallet_subscriptions_wallet_gifts_gift_id",
|
|
||||||
table: "wallet_subscriptions",
|
|
||||||
column: "gift_id",
|
|
||||||
principalTable: "wallet_gifts",
|
|
||||||
principalColumn: "id");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,99 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using NodaTime;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace DysonNetwork.Pass.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class AddWalletFund : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "wallet_funds",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
currency = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
|
|
||||||
total_amount = table.Column<decimal>(type: "numeric", nullable: false),
|
|
||||||
split_type = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
status = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
message = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: true),
|
|
||||||
creator_account_id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
expired_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_wallet_funds", x => x.id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_wallet_funds_accounts_creator_account_id",
|
|
||||||
column: x => x.creator_account_id,
|
|
||||||
principalTable: "accounts",
|
|
||||||
principalColumn: "id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "wallet_fund_recipients",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
fund_id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
recipient_account_id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
amount = table.Column<decimal>(type: "numeric", nullable: false),
|
|
||||||
is_received = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
received_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
|
||||||
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_wallet_fund_recipients", x => x.id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_wallet_fund_recipients_accounts_recipient_account_id",
|
|
||||||
column: x => x.recipient_account_id,
|
|
||||||
principalTable: "accounts",
|
|
||||||
principalColumn: "id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_wallet_fund_recipients_wallet_funds_fund_id",
|
|
||||||
column: x => x.fund_id,
|
|
||||||
principalTable: "wallet_funds",
|
|
||||||
principalColumn: "id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_wallet_fund_recipients_fund_id",
|
|
||||||
table: "wallet_fund_recipients",
|
|
||||||
column: "fund_id");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_wallet_fund_recipients_recipient_account_id",
|
|
||||||
table: "wallet_fund_recipients",
|
|
||||||
column: "recipient_account_id");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_wallet_funds_creator_account_id",
|
|
||||||
table: "wallet_funds",
|
|
||||||
column: "creator_account_id");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "wallet_fund_recipients");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "wallet_funds");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,29 +0,0 @@
|
|||||||
using DysonNetwork.Shared.Models;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace DysonNetwork.Pass.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class AddUsernameColor : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AddColumn<UsernameColor>(
|
|
||||||
name: "username_color",
|
|
||||||
table: "account_profiles",
|
|
||||||
type: "jsonb",
|
|
||||||
nullable: true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "username_color",
|
|
||||||
table: "account_profiles");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,160 +0,0 @@
|
|||||||
using System;
|
|
||||||
using DysonNetwork.Shared.Models;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using NodaTime;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace DysonNetwork.Pass.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class AddRealmFromSphere : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "realms",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
slug = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
|
|
||||||
name = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
|
|
||||||
description = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: false),
|
|
||||||
is_community = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
is_public = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
picture_id = table.Column<string>(type: "character varying(32)", maxLength: 32, nullable: true),
|
|
||||||
background_id = table.Column<string>(type: "character varying(32)", maxLength: 32, nullable: true),
|
|
||||||
picture = table.Column<SnCloudFileReferenceObject>(type: "jsonb", nullable: true),
|
|
||||||
background = table.Column<SnCloudFileReferenceObject>(type: "jsonb", nullable: true),
|
|
||||||
verification = table.Column<SnVerificationMark>(type: "jsonb", nullable: true),
|
|
||||||
account_id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_realms", x => x.id);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "realm_members",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
realm_id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
account_id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
role = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
joined_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
|
||||||
leave_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
|
||||||
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_realm_members", x => new { x.realm_id, x.account_id });
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_realm_members_realms_realm_id",
|
|
||||||
column: x => x.realm_id,
|
|
||||||
principalTable: "realms",
|
|
||||||
principalColumn: "id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "sn_chat_room",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
name = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: true),
|
|
||||||
description = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: true),
|
|
||||||
type = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
is_community = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
is_public = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
picture_id = table.Column<string>(type: "character varying(32)", maxLength: 32, nullable: true),
|
|
||||||
background_id = table.Column<string>(type: "character varying(32)", maxLength: 32, nullable: true),
|
|
||||||
picture = table.Column<SnCloudFileReferenceObject>(type: "jsonb", nullable: true),
|
|
||||||
background = table.Column<SnCloudFileReferenceObject>(type: "jsonb", nullable: true),
|
|
||||||
realm_id = table.Column<Guid>(type: "uuid", nullable: true),
|
|
||||||
sn_realm_id = table.Column<Guid>(type: "uuid", nullable: true),
|
|
||||||
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_sn_chat_room", x => x.id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_sn_chat_room_realms_sn_realm_id",
|
|
||||||
column: x => x.sn_realm_id,
|
|
||||||
principalTable: "realms",
|
|
||||||
principalColumn: "id");
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "sn_chat_member",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
chat_room_id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
account_id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
nick = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: true),
|
|
||||||
role = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
notify = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
last_read_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
|
||||||
joined_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
|
||||||
leave_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
|
||||||
is_bot = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
break_until = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
|
||||||
timeout_until = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
|
||||||
timeout_cause = table.Column<ChatTimeoutCause>(type: "jsonb", nullable: true),
|
|
||||||
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_sn_chat_member", x => x.id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_sn_chat_member_sn_chat_room_chat_room_id",
|
|
||||||
column: x => x.chat_room_id,
|
|
||||||
principalTable: "sn_chat_room",
|
|
||||||
principalColumn: "id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_realms_slug",
|
|
||||||
table: "realms",
|
|
||||||
column: "slug",
|
|
||||||
unique: true);
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_sn_chat_member_chat_room_id",
|
|
||||||
table: "sn_chat_member",
|
|
||||||
column: "chat_room_id");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_sn_chat_room_sn_realm_id",
|
|
||||||
table: "sn_chat_room",
|
|
||||||
column: "sn_realm_id");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "realm_members");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "sn_chat_member");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "sn_chat_room");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "realms");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,99 +0,0 @@
|
|||||||
using System;
|
|
||||||
using DysonNetwork.Shared.Models;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using NodaTime;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace DysonNetwork.Pass.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class RemoveChatRoom : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "sn_chat_member");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "sn_chat_room");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "sn_chat_room",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
background = table.Column<SnCloudFileReferenceObject>(type: "jsonb", nullable: true),
|
|
||||||
background_id = table.Column<string>(type: "character varying(32)", maxLength: 32, nullable: true),
|
|
||||||
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
|
||||||
description = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: true),
|
|
||||||
is_community = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
is_public = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
name = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: true),
|
|
||||||
picture = table.Column<SnCloudFileReferenceObject>(type: "jsonb", nullable: true),
|
|
||||||
picture_id = table.Column<string>(type: "character varying(32)", maxLength: 32, nullable: true),
|
|
||||||
realm_id = table.Column<Guid>(type: "uuid", nullable: true),
|
|
||||||
sn_realm_id = table.Column<Guid>(type: "uuid", nullable: true),
|
|
||||||
type = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_sn_chat_room", x => x.id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_sn_chat_room_realms_sn_realm_id",
|
|
||||||
column: x => x.sn_realm_id,
|
|
||||||
principalTable: "realms",
|
|
||||||
principalColumn: "id");
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "sn_chat_member",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
chat_room_id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
account_id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
break_until = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
|
||||||
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
|
||||||
is_bot = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
joined_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
|
||||||
last_read_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
|
||||||
leave_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
|
||||||
nick = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: true),
|
|
||||||
notify = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
role = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
timeout_cause = table.Column<ChatTimeoutCause>(type: "jsonb", nullable: true),
|
|
||||||
timeout_until = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
|
||||||
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_sn_chat_member", x => x.id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_sn_chat_member_sn_chat_room_chat_room_id",
|
|
||||||
column: x => x.chat_room_id,
|
|
||||||
principalTable: "sn_chat_room",
|
|
||||||
principalColumn: "id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_sn_chat_member_chat_room_id",
|
|
||||||
table: "sn_chat_member",
|
|
||||||
column: "chat_room_id");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_sn_chat_room_sn_realm_id",
|
|
||||||
table: "sn_chat_room",
|
|
||||||
column: "sn_realm_id");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,78 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using NodaTime;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace DysonNetwork.Pass.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class AddLotteries : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "lotteries",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
account_id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
region_one_numbers = table.Column<List<int>>(type: "jsonb", nullable: false),
|
|
||||||
region_two_number = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
multiplier = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
draw_status = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
draw_date = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
|
||||||
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_lotteries", x => x.id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_lotteries_accounts_account_id",
|
|
||||||
column: x => x.account_id,
|
|
||||||
principalTable: "accounts",
|
|
||||||
principalColumn: "id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "lottery_records",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
draw_date = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
winning_region_one_numbers = table.Column<List<int>>(type: "jsonb", nullable: false),
|
|
||||||
winning_region_two_number = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
total_tickets = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
total_prizes_awarded = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
total_prize_amount = table.Column<long>(type: "bigint", nullable: false),
|
|
||||||
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_lottery_records", x => x.id);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_lotteries_account_id",
|
|
||||||
table: "lotteries",
|
|
||||||
column: "account_id");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "lotteries");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "lottery_records");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,39 +0,0 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace DysonNetwork.Pass.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class AddDetailLotteriesStatus : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AddColumn<List<int>>(
|
|
||||||
name: "matched_region_one_numbers",
|
|
||||||
table: "lotteries",
|
|
||||||
type: "jsonb",
|
|
||||||
nullable: true);
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<int>(
|
|
||||||
name: "matched_region_two_number",
|
|
||||||
table: "lotteries",
|
|
||||||
type: "integer",
|
|
||||||
nullable: true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "matched_region_one_numbers",
|
|
||||||
table: "lotteries");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "matched_region_two_number",
|
|
||||||
table: "lotteries");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,80 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using NodaTime;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace DysonNetwork.Pass.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class AddPresenceActivity : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "background_id",
|
|
||||||
table: "realms");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "picture_id",
|
|
||||||
table: "realms");
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "presence_activities",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
type = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
manual_id = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: true),
|
|
||||||
title = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: true),
|
|
||||||
subtitle = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: true),
|
|
||||||
caption = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: true),
|
|
||||||
meta = table.Column<Dictionary<string, object>>(type: "jsonb", nullable: true),
|
|
||||||
lease_minutes = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
lease_expires_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
account_id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_presence_activities", x => x.id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_presence_activities_accounts_account_id",
|
|
||||||
column: x => x.account_id,
|
|
||||||
principalTable: "accounts",
|
|
||||||
principalColumn: "id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_presence_activities_account_id",
|
|
||||||
table: "presence_activities",
|
|
||||||
column: "account_id");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "presence_activities");
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<string>(
|
|
||||||
name: "background_id",
|
|
||||||
table: "realms",
|
|
||||||
type: "character varying(32)",
|
|
||||||
maxLength: 32,
|
|
||||||
nullable: true);
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<string>(
|
|
||||||
name: "picture_id",
|
|
||||||
table: "realms",
|
|
||||||
type: "character varying(32)",
|
|
||||||
maxLength: 32,
|
|
||||||
nullable: true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,62 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace DysonNetwork.Pass.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class EnrichPresenceActivity : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AddColumn<string>(
|
|
||||||
name: "large_image",
|
|
||||||
table: "presence_activities",
|
|
||||||
type: "character varying(4096)",
|
|
||||||
maxLength: 4096,
|
|
||||||
nullable: true);
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<string>(
|
|
||||||
name: "small_image",
|
|
||||||
table: "presence_activities",
|
|
||||||
type: "character varying(4096)",
|
|
||||||
maxLength: 4096,
|
|
||||||
nullable: true);
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<string>(
|
|
||||||
name: "subtitle_url",
|
|
||||||
table: "presence_activities",
|
|
||||||
type: "character varying(4096)",
|
|
||||||
maxLength: 4096,
|
|
||||||
nullable: true);
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<string>(
|
|
||||||
name: "title_url",
|
|
||||||
table: "presence_activities",
|
|
||||||
type: "character varying(4096)",
|
|
||||||
maxLength: 4096,
|
|
||||||
nullable: true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "large_image",
|
|
||||||
table: "presence_activities");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "small_image",
|
|
||||||
table: "presence_activities");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "subtitle_url",
|
|
||||||
table: "presence_activities");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "title_url",
|
|
||||||
table: "presence_activities");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,29 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace DysonNetwork.Pass.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class AddSocialCreditRecordStatus : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AddColumn<int>(
|
|
||||||
name: "status",
|
|
||||||
table: "social_credit_records",
|
|
||||||
type: "integer",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "status",
|
|
||||||
table: "social_credit_records");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,40 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace DysonNetwork.Pass.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class OpenableFunds : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AddColumn<bool>(
|
|
||||||
name: "is_open",
|
|
||||||
table: "wallet_funds",
|
|
||||||
type: "boolean",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: false);
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<decimal>(
|
|
||||||
name: "remaining_amount",
|
|
||||||
table: "wallet_funds",
|
|
||||||
type: "numeric",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: 0m);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "is_open",
|
|
||||||
table: "wallet_funds");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "remaining_amount",
|
|
||||||
table: "wallet_funds");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,29 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace DysonNetwork.Pass.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class OpenFundsTotalSplits : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AddColumn<int>(
|
|
||||||
name: "amount_of_splits",
|
|
||||||
table: "wallet_funds",
|
|
||||||
type: "integer",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "amount_of_splits",
|
|
||||||
table: "wallet_funds");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,143 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace DysonNetwork.Pass.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class DecoupleAuthSessionAndChallenge : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "fk_auth_challenges_auth_clients_client_id",
|
|
||||||
table: "auth_challenges");
|
|
||||||
|
|
||||||
migrationBuilder.DropIndex(
|
|
||||||
name: "ix_auth_challenges_client_id",
|
|
||||||
table: "auth_challenges");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "client_id",
|
|
||||||
table: "auth_challenges");
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<Guid>(
|
|
||||||
name: "client_id",
|
|
||||||
table: "auth_sessions",
|
|
||||||
type: "uuid",
|
|
||||||
nullable: true);
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<Guid>(
|
|
||||||
name: "parent_session_id",
|
|
||||||
table: "auth_sessions",
|
|
||||||
type: "uuid",
|
|
||||||
nullable: true);
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<string>(
|
|
||||||
name: "device_id",
|
|
||||||
table: "auth_challenges",
|
|
||||||
type: "character varying(512)",
|
|
||||||
maxLength: 512,
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: "");
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<string>(
|
|
||||||
name: "device_name",
|
|
||||||
table: "auth_challenges",
|
|
||||||
type: "character varying(1024)",
|
|
||||||
maxLength: 1024,
|
|
||||||
nullable: true);
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<int>(
|
|
||||||
name: "platform",
|
|
||||||
table: "auth_challenges",
|
|
||||||
type: "integer",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: 0);
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_auth_sessions_client_id",
|
|
||||||
table: "auth_sessions",
|
|
||||||
column: "client_id");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_auth_sessions_parent_session_id",
|
|
||||||
table: "auth_sessions",
|
|
||||||
column: "parent_session_id");
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "fk_auth_sessions_auth_clients_client_id",
|
|
||||||
table: "auth_sessions",
|
|
||||||
column: "client_id",
|
|
||||||
principalTable: "auth_clients",
|
|
||||||
principalColumn: "id");
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "fk_auth_sessions_auth_sessions_parent_session_id",
|
|
||||||
table: "auth_sessions",
|
|
||||||
column: "parent_session_id",
|
|
||||||
principalTable: "auth_sessions",
|
|
||||||
principalColumn: "id");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "fk_auth_sessions_auth_clients_client_id",
|
|
||||||
table: "auth_sessions");
|
|
||||||
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "fk_auth_sessions_auth_sessions_parent_session_id",
|
|
||||||
table: "auth_sessions");
|
|
||||||
|
|
||||||
migrationBuilder.DropIndex(
|
|
||||||
name: "ix_auth_sessions_client_id",
|
|
||||||
table: "auth_sessions");
|
|
||||||
|
|
||||||
migrationBuilder.DropIndex(
|
|
||||||
name: "ix_auth_sessions_parent_session_id",
|
|
||||||
table: "auth_sessions");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "client_id",
|
|
||||||
table: "auth_sessions");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "parent_session_id",
|
|
||||||
table: "auth_sessions");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "device_id",
|
|
||||||
table: "auth_challenges");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "device_name",
|
|
||||||
table: "auth_challenges");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "platform",
|
|
||||||
table: "auth_challenges");
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<Guid>(
|
|
||||||
name: "client_id",
|
|
||||||
table: "auth_challenges",
|
|
||||||
type: "uuid",
|
|
||||||
nullable: true);
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_auth_challenges_client_id",
|
|
||||||
table: "auth_challenges",
|
|
||||||
column: "client_id");
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "fk_auth_challenges_auth_clients_client_id",
|
|
||||||
table: "auth_challenges",
|
|
||||||
column: "client_id",
|
|
||||||
principalTable: "auth_clients",
|
|
||||||
principalColumn: "id");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,90 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using NodaTime;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace DysonNetwork.Pass.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class AddAffiliationSpell : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "affiliation_spells",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
spell = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
|
|
||||||
type = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
expires_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
|
||||||
affected_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
|
||||||
meta = table.Column<Dictionary<string, object>>(type: "jsonb", nullable: false),
|
|
||||||
account_id = table.Column<Guid>(type: "uuid", nullable: true),
|
|
||||||
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_affiliation_spells", x => x.id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_affiliation_spells_accounts_account_id",
|
|
||||||
column: x => x.account_id,
|
|
||||||
principalTable: "accounts",
|
|
||||||
principalColumn: "id");
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "affiliation_results",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
resource_identifier = table.Column<string>(type: "character varying(8192)", maxLength: 8192, nullable: false),
|
|
||||||
spell_id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_affiliation_results", x => x.id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_affiliation_results_affiliation_spells_spell_id",
|
|
||||||
column: x => x.spell_id,
|
|
||||||
principalTable: "affiliation_spells",
|
|
||||||
principalColumn: "id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_affiliation_results_spell_id",
|
|
||||||
table: "affiliation_results",
|
|
||||||
column: "spell_id");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_affiliation_spells_account_id",
|
|
||||||
table: "affiliation_spells",
|
|
||||||
column: "account_id");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_affiliation_spells_spell",
|
|
||||||
table: "affiliation_spells",
|
|
||||||
column: "spell",
|
|
||||||
unique: true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "affiliation_results");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "affiliation_spells");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,59 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace DysonNetwork.Pass.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class SimplifiedPermissionNode : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropIndex(
|
|
||||||
name: "ix_permission_nodes_key_area_actor",
|
|
||||||
table: "permission_nodes");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "area",
|
|
||||||
table: "permission_nodes");
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<int>(
|
|
||||||
name: "type",
|
|
||||||
table: "permission_nodes",
|
|
||||||
type: "integer",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: 0);
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_permission_nodes_key_actor",
|
|
||||||
table: "permission_nodes",
|
|
||||||
columns: new[] { "key", "actor" });
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropIndex(
|
|
||||||
name: "ix_permission_nodes_key_actor",
|
|
||||||
table: "permission_nodes");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "type",
|
|
||||||
table: "permission_nodes");
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<string>(
|
|
||||||
name: "area",
|
|
||||||
table: "permission_nodes",
|
|
||||||
type: "character varying(1024)",
|
|
||||||
maxLength: 1024,
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: "");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_permission_nodes_key_area_actor",
|
|
||||||
table: "permission_nodes",
|
|
||||||
columns: new[] { "key", "area", "actor" });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,105 +0,0 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace DysonNetwork.Pass.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class SimplifiedAuthSession : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "fk_auth_sessions_auth_challenges_challenge_id",
|
|
||||||
table: "auth_sessions");
|
|
||||||
|
|
||||||
migrationBuilder.DropIndex(
|
|
||||||
name: "ix_auth_sessions_challenge_id",
|
|
||||||
table: "auth_sessions");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "type",
|
|
||||||
table: "auth_challenges");
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<List<string>>(
|
|
||||||
name: "audiences",
|
|
||||||
table: "auth_sessions",
|
|
||||||
type: "jsonb",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: new List<string>());
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<string>(
|
|
||||||
name: "ip_address",
|
|
||||||
table: "auth_sessions",
|
|
||||||
type: "character varying(128)",
|
|
||||||
maxLength: 128,
|
|
||||||
nullable: true);
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<List<string>>(
|
|
||||||
name: "scopes",
|
|
||||||
table: "auth_sessions",
|
|
||||||
type: "jsonb",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: new List<string>());
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<int>(
|
|
||||||
name: "type",
|
|
||||||
table: "auth_sessions",
|
|
||||||
type: "integer",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: 0);
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<string>(
|
|
||||||
name: "user_agent",
|
|
||||||
table: "auth_sessions",
|
|
||||||
type: "character varying(512)",
|
|
||||||
maxLength: 512,
|
|
||||||
nullable: true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "audiences",
|
|
||||||
table: "auth_sessions");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "ip_address",
|
|
||||||
table: "auth_sessions");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "scopes",
|
|
||||||
table: "auth_sessions");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "type",
|
|
||||||
table: "auth_sessions");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "user_agent",
|
|
||||||
table: "auth_sessions");
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<int>(
|
|
||||||
name: "type",
|
|
||||||
table: "auth_challenges",
|
|
||||||
type: "integer",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: 0);
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_auth_sessions_challenge_id",
|
|
||||||
table: "auth_sessions",
|
|
||||||
column: "challenge_id");
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "fk_auth_sessions_auth_challenges_challenge_id",
|
|
||||||
table: "auth_sessions",
|
|
||||||
column: "challenge_id",
|
|
||||||
principalTable: "auth_challenges",
|
|
||||||
principalColumn: "id");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
using DysonNetwork.Shared.Geometry;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace DysonNetwork.Pass.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class AddLocationToSession : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AddColumn<GeoPoint>(
|
|
||||||
name: "location",
|
|
||||||
table: "auth_sessions",
|
|
||||||
type: "jsonb",
|
|
||||||
nullable: true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "location",
|
|
||||||
table: "auth_sessions");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -17,8 +17,8 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|||||||
namespace DysonNetwork.Pass.Migrations
|
namespace DysonNetwork.Pass.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(AppDatabase))]
|
[DbContext(typeof(AppDatabase))]
|
||||||
[Migration("20251203163459_AddLocationToSession")]
|
[Migration("20251214092550_InitialMigration")]
|
||||||
partial class AddLocationToSession
|
partial class InitialMigration
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
@@ -1,7 +1,9 @@
|
|||||||
using System.Text.Json;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text.Json;
|
||||||
|
using DysonNetwork.Shared.Geometry;
|
||||||
using DysonNetwork.Shared.Models;
|
using DysonNetwork.Shared.Models;
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
using NetTopologySuite.Geometries;
|
|
||||||
using NodaTime;
|
using NodaTime;
|
||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
@@ -14,9 +16,6 @@ namespace DysonNetwork.Pass.Migrations
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
{
|
{
|
||||||
migrationBuilder.AlterDatabase()
|
|
||||||
.Annotation("Npgsql:PostgresExtension:postgis", ",,");
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.CreateTable(
|
||||||
name: "accounts",
|
name: "accounts",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
@@ -25,8 +24,10 @@ namespace DysonNetwork.Pass.Migrations
|
|||||||
name = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
|
name = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
|
||||||
nick = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
|
nick = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
|
||||||
language = table.Column<string>(type: "character varying(32)", maxLength: 32, nullable: false),
|
language = table.Column<string>(type: "character varying(32)", maxLength: 32, nullable: false),
|
||||||
|
region = table.Column<string>(type: "character varying(32)", maxLength: 32, nullable: false),
|
||||||
activated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
activated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
||||||
is_superuser = table.Column<bool>(type: "boolean", nullable: false),
|
is_superuser = table.Column<bool>(type: "boolean", nullable: false),
|
||||||
|
automated_id = table.Column<Guid>(type: "uuid", nullable: true),
|
||||||
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
||||||
@@ -37,24 +38,23 @@ namespace DysonNetwork.Pass.Migrations
|
|||||||
});
|
});
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.CreateTable(
|
||||||
name: "custom_apps",
|
name: "lottery_records",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
id = table.Column<Guid>(type: "uuid", nullable: false),
|
id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
slug = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
|
draw_date = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
name = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
|
winning_region_one_numbers = table.Column<List<int>>(type: "jsonb", nullable: false),
|
||||||
description = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: true),
|
winning_region_two_number = table.Column<int>(type: "integer", nullable: false),
|
||||||
status = table.Column<int>(type: "integer", nullable: false),
|
total_tickets = table.Column<int>(type: "integer", nullable: false),
|
||||||
picture = table.Column<SnCloudFileReferenceObject>(type: "jsonb", nullable: true),
|
total_prizes_awarded = table.Column<int>(type: "integer", nullable: false),
|
||||||
background = table.Column<SnCloudFileReferenceObject>(type: "jsonb", nullable: true),
|
total_prize_amount = table.Column<long>(type: "bigint", nullable: false),
|
||||||
verification = table.Column<SnVerificationMark>(type: "jsonb", nullable: true),
|
|
||||||
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
table.PrimaryKey("pk_custom_apps", x => x.id);
|
table.PrimaryKey("pk_lottery_records", x => x.id);
|
||||||
});
|
});
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.CreateTable(
|
||||||
@@ -72,6 +72,29 @@ namespace DysonNetwork.Pass.Migrations
|
|||||||
table.PrimaryKey("pk_permission_groups", x => x.id);
|
table.PrimaryKey("pk_permission_groups", x => x.id);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "realms",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
slug = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
|
||||||
|
name = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
|
||||||
|
description = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: false),
|
||||||
|
is_community = table.Column<bool>(type: "boolean", nullable: false),
|
||||||
|
is_public = table.Column<bool>(type: "boolean", nullable: false),
|
||||||
|
picture = table.Column<SnCloudFileReferenceObject>(type: "jsonb", nullable: true),
|
||||||
|
background = table.Column<SnCloudFileReferenceObject>(type: "jsonb", nullable: true),
|
||||||
|
verification = table.Column<SnVerificationMark>(type: "jsonb", nullable: true),
|
||||||
|
account_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
|
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
|
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("pk_realms", x => x.id);
|
||||||
|
});
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.CreateTable(
|
||||||
name: "wallet_coupons",
|
name: "wallet_coupons",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
@@ -156,6 +179,7 @@ namespace DysonNetwork.Pass.Migrations
|
|||||||
reward_experience = table.Column<int>(type: "integer", nullable: true),
|
reward_experience = table.Column<int>(type: "integer", nullable: true),
|
||||||
tips = table.Column<ICollection<CheckInFortuneTip>>(type: "jsonb", nullable: false),
|
tips = table.Column<ICollection<CheckInFortuneTip>>(type: "jsonb", nullable: false),
|
||||||
account_id = table.Column<Guid>(type: "uuid", nullable: false),
|
account_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
backdated_from = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
||||||
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
||||||
@@ -206,6 +230,7 @@ namespace DysonNetwork.Pass.Migrations
|
|||||||
type = table.Column<int>(type: "integer", nullable: false),
|
type = table.Column<int>(type: "integer", nullable: false),
|
||||||
verified_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
verified_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
||||||
is_primary = table.Column<bool>(type: "boolean", nullable: false),
|
is_primary = table.Column<bool>(type: "boolean", nullable: false),
|
||||||
|
is_public = table.Column<bool>(type: "boolean", nullable: false),
|
||||||
content = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
|
content = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
|
||||||
account_id = table.Column<Guid>(type: "uuid", nullable: false),
|
account_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
@@ -236,13 +261,14 @@ namespace DysonNetwork.Pass.Migrations
|
|||||||
pronouns = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: true),
|
pronouns = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: true),
|
||||||
time_zone = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: true),
|
time_zone = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: true),
|
||||||
location = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: true),
|
location = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: true),
|
||||||
|
links = table.Column<List<SnProfileLink>>(type: "jsonb", nullable: true),
|
||||||
|
username_color = table.Column<UsernameColor>(type: "jsonb", nullable: true),
|
||||||
birthday = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
birthday = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
||||||
last_seen_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
last_seen_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
||||||
verification = table.Column<SnVerificationMark>(type: "jsonb", nullable: true),
|
verification = table.Column<SnVerificationMark>(type: "jsonb", nullable: true),
|
||||||
active_badge = table.Column<SnAccountBadge>(type: "jsonb", nullable: true),
|
active_badge = table.Column<SnAccountBadgeRef>(type: "jsonb", nullable: true),
|
||||||
experience = table.Column<int>(type: "integer", nullable: false),
|
experience = table.Column<int>(type: "integer", nullable: false),
|
||||||
picture_id = table.Column<string>(type: "character varying(32)", maxLength: 32, nullable: true),
|
social_credits = table.Column<double>(type: "double precision", nullable: false),
|
||||||
background_id = table.Column<string>(type: "character varying(32)", maxLength: 32, nullable: true),
|
|
||||||
picture = table.Column<SnCloudFileReferenceObject>(type: "jsonb", nullable: true),
|
picture = table.Column<SnCloudFileReferenceObject>(type: "jsonb", nullable: true),
|
||||||
background = table.Column<SnCloudFileReferenceObject>(type: "jsonb", nullable: true),
|
background = table.Column<SnCloudFileReferenceObject>(type: "jsonb", nullable: true),
|
||||||
account_id = table.Column<Guid>(type: "uuid", nullable: false),
|
account_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
@@ -299,7 +325,10 @@ namespace DysonNetwork.Pass.Migrations
|
|||||||
is_invisible = table.Column<bool>(type: "boolean", nullable: false),
|
is_invisible = table.Column<bool>(type: "boolean", nullable: false),
|
||||||
is_not_disturb = table.Column<bool>(type: "boolean", nullable: false),
|
is_not_disturb = table.Column<bool>(type: "boolean", nullable: false),
|
||||||
label = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: true),
|
label = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: true),
|
||||||
|
meta = table.Column<Dictionary<string, object>>(type: "jsonb", nullable: true),
|
||||||
cleared_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
cleared_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
||||||
|
app_identifier = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: true),
|
||||||
|
is_automated = table.Column<bool>(type: "boolean", nullable: false),
|
||||||
account_id = table.Column<Guid>(type: "uuid", nullable: false),
|
account_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
@@ -325,7 +354,7 @@ namespace DysonNetwork.Pass.Migrations
|
|||||||
meta = table.Column<Dictionary<string, object>>(type: "jsonb", nullable: false),
|
meta = table.Column<Dictionary<string, object>>(type: "jsonb", nullable: false),
|
||||||
user_agent = table.Column<string>(type: "character varying(512)", maxLength: 512, nullable: true),
|
user_agent = table.Column<string>(type: "character varying(512)", maxLength: 512, nullable: true),
|
||||||
ip_address = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: true),
|
ip_address = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: true),
|
||||||
location = table.Column<Point>(type: "geometry", nullable: true),
|
location = table.Column<GeoPoint>(type: "jsonb", nullable: true),
|
||||||
account_id = table.Column<Guid>(type: "uuid", nullable: false),
|
account_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
session_id = table.Column<Guid>(type: "uuid", nullable: true),
|
session_id = table.Column<Guid>(type: "uuid", nullable: true),
|
||||||
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
@@ -343,6 +372,31 @@ namespace DysonNetwork.Pass.Migrations
|
|||||||
onDelete: ReferentialAction.Cascade);
|
onDelete: ReferentialAction.Cascade);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "affiliation_spells",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
spell = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
|
||||||
|
type = table.Column<int>(type: "integer", nullable: false),
|
||||||
|
expires_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
||||||
|
affected_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
||||||
|
meta = table.Column<Dictionary<string, object>>(type: "jsonb", nullable: false),
|
||||||
|
account_id = table.Column<Guid>(type: "uuid", nullable: true),
|
||||||
|
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
|
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
|
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("pk_affiliation_spells", x => x.id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "fk_affiliation_spells_accounts_account_id",
|
||||||
|
column: x => x.account_id,
|
||||||
|
principalTable: "accounts",
|
||||||
|
principalColumn: "id");
|
||||||
|
});
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.CreateTable(
|
||||||
name: "auth_challenges",
|
name: "auth_challenges",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
@@ -352,16 +406,16 @@ namespace DysonNetwork.Pass.Migrations
|
|||||||
step_remain = table.Column<int>(type: "integer", nullable: false),
|
step_remain = table.Column<int>(type: "integer", nullable: false),
|
||||||
step_total = table.Column<int>(type: "integer", nullable: false),
|
step_total = table.Column<int>(type: "integer", nullable: false),
|
||||||
failed_attempts = table.Column<int>(type: "integer", nullable: false),
|
failed_attempts = table.Column<int>(type: "integer", nullable: false),
|
||||||
platform = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
type = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
blacklist_factors = table.Column<List<Guid>>(type: "jsonb", nullable: false),
|
blacklist_factors = table.Column<List<Guid>>(type: "jsonb", nullable: false),
|
||||||
audiences = table.Column<List<string>>(type: "jsonb", nullable: false),
|
audiences = table.Column<List<string>>(type: "jsonb", nullable: false),
|
||||||
scopes = table.Column<List<string>>(type: "jsonb", nullable: false),
|
scopes = table.Column<List<string>>(type: "jsonb", nullable: false),
|
||||||
ip_address = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: true),
|
ip_address = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: true),
|
||||||
user_agent = table.Column<string>(type: "character varying(512)", maxLength: 512, nullable: true),
|
user_agent = table.Column<string>(type: "character varying(512)", maxLength: 512, nullable: true),
|
||||||
device_id = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
device_id = table.Column<string>(type: "character varying(512)", maxLength: 512, nullable: false),
|
||||||
|
device_name = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: true),
|
||||||
|
platform = table.Column<int>(type: "integer", nullable: false),
|
||||||
nonce = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: true),
|
nonce = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: true),
|
||||||
location = table.Column<Point>(type: "geometry", nullable: true),
|
location = table.Column<GeoPoint>(type: "jsonb", nullable: true),
|
||||||
account_id = table.Column<Guid>(type: "uuid", nullable: false),
|
account_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
@@ -378,6 +432,31 @@ namespace DysonNetwork.Pass.Migrations
|
|||||||
onDelete: ReferentialAction.Cascade);
|
onDelete: ReferentialAction.Cascade);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "auth_clients",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
platform = table.Column<int>(type: "integer", nullable: false),
|
||||||
|
device_name = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
|
||||||
|
device_label = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: true),
|
||||||
|
device_id = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
|
||||||
|
account_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
|
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
|
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("pk_auth_clients", x => x.id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "fk_auth_clients_accounts_account_id",
|
||||||
|
column: x => x.account_id,
|
||||||
|
principalTable: "accounts",
|
||||||
|
principalColumn: "id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.CreateTable(
|
||||||
name: "badges",
|
name: "badges",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
@@ -405,6 +484,59 @@ namespace DysonNetwork.Pass.Migrations
|
|||||||
onDelete: ReferentialAction.Cascade);
|
onDelete: ReferentialAction.Cascade);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "experience_records",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
reason_type = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
|
||||||
|
reason = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
|
||||||
|
delta = table.Column<long>(type: "bigint", nullable: false),
|
||||||
|
bonus_multiplier = table.Column<double>(type: "double precision", nullable: false),
|
||||||
|
account_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
|
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
|
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("pk_experience_records", x => x.id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "fk_experience_records_accounts_account_id",
|
||||||
|
column: x => x.account_id,
|
||||||
|
principalTable: "accounts",
|
||||||
|
principalColumn: "id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "lotteries",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
account_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
region_one_numbers = table.Column<List<int>>(type: "jsonb", nullable: false),
|
||||||
|
region_two_number = table.Column<int>(type: "integer", nullable: false),
|
||||||
|
multiplier = table.Column<int>(type: "integer", nullable: false),
|
||||||
|
draw_status = table.Column<int>(type: "integer", nullable: false),
|
||||||
|
draw_date = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
||||||
|
matched_region_one_numbers = table.Column<List<int>>(type: "jsonb", nullable: true),
|
||||||
|
matched_region_two_number = table.Column<int>(type: "integer", nullable: true),
|
||||||
|
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
|
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
|
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("pk_lotteries", x => x.id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "fk_lotteries_accounts_account_id",
|
||||||
|
column: x => x.account_id,
|
||||||
|
principalTable: "accounts",
|
||||||
|
principalColumn: "id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.CreateTable(
|
||||||
name: "magic_spells",
|
name: "magic_spells",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
@@ -431,14 +563,22 @@ namespace DysonNetwork.Pass.Migrations
|
|||||||
});
|
});
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.CreateTable(
|
||||||
name: "notification_push_subscriptions",
|
name: "presence_activities",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
id = table.Column<Guid>(type: "uuid", nullable: false),
|
id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
device_id = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: false),
|
type = table.Column<int>(type: "integer", nullable: false),
|
||||||
device_token = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: false),
|
manual_id = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: true),
|
||||||
provider = table.Column<int>(type: "integer", nullable: false),
|
title = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: true),
|
||||||
last_used_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
subtitle = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: true),
|
||||||
|
caption = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: true),
|
||||||
|
large_image = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: true),
|
||||||
|
small_image = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: true),
|
||||||
|
title_url = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: true),
|
||||||
|
subtitle_url = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: true),
|
||||||
|
meta = table.Column<Dictionary<string, object>>(type: "jsonb", nullable: true),
|
||||||
|
lease_minutes = table.Column<int>(type: "integer", nullable: false),
|
||||||
|
lease_expires_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
account_id = table.Column<Guid>(type: "uuid", nullable: false),
|
account_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
@@ -446,9 +586,9 @@ namespace DysonNetwork.Pass.Migrations
|
|||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
table.PrimaryKey("pk_notification_push_subscriptions", x => x.id);
|
table.PrimaryKey("pk_presence_activities", x => x.id);
|
||||||
table.ForeignKey(
|
table.ForeignKey(
|
||||||
name: "fk_notification_push_subscriptions_accounts_account_id",
|
name: "fk_presence_activities_accounts_account_id",
|
||||||
column: x => x.account_id,
|
column: x => x.account_id,
|
||||||
principalTable: "accounts",
|
principalTable: "accounts",
|
||||||
principalColumn: "id",
|
principalColumn: "id",
|
||||||
@@ -456,17 +596,14 @@ namespace DysonNetwork.Pass.Migrations
|
|||||||
});
|
});
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.CreateTable(
|
||||||
name: "notifications",
|
name: "punishments",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
id = table.Column<Guid>(type: "uuid", nullable: false),
|
id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
topic = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
|
reason = table.Column<string>(type: "character varying(8192)", maxLength: 8192, nullable: false),
|
||||||
title = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: true),
|
expired_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
||||||
subtitle = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true),
|
type = table.Column<int>(type: "integer", nullable: false),
|
||||||
content = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: true),
|
blocked_permissions = table.Column<List<string>>(type: "jsonb", nullable: true),
|
||||||
meta = table.Column<Dictionary<string, object>>(type: "jsonb", nullable: true),
|
|
||||||
priority = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
viewed_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
|
||||||
account_id = table.Column<Guid>(type: "uuid", nullable: false),
|
account_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
@@ -474,15 +611,71 @@ namespace DysonNetwork.Pass.Migrations
|
|||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
table.PrimaryKey("pk_notifications", x => x.id);
|
table.PrimaryKey("pk_punishments", x => x.id);
|
||||||
table.ForeignKey(
|
table.ForeignKey(
|
||||||
name: "fk_notifications_accounts_account_id",
|
name: "fk_punishments_accounts_account_id",
|
||||||
column: x => x.account_id,
|
column: x => x.account_id,
|
||||||
principalTable: "accounts",
|
principalTable: "accounts",
|
||||||
principalColumn: "id",
|
principalColumn: "id",
|
||||||
onDelete: ReferentialAction.Cascade);
|
onDelete: ReferentialAction.Cascade);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "social_credit_records",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
reason_type = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
|
||||||
|
reason = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
|
||||||
|
delta = table.Column<double>(type: "double precision", nullable: false),
|
||||||
|
status = table.Column<int>(type: "integer", nullable: false),
|
||||||
|
expired_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
||||||
|
account_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
|
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
|
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("pk_social_credit_records", x => x.id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "fk_social_credit_records_accounts_account_id",
|
||||||
|
column: x => x.account_id,
|
||||||
|
principalTable: "accounts",
|
||||||
|
principalColumn: "id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "wallet_funds",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
currency = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
|
||||||
|
total_amount = table.Column<decimal>(type: "numeric", nullable: false),
|
||||||
|
remaining_amount = table.Column<decimal>(type: "numeric", nullable: false),
|
||||||
|
amount_of_splits = table.Column<int>(type: "integer", nullable: false),
|
||||||
|
split_type = table.Column<int>(type: "integer", nullable: false),
|
||||||
|
status = table.Column<int>(type: "integer", nullable: false),
|
||||||
|
message = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: true),
|
||||||
|
is_open = table.Column<bool>(type: "boolean", nullable: false),
|
||||||
|
creator_account_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
expired_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
|
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
|
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
|
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("pk_wallet_funds", x => x.id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "fk_wallet_funds_accounts_creator_account_id",
|
||||||
|
column: x => x.creator_account_id,
|
||||||
|
principalTable: "accounts",
|
||||||
|
principalColumn: "id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.CreateTable(
|
||||||
name: "wallets",
|
name: "wallets",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
@@ -504,31 +697,6 @@ namespace DysonNetwork.Pass.Migrations
|
|||||||
onDelete: ReferentialAction.Cascade);
|
onDelete: ReferentialAction.Cascade);
|
||||||
});
|
});
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "custom_app_secrets",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
secret = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
|
|
||||||
description = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: true),
|
|
||||||
expired_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
|
||||||
is_oidc = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
app_id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_custom_app_secrets", x => x.id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_custom_app_secrets_custom_apps_app_id",
|
|
||||||
column: x => x.app_id,
|
|
||||||
principalTable: "custom_apps",
|
|
||||||
principalColumn: "id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.CreateTable(
|
||||||
name: "permission_group_members",
|
name: "permission_group_members",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
@@ -557,8 +725,8 @@ namespace DysonNetwork.Pass.Migrations
|
|||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
id = table.Column<Guid>(type: "uuid", nullable: false),
|
id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
type = table.Column<int>(type: "integer", nullable: false),
|
||||||
actor = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
|
actor = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
|
||||||
area = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
|
|
||||||
key = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
|
key = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
|
||||||
value = table.Column<JsonDocument>(type: "jsonb", nullable: false),
|
value = table.Column<JsonDocument>(type: "jsonb", nullable: false),
|
||||||
expired_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
expired_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
||||||
@@ -578,6 +746,30 @@ namespace DysonNetwork.Pass.Migrations
|
|||||||
principalColumn: "id");
|
principalColumn: "id");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "realm_members",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
realm_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
account_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
role = table.Column<int>(type: "integer", nullable: false),
|
||||||
|
joined_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
||||||
|
leave_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
||||||
|
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
|
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
|
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("pk_realm_members", x => new { x.realm_id, x.account_id });
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "fk_realm_members_realms_realm_id",
|
||||||
|
column: x => x.realm_id,
|
||||||
|
principalTable: "realms",
|
||||||
|
principalColumn: "id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.CreateTable(
|
||||||
name: "wallet_subscriptions",
|
name: "wallet_subscriptions",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
@@ -615,16 +807,45 @@ namespace DysonNetwork.Pass.Migrations
|
|||||||
principalColumn: "id");
|
principalColumn: "id");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "affiliation_results",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
resource_identifier = table.Column<string>(type: "character varying(8192)", maxLength: 8192, nullable: false),
|
||||||
|
spell_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
|
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
|
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("pk_affiliation_results", x => x.id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "fk_affiliation_results_affiliation_spells_spell_id",
|
||||||
|
column: x => x.spell_id,
|
||||||
|
principalTable: "affiliation_spells",
|
||||||
|
principalColumn: "id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.CreateTable(
|
||||||
name: "auth_sessions",
|
name: "auth_sessions",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
id = table.Column<Guid>(type: "uuid", nullable: false),
|
id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
label = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: true),
|
type = table.Column<int>(type: "integer", nullable: false),
|
||||||
last_granted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
last_granted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
||||||
expired_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
expired_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
||||||
|
audiences = table.Column<List<string>>(type: "jsonb", nullable: false),
|
||||||
|
scopes = table.Column<List<string>>(type: "jsonb", nullable: false),
|
||||||
|
ip_address = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: true),
|
||||||
|
user_agent = table.Column<string>(type: "character varying(512)", maxLength: 512, nullable: true),
|
||||||
|
location = table.Column<GeoPoint>(type: "jsonb", nullable: true),
|
||||||
account_id = table.Column<Guid>(type: "uuid", nullable: false),
|
account_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
challenge_id = table.Column<Guid>(type: "uuid", nullable: false),
|
client_id = table.Column<Guid>(type: "uuid", nullable: true),
|
||||||
|
parent_session_id = table.Column<Guid>(type: "uuid", nullable: true),
|
||||||
|
challenge_id = table.Column<Guid>(type: "uuid", nullable: true),
|
||||||
app_id = table.Column<Guid>(type: "uuid", nullable: true),
|
app_id = table.Column<Guid>(type: "uuid", nullable: true),
|
||||||
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
@@ -640,16 +861,46 @@ namespace DysonNetwork.Pass.Migrations
|
|||||||
principalColumn: "id",
|
principalColumn: "id",
|
||||||
onDelete: ReferentialAction.Cascade);
|
onDelete: ReferentialAction.Cascade);
|
||||||
table.ForeignKey(
|
table.ForeignKey(
|
||||||
name: "fk_auth_sessions_auth_challenges_challenge_id",
|
name: "fk_auth_sessions_auth_clients_client_id",
|
||||||
column: x => x.challenge_id,
|
column: x => x.client_id,
|
||||||
principalTable: "auth_challenges",
|
principalTable: "auth_clients",
|
||||||
|
principalColumn: "id");
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "fk_auth_sessions_auth_sessions_parent_session_id",
|
||||||
|
column: x => x.parent_session_id,
|
||||||
|
principalTable: "auth_sessions",
|
||||||
|
principalColumn: "id");
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "wallet_fund_recipients",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
fund_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
recipient_account_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
amount = table.Column<decimal>(type: "numeric", nullable: false),
|
||||||
|
is_received = table.Column<bool>(type: "boolean", nullable: false),
|
||||||
|
received_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
||||||
|
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
|
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
|
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("pk_wallet_fund_recipients", x => x.id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "fk_wallet_fund_recipients_accounts_recipient_account_id",
|
||||||
|
column: x => x.recipient_account_id,
|
||||||
|
principalTable: "accounts",
|
||||||
principalColumn: "id",
|
principalColumn: "id",
|
||||||
onDelete: ReferentialAction.Cascade);
|
onDelete: ReferentialAction.Cascade);
|
||||||
table.ForeignKey(
|
table.ForeignKey(
|
||||||
name: "fk_auth_sessions_custom_apps_app_id",
|
name: "fk_wallet_fund_recipients_wallet_funds_fund_id",
|
||||||
column: x => x.app_id,
|
column: x => x.fund_id,
|
||||||
principalTable: "custom_apps",
|
principalTable: "wallet_funds",
|
||||||
principalColumn: "id");
|
principalColumn: "id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
});
|
});
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.CreateTable(
|
||||||
@@ -705,6 +956,91 @@ namespace DysonNetwork.Pass.Migrations
|
|||||||
onDelete: ReferentialAction.Cascade);
|
onDelete: ReferentialAction.Cascade);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "wallet_gifts",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
gifter_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
recipient_id = table.Column<Guid>(type: "uuid", nullable: true),
|
||||||
|
gift_code = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
|
||||||
|
message = table.Column<string>(type: "character varying(1000)", maxLength: 1000, nullable: true),
|
||||||
|
subscription_identifier = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: false),
|
||||||
|
base_price = table.Column<decimal>(type: "numeric", nullable: false),
|
||||||
|
final_price = table.Column<decimal>(type: "numeric", nullable: false),
|
||||||
|
status = table.Column<int>(type: "integer", nullable: false),
|
||||||
|
redeemed_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
||||||
|
redeemer_id = table.Column<Guid>(type: "uuid", nullable: true),
|
||||||
|
subscription_id = table.Column<Guid>(type: "uuid", nullable: true),
|
||||||
|
expires_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
|
is_open_gift = table.Column<bool>(type: "boolean", nullable: false),
|
||||||
|
payment_method = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: false),
|
||||||
|
payment_details = table.Column<SnPaymentDetails>(type: "jsonb", nullable: false),
|
||||||
|
coupon_id = table.Column<Guid>(type: "uuid", nullable: true),
|
||||||
|
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
|
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
|
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("pk_wallet_gifts", x => x.id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "fk_wallet_gifts_accounts_gifter_id",
|
||||||
|
column: x => x.gifter_id,
|
||||||
|
principalTable: "accounts",
|
||||||
|
principalColumn: "id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "fk_wallet_gifts_accounts_recipient_id",
|
||||||
|
column: x => x.recipient_id,
|
||||||
|
principalTable: "accounts",
|
||||||
|
principalColumn: "id");
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "fk_wallet_gifts_accounts_redeemer_id",
|
||||||
|
column: x => x.redeemer_id,
|
||||||
|
principalTable: "accounts",
|
||||||
|
principalColumn: "id");
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "fk_wallet_gifts_wallet_coupons_coupon_id",
|
||||||
|
column: x => x.coupon_id,
|
||||||
|
principalTable: "wallet_coupons",
|
||||||
|
principalColumn: "id");
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "fk_wallet_gifts_wallet_subscriptions_subscription_id",
|
||||||
|
column: x => x.subscription_id,
|
||||||
|
principalTable: "wallet_subscriptions",
|
||||||
|
principalColumn: "id");
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "api_keys",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
label = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
|
||||||
|
account_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
session_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
|
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
|
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("pk_api_keys", x => x.id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "fk_api_keys_accounts_account_id",
|
||||||
|
column: x => x.account_id,
|
||||||
|
principalTable: "accounts",
|
||||||
|
principalColumn: "id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "fk_api_keys_auth_sessions_session_id",
|
||||||
|
column: x => x.session_id,
|
||||||
|
principalTable: "auth_sessions",
|
||||||
|
principalColumn: "id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.CreateTable(
|
||||||
name: "payment_orders",
|
name: "payment_orders",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
@@ -714,6 +1050,7 @@ namespace DysonNetwork.Pass.Migrations
|
|||||||
currency = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
|
currency = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
|
||||||
remarks = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: true),
|
remarks = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: true),
|
||||||
app_identifier = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: true),
|
app_identifier = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: true),
|
||||||
|
product_identifier = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: true),
|
||||||
meta = table.Column<Dictionary<string, object>>(type: "jsonb", nullable: true),
|
meta = table.Column<Dictionary<string, object>>(type: "jsonb", nullable: true),
|
||||||
amount = table.Column<decimal>(type: "numeric", nullable: false),
|
amount = table.Column<decimal>(type: "numeric", nullable: false),
|
||||||
expired_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
expired_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
@@ -790,25 +1127,56 @@ namespace DysonNetwork.Pass.Migrations
|
|||||||
table: "action_logs",
|
table: "action_logs",
|
||||||
column: "account_id");
|
column: "account_id");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "ix_affiliation_results_spell_id",
|
||||||
|
table: "affiliation_results",
|
||||||
|
column: "spell_id");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "ix_affiliation_spells_account_id",
|
||||||
|
table: "affiliation_spells",
|
||||||
|
column: "account_id");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "ix_affiliation_spells_spell",
|
||||||
|
table: "affiliation_spells",
|
||||||
|
column: "spell",
|
||||||
|
unique: true);
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "ix_api_keys_account_id",
|
||||||
|
table: "api_keys",
|
||||||
|
column: "account_id");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "ix_api_keys_session_id",
|
||||||
|
table: "api_keys",
|
||||||
|
column: "session_id");
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "ix_auth_challenges_account_id",
|
name: "ix_auth_challenges_account_id",
|
||||||
table: "auth_challenges",
|
table: "auth_challenges",
|
||||||
column: "account_id");
|
column: "account_id");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "ix_auth_clients_account_id",
|
||||||
|
table: "auth_clients",
|
||||||
|
column: "account_id");
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "ix_auth_sessions_account_id",
|
name: "ix_auth_sessions_account_id",
|
||||||
table: "auth_sessions",
|
table: "auth_sessions",
|
||||||
column: "account_id");
|
column: "account_id");
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "ix_auth_sessions_app_id",
|
name: "ix_auth_sessions_client_id",
|
||||||
table: "auth_sessions",
|
table: "auth_sessions",
|
||||||
column: "app_id");
|
column: "client_id");
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "ix_auth_sessions_challenge_id",
|
name: "ix_auth_sessions_parent_session_id",
|
||||||
table: "auth_sessions",
|
table: "auth_sessions",
|
||||||
column: "challenge_id");
|
column: "parent_session_id");
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "ix_badges_account_id",
|
name: "ix_badges_account_id",
|
||||||
@@ -816,9 +1184,14 @@ namespace DysonNetwork.Pass.Migrations
|
|||||||
column: "account_id");
|
column: "account_id");
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "ix_custom_app_secrets_app_id",
|
name: "ix_experience_records_account_id",
|
||||||
table: "custom_app_secrets",
|
table: "experience_records",
|
||||||
column: "app_id");
|
column: "account_id");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "ix_lotteries_account_id",
|
||||||
|
table: "lotteries",
|
||||||
|
column: "account_id");
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "ix_magic_spells_account_id",
|
name: "ix_magic_spells_account_id",
|
||||||
@@ -831,22 +1204,6 @@ namespace DysonNetwork.Pass.Migrations
|
|||||||
column: "spell",
|
column: "spell",
|
||||||
unique: true);
|
unique: true);
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_notification_push_subscriptions_account_id",
|
|
||||||
table: "notification_push_subscriptions",
|
|
||||||
column: "account_id");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_notification_push_subscriptions_device_token_device_id_acco",
|
|
||||||
table: "notification_push_subscriptions",
|
|
||||||
columns: new[] { "device_token", "device_id", "account_id" },
|
|
||||||
unique: true);
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_notifications_account_id",
|
|
||||||
table: "notifications",
|
|
||||||
column: "account_id");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "ix_payment_orders_payee_wallet_id",
|
name: "ix_payment_orders_payee_wallet_id",
|
||||||
table: "payment_orders",
|
table: "payment_orders",
|
||||||
@@ -873,9 +1230,76 @@ namespace DysonNetwork.Pass.Migrations
|
|||||||
column: "group_id");
|
column: "group_id");
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "ix_permission_nodes_key_area_actor",
|
name: "ix_permission_nodes_key_actor",
|
||||||
table: "permission_nodes",
|
table: "permission_nodes",
|
||||||
columns: new[] { "key", "area", "actor" });
|
columns: new[] { "key", "actor" });
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "ix_presence_activities_account_id",
|
||||||
|
table: "presence_activities",
|
||||||
|
column: "account_id");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "ix_punishments_account_id",
|
||||||
|
table: "punishments",
|
||||||
|
column: "account_id");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "ix_realms_slug",
|
||||||
|
table: "realms",
|
||||||
|
column: "slug",
|
||||||
|
unique: true);
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "ix_social_credit_records_account_id",
|
||||||
|
table: "social_credit_records",
|
||||||
|
column: "account_id");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "ix_wallet_fund_recipients_fund_id",
|
||||||
|
table: "wallet_fund_recipients",
|
||||||
|
column: "fund_id");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "ix_wallet_fund_recipients_recipient_account_id",
|
||||||
|
table: "wallet_fund_recipients",
|
||||||
|
column: "recipient_account_id");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "ix_wallet_funds_creator_account_id",
|
||||||
|
table: "wallet_funds",
|
||||||
|
column: "creator_account_id");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "ix_wallet_gifts_coupon_id",
|
||||||
|
table: "wallet_gifts",
|
||||||
|
column: "coupon_id");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "ix_wallet_gifts_gift_code",
|
||||||
|
table: "wallet_gifts",
|
||||||
|
column: "gift_code");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "ix_wallet_gifts_gifter_id",
|
||||||
|
table: "wallet_gifts",
|
||||||
|
column: "gifter_id");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "ix_wallet_gifts_recipient_id",
|
||||||
|
table: "wallet_gifts",
|
||||||
|
column: "recipient_id");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "ix_wallet_gifts_redeemer_id",
|
||||||
|
table: "wallet_gifts",
|
||||||
|
column: "redeemer_id");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "ix_wallet_gifts_subscription_id",
|
||||||
|
table: "wallet_gifts",
|
||||||
|
column: "subscription_id",
|
||||||
|
unique: true);
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "ix_wallet_pockets_wallet_id",
|
name: "ix_wallet_pockets_wallet_id",
|
||||||
@@ -887,6 +1311,16 @@ namespace DysonNetwork.Pass.Migrations
|
|||||||
table: "wallet_subscriptions",
|
table: "wallet_subscriptions",
|
||||||
column: "account_id");
|
column: "account_id");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "ix_wallet_subscriptions_account_id_identifier",
|
||||||
|
table: "wallet_subscriptions",
|
||||||
|
columns: new[] { "account_id", "identifier" });
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "ix_wallet_subscriptions_account_id_is_active",
|
||||||
|
table: "wallet_subscriptions",
|
||||||
|
columns: new[] { "account_id", "is_active" });
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "ix_wallet_subscriptions_coupon_id",
|
name: "ix_wallet_subscriptions_coupon_id",
|
||||||
table: "wallet_subscriptions",
|
table: "wallet_subscriptions",
|
||||||
@@ -897,6 +1331,11 @@ namespace DysonNetwork.Pass.Migrations
|
|||||||
table: "wallet_subscriptions",
|
table: "wallet_subscriptions",
|
||||||
column: "identifier");
|
column: "identifier");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "ix_wallet_subscriptions_status",
|
||||||
|
table: "wallet_subscriptions",
|
||||||
|
column: "status");
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "ix_wallets_account_id",
|
name: "ix_wallets_account_id",
|
||||||
table: "wallets",
|
table: "wallets",
|
||||||
@@ -934,23 +1373,29 @@ namespace DysonNetwork.Pass.Migrations
|
|||||||
name: "action_logs");
|
name: "action_logs");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "auth_sessions");
|
name: "affiliation_results");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "api_keys");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "auth_challenges");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "badges");
|
name: "badges");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "custom_app_secrets");
|
name: "experience_records");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "lotteries");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "lottery_records");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "magic_spells");
|
name: "magic_spells");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "notification_push_subscriptions");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "notifications");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "payment_orders");
|
name: "payment_orders");
|
||||||
|
|
||||||
@@ -960,17 +1405,32 @@ namespace DysonNetwork.Pass.Migrations
|
|||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "permission_nodes");
|
name: "permission_nodes");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "presence_activities");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "punishments");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "realm_members");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "social_credit_records");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "wallet_fund_recipients");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "wallet_gifts");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "wallet_pockets");
|
name: "wallet_pockets");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "wallet_subscriptions");
|
name: "affiliation_spells");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "auth_challenges");
|
name: "auth_sessions");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "custom_apps");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "payment_transactions");
|
name: "payment_transactions");
|
||||||
@@ -979,11 +1439,23 @@ namespace DysonNetwork.Pass.Migrations
|
|||||||
name: "permission_groups");
|
name: "permission_groups");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "wallet_coupons");
|
name: "realms");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "wallet_funds");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "wallet_subscriptions");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "auth_clients");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "wallets");
|
name: "wallets");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "wallet_coupons");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "accounts");
|
name: "accounts");
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user