login logout logs

This commit is contained in:
hydrant
2021-04-19 12:17:56 +02:00
parent 06de6ef1a4
commit f0b2eca560
8 changed files with 2211 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,48 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace ReallifeGamemode.Database.Migrations
{
public partial class LoginLogoutLogs : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "LoginLogoutLogs",
columns: table => new
{
Id = table.Column<long>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Username = table.Column<string>(nullable: true),
SocialClubName = table.Column<string>(nullable: true),
UserId = table.Column<int>(nullable: true),
PlayerId = table.Column<long>(nullable: false),
IpAddress = table.Column<string>(nullable: true),
LoginLogout = table.Column<bool>(nullable: false),
Time = table.Column<DateTime>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_LoginLogoutLogs", x => x.Id);
table.ForeignKey(
name: "FK_LoginLogoutLogs_Users_UserId",
column: x => x.UserId,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateIndex(
name: "IX_LoginLogoutLogs_UserId",
table: "LoginLogoutLogs",
column: "UserId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "LoginLogoutLogs");
}
}
}

View File

@@ -872,6 +872,40 @@ namespace ReallifeGamemode.Database.Migrations
b.ToTable("DeathLogs");
});
modelBuilder.Entity("ReallifeGamemode.Database.Entities.Logs.LoginLogoutLogEntry", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<string>("IpAddress")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<bool>("LoginLogout")
.HasColumnType("tinyint(1)");
b.Property<long>("PlayerId")
.HasColumnType("bigint");
b.Property<string>("SocialClubName")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<DateTime>("Time")
.HasColumnType("datetime(6)");
b.Property<int?>("UserId")
.HasColumnType("int");
b.Property<string>("Username")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("LoginLogoutLogs");
});
modelBuilder.Entity("ReallifeGamemode.Database.Entities.News", b =>
{
b.Property<int>("Id")
@@ -1898,6 +1932,13 @@ namespace ReallifeGamemode.Database.Migrations
.IsRequired();
});
modelBuilder.Entity("ReallifeGamemode.Database.Entities.Logs.LoginLogoutLogEntry", b =>
{
b.HasOne("ReallifeGamemode.Database.Entities.User", "User")
.WithMany()
.HasForeignKey("UserId");
});
modelBuilder.Entity("ReallifeGamemode.Database.Entities.News", b =>
{
b.HasOne("ReallifeGamemode.Database.Entities.User", "User")