Préparation feature 2.0
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace MareSynchronosServer.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class SyncshellDiscovery : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "auto_detect_visible",
|
||||
table: "groups",
|
||||
type: "boolean",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "password_temporarily_disabled",
|
||||
table: "groups",
|
||||
type: "boolean",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "auto_detect_visible",
|
||||
table: "groups");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "password_temporarily_disabled",
|
||||
table: "groups");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace MareSynchronosServer.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class McdfShare : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "mcdf_shares",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
owner_uid = table.Column<string>(type: "character varying(10)", nullable: false),
|
||||
description = table.Column<string>(type: "text", nullable: false),
|
||||
cipher_data = table.Column<byte[]>(type: "bytea", nullable: false),
|
||||
nonce = table.Column<byte[]>(type: "bytea", nullable: false),
|
||||
salt = table.Column<byte[]>(type: "bytea", nullable: false),
|
||||
tag = table.Column<byte[]>(type: "bytea", nullable: false),
|
||||
created_utc = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
||||
updated_utc = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
|
||||
expires_at_utc = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
|
||||
download_count = table.Column<int>(type: "integer", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_mcdf_shares", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "fk_mcdf_shares_users_owner_uid",
|
||||
column: x => x.owner_uid,
|
||||
principalTable: "users",
|
||||
principalColumn: "uid",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "mcdf_share_allowed_groups",
|
||||
columns: table => new
|
||||
{
|
||||
share_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
allowed_group_gid = table.Column<string>(type: "character varying(20)", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_mcdf_share_allowed_groups", x => new { x.share_id, x.allowed_group_gid });
|
||||
table.ForeignKey(
|
||||
name: "fk_mcdf_share_allowed_groups_mcdf_shares_share_id",
|
||||
column: x => x.share_id,
|
||||
principalTable: "mcdf_shares",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "mcdf_share_allowed_users",
|
||||
columns: table => new
|
||||
{
|
||||
share_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
allowed_individual_uid = table.Column<string>(type: "character varying(10)", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_mcdf_share_allowed_users", x => new { x.share_id, x.allowed_individual_uid });
|
||||
table.ForeignKey(
|
||||
name: "fk_mcdf_share_allowed_users_mcdf_shares_share_id",
|
||||
column: x => x.share_id,
|
||||
principalTable: "mcdf_shares",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_mcdf_share_allowed_groups_allowed_group_gid",
|
||||
table: "mcdf_share_allowed_groups",
|
||||
column: "allowed_group_gid");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_mcdf_share_allowed_users_allowed_individual_uid",
|
||||
table: "mcdf_share_allowed_users",
|
||||
column: "allowed_individual_uid");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_mcdf_shares_owner_uid",
|
||||
table: "mcdf_shares",
|
||||
column: "owner_uid");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "mcdf_share_allowed_groups");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "mcdf_share_allowed_users");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "mcdf_shares");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -454,6 +454,10 @@ namespace MareSynchronosServer.Migrations
|
||||
.HasColumnType("boolean")
|
||||
.HasColumnName("disable_vfx");
|
||||
|
||||
b.Property<bool>("AutoDetectVisible")
|
||||
.HasColumnType("boolean")
|
||||
.HasColumnName("auto_detect_visible");
|
||||
|
||||
b.Property<string>("HashedPassword")
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("hashed_password");
|
||||
@@ -462,10 +466,22 @@ namespace MareSynchronosServer.Migrations
|
||||
.HasColumnType("boolean")
|
||||
.HasColumnName("is_temporary");
|
||||
|
||||
b.Property<bool>("PasswordTemporarilyDisabled")
|
||||
.HasColumnType("boolean")
|
||||
.HasColumnName("password_temporarily_disabled");
|
||||
|
||||
b.Property<bool>("InvitesEnabled")
|
||||
.HasColumnType("boolean")
|
||||
.HasColumnName("invites_enabled");
|
||||
|
||||
b.Property<bool>("AutoDetectVisible")
|
||||
.HasColumnType("boolean")
|
||||
.HasColumnName("auto_detect_visible");
|
||||
|
||||
b.Property<bool>("PasswordTemporarilyDisabled")
|
||||
.HasColumnType("boolean")
|
||||
.HasColumnName("password_temporarily_disabled");
|
||||
|
||||
b.Property<string>("OwnerUID")
|
||||
.HasColumnType("character varying(10)")
|
||||
.HasColumnName("owner_uid");
|
||||
@@ -479,6 +495,99 @@ namespace MareSynchronosServer.Migrations
|
||||
b.ToTable("groups", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("MareSynchronosShared.Models.McdfShare", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<byte[]>("CipherData")
|
||||
.HasColumnType("bytea")
|
||||
.HasColumnName("cipher_data");
|
||||
|
||||
b.Property<DateTime>("CreatedUtc")
|
||||
.HasColumnType("timestamp with time zone")
|
||||
.HasColumnName("created_utc");
|
||||
|
||||
b.Property<int>("DownloadCount")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("download_count");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("description");
|
||||
|
||||
b.Property<DateTime?>("ExpiresAtUtc")
|
||||
.HasColumnType("timestamp with time zone")
|
||||
.HasColumnName("expires_at_utc");
|
||||
|
||||
b.Property<byte[]>("Nonce")
|
||||
.HasColumnType("bytea")
|
||||
.HasColumnName("nonce");
|
||||
|
||||
b.Property<string>("OwnerUID")
|
||||
.HasColumnType("character varying(10)")
|
||||
.HasColumnName("owner_uid");
|
||||
|
||||
b.Property<byte[]>("Salt")
|
||||
.HasColumnType("bytea")
|
||||
.HasColumnName("salt");
|
||||
|
||||
b.Property<byte[]>("Tag")
|
||||
.HasColumnType("bytea")
|
||||
.HasColumnName("tag");
|
||||
|
||||
b.Property<DateTime?>("UpdatedUtc")
|
||||
.HasColumnType("timestamp with time zone")
|
||||
.HasColumnName("updated_utc");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_mcdf_shares");
|
||||
|
||||
b.HasIndex("OwnerUID")
|
||||
.HasDatabaseName("ix_mcdf_shares_owner_uid");
|
||||
|
||||
b.ToTable("mcdf_shares", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("MareSynchronosShared.Models.McdfShareAllowedGroup", b =>
|
||||
{
|
||||
b.Property<Guid>("ShareId")
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("share_id");
|
||||
|
||||
b.Property<string>("AllowedGroupGid")
|
||||
.HasColumnType("character varying(20)")
|
||||
.HasColumnName("allowed_group_gid");
|
||||
|
||||
b.HasKey("ShareId", "AllowedGroupGid")
|
||||
.HasName("pk_mcdf_share_allowed_groups");
|
||||
|
||||
b.HasIndex("AllowedGroupGid")
|
||||
.HasDatabaseName("ix_mcdf_share_allowed_groups_allowed_group_gid");
|
||||
|
||||
b.ToTable("mcdf_share_allowed_groups", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("MareSynchronosShared.Models.McdfShareAllowedUser", b =>
|
||||
{
|
||||
b.Property<Guid>("ShareId")
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("share_id");
|
||||
|
||||
b.Property<string>("AllowedIndividualUid")
|
||||
.HasColumnType("character varying(10)")
|
||||
.HasColumnName("allowed_individual_uid");
|
||||
|
||||
b.HasKey("ShareId", "AllowedIndividualUid")
|
||||
.HasName("pk_mcdf_share_allowed_users");
|
||||
|
||||
b.HasIndex("AllowedIndividualUid")
|
||||
.HasDatabaseName("ix_mcdf_share_allowed_users_allowed_individual_uid");
|
||||
|
||||
b.ToTable("mcdf_share_allowed_users", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("MareSynchronosShared.Models.GroupBan", b =>
|
||||
{
|
||||
b.Property<string>("GroupGID")
|
||||
@@ -745,6 +854,13 @@ namespace MareSynchronosServer.Migrations
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("MareSynchronosShared.Models.McdfShare", b =>
|
||||
{
|
||||
b.Navigation("AllowedIndividuals");
|
||||
|
||||
b.Navigation("AllowedSyncshells");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("MareSynchronosShared.Models.CharaData", b =>
|
||||
{
|
||||
b.HasOne("MareSynchronosShared.Models.User", "Uploader")
|
||||
@@ -943,6 +1059,42 @@ namespace MareSynchronosServer.Migrations
|
||||
b.Navigation("Group");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("MareSynchronosShared.Models.McdfShare", b =>
|
||||
{
|
||||
b.HasOne("MareSynchronosShared.Models.User", "Owner")
|
||||
.WithMany()
|
||||
.HasForeignKey("OwnerUID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired()
|
||||
.HasConstraintName("fk_mcdf_shares_users_owner_uid");
|
||||
|
||||
b.Navigation("Owner");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("MareSynchronosShared.Models.McdfShareAllowedGroup", b =>
|
||||
{
|
||||
b.HasOne("MareSynchronosShared.Models.McdfShare", "Share")
|
||||
.WithMany("AllowedSyncshells")
|
||||
.HasForeignKey("ShareId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired()
|
||||
.HasConstraintName("fk_mcdf_share_allowed_groups_mcdf_shares_share_id");
|
||||
|
||||
b.Navigation("Share");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("MareSynchronosShared.Models.McdfShareAllowedUser", b =>
|
||||
{
|
||||
b.HasOne("MareSynchronosShared.Models.McdfShare", "Share")
|
||||
.WithMany("AllowedIndividuals")
|
||||
.HasForeignKey("ShareId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired()
|
||||
.HasConstraintName("fk_mcdf_share_allowed_users_mcdf_shares_share_id");
|
||||
|
||||
b.Navigation("Share");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("MareSynchronosShared.Models.LodeStoneAuth", b =>
|
||||
{
|
||||
b.HasOne("MareSynchronosShared.Models.User", "User")
|
||||
|
||||
Reference in New Issue
Block a user