Files
nadekobot/NadekoBot.Core/Migrations/20180802214932_sar group names.cs
2021-09-06 21:29:22 +02:00

51 lines
1.8 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace NadekoBot.Migrations
{
public partial class sargroupnames : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "GroupName",
columns: table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("Sqlite:Autoincrement", true),
DateAdded = table.Column<DateTime>(nullable: true),
Number = table.Column<int>(nullable: false),
Name = table.Column<string>(nullable: true),
GuildConfigId = table.Column<int>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_GroupName", x => x.Id);
table.ForeignKey(
name: "FK_GroupName_GuildConfigs_GuildConfigId",
column: x => x.GuildConfigId,
principalTable: "GuildConfigs",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateIndex(
name: "IX_GroupName_GuildConfigId",
table: "GroupName",
column: "GuildConfigId");
migrationBuilder.CreateIndex(
name: "IX_GroupName_Number",
table: "GroupName",
column: "Number",
unique: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "GroupName");
}
}
}