Add time index to connection log (#29281)
* Add time index to connection log Queries go nyoom. * Don't let me code shit at 5 AM
This commit is contained in:
committed by
GitHub
parent
730a4d289d
commit
f041f58a6d
1915
Content.Server.Database/Migrations/Postgres/20240621120713_ConnectionLogTimeIndex.Designer.cs
generated
Normal file
1915
Content.Server.Database/Migrations/Postgres/20240621120713_ConnectionLogTimeIndex.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,27 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace Content.Server.Database.Migrations.Postgres
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class ConnectionLogTimeIndex : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_connection_log_time",
|
||||||
|
table: "connection_log",
|
||||||
|
column: "time");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropIndex(
|
||||||
|
name: "IX_connection_log_time",
|
||||||
|
table: "connection_log");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -559,6 +559,8 @@ namespace Content.Server.Database.Migrations.Postgres
|
|||||||
b.HasIndex("ServerId")
|
b.HasIndex("ServerId")
|
||||||
.HasDatabaseName("IX_connection_log_server_id");
|
.HasDatabaseName("IX_connection_log_server_id");
|
||||||
|
|
||||||
|
b.HasIndex("Time");
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
b.HasIndex("UserId");
|
||||||
|
|
||||||
b.ToTable("connection_log", null, t =>
|
b.ToTable("connection_log", null, t =>
|
||||||
|
|||||||
1840
Content.Server.Database/Migrations/Sqlite/20240621120705_ConnectionLogTimeIndex.Designer.cs
generated
Normal file
1840
Content.Server.Database/Migrations/Sqlite/20240621120705_ConnectionLogTimeIndex.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,27 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace Content.Server.Database.Migrations.Sqlite
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class ConnectionLogTimeIndex : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_connection_log_time",
|
||||||
|
table: "connection_log",
|
||||||
|
column: "time");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropIndex(
|
||||||
|
name: "IX_connection_log_time",
|
||||||
|
table: "connection_log");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -528,6 +528,8 @@ namespace Content.Server.Database.Migrations.Sqlite
|
|||||||
b.HasIndex("ServerId")
|
b.HasIndex("ServerId")
|
||||||
.HasDatabaseName("IX_connection_log_server_id");
|
.HasDatabaseName("IX_connection_log_server_id");
|
||||||
|
|
||||||
|
b.HasIndex("Time");
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
b.HasIndex("UserId");
|
||||||
|
|
||||||
b.ToTable("connection_log", (string)null);
|
b.ToTable("connection_log", (string)null);
|
||||||
|
|||||||
@@ -187,6 +187,9 @@ namespace Content.Server.Database
|
|||||||
modelBuilder.Entity<ConnectionLog>()
|
modelBuilder.Entity<ConnectionLog>()
|
||||||
.HasIndex(p => p.UserId);
|
.HasIndex(p => p.UserId);
|
||||||
|
|
||||||
|
modelBuilder.Entity<ConnectionLog>()
|
||||||
|
.HasIndex(p => p.Time);
|
||||||
|
|
||||||
modelBuilder.Entity<ConnectionLog>()
|
modelBuilder.Entity<ConnectionLog>()
|
||||||
.Property(p => p.ServerId)
|
.Property(p => p.ServerId)
|
||||||
.HasDefaultValue(0);
|
.HasDefaultValue(0);
|
||||||
|
|||||||
Reference in New Issue
Block a user