46 lines
1.7 KiB
C#
46 lines
1.7 KiB
C#
|
using System;
|
|||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|||
|
|
|||
|
namespace NadekoBot.Migrations
|
|||
|
{
|
|||
|
public partial class streamrole : Migration
|
|||
|
{
|
|||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
migrationBuilder.CreateTable(
|
|||
|
name: "StreamRoleSettings",
|
|||
|
columns: table => new
|
|||
|
{
|
|||
|
Id = table.Column<int>(nullable: false)
|
|||
|
.Annotation("Sqlite:Autoincrement", true),
|
|||
|
AddRoleId = table.Column<ulong>(nullable: false),
|
|||
|
DateAdded = table.Column<DateTime>(nullable: true),
|
|||
|
FromRoleId = table.Column<ulong>(nullable: false),
|
|||
|
GuildConfigId = table.Column<int>(nullable: false)
|
|||
|
},
|
|||
|
constraints: table =>
|
|||
|
{
|
|||
|
table.PrimaryKey("PK_StreamRoleSettings", x => x.Id);
|
|||
|
table.ForeignKey(
|
|||
|
name: "FK_StreamRoleSettings_GuildConfigs_GuildConfigId",
|
|||
|
column: x => x.GuildConfigId,
|
|||
|
principalTable: "GuildConfigs",
|
|||
|
principalColumn: "Id",
|
|||
|
onDelete: ReferentialAction.Cascade);
|
|||
|
});
|
|||
|
|
|||
|
migrationBuilder.CreateIndex(
|
|||
|
name: "IX_StreamRoleSettings_GuildConfigId",
|
|||
|
table: "StreamRoleSettings",
|
|||
|
column: "GuildConfigId",
|
|||
|
unique: true);
|
|||
|
}
|
|||
|
|
|||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
migrationBuilder.DropTable(
|
|||
|
name: "StreamRoleSettings");
|
|||
|
}
|
|||
|
}
|
|||
|
}
|