Lets try this
This commit is contained in:
@@ -54,8 +54,4 @@
|
|||||||
<ProjectReference Include="..\..\LightlessAPI\LightlessSyncAPI\LightlessSync.API.csproj" />
|
<ProjectReference Include="..\..\LightlessAPI\LightlessSyncAPI\LightlessSync.API.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="LightlessSyncServer\Migrations\" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -1,736 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace LightlessSyncServer.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class AddBannedUid : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "banned_registrations",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
discord_id_or_lodestone_auth = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_banned_registrations", x => x.discord_id_or_lodestone_auth);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "banned_users",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
character_identification = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: false),
|
|
||||||
reason = table.Column<string>(type: "text", nullable: true),
|
|
||||||
banned_uid = table.Column<string>(type: "text", nullable: true),
|
|
||||||
timestamp = table.Column<byte[]>(type: "bytea", rowVersion: true, nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_banned_users", x => x.character_identification);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "forbidden_upload_entries",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
hash = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false),
|
|
||||||
forbidden_by = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: true),
|
|
||||||
timestamp = table.Column<byte[]>(type: "bytea", rowVersion: true, nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_forbidden_upload_entries", x => x.hash);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "users",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
uid = table.Column<string>(type: "character varying(10)", maxLength: 10, nullable: false),
|
|
||||||
timestamp = table.Column<byte[]>(type: "bytea", rowVersion: true, nullable: true),
|
|
||||||
is_moderator = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
is_admin = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
last_logged_in = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
|
||||||
alias = table.Column<string>(type: "character varying(15)", maxLength: 15, nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_users", x => x.uid);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "auth",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
hashed_key = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false),
|
|
||||||
user_uid = table.Column<string>(type: "character varying(10)", nullable: true),
|
|
||||||
mark_for_ban = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
is_banned = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
primary_user_uid = table.Column<string>(type: "character varying(10)", nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_auth", x => x.hashed_key);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_auth_users_primary_user_uid",
|
|
||||||
column: x => x.primary_user_uid,
|
|
||||||
principalTable: "users",
|
|
||||||
principalColumn: "uid");
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_auth_users_user_uid",
|
|
||||||
column: x => x.user_uid,
|
|
||||||
principalTable: "users",
|
|
||||||
principalColumn: "uid");
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "chara_data",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
id = table.Column<string>(type: "text", nullable: false),
|
|
||||||
uploader_uid = table.Column<string>(type: "character varying(10)", nullable: false),
|
|
||||||
created_date = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
|
||||||
updated_date = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
|
||||||
description = table.Column<string>(type: "text", nullable: true),
|
|
||||||
access_type = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
share_type = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
expiry_date = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
|
|
||||||
glamourer_data = table.Column<string>(type: "text", nullable: true),
|
|
||||||
customize_data = table.Column<string>(type: "text", nullable: true),
|
|
||||||
manipulation_data = table.Column<string>(type: "text", nullable: true),
|
|
||||||
download_count = table.Column<int>(type: "integer", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_chara_data", x => new { x.id, x.uploader_uid });
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_chara_data_users_uploader_uid",
|
|
||||||
column: x => x.uploader_uid,
|
|
||||||
principalTable: "users",
|
|
||||||
principalColumn: "uid",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "client_pairs",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
user_uid = table.Column<string>(type: "character varying(10)", maxLength: 10, nullable: false),
|
|
||||||
other_user_uid = table.Column<string>(type: "character varying(10)", maxLength: 10, nullable: false),
|
|
||||||
timestamp = table.Column<byte[]>(type: "bytea", rowVersion: true, nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_client_pairs", x => new { x.user_uid, x.other_user_uid });
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_client_pairs_users_other_user_uid",
|
|
||||||
column: x => x.other_user_uid,
|
|
||||||
principalTable: "users",
|
|
||||||
principalColumn: "uid",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_client_pairs_users_user_uid",
|
|
||||||
column: x => x.user_uid,
|
|
||||||
principalTable: "users",
|
|
||||||
principalColumn: "uid",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "file_caches",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
hash = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false),
|
|
||||||
uploader_uid = table.Column<string>(type: "character varying(10)", maxLength: 10, nullable: true),
|
|
||||||
uploaded = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
upload_date = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
|
||||||
timestamp = table.Column<byte[]>(type: "bytea", rowVersion: true, nullable: true),
|
|
||||||
size = table.Column<long>(type: "bigint", nullable: false),
|
|
||||||
raw_size = table.Column<long>(type: "bigint", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_file_caches", x => x.hash);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_file_caches_users_uploader_uid",
|
|
||||||
column: x => x.uploader_uid,
|
|
||||||
principalTable: "users",
|
|
||||||
principalColumn: "uid");
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "groups",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
gid = table.Column<string>(type: "character varying(20)", maxLength: 20, nullable: false),
|
|
||||||
owner_uid = table.Column<string>(type: "character varying(10)", nullable: true),
|
|
||||||
alias = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: true),
|
|
||||||
invites_enabled = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
hashed_password = table.Column<string>(type: "text", nullable: true),
|
|
||||||
prefer_disable_sounds = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
prefer_disable_animations = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
prefer_disable_vfx = table.Column<bool>(type: "boolean", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_groups", x => x.gid);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_groups_users_owner_uid",
|
|
||||||
column: x => x.owner_uid,
|
|
||||||
principalTable: "users",
|
|
||||||
principalColumn: "uid");
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "lodestone_auth",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
discord_id = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
|
||||||
hashed_lodestone_id = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: true),
|
|
||||||
lodestone_auth_string = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: true),
|
|
||||||
user_uid = table.Column<string>(type: "character varying(10)", nullable: true),
|
|
||||||
started_at = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_lodestone_auth", x => x.discord_id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_lodestone_auth_users_user_uid",
|
|
||||||
column: x => x.user_uid,
|
|
||||||
principalTable: "users",
|
|
||||||
principalColumn: "uid");
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "user_default_preferred_permissions",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
user_uid = table.Column<string>(type: "character varying(10)", maxLength: 10, nullable: false),
|
|
||||||
disable_individual_animations = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
disable_individual_sounds = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
disable_individual_vfx = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
disable_group_animations = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
disable_group_sounds = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
disable_group_vfx = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
individual_is_sticky = table.Column<bool>(type: "boolean", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_user_default_preferred_permissions", x => x.user_uid);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_user_default_preferred_permissions_users_user_uid",
|
|
||||||
column: x => x.user_uid,
|
|
||||||
principalTable: "users",
|
|
||||||
principalColumn: "uid",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "user_permission_sets",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
user_uid = table.Column<string>(type: "character varying(10)", nullable: false),
|
|
||||||
other_user_uid = table.Column<string>(type: "character varying(10)", nullable: false),
|
|
||||||
sticky = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
is_paused = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
disable_animations = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
disable_vfx = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
disable_sounds = table.Column<bool>(type: "boolean", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_user_permission_sets", x => new { x.user_uid, x.other_user_uid });
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_user_permission_sets_users_other_user_uid",
|
|
||||||
column: x => x.other_user_uid,
|
|
||||||
principalTable: "users",
|
|
||||||
principalColumn: "uid",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_user_permission_sets_users_user_uid",
|
|
||||||
column: x => x.user_uid,
|
|
||||||
principalTable: "users",
|
|
||||||
principalColumn: "uid",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "user_profile_data",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
user_uid = table.Column<string>(type: "character varying(10)", nullable: false),
|
|
||||||
base64profile_image = table.Column<string>(type: "text", nullable: true),
|
|
||||||
flagged_for_report = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
is_nsfw = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
profile_disabled = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
user_description = table.Column<string>(type: "text", nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_user_profile_data", x => x.user_uid);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_user_profile_data_users_user_uid",
|
|
||||||
column: x => x.user_uid,
|
|
||||||
principalTable: "users",
|
|
||||||
principalColumn: "uid",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "chara_data_file_swaps",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
parent_id = table.Column<string>(type: "text", nullable: false),
|
|
||||||
parent_uploader_uid = table.Column<string>(type: "character varying(10)", nullable: false),
|
|
||||||
game_path = table.Column<string>(type: "text", nullable: false),
|
|
||||||
file_path = table.Column<string>(type: "text", nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_chara_data_file_swaps", x => new { x.parent_id, x.parent_uploader_uid, x.game_path });
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_chara_data_file_swaps_chara_data_parent_id_parent_uploader_",
|
|
||||||
columns: x => new { x.parent_id, x.parent_uploader_uid },
|
|
||||||
principalTable: "chara_data",
|
|
||||||
principalColumns: new[] { "id", "uploader_uid" },
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "chara_data_orig_files",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
parent_id = table.Column<string>(type: "text", nullable: false),
|
|
||||||
parent_uploader_uid = table.Column<string>(type: "character varying(10)", nullable: false),
|
|
||||||
game_path = table.Column<string>(type: "text", nullable: false),
|
|
||||||
hash = table.Column<string>(type: "text", nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_chara_data_orig_files", x => new { x.parent_id, x.parent_uploader_uid, x.game_path });
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_chara_data_orig_files_chara_data_parent_id_parent_uploader_",
|
|
||||||
columns: x => new { x.parent_id, x.parent_uploader_uid },
|
|
||||||
principalTable: "chara_data",
|
|
||||||
principalColumns: new[] { "id", "uploader_uid" },
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "chara_data_poses",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
id = table.Column<long>(type: "bigint", nullable: false)
|
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
||||||
parent_id = table.Column<string>(type: "text", nullable: false),
|
|
||||||
parent_uploader_uid = table.Column<string>(type: "character varying(10)", nullable: false),
|
|
||||||
description = table.Column<string>(type: "text", nullable: true),
|
|
||||||
pose_data = table.Column<string>(type: "text", nullable: true),
|
|
||||||
world_data = table.Column<string>(type: "text", nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_chara_data_poses", x => new { x.parent_id, x.parent_uploader_uid, x.id });
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_chara_data_poses_chara_data_parent_id_parent_uploader_uid",
|
|
||||||
columns: x => new { x.parent_id, x.parent_uploader_uid },
|
|
||||||
principalTable: "chara_data",
|
|
||||||
principalColumns: new[] { "id", "uploader_uid" },
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "chara_data_files",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
game_path = table.Column<string>(type: "text", nullable: false),
|
|
||||||
parent_id = table.Column<string>(type: "text", nullable: false),
|
|
||||||
parent_uploader_uid = table.Column<string>(type: "character varying(10)", nullable: false),
|
|
||||||
file_cache_hash = table.Column<string>(type: "character varying(40)", nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_chara_data_files", x => new { x.parent_id, x.parent_uploader_uid, x.game_path });
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_chara_data_files_chara_data_parent_id_parent_uploader_uid",
|
|
||||||
columns: x => new { x.parent_id, x.parent_uploader_uid },
|
|
||||||
principalTable: "chara_data",
|
|
||||||
principalColumns: new[] { "id", "uploader_uid" },
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_chara_data_files_files_file_cache_hash",
|
|
||||||
column: x => x.file_cache_hash,
|
|
||||||
principalTable: "file_caches",
|
|
||||||
principalColumn: "hash",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "chara_data_allowance",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
id = table.Column<long>(type: "bigint", nullable: false)
|
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
||||||
parent_id = table.Column<string>(type: "text", nullable: false),
|
|
||||||
parent_uploader_uid = table.Column<string>(type: "character varying(10)", nullable: false),
|
|
||||||
allowed_user_uid = table.Column<string>(type: "character varying(10)", nullable: true),
|
|
||||||
allowed_group_gid = table.Column<string>(type: "character varying(20)", nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_chara_data_allowance", x => new { x.parent_id, x.parent_uploader_uid, x.id });
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_chara_data_allowance_chara_data_parent_id_parent_uploader_u",
|
|
||||||
columns: x => new { x.parent_id, x.parent_uploader_uid },
|
|
||||||
principalTable: "chara_data",
|
|
||||||
principalColumns: new[] { "id", "uploader_uid" },
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_chara_data_allowance_groups_allowed_group_gid",
|
|
||||||
column: x => x.allowed_group_gid,
|
|
||||||
principalTable: "groups",
|
|
||||||
principalColumn: "gid",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_chara_data_allowance_users_allowed_user_uid",
|
|
||||||
column: x => x.allowed_user_uid,
|
|
||||||
principalTable: "users",
|
|
||||||
principalColumn: "uid",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "group_bans",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
group_gid = table.Column<string>(type: "character varying(20)", nullable: false),
|
|
||||||
banned_user_uid = table.Column<string>(type: "character varying(10)", nullable: false),
|
|
||||||
banned_by_uid = table.Column<string>(type: "character varying(10)", nullable: true),
|
|
||||||
banned_on = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
|
||||||
banned_reason = table.Column<string>(type: "text", nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_group_bans", x => new { x.group_gid, x.banned_user_uid });
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_group_bans_groups_group_gid",
|
|
||||||
column: x => x.group_gid,
|
|
||||||
principalTable: "groups",
|
|
||||||
principalColumn: "gid",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_group_bans_users_banned_by_uid",
|
|
||||||
column: x => x.banned_by_uid,
|
|
||||||
principalTable: "users",
|
|
||||||
principalColumn: "uid");
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_group_bans_users_banned_user_uid",
|
|
||||||
column: x => x.banned_user_uid,
|
|
||||||
principalTable: "users",
|
|
||||||
principalColumn: "uid",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "group_pair_preferred_permissions",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
group_gid = table.Column<string>(type: "character varying(20)", nullable: false),
|
|
||||||
user_uid = table.Column<string>(type: "character varying(10)", nullable: false),
|
|
||||||
is_paused = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
disable_animations = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
disable_sounds = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
disable_vfx = table.Column<bool>(type: "boolean", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_group_pair_preferred_permissions", x => new { x.user_uid, x.group_gid });
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_group_pair_preferred_permissions_groups_group_gid",
|
|
||||||
column: x => x.group_gid,
|
|
||||||
principalTable: "groups",
|
|
||||||
principalColumn: "gid",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_group_pair_preferred_permissions_users_user_uid",
|
|
||||||
column: x => x.user_uid,
|
|
||||||
principalTable: "users",
|
|
||||||
principalColumn: "uid",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "group_pairs",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
group_gid = table.Column<string>(type: "character varying(20)", nullable: false),
|
|
||||||
group_user_uid = table.Column<string>(type: "character varying(10)", nullable: false),
|
|
||||||
is_pinned = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
is_moderator = table.Column<bool>(type: "boolean", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_group_pairs", x => new { x.group_gid, x.group_user_uid });
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_group_pairs_groups_group_gid",
|
|
||||||
column: x => x.group_gid,
|
|
||||||
principalTable: "groups",
|
|
||||||
principalColumn: "gid",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_group_pairs_users_group_user_uid",
|
|
||||||
column: x => x.group_user_uid,
|
|
||||||
principalTable: "users",
|
|
||||||
principalColumn: "uid",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "group_temp_invites",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
group_gid = table.Column<string>(type: "character varying(20)", nullable: false),
|
|
||||||
invite = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false),
|
|
||||||
expiration_date = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_group_temp_invites", x => new { x.group_gid, x.invite });
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_group_temp_invites_groups_group_gid",
|
|
||||||
column: x => x.group_gid,
|
|
||||||
principalTable: "groups",
|
|
||||||
principalColumn: "gid",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_auth_primary_user_uid",
|
|
||||||
table: "auth",
|
|
||||||
column: "primary_user_uid");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_auth_user_uid",
|
|
||||||
table: "auth",
|
|
||||||
column: "user_uid");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_chara_data_id",
|
|
||||||
table: "chara_data",
|
|
||||||
column: "id");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_chara_data_uploader_uid",
|
|
||||||
table: "chara_data",
|
|
||||||
column: "uploader_uid");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_chara_data_allowance_allowed_group_gid",
|
|
||||||
table: "chara_data_allowance",
|
|
||||||
column: "allowed_group_gid");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_chara_data_allowance_allowed_user_uid",
|
|
||||||
table: "chara_data_allowance",
|
|
||||||
column: "allowed_user_uid");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_chara_data_allowance_parent_id",
|
|
||||||
table: "chara_data_allowance",
|
|
||||||
column: "parent_id");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_chara_data_file_swaps_parent_id",
|
|
||||||
table: "chara_data_file_swaps",
|
|
||||||
column: "parent_id");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_chara_data_files_file_cache_hash",
|
|
||||||
table: "chara_data_files",
|
|
||||||
column: "file_cache_hash");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_chara_data_files_parent_id",
|
|
||||||
table: "chara_data_files",
|
|
||||||
column: "parent_id");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_chara_data_orig_files_parent_id",
|
|
||||||
table: "chara_data_orig_files",
|
|
||||||
column: "parent_id");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_chara_data_poses_parent_id",
|
|
||||||
table: "chara_data_poses",
|
|
||||||
column: "parent_id");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_client_pairs_other_user_uid",
|
|
||||||
table: "client_pairs",
|
|
||||||
column: "other_user_uid");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_client_pairs_user_uid",
|
|
||||||
table: "client_pairs",
|
|
||||||
column: "user_uid");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_file_caches_uploader_uid",
|
|
||||||
table: "file_caches",
|
|
||||||
column: "uploader_uid");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_group_bans_banned_by_uid",
|
|
||||||
table: "group_bans",
|
|
||||||
column: "banned_by_uid");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_group_bans_banned_user_uid",
|
|
||||||
table: "group_bans",
|
|
||||||
column: "banned_user_uid");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_group_bans_group_gid",
|
|
||||||
table: "group_bans",
|
|
||||||
column: "group_gid");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_group_pair_preferred_permissions_group_gid",
|
|
||||||
table: "group_pair_preferred_permissions",
|
|
||||||
column: "group_gid");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_group_pair_preferred_permissions_user_uid",
|
|
||||||
table: "group_pair_preferred_permissions",
|
|
||||||
column: "user_uid");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_group_pairs_group_gid",
|
|
||||||
table: "group_pairs",
|
|
||||||
column: "group_gid");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_group_pairs_group_user_uid",
|
|
||||||
table: "group_pairs",
|
|
||||||
column: "group_user_uid");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_group_temp_invites_group_gid",
|
|
||||||
table: "group_temp_invites",
|
|
||||||
column: "group_gid");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_group_temp_invites_invite",
|
|
||||||
table: "group_temp_invites",
|
|
||||||
column: "invite");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_groups_owner_uid",
|
|
||||||
table: "groups",
|
|
||||||
column: "owner_uid");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_lodestone_auth_user_uid",
|
|
||||||
table: "lodestone_auth",
|
|
||||||
column: "user_uid");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_user_default_preferred_permissions_user_uid",
|
|
||||||
table: "user_default_preferred_permissions",
|
|
||||||
column: "user_uid");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_user_permission_sets_other_user_uid",
|
|
||||||
table: "user_permission_sets",
|
|
||||||
column: "other_user_uid");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_user_permission_sets_user_uid",
|
|
||||||
table: "user_permission_sets",
|
|
||||||
column: "user_uid");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_user_permission_sets_user_uid_other_user_uid_is_paused",
|
|
||||||
table: "user_permission_sets",
|
|
||||||
columns: new[] { "user_uid", "other_user_uid", "is_paused" });
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "auth");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "banned_registrations");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "banned_users");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "chara_data_allowance");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "chara_data_file_swaps");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "chara_data_files");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "chara_data_orig_files");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "chara_data_poses");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "client_pairs");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "forbidden_upload_entries");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "group_bans");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "group_pair_preferred_permissions");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "group_pairs");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "group_temp_invites");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "lodestone_auth");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "user_default_preferred_permissions");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "user_permission_sets");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "user_profile_data");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "file_caches");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "chara_data");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "groups");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "users");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -12,7 +12,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|||||||
namespace LightlessSyncServer.Migrations
|
namespace LightlessSyncServer.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(LightlessDbContext))]
|
[DbContext(typeof(LightlessDbContext))]
|
||||||
[Migration("20250905161830_AddBannedUid")]
|
[Migration("20250905190334_AddBannedUid")]
|
||||||
partial class AddBannedUid
|
partial class AddBannedUid
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace LightlessSyncServer.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class AddBannedUid : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user