55 lines
2.1 KiB
C#
55 lines
2.1 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace Flypaper.Storage.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class AddExplanationRulesAndTokenWrite : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.AddColumn<bool>(
|
|
name: "CanWrite",
|
|
table: "McpTokens",
|
|
type: "INTEGER",
|
|
nullable: false,
|
|
defaultValue: false);
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "ExplanationRules",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
|
.Annotation("Sqlite:Autoincrement", true),
|
|
Kind = table.Column<string>(type: "TEXT", maxLength: 16, nullable: false),
|
|
Pattern = table.Column<string>(type: "TEXT", maxLength: 500, nullable: false),
|
|
Text = table.Column<string>(type: "TEXT", maxLength: 600, nullable: false),
|
|
Priority = table.Column<int>(type: "INTEGER", nullable: false),
|
|
Enabled = table.Column<bool>(type: "INTEGER", nullable: false),
|
|
Note = table.Column<string>(type: "TEXT", maxLength: 500, nullable: true),
|
|
CreatedAt = table.Column<DateTime>(type: "TEXT", nullable: false),
|
|
UpdatedAt = table.Column<DateTime>(type: "TEXT", nullable: false),
|
|
CreatedBy = table.Column<string>(type: "TEXT", maxLength: 100, nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_ExplanationRules", x => x.Id);
|
|
});
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "ExplanationRules");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "CanWrite",
|
|
table: "McpTokens");
|
|
}
|
|
}
|
|
}
|