49 lines
1.7 KiB
C#
49 lines
1.7 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace Iceshrimp.Backend.Core.Database.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class AddFederationControl : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "allowed_instance",
|
|
columns: table => new
|
|
{
|
|
host = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
|
|
imported = table.Column<bool>(type: "boolean", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_allowed_instance", x => x.host);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "blocked_instance",
|
|
columns: table => new
|
|
{
|
|
host = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
|
|
reason = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: true),
|
|
imported = table.Column<bool>(type: "boolean", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_blocked_instance", x => x.host);
|
|
});
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "allowed_instance");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "blocked_instance");
|
|
}
|
|
}
|
|
}
|