Skip to content

Commit

Permalink
Ban template system (#29365)
Browse files Browse the repository at this point in the history
To help out admins, so they can easily fill out datacenter bans and stuff. Supports ban exemption flags and everything.

This is for use with SS14.Admin so it's just DB models here.

(cherry picked from commit 0c34eb6138b9f7d1698b546d1591096fc517d989)
  • Loading branch information
PJB3005 authored and Evgencheg committed Sep 25, 2024
1 parent d392e20 commit e746c54
Show file tree
Hide file tree
Showing 8 changed files with 4,081 additions and 1 deletion.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;

#nullable disable

namespace Content.Server.Database.Migrations.Postgres
{
/// <inheritdoc />
public partial class BanTemplate : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "ban_template",
columns: table => new
{
ban_template_id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
title = table.Column<string>(type: "text", nullable: false),
length = table.Column<TimeSpan>(type: "interval", nullable: false),
reason = table.Column<string>(type: "text", nullable: false),
exempt_flags = table.Column<int>(type: "integer", nullable: false),
severity = table.Column<int>(type: "integer", nullable: false),
auto_delete = table.Column<bool>(type: "boolean", nullable: false),
hidden = table.Column<bool>(type: "boolean", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ban_template", x => x.ban_template_id);
});
}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "ban_template");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,51 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.ToTable("assigned_user_id", (string)null);
});

modelBuilder.Entity("Content.Server.Database.BanTemplate", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasColumnName("ban_template_id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<bool>("AutoDelete")
.HasColumnType("boolean")
.HasColumnName("auto_delete");
b.Property<int>("ExemptFlags")
.HasColumnType("integer")
.HasColumnName("exempt_flags");
b.Property<bool>("Hidden")
.HasColumnType("boolean")
.HasColumnName("hidden");
b.Property<TimeSpan>("Length")
.HasColumnType("interval")
.HasColumnName("length");
b.Property<string>("Reason")
.IsRequired()
.HasColumnType("text")
.HasColumnName("reason");
b.Property<int>("Severity")
.HasColumnType("integer")
.HasColumnName("severity");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("text")
.HasColumnName("title");
b.HasKey("Id")
.HasName("PK_ban_template");
b.ToTable("ban_template", (string)null);
});

modelBuilder.Entity("Content.Server.Database.ConnectionLog", b =>
{
b.Property<int>("Id")
Expand Down
Loading

0 comments on commit e746c54

Please sign in to comment.