mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-11 01:38:27 -04:00
Killed history
This commit is contained in:
26
NadekoBot.Core/Migrations/20210519085051_cr-allow-target.cs
Normal file
26
NadekoBot.Core/Migrations/20210519085051_cr-allow-target.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace NadekoBot.Migrations
|
||||
{
|
||||
public partial class crallowtarget : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "AllowTarget",
|
||||
table: "CustomReactions",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.Sql("update customreactions set allowtarget=1 where instr(lower(Response), '%target%') > 0");
|
||||
migrationBuilder.Sql("update customreactions set Trigger=replace(Trigger, '%mention%', '%bot.mention%')");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "AllowTarget",
|
||||
table: "CustomReactions");
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user