Recreate recent activity migrations

This commit is contained in:
Slendy 2024-05-13 22:30:04 -05:00
commit 1e276923d6
No known key found for this signature in database
GPG key ID: 7288D68361B91428
8 changed files with 766 additions and 187 deletions

View file

@ -1,33 +0,0 @@
using System;
using LBPUnion.ProjectLighthouse.Database;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace ProjectLighthouse.Migrations
{
[DbContext(typeof(DatabaseContext))]
[Migration("20240120214606_AddPublishedAtToWebAnnouncements")]
public partial class AddPublishedAtToWebAnnouncements : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<DateTime>(
name: "PublishedAt",
table: "WebsiteAnnouncements",
type: "datetime(6)",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "PublishedAt",
table: "WebsiteAnnouncements");
}
}
}

View file

@ -1,151 +0,0 @@
using System;
using LBPUnion.ProjectLighthouse.Database;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace LBPUnion.ProjectLighthouse.Migrations
{
[DbContext(typeof(DatabaseContext))]
[Migration("20240325034658_InitialActivity")]
public partial class InitialActivity : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Activities",
columns: table => new
{
ActivityId = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Timestamp = table.Column<DateTime>(type: "datetime(6)", nullable: false),
UserId = table.Column<int>(type: "int", nullable: false),
Type = table.Column<int>(type: "int", nullable: false),
Discriminator = table.Column<string>(type: "varchar(34)", maxLength: 34, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
SlotId = table.Column<int>(type: "int", nullable: true),
CommentId = table.Column<int>(type: "int", nullable: true),
PhotoId = table.Column<int>(type: "int", nullable: true),
NewsId = table.Column<int>(type: "int", nullable: true),
PlaylistId = table.Column<int>(type: "int", nullable: true),
ReviewId = table.Column<int>(type: "int", nullable: true),
ScoreId = table.Column<int>(type: "int", nullable: true),
TargetUserId = table.Column<int>(type: "int", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Activities", x => x.ActivityId);
table.ForeignKey(
name: "FK_Activities_Comments_CommentId",
column: x => x.CommentId,
principalTable: "Comments",
principalColumn: "CommentId",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Activities_Photos_PhotoId",
column: x => x.PhotoId,
principalTable: "Photos",
principalColumn: "PhotoId",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Activities_Playlists_PlaylistId",
column: x => x.PlaylistId,
principalTable: "Playlists",
principalColumn: "PlaylistId",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Activities_Reviews_ReviewId",
column: x => x.ReviewId,
principalTable: "Reviews",
principalColumn: "ReviewId",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Activities_Scores_ScoreId",
column: x => x.ScoreId,
principalTable: "Scores",
principalColumn: "ScoreId",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Activities_Slots_SlotId",
column: x => x.SlotId,
principalTable: "Slots",
principalColumn: "SlotId",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Activities_Users_TargetUserId",
column: x => x.TargetUserId,
principalTable: "Users",
principalColumn: "UserId",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Activities_Users_UserId",
column: x => x.UserId,
principalTable: "Users",
principalColumn: "UserId",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Activities_WebsiteAnnouncements_NewsId",
column: x => x.NewsId,
principalTable: "WebsiteAnnouncements",
principalColumn: "AnnouncementId",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_Activities_CommentId",
table: "Activities",
column: "CommentId");
migrationBuilder.CreateIndex(
name: "IX_Activities_NewsId",
table: "Activities",
column: "NewsId");
migrationBuilder.CreateIndex(
name: "IX_Activities_PhotoId",
table: "Activities",
column: "PhotoId");
migrationBuilder.CreateIndex(
name: "IX_Activities_PlaylistId",
table: "Activities",
column: "PlaylistId");
migrationBuilder.CreateIndex(
name: "IX_Activities_ReviewId",
table: "Activities",
column: "ReviewId");
migrationBuilder.CreateIndex(
name: "IX_Activities_ScoreId",
table: "Activities",
column: "ScoreId");
migrationBuilder.CreateIndex(
name: "IX_Activities_SlotId",
table: "Activities",
column: "SlotId");
migrationBuilder.CreateIndex(
name: "IX_Activities_TargetUserId",
table: "Activities",
column: "TargetUserId");
migrationBuilder.CreateIndex(
name: "IX_Activities_UserId",
table: "Activities",
column: "UserId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Activities");
}
}
}

View file

@ -0,0 +1,692 @@
using System;
using LBPUnion.ProjectLighthouse.Database;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace LBPUnion.ProjectLighthouse.Migrations
{
[DbContext(typeof(DatabaseContext))]
[Migration("20240514032512_AddRecentActivity")]
public partial class AddRecentActivity : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<int>(
name: "TokenId",
table: "WebTokens",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "AnnouncementId",
table: "WebsiteAnnouncements",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "VisitedLevelId",
table: "VisitedLevels",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "UserId",
table: "Users",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "SlotId",
table: "Slots",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "ScoreId",
table: "Scores",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "ReviewId",
table: "Reviews",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "ReportId",
table: "Reports",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "TokenId",
table: "RegistrationTokens",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "RatedReviewId",
table: "RatedReviews",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "RatedLevelId",
table: "RatedLevels",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "RatingId",
table: "RatedComments",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "QueuedLevelId",
table: "QueuedLevels",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "PlaylistId",
table: "Playlists",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "PlatformLinkAttemptId",
table: "PlatformLinkAttempts",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "PhotoSubjectId",
table: "PhotoSubjects",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "PhotoId",
table: "Photos",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "TokenId",
table: "PasswordResetTokens",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "Id",
table: "Notifications",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "HeartedProfileId",
table: "HeartedProfiles",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "HeartedPlaylistId",
table: "HeartedPlaylists",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "HeartedLevelId",
table: "HeartedLevels",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "TokenId",
table: "GameTokens",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "EmailVerificationTokenId",
table: "EmailVerificationTokens",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "EmailSetTokenId",
table: "EmailSetTokens",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "CategoryId",
table: "CustomCategories",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "CommentId",
table: "Comments",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "CaseId",
table: "Cases",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "BlockedProfileId",
table: "BlockedProfiles",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "Id",
table: "APIKeys",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.CreateTable(
name: "Activities",
columns: table => new
{
ActivityId = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Timestamp = table.Column<DateTime>(type: "datetime(6)", nullable: false),
UserId = table.Column<int>(type: "int", nullable: false),
Type = table.Column<int>(type: "int", nullable: false),
Discriminator = table.Column<string>(type: "varchar(34)", maxLength: 34, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
SlotId = table.Column<int>(type: "int", nullable: true),
CommentId = table.Column<int>(type: "int", nullable: true),
PhotoId = table.Column<int>(type: "int", nullable: true),
NewsId = table.Column<int>(type: "int", nullable: true),
PlaylistId = table.Column<int>(type: "int", nullable: true),
ReviewId = table.Column<int>(type: "int", nullable: true),
ScoreId = table.Column<int>(type: "int", nullable: true),
Points = table.Column<int>(type: "int", nullable: true),
TargetUserId = table.Column<int>(type: "int", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Activities", x => x.ActivityId);
table.ForeignKey(
name: "FK_Activities_Comments_CommentId",
column: x => x.CommentId,
principalTable: "Comments",
principalColumn: "CommentId",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Activities_Photos_PhotoId",
column: x => x.PhotoId,
principalTable: "Photos",
principalColumn: "PhotoId",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Activities_Playlists_PlaylistId",
column: x => x.PlaylistId,
principalTable: "Playlists",
principalColumn: "PlaylistId",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Activities_Reviews_ReviewId",
column: x => x.ReviewId,
principalTable: "Reviews",
principalColumn: "ReviewId",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Activities_Scores_ScoreId",
column: x => x.ScoreId,
principalTable: "Scores",
principalColumn: "ScoreId",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Activities_Slots_SlotId",
column: x => x.SlotId,
principalTable: "Slots",
principalColumn: "SlotId",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Activities_Users_TargetUserId",
column: x => x.TargetUserId,
principalTable: "Users",
principalColumn: "UserId",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Activities_Users_UserId",
column: x => x.UserId,
principalTable: "Users",
principalColumn: "UserId",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Activities_WebsiteAnnouncements_NewsId",
column: x => x.NewsId,
principalTable: "WebsiteAnnouncements",
principalColumn: "AnnouncementId",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_Activities_CommentId",
table: "Activities",
column: "CommentId");
migrationBuilder.CreateIndex(
name: "IX_Activities_NewsId",
table: "Activities",
column: "NewsId");
migrationBuilder.CreateIndex(
name: "IX_Activities_PhotoId",
table: "Activities",
column: "PhotoId");
migrationBuilder.CreateIndex(
name: "IX_Activities_PlaylistId",
table: "Activities",
column: "PlaylistId");
migrationBuilder.CreateIndex(
name: "IX_Activities_ReviewId",
table: "Activities",
column: "ReviewId");
migrationBuilder.CreateIndex(
name: "IX_Activities_ScoreId",
table: "Activities",
column: "ScoreId");
migrationBuilder.CreateIndex(
name: "IX_Activities_SlotId",
table: "Activities",
column: "SlotId");
migrationBuilder.CreateIndex(
name: "IX_Activities_TargetUserId",
table: "Activities",
column: "TargetUserId");
migrationBuilder.CreateIndex(
name: "IX_Activities_UserId",
table: "Activities",
column: "UserId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Activities");
migrationBuilder.AlterColumn<int>(
name: "TokenId",
table: "WebTokens",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "AnnouncementId",
table: "WebsiteAnnouncements",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "VisitedLevelId",
table: "VisitedLevels",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "UserId",
table: "Users",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "SlotId",
table: "Slots",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "ScoreId",
table: "Scores",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "ReviewId",
table: "Reviews",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "ReportId",
table: "Reports",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "TokenId",
table: "RegistrationTokens",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "RatedReviewId",
table: "RatedReviews",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "RatedLevelId",
table: "RatedLevels",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "RatingId",
table: "RatedComments",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "QueuedLevelId",
table: "QueuedLevels",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "PlaylistId",
table: "Playlists",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "PlatformLinkAttemptId",
table: "PlatformLinkAttempts",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "PhotoSubjectId",
table: "PhotoSubjects",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "PhotoId",
table: "Photos",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "TokenId",
table: "PasswordResetTokens",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "Id",
table: "Notifications",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "HeartedProfileId",
table: "HeartedProfiles",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "HeartedPlaylistId",
table: "HeartedPlaylists",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "HeartedLevelId",
table: "HeartedLevels",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "TokenId",
table: "GameTokens",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "EmailVerificationTokenId",
table: "EmailVerificationTokens",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "EmailSetTokenId",
table: "EmailSetTokens",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "CategoryId",
table: "CustomCategories",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "CommentId",
table: "Comments",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "CaseId",
table: "Cases",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "BlockedProfileId",
table: "BlockedProfiles",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "Id",
table: "APIKeys",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
}
}
}

View file

@ -3,6 +3,7 @@ using System;
using LBPUnion.ProjectLighthouse.Database;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
@ -16,15 +17,19 @@ namespace ProjectLighthouse.Migrations
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "8.0.2")
.HasAnnotation("ProductVersion", "8.0.3")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
modelBuilder.Entity("LBPUnion.ProjectLighthouse.Types.Entities.Activity.ActivityEntity", b =>
{
b.Property<int>("ActivityId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("ActivityId"));
b.Property<string>("Discriminator")
.IsRequired()
.HasMaxLength(34)
@ -56,6 +61,8 @@ namespace ProjectLighthouse.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("HeartedLevelId"));
b.Property<int>("SlotId")
.HasColumnType("int");
@ -77,6 +84,8 @@ namespace ProjectLighthouse.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("HeartedPlaylistId"));
b.Property<int>("PlaylistId")
.HasColumnType("int");
@ -98,6 +107,8 @@ namespace ProjectLighthouse.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("HeartedProfileId"));
b.Property<int>("HeartedUserId")
.HasColumnType("int");
@ -119,6 +130,8 @@ namespace ProjectLighthouse.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("QueuedLevelId"));
b.Property<int>("SlotId")
.HasColumnType("int");
@ -140,6 +153,8 @@ namespace ProjectLighthouse.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("RatingId"));
b.Property<int>("CommentId")
.HasColumnType("int");
@ -164,6 +179,8 @@ namespace ProjectLighthouse.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("RatedLevelId"));
b.Property<int>("Rating")
.HasColumnType("int");
@ -194,6 +211,8 @@ namespace ProjectLighthouse.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("RatedReviewId"));
b.Property<int>("ReviewId")
.HasColumnType("int");
@ -218,6 +237,8 @@ namespace ProjectLighthouse.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("VisitedLevelId"));
b.Property<int>("PlaysLBP1")
.HasColumnType("int");
@ -248,6 +269,8 @@ namespace ProjectLighthouse.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("CategoryId"));
b.Property<string>("Description")
.HasColumnType("longtext");
@ -274,6 +297,8 @@ namespace ProjectLighthouse.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("PlaylistId"));
b.Property<int>("CreatorId")
.HasColumnType("int");
@ -302,6 +327,8 @@ namespace ProjectLighthouse.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("ReviewId"));
b.Property<bool>("Deleted")
.HasColumnType("tinyint(1)");
@ -349,6 +376,8 @@ namespace ProjectLighthouse.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("ScoreId"));
b.Property<int>("ChildSlotId")
.HasColumnType("int");
@ -382,6 +411,8 @@ namespace ProjectLighthouse.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("SlotId"));
b.Property<string>("AuthorLabels")
.IsRequired()
.HasColumnType("longtext");
@ -535,6 +566,8 @@ namespace ProjectLighthouse.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("ReportId"));
b.Property<string>("Bounds")
.HasColumnType("longtext");
@ -581,6 +614,8 @@ namespace ProjectLighthouse.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("CaseId"));
b.Property<int>("AffectedId")
.HasColumnType("int");
@ -635,6 +670,8 @@ namespace ProjectLighthouse.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<bool>("IsDismissed")
.HasColumnType("tinyint(1)");
@ -660,6 +697,8 @@ namespace ProjectLighthouse.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("BlockedProfileId"));
b.Property<int>("BlockedUserId")
.HasColumnType("int");
@ -681,6 +720,8 @@ namespace ProjectLighthouse.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("CommentId"));
b.Property<bool>("Deleted")
.HasColumnType("tinyint(1)");
@ -750,6 +791,8 @@ namespace ProjectLighthouse.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("PhotoId"));
b.Property<int>("CreatorId")
.HasColumnType("int");
@ -790,6 +833,8 @@ namespace ProjectLighthouse.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("PhotoSubjectId"));
b.Property<string>("Bounds")
.HasColumnType("longtext");
@ -814,6 +859,8 @@ namespace ProjectLighthouse.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("PlatformLinkAttemptId"));
b.Property<string>("IPAddress")
.HasColumnType("longtext");
@ -842,6 +889,8 @@ namespace ProjectLighthouse.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("UserId"));
b.Property<int>("AdminGrantedSlots")
.HasColumnType("int");
@ -947,6 +996,8 @@ namespace ProjectLighthouse.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("Created")
.HasColumnType("datetime(6)");
@ -967,6 +1018,8 @@ namespace ProjectLighthouse.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("EmailSetTokenId"));
b.Property<string>("EmailToken")
.HasColumnType("longtext");
@ -989,6 +1042,8 @@ namespace ProjectLighthouse.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("EmailVerificationTokenId"));
b.Property<string>("EmailToken")
.HasColumnType("longtext");
@ -1011,6 +1066,8 @@ namespace ProjectLighthouse.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("TokenId"));
b.Property<DateTime>("ExpiresAt")
.HasColumnType("datetime(6)");
@ -1042,6 +1099,8 @@ namespace ProjectLighthouse.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("TokenId"));
b.Property<DateTime>("Created")
.HasColumnType("datetime(6)");
@ -1062,6 +1121,8 @@ namespace ProjectLighthouse.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("TokenId"));
b.Property<DateTime>("Created")
.HasColumnType("datetime(6)");
@ -1082,6 +1143,8 @@ namespace ProjectLighthouse.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("TokenId"));
b.Property<DateTime>("ExpiresAt")
.HasColumnType("datetime(6)");
@ -1105,6 +1168,8 @@ namespace ProjectLighthouse.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("AnnouncementId"));
b.Property<string>("Content")
.HasColumnType("longtext");
@ -1246,6 +1311,9 @@ namespace ProjectLighthouse.Migrations
{
b.HasBaseType("LBPUnion.ProjectLighthouse.Types.Entities.Activity.ActivityEntity");
b.Property<int>("Points")
.HasColumnType("int");
b.Property<int>("ScoreId")
.HasColumnType("int");

View file

@ -82,6 +82,7 @@ public class ActivityEntityEventHandler : IEntityEventHandler
ScoreId = score.ScoreId,
UserId = score.UserId,
SlotId = score.SlotId,
Points = score.Points,
},
_ => null,
},
@ -245,6 +246,7 @@ public class ActivityEntityEventHandler : IEntityEventHandler
ScoreId = score.ScoreId,
SlotId = score.SlotId,
UserId = score.UserId,
Points = score.Points,
};
break;

View file

@ -22,4 +22,6 @@ public class ScoreActivityEntity : ActivityEntity
[ForeignKey(nameof(SlotId))]
public SlotEntity Slot { get; set; }
public int Points { get; set; }
}

View file

@ -150,6 +150,7 @@ public class GameEvent : ILbpSerializable, INeedsPreparationForSerialization
EventType.Score => new GameScoreEvent
{
ScoreId = ((ScoreActivityEntity)activity.Activity).ScoreId,
Score = ((ScoreActivityEntity)activity.Activity).Points,
Slot = new ReviewSlot
{
SlotId = targetId,

View file

@ -32,8 +32,6 @@ public class GameScoreEvent : GameEvent
SlotEntity slot = await database.Slots.FindAsync(score.SlotId);
if (slot == null) return;
this.Score = score.Points;
//TODO is this correct?
this.UserCount = score.Type;
this.Slot = ReviewSlot.CreateFromEntity(slot);