fish-station/Content.Server.Database/Migrations/Postgres/20250407235304_AHelpDb.cs

46 lines
1.9 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace Content.Server.Database.Migrations.Postgres
{
/// <inheritdoc />
public partial class AHelpDb : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "ahelp_messages",
columns: table => new
{
ahelp_messages_id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
receiver_user_id = table.Column<Guid>(type: "uuid", nullable: false),
sender_user_id = table.Column<Guid>(type: "uuid", nullable: false),
sent_at = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
message = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: false),
play_sound = table.Column<bool>(type: "boolean", nullable: false),
admin_only = table.Column<bool>(type: "boolean", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ahelp_messages", x => x.ahelp_messages_id);
});
migrationBuilder.CreateIndex(
name: "IX_ahelp_messages_receiver_user_id",
table: "ahelp_messages",
column: "receiver_user_id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "ahelp_messages");
}
}
}