using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace DorkNet.Server.Migrations
{
///
public partial class RoomRolePermissions : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "RoomRolePermissions",
columns: table => new
{
Id = table.Column(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
RoomId = table.Column(type: "INTEGER", nullable: false),
SubRoomId = table.Column(type: "INTEGER", nullable: false),
Role = table.Column(type: "INTEGER", nullable: false),
Permission = table.Column(type: "TEXT", maxLength: 128, nullable: false),
Type = table.Column(type: "INTEGER", nullable: false),
Override = table.Column(type: "INTEGER", nullable: false),
Value = table.Column(type: "TEXT", maxLength: 4096, nullable: false),
UpdatedByPlayerId = table.Column(type: "INTEGER", nullable: false),
UpdatedAt = table.Column(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_RoomRolePermissions", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_RoomRolePermissions_RoomId_SubRoomId_Role_Permission",
table: "RoomRolePermissions",
columns: new[] { "RoomId", "SubRoomId", "Role", "Permission" },
unique: true);
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "RoomRolePermissions");
}
}
}