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