diff --git a/mem0.NET b/mem0.NET new file mode 160000 index 00000000..064885a6 --- /dev/null +++ b/mem0.NET @@ -0,0 +1 @@ +Subproject commit 064885a681438a2290c60112ad6a5d49cee9b36c diff --git a/src/Service/FastWiki.Service/FastWiki.Service.csproj b/src/Service/FastWiki.Service/FastWiki.Service.csproj index 423daad2..4b54359d 100644 --- a/src/Service/FastWiki.Service/FastWiki.Service.csproj +++ b/src/Service/FastWiki.Service/FastWiki.Service.csproj @@ -87,4 +87,8 @@ <_ContentIncludedByDefault Remove="wwwroot\uploads\20240816\27166df2bf0042058a77bfcadef29b2a1.png" /> <_ContentIncludedByDefault Remove="wwwroot\uploads\20240816\7ccbd188751846fd972d4bf71db86236基础组件发版(gp-gateway-center).md" /> + + + + diff --git a/src/Service/FastWiki.Service/Migrations/PostgreSQL/20240422143639_Initial.cs b/src/Service/FastWiki.Service/Migrations/PostgreSQL/20240422143639_Initial.cs deleted file mode 100644 index 0b273049..00000000 --- a/src/Service/FastWiki.Service/Migrations/PostgreSQL/20240422143639_Initial.cs +++ /dev/null @@ -1,289 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -namespace FastWiki.Service.Migrations.PostgreSQL; - -/// -public partial class Initial : Migration -{ - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - "wiki-chat-application", - table => new - { - Id = table.Column("text", nullable: false), - Name = table.Column("text", nullable: false), - Prompt = table.Column("text", nullable: false), - ChatModel = table.Column("text", nullable: false), - Temperature = table.Column("double precision", nullable: false), - MaxResponseToken = table.Column("integer", nullable: false), - Template = table.Column("text", nullable: false), - Parameter = table.Column("text", nullable: false), - Opener = table.Column("text", nullable: false), - WikiIds = table.Column("text", nullable: false), - ReferenceUpperLimit = table.Column("integer", nullable: false), - Relevancy = table.Column("double precision", nullable: false), - NoReplyFoundTemplate = table.Column("text", nullable: true), - ShowSourceFile = table.Column("boolean", nullable: false), - Extend = table.Column("text", nullable: false), - FunctionIds = table.Column("text", nullable: false), - Creator = table.Column("uuid", nullable: true), - CreationTime = table.Column("timestamp without time zone", nullable: false), - Modifier = table.Column("uuid", nullable: true), - ModificationTime = table.Column("timestamp without time zone", nullable: false), - IsDeleted = table.Column("boolean", nullable: false) - }, - constraints: table => { table.PrimaryKey("PK_wiki-chat-application", x => x.Id); }); - - migrationBuilder.CreateTable( - "wiki-chat-dialog", - table => new - { - Id = table.Column("text", nullable: false), - Name = table.Column("text", nullable: false), - ChatId = table.Column("text", nullable: true), - ApplicationId = table.Column("text", nullable: false), - Description = table.Column("text", nullable: false), - Type = table.Column("integer", nullable: false), - Creator = table.Column("uuid", nullable: false), - CreationTime = table.Column("timestamp without time zone", nullable: false), - Modifier = table.Column("uuid", nullable: false), - ModificationTime = table.Column("timestamp without time zone", nullable: false), - IsDeleted = table.Column("boolean", nullable: false) - }, - constraints: table => { table.PrimaryKey("PK_wiki-chat-dialog", x => x.Id); }); - - migrationBuilder.CreateTable( - "wiki-chat-dialog-history", - table => new - { - Id = table.Column("text", nullable: false), - ChatDialogId = table.Column("text", nullable: false), - Content = table.Column("text", maxLength: -1, nullable: false), - TokenConsumption = table.Column("integer", nullable: false), - Current = table.Column("boolean", nullable: false), - Type = table.Column("integer", nullable: false), - ReferenceFile = table.Column("text", nullable: false), - Creator = table.Column("uuid", nullable: false), - CreationTime = table.Column("timestamp without time zone", nullable: false), - Modifier = table.Column("uuid", nullable: false), - ModificationTime = table.Column("timestamp without time zone", nullable: false), - IsDeleted = table.Column("boolean", nullable: false) - }, - constraints: table => { table.PrimaryKey("PK_wiki-chat-dialog-history", x => x.Id); }); - - migrationBuilder.CreateTable( - "wiki-chat-share", - table => new - { - Id = table.Column("text", nullable: false), - Name = table.Column("text", nullable: false), - ChatApplicationId = table.Column("text", nullable: false), - Expires = table.Column("timestamp without time zone", nullable: true), - UsedToken = table.Column("bigint", nullable: false), - AvailableToken = table.Column("bigint", nullable: false), - AvailableQuantity = table.Column("integer", nullable: false), - APIKey = table.Column("text", nullable: true), - Creator = table.Column("uuid", nullable: false), - CreationTime = table.Column("timestamp without time zone", nullable: false), - Modifier = table.Column("uuid", nullable: false), - ModificationTime = table.Column("timestamp without time zone", nullable: false) - }, - constraints: table => { table.PrimaryKey("PK_wiki-chat-share", x => x.Id); }); - - migrationBuilder.CreateTable( - "wiki-file-storages", - table => new - { - Id = table.Column("bigint", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", - NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - Name = table.Column("character varying(100)", maxLength: 100, nullable: false), - Path = table.Column("character varying(200)", maxLength: 200, nullable: false), - Size = table.Column("bigint", nullable: false), - IsCompression = table.Column("boolean", nullable: false), - FullName = table.Column("text", nullable: false), - Creator = table.Column("uuid", nullable: true), - CreationTime = table.Column("timestamp without time zone", nullable: false), - Modifier = table.Column("uuid", nullable: true), - ModificationTime = table.Column("timestamp without time zone", nullable: false), - IsDeleted = table.Column("boolean", nullable: false) - }, - constraints: table => { table.PrimaryKey("PK_wiki-file-storages", x => x.Id); }); - - migrationBuilder.CreateTable( - "wiki-function-calls", - table => new - { - Id = table.Column("bigint", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", - NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - Name = table.Column("text", nullable: false), - Description = table.Column("text", nullable: false), - Content = table.Column("text", nullable: false), - Parameters = table.Column("text", nullable: false), - Items = table.Column("text", nullable: false), - Enable = table.Column("boolean", nullable: false), - Imports = table.Column("text", nullable: false), - Main = table.Column("text", nullable: false), - Creator = table.Column("uuid", nullable: false), - CreationTime = table.Column("timestamp without time zone", nullable: false), - Modifier = table.Column("uuid", nullable: false), - ModificationTime = table.Column("timestamp without time zone", nullable: false), - IsDeleted = table.Column("boolean", nullable: false) - }, - constraints: table => { table.PrimaryKey("PK_wiki-function-calls", x => x.Id); }); - - migrationBuilder.CreateTable( - "wiki-users", - table => new - { - Id = table.Column("uuid", nullable: false), - Account = table.Column("text", nullable: false), - Name = table.Column("character varying(100)", maxLength: 100, nullable: false), - Password = table.Column("character varying(100)", maxLength: 100, nullable: false), - Salt = table.Column("text", nullable: false), - Avatar = table.Column("text", nullable: false), - Email = table.Column("text", nullable: false), - Phone = table.Column("text", nullable: false), - IsDisable = table.Column("boolean", nullable: false), - Role = table.Column("integer", nullable: false), - Creator = table.Column("uuid", nullable: true), - CreationTime = table.Column("timestamp without time zone", nullable: false), - Modifier = table.Column("uuid", nullable: true), - ModificationTime = table.Column("timestamp without time zone", nullable: false), - IsDeleted = table.Column("boolean", nullable: false) - }, - constraints: table => { table.PrimaryKey("PK_wiki-users", x => x.Id); }); - - migrationBuilder.CreateTable( - "wiki-wiki-details", - table => new - { - Id = table.Column("bigint", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", - NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - WikiId = table.Column("bigint", nullable: false), - FileName = table.Column("character varying(100)", maxLength: 100, nullable: false), - Path = table.Column("character varying(200)", maxLength: 200, nullable: false), - FileId = table.Column("bigint", nullable: false), - DataCount = table.Column("integer", nullable: false), - Type = table.Column("character varying(100)", maxLength: 100, nullable: false), - State = table.Column("integer", nullable: false), - Creator = table.Column("bigint", nullable: false), - CreationTime = table.Column("timestamp without time zone", nullable: false), - Modifier = table.Column("bigint", nullable: false), - ModificationTime = table.Column("timestamp without time zone", nullable: false), - MaxTokensPerParagraph = table.Column("integer", nullable: false), - MaxTokensPerLine = table.Column("integer", nullable: false), - OverlappingTokens = table.Column("integer", nullable: false), - Mode = table.Column("integer", nullable: false), - TrainingPattern = table.Column("integer", nullable: false), - QAPromptTemplate = table.Column("text", nullable: true) - }, - constraints: table => { table.PrimaryKey("PK_wiki-wiki-details", x => x.Id); }); - - migrationBuilder.CreateTable( - "wiki-wikis", - table => new - { - Id = table.Column("bigint", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", - NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - Icon = table.Column("text", nullable: false), - Name = table.Column("character varying(100)", maxLength: 100, nullable: false), - Model = table.Column("text", nullable: false), - EmbeddingModel = table.Column("text", nullable: false), - Creator = table.Column("uuid", nullable: true), - CreationTime = table.Column("timestamp without time zone", nullable: false), - Modifier = table.Column("uuid", nullable: true), - ModificationTime = table.Column("timestamp without time zone", nullable: false), - IsDeleted = table.Column("boolean", nullable: false) - }, - constraints: table => { table.PrimaryKey("PK_wiki-wikis", x => x.Id); }); - - migrationBuilder.InsertData( - "wiki-users", - new[] - { - "Id", "Account", "Avatar", "CreationTime", "Creator", "Email", "IsDeleted", "IsDisable", - "ModificationTime", "Modifier", "Name", "Password", "Phone", "Role", "Salt" - }, - new object[] - { - new Guid("81ba41a1-27df-4f6c-b327-dfec1bce8c85"), "admin", - "https://blog-simple.oss-cn-shenzhen.aliyuncs.com/Avatar.jpg", - new DateTime(2024, 4, 22, 14, 36, 39, 431, DateTimeKind.Utc).AddTicks(7635), null, "239573049@qq.com", - false, false, new DateTime(2024, 4, 22, 14, 36, 39, 431, DateTimeKind.Utc).AddTicks(7638), null, - "admin", "ae322a2c4c237df3b8683703e51442aa", "13049809673", 2, "19ea5ff625024a1d80bbf86c054e132c" - }); - - migrationBuilder.CreateIndex( - "IX_wiki-chat-application_Name", - "wiki-chat-application", - "Name"); - - migrationBuilder.CreateIndex( - "IX_wiki-chat-dialog_ChatId", - "wiki-chat-dialog", - "ChatId"); - - migrationBuilder.CreateIndex( - "IX_wiki-chat-dialog-history_ChatDialogId", - "wiki-chat-dialog-history", - "ChatDialogId"); - - migrationBuilder.CreateIndex( - "IX_wiki-chat-dialog-history_Creator", - "wiki-chat-dialog-history", - "Creator"); - - migrationBuilder.CreateIndex( - "IX_wiki-chat-share_ChatApplicationId", - "wiki-chat-share", - "ChatApplicationId"); - - migrationBuilder.CreateIndex( - "IX_wiki-function-calls_CreationTime", - "wiki-function-calls", - "CreationTime"); - - migrationBuilder.CreateIndex( - "IX_wiki-wikis_Name", - "wiki-wikis", - "Name"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - "wiki-chat-application"); - - migrationBuilder.DropTable( - "wiki-chat-dialog"); - - migrationBuilder.DropTable( - "wiki-chat-dialog-history"); - - migrationBuilder.DropTable( - "wiki-chat-share"); - - migrationBuilder.DropTable( - "wiki-file-storages"); - - migrationBuilder.DropTable( - "wiki-function-calls"); - - migrationBuilder.DropTable( - "wiki-users"); - - migrationBuilder.DropTable( - "wiki-wiki-details"); - - migrationBuilder.DropTable( - "wiki-wikis"); - } -} \ No newline at end of file diff --git a/src/Service/FastWiki.Service/Migrations/PostgreSQL/20240512150624_RemoveDialog.Designer.cs b/src/Service/FastWiki.Service/Migrations/PostgreSQL/20240512150624_RemoveDialog.Designer.cs deleted file mode 100644 index 167ad66c..00000000 --- a/src/Service/FastWiki.Service/Migrations/PostgreSQL/20240512150624_RemoveDialog.Designer.cs +++ /dev/null @@ -1,483 +0,0 @@ -// -using System; -using FastWiki.Service.DataAccess; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace FastWiki.Service.Migrations.PostgreSQL -{ - [DbContext(typeof(WikiDbContext))] - [Migration("20240512150624_RemoveDialog")] - partial class RemoveDialog - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("FastWiki.Service.Domain.ChatApplications.Aggregates.ChatApplication", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ChatModel") - .HasColumnType("text"); - - b.Property("CreationTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Creator") - .HasColumnType("uuid"); - - b.Property("Extend") - .HasColumnType("text"); - - b.Property("FunctionIds") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("MaxResponseToken") - .HasColumnType("integer"); - - b.Property("ModificationTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Modifier") - .HasColumnType("uuid"); - - b.Property("Name") - .HasColumnType("text"); - - b.Property("NoReplyFoundTemplate") - .HasColumnType("text"); - - b.Property("Opener") - .HasColumnType("text"); - - b.Property("Parameter") - .HasColumnType("text"); - - b.Property("Prompt") - .HasColumnType("text"); - - b.Property("ReferenceUpperLimit") - .HasColumnType("integer"); - - b.Property("Relevancy") - .HasColumnType("double precision"); - - b.Property("ShowSourceFile") - .HasColumnType("boolean"); - - b.Property("Temperature") - .HasColumnType("double precision"); - - b.Property("Template") - .HasColumnType("text"); - - b.Property("WikiIds") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("Name"); - - b.ToTable("wiki-chat-application", (string)null); - }); - - modelBuilder.Entity("FastWiki.Service.Domain.ChatApplications.Aggregates.ChatRecord", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ApplicationId") - .HasColumnType("text"); - - b.Property("CreationTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Creator") - .HasColumnType("uuid"); - - b.Property("ModificationTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Modifier") - .HasColumnType("uuid"); - - b.Property("Question") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CreationTime"); - - b.ToTable("wiki-chat-record", (string)null); - }); - - modelBuilder.Entity("FastWiki.Service.Domain.ChatApplications.Aggregates.ChatShare", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("APIKey") - .HasColumnType("text"); - - b.Property("AvailableQuantity") - .HasColumnType("integer"); - - b.Property("AvailableToken") - .HasColumnType("bigint"); - - b.Property("ChatApplicationId") - .HasColumnType("text"); - - b.Property("CreationTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Creator") - .HasColumnType("uuid"); - - b.Property("Expires") - .HasColumnType("timestamp without time zone"); - - b.Property("ModificationTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Modifier") - .HasColumnType("uuid"); - - b.Property("Name") - .HasColumnType("text"); - - b.Property("UsedToken") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("ChatApplicationId"); - - b.ToTable("wiki-chat-share", (string)null); - }); - - modelBuilder.Entity("FastWiki.Service.Domain.ChatApplications.Aggregates.Questions", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ApplicationId") - .HasColumnType("text"); - - b.Property("CreationTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Order") - .HasColumnType("integer"); - - b.Property("Question") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CreationTime"); - - b.ToTable("wiki-questions", (string)null); - }); - - modelBuilder.Entity("FastWiki.Service.Domain.Function.Aggregates.FastWikiFunctionCall", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Content") - .HasColumnType("text"); - - b.Property("CreationTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Creator") - .HasColumnType("uuid"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("Enable") - .HasColumnType("boolean"); - - b.Property("Imports") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("Items") - .HasColumnType("text"); - - b.Property("Main") - .HasColumnType("text"); - - b.Property("ModificationTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Modifier") - .HasColumnType("uuid"); - - b.Property("Name") - .HasColumnType("text"); - - b.Property("Parameters") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CreationTime"); - - b.ToTable("wiki-function-calls", (string)null); - }); - - modelBuilder.Entity("FastWiki.Service.Domain.Storage.Aggregates.FileStorage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreationTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Creator") - .HasColumnType("uuid"); - - b.Property("FullName") - .HasColumnType("text"); - - b.Property("IsCompression") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModificationTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Modifier") - .HasColumnType("uuid"); - - b.Property("Name") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("Path") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Size") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.ToTable("wiki-file-storages", (string)null); - }); - - modelBuilder.Entity("FastWiki.Service.Domain.Users.Aggregates.User", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("Account") - .HasColumnType("text"); - - b.Property("Avatar") - .HasColumnType("text"); - - b.Property("CreationTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Creator") - .HasColumnType("uuid"); - - b.Property("Email") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("IsDisable") - .HasColumnType("boolean"); - - b.Property("ModificationTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Modifier") - .HasColumnType("uuid"); - - b.Property("Name") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("Password") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("Phone") - .HasColumnType("text"); - - b.Property("Role") - .HasColumnType("integer"); - - b.Property("Salt") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("wiki-users", (string)null); - - b.HasData( - new - { - Id = new Guid("369059b8-6905-488b-87ab-447afa38b4de"), - Account = "admin", - Avatar = "https://blog-simple.oss-cn-shenzhen.aliyuncs.com/Avatar.jpg", - CreationTime = new DateTime(2024, 5, 12, 15, 6, 23, 950, DateTimeKind.Utc).AddTicks(9764), - Email = "239573049@qq.com", - IsDeleted = false, - IsDisable = false, - ModificationTime = new DateTime(2024, 5, 12, 15, 6, 23, 950, DateTimeKind.Utc).AddTicks(9767), - Name = "admin", - Password = "25b55175d0b2235c4fd324a0388343e0", - Phone = "13049809673", - Role = 2, - Salt = "c2f1bbebf79549178117880c43e58776" - }); - }); - - modelBuilder.Entity("FastWiki.Service.Domain.Wikis.Aggregates.Wiki", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreationTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Creator") - .HasColumnType("uuid"); - - b.Property("EmbeddingModel") - .HasColumnType("text"); - - b.Property("Icon") - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("Model") - .HasColumnType("text"); - - b.Property("ModificationTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Modifier") - .HasColumnType("uuid"); - - b.Property("Name") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.HasKey("Id"); - - b.HasIndex("Name"); - - b.ToTable("wiki-wikis", (string)null); - }); - - modelBuilder.Entity("FastWiki.Service.Domain.Wikis.Aggregates.WikiDetail", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreationTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Creator") - .HasColumnType("bigint"); - - b.Property("DataCount") - .HasColumnType("integer"); - - b.Property("FileId") - .HasColumnType("bigint"); - - b.Property("FileName") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("MaxTokensPerLine") - .HasColumnType("integer"); - - b.Property("MaxTokensPerParagraph") - .HasColumnType("integer"); - - b.Property("Mode") - .HasColumnType("integer"); - - b.Property("ModificationTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Modifier") - .HasColumnType("bigint"); - - b.Property("OverlappingTokens") - .HasColumnType("integer"); - - b.Property("Path") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("QAPromptTemplate") - .HasColumnType("text"); - - b.Property("State") - .HasColumnType("integer"); - - b.Property("TrainingPattern") - .HasColumnType("integer"); - - b.Property("Type") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("WikiId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.ToTable("wiki-wiki-details", (string)null); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Service/FastWiki.Service/Migrations/PostgreSQL/20240512150624_RemoveDialog.cs b/src/Service/FastWiki.Service/Migrations/PostgreSQL/20240512150624_RemoveDialog.cs deleted file mode 100644 index 66e92d0b..00000000 --- a/src/Service/FastWiki.Service/Migrations/PostgreSQL/20240512150624_RemoveDialog.cs +++ /dev/null @@ -1,819 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -namespace FastWiki.Service.Migrations.PostgreSQL; - -/// -public partial class RemoveDialog : Migration -{ - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - "wiki-chat-dialog"); - - migrationBuilder.DropTable( - "wiki-chat-dialog-history"); - - migrationBuilder.DeleteData( - "wiki-users", - "Id", - new Guid("81ba41a1-27df-4f6c-b327-dfec1bce8c85")); - - migrationBuilder.AlterColumn( - "Name", - "wiki-wikis", - "character varying(100)", - maxLength: 100, - nullable: true, - oldClrType: typeof(string), - oldType: "character varying(100)", - oldMaxLength: 100); - - migrationBuilder.AlterColumn( - "Model", - "wiki-wikis", - "text", - nullable: true, - oldClrType: typeof(string), - oldType: "text"); - - migrationBuilder.AlterColumn( - "Icon", - "wiki-wikis", - "text", - nullable: true, - oldClrType: typeof(string), - oldType: "text"); - - migrationBuilder.AlterColumn( - "EmbeddingModel", - "wiki-wikis", - "text", - nullable: true, - oldClrType: typeof(string), - oldType: "text"); - - migrationBuilder.AlterColumn( - "Type", - "wiki-wiki-details", - "character varying(100)", - maxLength: 100, - nullable: true, - oldClrType: typeof(string), - oldType: "character varying(100)", - oldMaxLength: 100); - - migrationBuilder.AlterColumn( - "Path", - "wiki-wiki-details", - "character varying(200)", - maxLength: 200, - nullable: true, - oldClrType: typeof(string), - oldType: "character varying(200)", - oldMaxLength: 200); - - migrationBuilder.AlterColumn( - "FileName", - "wiki-wiki-details", - "character varying(100)", - maxLength: 100, - nullable: true, - oldClrType: typeof(string), - oldType: "character varying(100)", - oldMaxLength: 100); - - migrationBuilder.AlterColumn( - "Salt", - "wiki-users", - "text", - nullable: true, - oldClrType: typeof(string), - oldType: "text"); - - migrationBuilder.AlterColumn( - "Phone", - "wiki-users", - "text", - nullable: true, - oldClrType: typeof(string), - oldType: "text"); - - migrationBuilder.AlterColumn( - "Password", - "wiki-users", - "character varying(100)", - maxLength: 100, - nullable: true, - oldClrType: typeof(string), - oldType: "character varying(100)", - oldMaxLength: 100); - - migrationBuilder.AlterColumn( - "Name", - "wiki-users", - "character varying(100)", - maxLength: 100, - nullable: true, - oldClrType: typeof(string), - oldType: "character varying(100)", - oldMaxLength: 100); - - migrationBuilder.AlterColumn( - "Email", - "wiki-users", - "text", - nullable: true, - oldClrType: typeof(string), - oldType: "text"); - - migrationBuilder.AlterColumn( - "Avatar", - "wiki-users", - "text", - nullable: true, - oldClrType: typeof(string), - oldType: "text"); - - migrationBuilder.AlterColumn( - "Account", - "wiki-users", - "text", - nullable: true, - oldClrType: typeof(string), - oldType: "text"); - - migrationBuilder.AlterColumn( - "Parameters", - "wiki-function-calls", - "text", - nullable: true, - oldClrType: typeof(string), - oldType: "text"); - - migrationBuilder.AlterColumn( - "Name", - "wiki-function-calls", - "text", - nullable: true, - oldClrType: typeof(string), - oldType: "text"); - - migrationBuilder.AlterColumn( - "Main", - "wiki-function-calls", - "text", - nullable: true, - oldClrType: typeof(string), - oldType: "text"); - - migrationBuilder.AlterColumn( - "Items", - "wiki-function-calls", - "text", - nullable: true, - oldClrType: typeof(string), - oldType: "text"); - - migrationBuilder.AlterColumn( - "Imports", - "wiki-function-calls", - "text", - nullable: true, - oldClrType: typeof(string), - oldType: "text"); - - migrationBuilder.AlterColumn( - "Description", - "wiki-function-calls", - "text", - nullable: true, - oldClrType: typeof(string), - oldType: "text"); - - migrationBuilder.AlterColumn( - "Content", - "wiki-function-calls", - "text", - nullable: true, - oldClrType: typeof(string), - oldType: "text"); - - migrationBuilder.AlterColumn( - "Path", - "wiki-file-storages", - "character varying(200)", - maxLength: 200, - nullable: true, - oldClrType: typeof(string), - oldType: "character varying(200)", - oldMaxLength: 200); - - migrationBuilder.AlterColumn( - "Name", - "wiki-file-storages", - "character varying(100)", - maxLength: 100, - nullable: true, - oldClrType: typeof(string), - oldType: "character varying(100)", - oldMaxLength: 100); - - migrationBuilder.AlterColumn( - "FullName", - "wiki-file-storages", - "text", - nullable: true, - oldClrType: typeof(string), - oldType: "text"); - - migrationBuilder.AlterColumn( - "Name", - "wiki-chat-share", - "text", - nullable: true, - oldClrType: typeof(string), - oldType: "text"); - - migrationBuilder.AlterColumn( - "ChatApplicationId", - "wiki-chat-share", - "text", - nullable: true, - oldClrType: typeof(string), - oldType: "text"); - - migrationBuilder.AlterColumn( - "WikiIds", - "wiki-chat-application", - "text", - nullable: true, - oldClrType: typeof(string), - oldType: "text"); - - migrationBuilder.AlterColumn( - "Template", - "wiki-chat-application", - "text", - nullable: true, - oldClrType: typeof(string), - oldType: "text"); - - migrationBuilder.AlterColumn( - "Prompt", - "wiki-chat-application", - "text", - nullable: true, - oldClrType: typeof(string), - oldType: "text"); - - migrationBuilder.AlterColumn( - "Parameter", - "wiki-chat-application", - "text", - nullable: true, - oldClrType: typeof(string), - oldType: "text"); - - migrationBuilder.AlterColumn( - "Opener", - "wiki-chat-application", - "text", - nullable: true, - oldClrType: typeof(string), - oldType: "text"); - - migrationBuilder.AlterColumn( - "Name", - "wiki-chat-application", - "text", - nullable: true, - oldClrType: typeof(string), - oldType: "text"); - - migrationBuilder.AlterColumn( - "FunctionIds", - "wiki-chat-application", - "text", - nullable: true, - oldClrType: typeof(string), - oldType: "text"); - - migrationBuilder.AlterColumn( - "Extend", - "wiki-chat-application", - "text", - nullable: true, - oldClrType: typeof(string), - oldType: "text"); - - migrationBuilder.AlterColumn( - "ChatModel", - "wiki-chat-application", - "text", - nullable: true, - oldClrType: typeof(string), - oldType: "text"); - - migrationBuilder.CreateTable( - "wiki-chat-record", - table => new - { - Id = table.Column("text", nullable: false), - ApplicationId = table.Column("text", nullable: true), - Question = table.Column("text", nullable: true), - Creator = table.Column("uuid", nullable: false), - CreationTime = table.Column("timestamp without time zone", nullable: false), - Modifier = table.Column("uuid", nullable: false), - ModificationTime = table.Column("timestamp without time zone", nullable: false) - }, - constraints: table => { table.PrimaryKey("PK_wiki-chat-record", x => x.Id); }); - - migrationBuilder.CreateTable( - "wiki-questions", - table => new - { - Id = table.Column("text", nullable: false), - ApplicationId = table.Column("text", nullable: true), - Question = table.Column("text", nullable: true), - Order = table.Column("integer", nullable: false), - CreationTime = table.Column("timestamp without time zone", nullable: false) - }, - constraints: table => { table.PrimaryKey("PK_wiki-questions", x => x.Id); }); - - migrationBuilder.InsertData( - "wiki-users", - new[] - { - "Id", "Account", "Avatar", "CreationTime", "Creator", "Email", "IsDeleted", "IsDisable", - "ModificationTime", "Modifier", "Name", "Password", "Phone", "Role", "Salt" - }, - new object[] - { - new Guid("369059b8-6905-488b-87ab-447afa38b4de"), "admin", - "https://blog-simple.oss-cn-shenzhen.aliyuncs.com/Avatar.jpg", - new DateTime(2024, 5, 12, 15, 6, 23, 950, DateTimeKind.Utc).AddTicks(9764), null, "239573049@qq.com", - false, false, new DateTime(2024, 5, 12, 15, 6, 23, 950, DateTimeKind.Utc).AddTicks(9767), null, "admin", - "25b55175d0b2235c4fd324a0388343e0", "13049809673", 2, "c2f1bbebf79549178117880c43e58776" - }); - - migrationBuilder.CreateIndex( - "IX_wiki-chat-record_CreationTime", - "wiki-chat-record", - "CreationTime"); - - migrationBuilder.CreateIndex( - "IX_wiki-questions_CreationTime", - "wiki-questions", - "CreationTime"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - "wiki-chat-record"); - - migrationBuilder.DropTable( - "wiki-questions"); - - migrationBuilder.DeleteData( - "wiki-users", - "Id", - new Guid("369059b8-6905-488b-87ab-447afa38b4de")); - - migrationBuilder.AlterColumn( - "Name", - "wiki-wikis", - "character varying(100)", - maxLength: 100, - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "character varying(100)", - oldMaxLength: 100, - oldNullable: true); - - migrationBuilder.AlterColumn( - "Model", - "wiki-wikis", - "text", - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - "Icon", - "wiki-wikis", - "text", - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - "EmbeddingModel", - "wiki-wikis", - "text", - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - "Type", - "wiki-wiki-details", - "character varying(100)", - maxLength: 100, - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "character varying(100)", - oldMaxLength: 100, - oldNullable: true); - - migrationBuilder.AlterColumn( - "Path", - "wiki-wiki-details", - "character varying(200)", - maxLength: 200, - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "character varying(200)", - oldMaxLength: 200, - oldNullable: true); - - migrationBuilder.AlterColumn( - "FileName", - "wiki-wiki-details", - "character varying(100)", - maxLength: 100, - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "character varying(100)", - oldMaxLength: 100, - oldNullable: true); - - migrationBuilder.AlterColumn( - "Salt", - "wiki-users", - "text", - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - "Phone", - "wiki-users", - "text", - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - "Password", - "wiki-users", - "character varying(100)", - maxLength: 100, - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "character varying(100)", - oldMaxLength: 100, - oldNullable: true); - - migrationBuilder.AlterColumn( - "Name", - "wiki-users", - "character varying(100)", - maxLength: 100, - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "character varying(100)", - oldMaxLength: 100, - oldNullable: true); - - migrationBuilder.AlterColumn( - "Email", - "wiki-users", - "text", - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - "Avatar", - "wiki-users", - "text", - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - "Account", - "wiki-users", - "text", - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - "Parameters", - "wiki-function-calls", - "text", - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - "Name", - "wiki-function-calls", - "text", - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - "Main", - "wiki-function-calls", - "text", - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - "Items", - "wiki-function-calls", - "text", - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - "Imports", - "wiki-function-calls", - "text", - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - "Description", - "wiki-function-calls", - "text", - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - "Content", - "wiki-function-calls", - "text", - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - "Path", - "wiki-file-storages", - "character varying(200)", - maxLength: 200, - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "character varying(200)", - oldMaxLength: 200, - oldNullable: true); - - migrationBuilder.AlterColumn( - "Name", - "wiki-file-storages", - "character varying(100)", - maxLength: 100, - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "character varying(100)", - oldMaxLength: 100, - oldNullable: true); - - migrationBuilder.AlterColumn( - "FullName", - "wiki-file-storages", - "text", - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - "Name", - "wiki-chat-share", - "text", - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - "ChatApplicationId", - "wiki-chat-share", - "text", - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - "WikiIds", - "wiki-chat-application", - "text", - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - "Template", - "wiki-chat-application", - "text", - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - "Prompt", - "wiki-chat-application", - "text", - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - "Parameter", - "wiki-chat-application", - "text", - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - "Opener", - "wiki-chat-application", - "text", - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - "Name", - "wiki-chat-application", - "text", - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - "FunctionIds", - "wiki-chat-application", - "text", - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - "Extend", - "wiki-chat-application", - "text", - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - "ChatModel", - "wiki-chat-application", - "text", - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.CreateTable( - "wiki-chat-dialog", - table => new - { - Id = table.Column("text", nullable: false), - ApplicationId = table.Column("text", nullable: false), - ChatId = table.Column("text", nullable: true), - CreationTime = table.Column("timestamp without time zone", nullable: false), - Creator = table.Column("uuid", nullable: false), - Description = table.Column("text", nullable: false), - IsDeleted = table.Column("boolean", nullable: false), - ModificationTime = table.Column("timestamp without time zone", nullable: false), - Modifier = table.Column("uuid", nullable: false), - Name = table.Column("text", nullable: false), - Type = table.Column("integer", nullable: false) - }, - constraints: table => { table.PrimaryKey("PK_wiki-chat-dialog", x => x.Id); }); - - migrationBuilder.CreateTable( - "wiki-chat-dialog-history", - table => new - { - Id = table.Column("text", nullable: false), - ChatDialogId = table.Column("text", nullable: false), - Content = table.Column("text", maxLength: -1, nullable: false), - CreationTime = table.Column("timestamp without time zone", nullable: false), - Creator = table.Column("uuid", nullable: false), - Current = table.Column("boolean", nullable: false), - IsDeleted = table.Column("boolean", nullable: false), - ModificationTime = table.Column("timestamp without time zone", nullable: false), - Modifier = table.Column("uuid", nullable: false), - ReferenceFile = table.Column("text", nullable: false), - TokenConsumption = table.Column("integer", nullable: false), - Type = table.Column("integer", nullable: false) - }, - constraints: table => { table.PrimaryKey("PK_wiki-chat-dialog-history", x => x.Id); }); - - migrationBuilder.InsertData( - "wiki-users", - new[] - { - "Id", "Account", "Avatar", "CreationTime", "Creator", "Email", "IsDeleted", "IsDisable", - "ModificationTime", "Modifier", "Name", "Password", "Phone", "Role", "Salt" - }, - new object[] - { - new Guid("81ba41a1-27df-4f6c-b327-dfec1bce8c85"), "admin", - "https://blog-simple.oss-cn-shenzhen.aliyuncs.com/Avatar.jpg", - new DateTime(2024, 4, 22, 14, 36, 39, 431, DateTimeKind.Utc).AddTicks(7635), null, "239573049@qq.com", - false, false, new DateTime(2024, 4, 22, 14, 36, 39, 431, DateTimeKind.Utc).AddTicks(7638), null, - "admin", "ae322a2c4c237df3b8683703e51442aa", "13049809673", 2, "19ea5ff625024a1d80bbf86c054e132c" - }); - - migrationBuilder.CreateIndex( - "IX_wiki-chat-dialog_ChatId", - "wiki-chat-dialog", - "ChatId"); - - migrationBuilder.CreateIndex( - "IX_wiki-chat-dialog-history_ChatDialogId", - "wiki-chat-dialog-history", - "ChatDialogId"); - - migrationBuilder.CreateIndex( - "IX_wiki-chat-dialog-history_Creator", - "wiki-chat-dialog-history", - "Creator"); - } -} \ No newline at end of file diff --git a/src/Service/FastWiki.Service/Migrations/PostgreSQL/20240818080712_UpdateWikiType.Designer.cs b/src/Service/FastWiki.Service/Migrations/PostgreSQL/20240818080712_UpdateWikiType.Designer.cs deleted file mode 100644 index 56c7c2f2..00000000 --- a/src/Service/FastWiki.Service/Migrations/PostgreSQL/20240818080712_UpdateWikiType.Designer.cs +++ /dev/null @@ -1,516 +0,0 @@ -// -using System; -using FastWiki.Service.DataAccess; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace FastWiki.Service.Migrations.PostgreSQL -{ - [DbContext(typeof(WikiDbContext))] - [Migration("20240818080712_UpdateWikiType")] - partial class UpdateWikiType - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.7"); - - modelBuilder.Entity("FastWiki.Service.Domain.ChatApplications.Aggregates.ChatApplication", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ChatModel") - .HasColumnType("TEXT"); - - b.Property("CreationTime") - .HasColumnType("TEXT"); - - b.Property("Creator") - .HasColumnType("TEXT"); - - b.Property("Extend") - .HasColumnType("TEXT"); - - b.Property("FunctionIds") - .HasColumnType("TEXT"); - - b.Property("IsDeleted") - .HasColumnType("INTEGER"); - - b.Property("MaxResponseToken") - .HasColumnType("INTEGER"); - - b.Property("ModificationTime") - .HasColumnType("TEXT"); - - b.Property("Modifier") - .HasColumnType("TEXT"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("NoReplyFoundTemplate") - .HasColumnType("TEXT"); - - b.Property("Opener") - .HasColumnType("TEXT"); - - b.Property("Parameter") - .HasColumnType("TEXT"); - - b.Property("Prompt") - .HasColumnType("TEXT"); - - b.Property("ReferenceUpperLimit") - .HasColumnType("INTEGER"); - - b.Property("Relevancy") - .HasColumnType("REAL"); - - b.Property("ShowSourceFile") - .HasColumnType("INTEGER"); - - b.Property("Temperature") - .HasColumnType("REAL"); - - b.Property("Template") - .HasColumnType("TEXT"); - - b.Property("WikiIds") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("Name"); - - b.ToTable("wiki-chat-application", (string)null); - }); - - modelBuilder.Entity("FastWiki.Service.Domain.ChatApplications.Aggregates.ChatRecord", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ApplicationId") - .HasColumnType("TEXT"); - - b.Property("CreationTime") - .HasColumnType("TEXT"); - - b.Property("Creator") - .HasColumnType("TEXT"); - - b.Property("ModificationTime") - .HasColumnType("TEXT"); - - b.Property("Modifier") - .HasColumnType("TEXT"); - - b.Property("Question") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("CreationTime"); - - b.ToTable("wiki-chat-record", (string)null); - }); - - modelBuilder.Entity("FastWiki.Service.Domain.ChatApplications.Aggregates.ChatShare", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("APIKey") - .HasColumnType("TEXT"); - - b.Property("AvailableQuantity") - .HasColumnType("INTEGER"); - - b.Property("AvailableToken") - .HasColumnType("INTEGER"); - - b.Property("ChatApplicationId") - .HasColumnType("TEXT"); - - b.Property("CreationTime") - .HasColumnType("TEXT"); - - b.Property("Creator") - .HasColumnType("TEXT"); - - b.Property("Expires") - .HasColumnType("TEXT"); - - b.Property("ModificationTime") - .HasColumnType("TEXT"); - - b.Property("Modifier") - .HasColumnType("TEXT"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("UsedToken") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ChatApplicationId"); - - b.ToTable("wiki-chat-share", (string)null); - }); - - modelBuilder.Entity("FastWiki.Service.Domain.ChatApplications.Aggregates.Questions", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ApplicationId") - .HasColumnType("TEXT"); - - b.Property("CreationTime") - .HasColumnType("TEXT"); - - b.Property("Order") - .HasColumnType("INTEGER"); - - b.Property("Question") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("wiki-questions", (string)null); - }); - - modelBuilder.Entity("FastWiki.Service.Domain.Function.Aggregates.FastWikiFunctionCall", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Content") - .HasColumnType("TEXT"); - - b.Property("CreationTime") - .HasColumnType("TEXT"); - - b.Property("Creator") - .HasColumnType("TEXT"); - - b.Property("Description") - .HasColumnType("TEXT"); - - b.Property("Enable") - .HasColumnType("INTEGER"); - - b.Property("Imports") - .HasColumnType("TEXT"); - - b.Property("IsDeleted") - .HasColumnType("INTEGER"); - - b.Property("Items") - .HasColumnType("TEXT"); - - b.Property("Main") - .HasColumnType("TEXT"); - - b.Property("ModificationTime") - .HasColumnType("TEXT"); - - b.Property("Modifier") - .HasColumnType("TEXT"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("Parameters") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("CreationTime"); - - b.ToTable("wiki-function-calls", (string)null); - }); - - modelBuilder.Entity("FastWiki.Service.Domain.Storage.Aggregates.FileStorage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("CreationTime") - .HasColumnType("TEXT"); - - b.Property("Creator") - .HasColumnType("TEXT"); - - b.Property("FullName") - .HasColumnType("TEXT"); - - b.Property("IsCompression") - .HasColumnType("INTEGER"); - - b.Property("IsDeleted") - .HasColumnType("INTEGER"); - - b.Property("ModificationTime") - .HasColumnType("TEXT"); - - b.Property("Modifier") - .HasColumnType("TEXT"); - - b.Property("Name") - .HasMaxLength(100) - .HasColumnType("TEXT"); - - b.Property("Path") - .HasMaxLength(200) - .HasColumnType("TEXT"); - - b.Property("Size") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.ToTable("wiki-file-storages", (string)null); - }); - - modelBuilder.Entity("FastWiki.Service.Domain.Users.Aggregates.User", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property("Account") - .HasColumnType("TEXT"); - - b.Property("Avatar") - .HasColumnType("TEXT"); - - b.Property("CreationTime") - .HasColumnType("TEXT"); - - b.Property("Creator") - .HasColumnType("TEXT"); - - b.Property("Email") - .HasColumnType("TEXT"); - - b.Property("IsDeleted") - .HasColumnType("INTEGER"); - - b.Property("IsDisable") - .HasColumnType("INTEGER"); - - b.Property("ModificationTime") - .HasColumnType("TEXT"); - - b.Property("Modifier") - .HasColumnType("TEXT"); - - b.Property("Name") - .HasMaxLength(100) - .HasColumnType("TEXT"); - - b.Property("Password") - .HasMaxLength(100) - .HasColumnType("TEXT"); - - b.Property("Phone") - .HasColumnType("TEXT"); - - b.Property("Role") - .HasColumnType("INTEGER"); - - b.Property("Salt") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("wiki-users", (string)null); - - b.HasData( - new - { - Id = new Guid("3667f5ec-65d4-4543-84cd-00a246c77215"), - Account = "admin", - Avatar = "https://blog-simple.oss-cn-shenzhen.aliyuncs.com/Avatar.jpg", - CreationTime = new DateTime(2024, 8, 18, 8, 7, 12, 702, DateTimeKind.Utc).AddTicks(9179), - Email = "239573049@qq.com", - IsDeleted = false, - IsDisable = false, - ModificationTime = new DateTime(2024, 8, 18, 8, 7, 12, 702, DateTimeKind.Utc).AddTicks(9183), - Name = "admin", - Password = "6726a2a303e85cffa4eb309d66715aee", - Phone = "13049809673", - Role = 2, - Salt = "93b6fe5a96f94c64b7ddff515a007e2f" - }); - }); - - modelBuilder.Entity("FastWiki.Service.Domain.Wikis.Aggregates.Wiki", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("CreationTime") - .HasColumnType("TEXT"); - - b.Property("Creator") - .HasColumnType("TEXT"); - - b.Property("EmbeddingModel") - .HasColumnType("TEXT"); - - b.Property("Icon") - .HasColumnType("TEXT"); - - b.Property("IsDeleted") - .HasColumnType("INTEGER"); - - b.Property("Model") - .HasColumnType("TEXT"); - - b.Property("ModificationTime") - .HasColumnType("TEXT"); - - b.Property("Modifier") - .HasColumnType("TEXT"); - - b.Property("Name") - .HasMaxLength(100) - .HasColumnType("TEXT"); - - b.Property("VectorType") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("Name"); - - b.ToTable("wiki-wikis", (string)null); - }); - - modelBuilder.Entity("FastWiki.Service.Domain.Wikis.Aggregates.WikiDetail", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("CreationTime") - .HasColumnType("TEXT"); - - b.Property("Creator") - .HasColumnType("INTEGER"); - - b.Property("DataCount") - .HasColumnType("INTEGER"); - - b.Property("FileId") - .HasColumnType("INTEGER"); - - b.Property("FileName") - .HasMaxLength(100) - .HasColumnType("TEXT"); - - b.Property("MaxTokensPerLine") - .HasColumnType("INTEGER"); - - b.Property("MaxTokensPerParagraph") - .HasColumnType("INTEGER"); - - b.Property("Mode") - .HasColumnType("INTEGER"); - - b.Property("ModificationTime") - .HasColumnType("TEXT"); - - b.Property("Modifier") - .HasColumnType("INTEGER"); - - b.Property("OverlappingTokens") - .HasColumnType("INTEGER"); - - b.Property("Path") - .HasMaxLength(200) - .HasColumnType("TEXT"); - - b.Property("QAPromptTemplate") - .HasColumnType("TEXT"); - - b.Property("State") - .HasColumnType("INTEGER"); - - b.Property("TrainingPattern") - .HasColumnType("INTEGER"); - - b.Property("Type") - .HasMaxLength(100) - .HasColumnType("TEXT"); - - b.Property("WikiId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.ToTable("wiki-wiki-details", (string)null); - }); - - modelBuilder.Entity("mem0.Core.Model.History", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property("DateTime") - .HasColumnType("TEXT"); - - b.Property("Event") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("IsDeleted") - .HasColumnType("INTEGER"); - - b.Property("MemoryId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("NewValue") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("PrevValue") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("TrackId") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("MemoryId"); - - b.HasIndex("TrackId"); - - b.HasIndex("UserId"); - - b.ToTable("wiki-histories", (string)null); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Service/FastWiki.Service/Migrations/PostgreSQL/20240818080712_UpdateWikiType.cs b/src/Service/FastWiki.Service/Migrations/PostgreSQL/20240818080712_UpdateWikiType.cs deleted file mode 100644 index e4d735d5..00000000 --- a/src/Service/FastWiki.Service/Migrations/PostgreSQL/20240818080712_UpdateWikiType.cs +++ /dev/null @@ -1,2054 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace FastWiki.Service.Migrations.PostgreSQL -{ - /// - public partial class UpdateWikiType : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_wiki-questions_CreationTime", - table: "wiki-questions"); - - migrationBuilder.DeleteData( - table: "wiki-users", - keyColumn: "Id", - keyValue: new Guid("369059b8-6905-488b-87ab-447afa38b4de")); - - migrationBuilder.AlterColumn( - name: "Name", - table: "wiki-wikis", - type: "TEXT", - maxLength: 100, - nullable: true, - oldClrType: typeof(string), - oldType: "character varying(100)", - oldMaxLength: 100, - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Modifier", - table: "wiki-wikis", - type: "TEXT", - nullable: true, - oldClrType: typeof(Guid), - oldType: "uuid", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "ModificationTime", - table: "wiki-wikis", - type: "TEXT", - nullable: false, - oldClrType: typeof(DateTime), - oldType: "timestamp without time zone"); - - migrationBuilder.AlterColumn( - name: "Model", - table: "wiki-wikis", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "IsDeleted", - table: "wiki-wikis", - type: "INTEGER", - nullable: false, - oldClrType: typeof(bool), - oldType: "boolean"); - - migrationBuilder.AlterColumn( - name: "Icon", - table: "wiki-wikis", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "EmbeddingModel", - table: "wiki-wikis", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Creator", - table: "wiki-wikis", - type: "TEXT", - nullable: true, - oldClrType: typeof(Guid), - oldType: "uuid", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "CreationTime", - table: "wiki-wikis", - type: "TEXT", - nullable: false, - oldClrType: typeof(DateTime), - oldType: "timestamp without time zone"); - - migrationBuilder.AlterColumn( - name: "Id", - table: "wiki-wikis", - type: "INTEGER", - nullable: false, - oldClrType: typeof(long), - oldType: "bigint") - .Annotation("Sqlite:Autoincrement", true) - .OldAnnotation("Sqlite:Autoincrement", true); - - migrationBuilder.AddColumn( - name: "VectorType", - table: "wiki-wikis", - type: "INTEGER", - nullable: false, - defaultValue: 0); - - migrationBuilder.AlterColumn( - name: "WikiId", - table: "wiki-wiki-details", - type: "INTEGER", - nullable: false, - oldClrType: typeof(long), - oldType: "bigint"); - - migrationBuilder.AlterColumn( - name: "Type", - table: "wiki-wiki-details", - type: "TEXT", - maxLength: 100, - nullable: true, - oldClrType: typeof(string), - oldType: "character varying(100)", - oldMaxLength: 100, - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "TrainingPattern", - table: "wiki-wiki-details", - type: "INTEGER", - nullable: false, - oldClrType: typeof(int), - oldType: "integer"); - - migrationBuilder.AlterColumn( - name: "State", - table: "wiki-wiki-details", - type: "INTEGER", - nullable: false, - oldClrType: typeof(int), - oldType: "integer"); - - migrationBuilder.AlterColumn( - name: "QAPromptTemplate", - table: "wiki-wiki-details", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Path", - table: "wiki-wiki-details", - type: "TEXT", - maxLength: 200, - nullable: true, - oldClrType: typeof(string), - oldType: "character varying(200)", - oldMaxLength: 200, - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "OverlappingTokens", - table: "wiki-wiki-details", - type: "INTEGER", - nullable: false, - oldClrType: typeof(int), - oldType: "integer"); - - migrationBuilder.AlterColumn( - name: "Modifier", - table: "wiki-wiki-details", - type: "INTEGER", - nullable: false, - oldClrType: typeof(long), - oldType: "bigint"); - - migrationBuilder.AlterColumn( - name: "ModificationTime", - table: "wiki-wiki-details", - type: "TEXT", - nullable: false, - oldClrType: typeof(DateTime), - oldType: "timestamp without time zone"); - - migrationBuilder.AlterColumn( - name: "Mode", - table: "wiki-wiki-details", - type: "INTEGER", - nullable: false, - oldClrType: typeof(int), - oldType: "integer"); - - migrationBuilder.AlterColumn( - name: "MaxTokensPerParagraph", - table: "wiki-wiki-details", - type: "INTEGER", - nullable: false, - oldClrType: typeof(int), - oldType: "integer"); - - migrationBuilder.AlterColumn( - name: "MaxTokensPerLine", - table: "wiki-wiki-details", - type: "INTEGER", - nullable: false, - oldClrType: typeof(int), - oldType: "integer"); - - migrationBuilder.AlterColumn( - name: "FileName", - table: "wiki-wiki-details", - type: "TEXT", - maxLength: 100, - nullable: true, - oldClrType: typeof(string), - oldType: "character varying(100)", - oldMaxLength: 100, - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "FileId", - table: "wiki-wiki-details", - type: "INTEGER", - nullable: false, - oldClrType: typeof(long), - oldType: "bigint"); - - migrationBuilder.AlterColumn( - name: "DataCount", - table: "wiki-wiki-details", - type: "INTEGER", - nullable: false, - oldClrType: typeof(int), - oldType: "integer"); - - migrationBuilder.AlterColumn( - name: "Creator", - table: "wiki-wiki-details", - type: "INTEGER", - nullable: false, - oldClrType: typeof(long), - oldType: "bigint"); - - migrationBuilder.AlterColumn( - name: "CreationTime", - table: "wiki-wiki-details", - type: "TEXT", - nullable: false, - oldClrType: typeof(DateTime), - oldType: "timestamp without time zone"); - - migrationBuilder.AlterColumn( - name: "Id", - table: "wiki-wiki-details", - type: "INTEGER", - nullable: false, - oldClrType: typeof(long), - oldType: "bigint") - .Annotation("Sqlite:Autoincrement", true) - .OldAnnotation("Sqlite:Autoincrement", true); - - migrationBuilder.AlterColumn( - name: "Salt", - table: "wiki-users", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Role", - table: "wiki-users", - type: "INTEGER", - nullable: false, - oldClrType: typeof(int), - oldType: "integer"); - - migrationBuilder.AlterColumn( - name: "Phone", - table: "wiki-users", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Password", - table: "wiki-users", - type: "TEXT", - maxLength: 100, - nullable: true, - oldClrType: typeof(string), - oldType: "character varying(100)", - oldMaxLength: 100, - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Name", - table: "wiki-users", - type: "TEXT", - maxLength: 100, - nullable: true, - oldClrType: typeof(string), - oldType: "character varying(100)", - oldMaxLength: 100, - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Modifier", - table: "wiki-users", - type: "TEXT", - nullable: true, - oldClrType: typeof(Guid), - oldType: "uuid", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "ModificationTime", - table: "wiki-users", - type: "TEXT", - nullable: false, - oldClrType: typeof(DateTime), - oldType: "timestamp without time zone"); - - migrationBuilder.AlterColumn( - name: "IsDisable", - table: "wiki-users", - type: "INTEGER", - nullable: false, - oldClrType: typeof(bool), - oldType: "boolean"); - - migrationBuilder.AlterColumn( - name: "IsDeleted", - table: "wiki-users", - type: "INTEGER", - nullable: false, - oldClrType: typeof(bool), - oldType: "boolean"); - - migrationBuilder.AlterColumn( - name: "Email", - table: "wiki-users", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Creator", - table: "wiki-users", - type: "TEXT", - nullable: true, - oldClrType: typeof(Guid), - oldType: "uuid", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "CreationTime", - table: "wiki-users", - type: "TEXT", - nullable: false, - oldClrType: typeof(DateTime), - oldType: "timestamp without time zone"); - - migrationBuilder.AlterColumn( - name: "Avatar", - table: "wiki-users", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Account", - table: "wiki-users", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Id", - table: "wiki-users", - type: "TEXT", - nullable: false, - oldClrType: typeof(Guid), - oldType: "uuid"); - - migrationBuilder.AlterColumn( - name: "Question", - table: "wiki-questions", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Order", - table: "wiki-questions", - type: "INTEGER", - nullable: false, - oldClrType: typeof(int), - oldType: "integer"); - - migrationBuilder.AlterColumn( - name: "CreationTime", - table: "wiki-questions", - type: "TEXT", - nullable: false, - oldClrType: typeof(DateTime), - oldType: "timestamp without time zone"); - - migrationBuilder.AlterColumn( - name: "ApplicationId", - table: "wiki-questions", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Id", - table: "wiki-questions", - type: "TEXT", - nullable: false, - oldClrType: typeof(string), - oldType: "text"); - - migrationBuilder.AlterColumn( - name: "Parameters", - table: "wiki-function-calls", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Name", - table: "wiki-function-calls", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Modifier", - table: "wiki-function-calls", - type: "TEXT", - nullable: false, - oldClrType: typeof(Guid), - oldType: "uuid"); - - migrationBuilder.AlterColumn( - name: "ModificationTime", - table: "wiki-function-calls", - type: "TEXT", - nullable: false, - oldClrType: typeof(DateTime), - oldType: "timestamp without time zone"); - - migrationBuilder.AlterColumn( - name: "Main", - table: "wiki-function-calls", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Items", - table: "wiki-function-calls", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "IsDeleted", - table: "wiki-function-calls", - type: "INTEGER", - nullable: false, - oldClrType: typeof(bool), - oldType: "boolean"); - - migrationBuilder.AlterColumn( - name: "Imports", - table: "wiki-function-calls", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Enable", - table: "wiki-function-calls", - type: "INTEGER", - nullable: false, - oldClrType: typeof(bool), - oldType: "boolean"); - - migrationBuilder.AlterColumn( - name: "Description", - table: "wiki-function-calls", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Creator", - table: "wiki-function-calls", - type: "TEXT", - nullable: false, - oldClrType: typeof(Guid), - oldType: "uuid"); - - migrationBuilder.AlterColumn( - name: "CreationTime", - table: "wiki-function-calls", - type: "TEXT", - nullable: false, - oldClrType: typeof(DateTime), - oldType: "timestamp without time zone"); - - migrationBuilder.AlterColumn( - name: "Content", - table: "wiki-function-calls", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Id", - table: "wiki-function-calls", - type: "INTEGER", - nullable: false, - oldClrType: typeof(long), - oldType: "bigint") - .Annotation("Sqlite:Autoincrement", true) - .OldAnnotation("Sqlite:Autoincrement", true); - - migrationBuilder.AlterColumn( - name: "Size", - table: "wiki-file-storages", - type: "INTEGER", - nullable: false, - oldClrType: typeof(long), - oldType: "bigint"); - - migrationBuilder.AlterColumn( - name: "Path", - table: "wiki-file-storages", - type: "TEXT", - maxLength: 200, - nullable: true, - oldClrType: typeof(string), - oldType: "character varying(200)", - oldMaxLength: 200, - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Name", - table: "wiki-file-storages", - type: "TEXT", - maxLength: 100, - nullable: true, - oldClrType: typeof(string), - oldType: "character varying(100)", - oldMaxLength: 100, - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Modifier", - table: "wiki-file-storages", - type: "TEXT", - nullable: true, - oldClrType: typeof(Guid), - oldType: "uuid", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "ModificationTime", - table: "wiki-file-storages", - type: "TEXT", - nullable: false, - oldClrType: typeof(DateTime), - oldType: "timestamp without time zone"); - - migrationBuilder.AlterColumn( - name: "IsDeleted", - table: "wiki-file-storages", - type: "INTEGER", - nullable: false, - oldClrType: typeof(bool), - oldType: "boolean"); - - migrationBuilder.AlterColumn( - name: "IsCompression", - table: "wiki-file-storages", - type: "INTEGER", - nullable: false, - oldClrType: typeof(bool), - oldType: "boolean"); - - migrationBuilder.AlterColumn( - name: "FullName", - table: "wiki-file-storages", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Creator", - table: "wiki-file-storages", - type: "TEXT", - nullable: true, - oldClrType: typeof(Guid), - oldType: "uuid", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "CreationTime", - table: "wiki-file-storages", - type: "TEXT", - nullable: false, - oldClrType: typeof(DateTime), - oldType: "timestamp without time zone"); - - migrationBuilder.AlterColumn( - name: "Id", - table: "wiki-file-storages", - type: "INTEGER", - nullable: false, - oldClrType: typeof(long), - oldType: "bigint") - .Annotation("Sqlite:Autoincrement", true) - .OldAnnotation("Sqlite:Autoincrement", true); - - migrationBuilder.AlterColumn( - name: "UsedToken", - table: "wiki-chat-share", - type: "INTEGER", - nullable: false, - oldClrType: typeof(long), - oldType: "bigint"); - - migrationBuilder.AlterColumn( - name: "Name", - table: "wiki-chat-share", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Modifier", - table: "wiki-chat-share", - type: "TEXT", - nullable: false, - oldClrType: typeof(Guid), - oldType: "uuid"); - - migrationBuilder.AlterColumn( - name: "ModificationTime", - table: "wiki-chat-share", - type: "TEXT", - nullable: false, - oldClrType: typeof(DateTime), - oldType: "timestamp without time zone"); - - migrationBuilder.AlterColumn( - name: "Expires", - table: "wiki-chat-share", - type: "TEXT", - nullable: true, - oldClrType: typeof(DateTime), - oldType: "timestamp without time zone", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Creator", - table: "wiki-chat-share", - type: "TEXT", - nullable: false, - oldClrType: typeof(Guid), - oldType: "uuid"); - - migrationBuilder.AlterColumn( - name: "CreationTime", - table: "wiki-chat-share", - type: "TEXT", - nullable: false, - oldClrType: typeof(DateTime), - oldType: "timestamp without time zone"); - - migrationBuilder.AlterColumn( - name: "ChatApplicationId", - table: "wiki-chat-share", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "AvailableToken", - table: "wiki-chat-share", - type: "INTEGER", - nullable: false, - oldClrType: typeof(long), - oldType: "bigint"); - - migrationBuilder.AlterColumn( - name: "AvailableQuantity", - table: "wiki-chat-share", - type: "INTEGER", - nullable: false, - oldClrType: typeof(int), - oldType: "integer"); - - migrationBuilder.AlterColumn( - name: "APIKey", - table: "wiki-chat-share", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Id", - table: "wiki-chat-share", - type: "TEXT", - nullable: false, - oldClrType: typeof(string), - oldType: "text"); - - migrationBuilder.AlterColumn( - name: "Question", - table: "wiki-chat-record", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Modifier", - table: "wiki-chat-record", - type: "TEXT", - nullable: false, - oldClrType: typeof(Guid), - oldType: "uuid"); - - migrationBuilder.AlterColumn( - name: "ModificationTime", - table: "wiki-chat-record", - type: "TEXT", - nullable: false, - oldClrType: typeof(DateTime), - oldType: "timestamp without time zone"); - - migrationBuilder.AlterColumn( - name: "Creator", - table: "wiki-chat-record", - type: "TEXT", - nullable: false, - oldClrType: typeof(Guid), - oldType: "uuid"); - - migrationBuilder.AlterColumn( - name: "CreationTime", - table: "wiki-chat-record", - type: "TEXT", - nullable: false, - oldClrType: typeof(DateTime), - oldType: "timestamp without time zone"); - - migrationBuilder.AlterColumn( - name: "ApplicationId", - table: "wiki-chat-record", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Id", - table: "wiki-chat-record", - type: "TEXT", - nullable: false, - oldClrType: typeof(string), - oldType: "text"); - - migrationBuilder.AlterColumn( - name: "WikiIds", - table: "wiki-chat-application", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Template", - table: "wiki-chat-application", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Temperature", - table: "wiki-chat-application", - type: "REAL", - nullable: false, - oldClrType: typeof(double), - oldType: "double precision"); - - migrationBuilder.AlterColumn( - name: "ShowSourceFile", - table: "wiki-chat-application", - type: "INTEGER", - nullable: false, - oldClrType: typeof(bool), - oldType: "boolean"); - - migrationBuilder.AlterColumn( - name: "Relevancy", - table: "wiki-chat-application", - type: "REAL", - nullable: false, - oldClrType: typeof(double), - oldType: "double precision"); - - migrationBuilder.AlterColumn( - name: "ReferenceUpperLimit", - table: "wiki-chat-application", - type: "INTEGER", - nullable: false, - oldClrType: typeof(int), - oldType: "integer"); - - migrationBuilder.AlterColumn( - name: "Prompt", - table: "wiki-chat-application", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Parameter", - table: "wiki-chat-application", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Opener", - table: "wiki-chat-application", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "NoReplyFoundTemplate", - table: "wiki-chat-application", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Name", - table: "wiki-chat-application", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Modifier", - table: "wiki-chat-application", - type: "TEXT", - nullable: true, - oldClrType: typeof(Guid), - oldType: "uuid", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "ModificationTime", - table: "wiki-chat-application", - type: "TEXT", - nullable: false, - oldClrType: typeof(DateTime), - oldType: "timestamp without time zone"); - - migrationBuilder.AlterColumn( - name: "MaxResponseToken", - table: "wiki-chat-application", - type: "INTEGER", - nullable: false, - oldClrType: typeof(int), - oldType: "integer"); - - migrationBuilder.AlterColumn( - name: "IsDeleted", - table: "wiki-chat-application", - type: "INTEGER", - nullable: false, - oldClrType: typeof(bool), - oldType: "boolean"); - - migrationBuilder.AlterColumn( - name: "FunctionIds", - table: "wiki-chat-application", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Extend", - table: "wiki-chat-application", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Creator", - table: "wiki-chat-application", - type: "TEXT", - nullable: true, - oldClrType: typeof(Guid), - oldType: "uuid", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "CreationTime", - table: "wiki-chat-application", - type: "TEXT", - nullable: false, - oldClrType: typeof(DateTime), - oldType: "timestamp without time zone"); - - migrationBuilder.AlterColumn( - name: "ChatModel", - table: "wiki-chat-application", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Id", - table: "wiki-chat-application", - type: "TEXT", - nullable: false, - oldClrType: typeof(string), - oldType: "text"); - - migrationBuilder.CreateTable( - name: "wiki-histories", - columns: table => new - { - Id = table.Column(type: "TEXT", nullable: false), - MemoryId = table.Column(type: "TEXT", nullable: false), - PrevValue = table.Column(type: "TEXT", nullable: false), - NewValue = table.Column(type: "TEXT", nullable: false), - Event = table.Column(type: "TEXT", nullable: false), - DateTime = table.Column(type: "TEXT", nullable: false), - IsDeleted = table.Column(type: "INTEGER", nullable: false), - UserId = table.Column(type: "TEXT", nullable: true), - TrackId = table.Column(type: "TEXT", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_wiki-histories", x => x.Id); - }); - - migrationBuilder.InsertData( - table: "wiki-users", - columns: new[] { "Id", "Account", "Avatar", "CreationTime", "Creator", "Email", "IsDeleted", "IsDisable", "ModificationTime", "Modifier", "Name", "Password", "Phone", "Role", "Salt" }, - values: new object[] { new Guid("3667f5ec-65d4-4543-84cd-00a246c77215"), "admin", "https://blog-simple.oss-cn-shenzhen.aliyuncs.com/Avatar.jpg", new DateTime(2024, 8, 18, 8, 7, 12, 702, DateTimeKind.Utc).AddTicks(9179), null, "239573049@qq.com", false, false, new DateTime(2024, 8, 18, 8, 7, 12, 702, DateTimeKind.Utc).AddTicks(9183), null, "admin", "6726a2a303e85cffa4eb309d66715aee", "13049809673", 2, "93b6fe5a96f94c64b7ddff515a007e2f" }); - - migrationBuilder.CreateIndex( - name: "IX_wiki-histories_MemoryId", - table: "wiki-histories", - column: "MemoryId"); - - migrationBuilder.CreateIndex( - name: "IX_wiki-histories_TrackId", - table: "wiki-histories", - column: "TrackId"); - - migrationBuilder.CreateIndex( - name: "IX_wiki-histories_UserId", - table: "wiki-histories", - column: "UserId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "wiki-histories"); - - migrationBuilder.DeleteData( - table: "wiki-users", - keyColumn: "Id", - keyValue: new Guid("3667f5ec-65d4-4543-84cd-00a246c77215")); - - migrationBuilder.DropColumn( - name: "VectorType", - table: "wiki-wikis"); - - migrationBuilder.AlterColumn( - name: "Name", - table: "wiki-wikis", - type: "character varying(100)", - maxLength: 100, - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT", - oldMaxLength: 100, - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Modifier", - table: "wiki-wikis", - type: "uuid", - nullable: true, - oldClrType: typeof(Guid), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "ModificationTime", - table: "wiki-wikis", - type: "timestamp without time zone", - nullable: false, - oldClrType: typeof(DateTime), - oldType: "TEXT"); - - migrationBuilder.AlterColumn( - name: "Model", - table: "wiki-wikis", - type: "text", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "IsDeleted", - table: "wiki-wikis", - type: "boolean", - nullable: false, - oldClrType: typeof(bool), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn( - name: "Icon", - table: "wiki-wikis", - type: "text", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "EmbeddingModel", - table: "wiki-wikis", - type: "text", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Creator", - table: "wiki-wikis", - type: "uuid", - nullable: true, - oldClrType: typeof(Guid), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "CreationTime", - table: "wiki-wikis", - type: "timestamp without time zone", - nullable: false, - oldClrType: typeof(DateTime), - oldType: "TEXT"); - - migrationBuilder.AlterColumn( - name: "Id", - table: "wiki-wikis", - type: "bigint", - nullable: false, - oldClrType: typeof(long), - oldType: "INTEGER") - .Annotation("Sqlite:Autoincrement", true) - .OldAnnotation("Sqlite:Autoincrement", true); - - migrationBuilder.AlterColumn( - name: "WikiId", - table: "wiki-wiki-details", - type: "bigint", - nullable: false, - oldClrType: typeof(long), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn( - name: "Type", - table: "wiki-wiki-details", - type: "character varying(100)", - maxLength: 100, - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT", - oldMaxLength: 100, - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "TrainingPattern", - table: "wiki-wiki-details", - type: "integer", - nullable: false, - oldClrType: typeof(int), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn( - name: "State", - table: "wiki-wiki-details", - type: "integer", - nullable: false, - oldClrType: typeof(int), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn( - name: "QAPromptTemplate", - table: "wiki-wiki-details", - type: "text", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Path", - table: "wiki-wiki-details", - type: "character varying(200)", - maxLength: 200, - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT", - oldMaxLength: 200, - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "OverlappingTokens", - table: "wiki-wiki-details", - type: "integer", - nullable: false, - oldClrType: typeof(int), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn( - name: "Modifier", - table: "wiki-wiki-details", - type: "bigint", - nullable: false, - oldClrType: typeof(long), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn( - name: "ModificationTime", - table: "wiki-wiki-details", - type: "timestamp without time zone", - nullable: false, - oldClrType: typeof(DateTime), - oldType: "TEXT"); - - migrationBuilder.AlterColumn( - name: "Mode", - table: "wiki-wiki-details", - type: "integer", - nullable: false, - oldClrType: typeof(int), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn( - name: "MaxTokensPerParagraph", - table: "wiki-wiki-details", - type: "integer", - nullable: false, - oldClrType: typeof(int), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn( - name: "MaxTokensPerLine", - table: "wiki-wiki-details", - type: "integer", - nullable: false, - oldClrType: typeof(int), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn( - name: "FileName", - table: "wiki-wiki-details", - type: "character varying(100)", - maxLength: 100, - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT", - oldMaxLength: 100, - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "FileId", - table: "wiki-wiki-details", - type: "bigint", - nullable: false, - oldClrType: typeof(long), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn( - name: "DataCount", - table: "wiki-wiki-details", - type: "integer", - nullable: false, - oldClrType: typeof(int), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn( - name: "Creator", - table: "wiki-wiki-details", - type: "bigint", - nullable: false, - oldClrType: typeof(long), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn( - name: "CreationTime", - table: "wiki-wiki-details", - type: "timestamp without time zone", - nullable: false, - oldClrType: typeof(DateTime), - oldType: "TEXT"); - - migrationBuilder.AlterColumn( - name: "Id", - table: "wiki-wiki-details", - type: "bigint", - nullable: false, - oldClrType: typeof(long), - oldType: "INTEGER") - .Annotation("Sqlite:Autoincrement", true) - .OldAnnotation("Sqlite:Autoincrement", true); - - migrationBuilder.AlterColumn( - name: "Salt", - table: "wiki-users", - type: "text", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Role", - table: "wiki-users", - type: "integer", - nullable: false, - oldClrType: typeof(int), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn( - name: "Phone", - table: "wiki-users", - type: "text", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Password", - table: "wiki-users", - type: "character varying(100)", - maxLength: 100, - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT", - oldMaxLength: 100, - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Name", - table: "wiki-users", - type: "character varying(100)", - maxLength: 100, - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT", - oldMaxLength: 100, - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Modifier", - table: "wiki-users", - type: "uuid", - nullable: true, - oldClrType: typeof(Guid), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "ModificationTime", - table: "wiki-users", - type: "timestamp without time zone", - nullable: false, - oldClrType: typeof(DateTime), - oldType: "TEXT"); - - migrationBuilder.AlterColumn( - name: "IsDisable", - table: "wiki-users", - type: "boolean", - nullable: false, - oldClrType: typeof(bool), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn( - name: "IsDeleted", - table: "wiki-users", - type: "boolean", - nullable: false, - oldClrType: typeof(bool), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn( - name: "Email", - table: "wiki-users", - type: "text", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Creator", - table: "wiki-users", - type: "uuid", - nullable: true, - oldClrType: typeof(Guid), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "CreationTime", - table: "wiki-users", - type: "timestamp without time zone", - nullable: false, - oldClrType: typeof(DateTime), - oldType: "TEXT"); - - migrationBuilder.AlterColumn( - name: "Avatar", - table: "wiki-users", - type: "text", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Account", - table: "wiki-users", - type: "text", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Id", - table: "wiki-users", - type: "uuid", - nullable: false, - oldClrType: typeof(Guid), - oldType: "TEXT"); - - migrationBuilder.AlterColumn( - name: "Question", - table: "wiki-questions", - type: "text", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Order", - table: "wiki-questions", - type: "integer", - nullable: false, - oldClrType: typeof(int), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn( - name: "CreationTime", - table: "wiki-questions", - type: "timestamp without time zone", - nullable: false, - oldClrType: typeof(DateTime), - oldType: "TEXT"); - - migrationBuilder.AlterColumn( - name: "ApplicationId", - table: "wiki-questions", - type: "text", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Id", - table: "wiki-questions", - type: "text", - nullable: false, - oldClrType: typeof(string), - oldType: "TEXT"); - - migrationBuilder.AlterColumn( - name: "Parameters", - table: "wiki-function-calls", - type: "text", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Name", - table: "wiki-function-calls", - type: "text", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Modifier", - table: "wiki-function-calls", - type: "uuid", - nullable: false, - oldClrType: typeof(Guid), - oldType: "TEXT"); - - migrationBuilder.AlterColumn( - name: "ModificationTime", - table: "wiki-function-calls", - type: "timestamp without time zone", - nullable: false, - oldClrType: typeof(DateTime), - oldType: "TEXT"); - - migrationBuilder.AlterColumn( - name: "Main", - table: "wiki-function-calls", - type: "text", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Items", - table: "wiki-function-calls", - type: "text", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "IsDeleted", - table: "wiki-function-calls", - type: "boolean", - nullable: false, - oldClrType: typeof(bool), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn( - name: "Imports", - table: "wiki-function-calls", - type: "text", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Enable", - table: "wiki-function-calls", - type: "boolean", - nullable: false, - oldClrType: typeof(bool), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn( - name: "Description", - table: "wiki-function-calls", - type: "text", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Creator", - table: "wiki-function-calls", - type: "uuid", - nullable: false, - oldClrType: typeof(Guid), - oldType: "TEXT"); - - migrationBuilder.AlterColumn( - name: "CreationTime", - table: "wiki-function-calls", - type: "timestamp without time zone", - nullable: false, - oldClrType: typeof(DateTime), - oldType: "TEXT"); - - migrationBuilder.AlterColumn( - name: "Content", - table: "wiki-function-calls", - type: "text", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Id", - table: "wiki-function-calls", - type: "bigint", - nullable: false, - oldClrType: typeof(long), - oldType: "INTEGER") - .Annotation("Sqlite:Autoincrement", true) - .OldAnnotation("Sqlite:Autoincrement", true); - - migrationBuilder.AlterColumn( - name: "Size", - table: "wiki-file-storages", - type: "bigint", - nullable: false, - oldClrType: typeof(long), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn( - name: "Path", - table: "wiki-file-storages", - type: "character varying(200)", - maxLength: 200, - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT", - oldMaxLength: 200, - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Name", - table: "wiki-file-storages", - type: "character varying(100)", - maxLength: 100, - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT", - oldMaxLength: 100, - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Modifier", - table: "wiki-file-storages", - type: "uuid", - nullable: true, - oldClrType: typeof(Guid), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "ModificationTime", - table: "wiki-file-storages", - type: "timestamp without time zone", - nullable: false, - oldClrType: typeof(DateTime), - oldType: "TEXT"); - - migrationBuilder.AlterColumn( - name: "IsDeleted", - table: "wiki-file-storages", - type: "boolean", - nullable: false, - oldClrType: typeof(bool), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn( - name: "IsCompression", - table: "wiki-file-storages", - type: "boolean", - nullable: false, - oldClrType: typeof(bool), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn( - name: "FullName", - table: "wiki-file-storages", - type: "text", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Creator", - table: "wiki-file-storages", - type: "uuid", - nullable: true, - oldClrType: typeof(Guid), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "CreationTime", - table: "wiki-file-storages", - type: "timestamp without time zone", - nullable: false, - oldClrType: typeof(DateTime), - oldType: "TEXT"); - - migrationBuilder.AlterColumn( - name: "Id", - table: "wiki-file-storages", - type: "bigint", - nullable: false, - oldClrType: typeof(long), - oldType: "INTEGER") - .Annotation("Sqlite:Autoincrement", true) - .OldAnnotation("Sqlite:Autoincrement", true); - - migrationBuilder.AlterColumn( - name: "UsedToken", - table: "wiki-chat-share", - type: "bigint", - nullable: false, - oldClrType: typeof(long), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn( - name: "Name", - table: "wiki-chat-share", - type: "text", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Modifier", - table: "wiki-chat-share", - type: "uuid", - nullable: false, - oldClrType: typeof(Guid), - oldType: "TEXT"); - - migrationBuilder.AlterColumn( - name: "ModificationTime", - table: "wiki-chat-share", - type: "timestamp without time zone", - nullable: false, - oldClrType: typeof(DateTime), - oldType: "TEXT"); - - migrationBuilder.AlterColumn( - name: "Expires", - table: "wiki-chat-share", - type: "timestamp without time zone", - nullable: true, - oldClrType: typeof(DateTime), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Creator", - table: "wiki-chat-share", - type: "uuid", - nullable: false, - oldClrType: typeof(Guid), - oldType: "TEXT"); - - migrationBuilder.AlterColumn( - name: "CreationTime", - table: "wiki-chat-share", - type: "timestamp without time zone", - nullable: false, - oldClrType: typeof(DateTime), - oldType: "TEXT"); - - migrationBuilder.AlterColumn( - name: "ChatApplicationId", - table: "wiki-chat-share", - type: "text", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "AvailableToken", - table: "wiki-chat-share", - type: "bigint", - nullable: false, - oldClrType: typeof(long), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn( - name: "AvailableQuantity", - table: "wiki-chat-share", - type: "integer", - nullable: false, - oldClrType: typeof(int), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn( - name: "APIKey", - table: "wiki-chat-share", - type: "text", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Id", - table: "wiki-chat-share", - type: "text", - nullable: false, - oldClrType: typeof(string), - oldType: "TEXT"); - - migrationBuilder.AlterColumn( - name: "Question", - table: "wiki-chat-record", - type: "text", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Modifier", - table: "wiki-chat-record", - type: "uuid", - nullable: false, - oldClrType: typeof(Guid), - oldType: "TEXT"); - - migrationBuilder.AlterColumn( - name: "ModificationTime", - table: "wiki-chat-record", - type: "timestamp without time zone", - nullable: false, - oldClrType: typeof(DateTime), - oldType: "TEXT"); - - migrationBuilder.AlterColumn( - name: "Creator", - table: "wiki-chat-record", - type: "uuid", - nullable: false, - oldClrType: typeof(Guid), - oldType: "TEXT"); - - migrationBuilder.AlterColumn( - name: "CreationTime", - table: "wiki-chat-record", - type: "timestamp without time zone", - nullable: false, - oldClrType: typeof(DateTime), - oldType: "TEXT"); - - migrationBuilder.AlterColumn( - name: "ApplicationId", - table: "wiki-chat-record", - type: "text", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Id", - table: "wiki-chat-record", - type: "text", - nullable: false, - oldClrType: typeof(string), - oldType: "TEXT"); - - migrationBuilder.AlterColumn( - name: "WikiIds", - table: "wiki-chat-application", - type: "text", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Template", - table: "wiki-chat-application", - type: "text", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Temperature", - table: "wiki-chat-application", - type: "double precision", - nullable: false, - oldClrType: typeof(double), - oldType: "REAL"); - - migrationBuilder.AlterColumn( - name: "ShowSourceFile", - table: "wiki-chat-application", - type: "boolean", - nullable: false, - oldClrType: typeof(bool), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn( - name: "Relevancy", - table: "wiki-chat-application", - type: "double precision", - nullable: false, - oldClrType: typeof(double), - oldType: "REAL"); - - migrationBuilder.AlterColumn( - name: "ReferenceUpperLimit", - table: "wiki-chat-application", - type: "integer", - nullable: false, - oldClrType: typeof(int), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn( - name: "Prompt", - table: "wiki-chat-application", - type: "text", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Parameter", - table: "wiki-chat-application", - type: "text", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Opener", - table: "wiki-chat-application", - type: "text", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "NoReplyFoundTemplate", - table: "wiki-chat-application", - type: "text", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Name", - table: "wiki-chat-application", - type: "text", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Modifier", - table: "wiki-chat-application", - type: "uuid", - nullable: true, - oldClrType: typeof(Guid), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "ModificationTime", - table: "wiki-chat-application", - type: "timestamp without time zone", - nullable: false, - oldClrType: typeof(DateTime), - oldType: "TEXT"); - - migrationBuilder.AlterColumn( - name: "MaxResponseToken", - table: "wiki-chat-application", - type: "integer", - nullable: false, - oldClrType: typeof(int), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn( - name: "IsDeleted", - table: "wiki-chat-application", - type: "boolean", - nullable: false, - oldClrType: typeof(bool), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn( - name: "FunctionIds", - table: "wiki-chat-application", - type: "text", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Extend", - table: "wiki-chat-application", - type: "text", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Creator", - table: "wiki-chat-application", - type: "uuid", - nullable: true, - oldClrType: typeof(Guid), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "CreationTime", - table: "wiki-chat-application", - type: "timestamp without time zone", - nullable: false, - oldClrType: typeof(DateTime), - oldType: "TEXT"); - - migrationBuilder.AlterColumn( - name: "ChatModel", - table: "wiki-chat-application", - type: "text", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "Id", - table: "wiki-chat-application", - type: "text", - nullable: false, - oldClrType: typeof(string), - oldType: "TEXT"); - - migrationBuilder.InsertData( - table: "wiki-users", - columns: new[] { "Id", "Account", "Avatar", "CreationTime", "Creator", "Email", "IsDeleted", "IsDisable", "ModificationTime", "Modifier", "Name", "Password", "Phone", "Role", "Salt" }, - values: new object[] { new Guid("369059b8-6905-488b-87ab-447afa38b4de"), "admin", "https://blog-simple.oss-cn-shenzhen.aliyuncs.com/Avatar.jpg", new DateTime(2024, 5, 12, 15, 6, 23, 950, DateTimeKind.Utc).AddTicks(9764), null, "239573049@qq.com", false, false, new DateTime(2024, 5, 12, 15, 6, 23, 950, DateTimeKind.Utc).AddTicks(9767), null, "admin", "25b55175d0b2235c4fd324a0388343e0", "13049809673", 2, "c2f1bbebf79549178117880c43e58776" }); - - migrationBuilder.CreateIndex( - name: "IX_wiki-questions_CreationTime", - table: "wiki-questions", - column: "CreationTime"); - } - } -} diff --git a/src/Service/FastWiki.Service/Migrations/PostgreSQL/20240818140758_AddWikiQuantized.Designer.cs b/src/Service/FastWiki.Service/Migrations/PostgreSQL/20240818140758_AddWikiQuantized.Designer.cs deleted file mode 100644 index 3614b048..00000000 --- a/src/Service/FastWiki.Service/Migrations/PostgreSQL/20240818140758_AddWikiQuantized.Designer.cs +++ /dev/null @@ -1,549 +0,0 @@ -// -using System; -using FastWiki.Service.DataAccess; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace FastWiki.Service.Migrations.PostgreSQL -{ - [DbContext(typeof(WikiDbContext))] - [Migration("20240818140758_AddWikiQuantized")] - partial class AddWikiQuantized - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.7"); - - modelBuilder.Entity("FastWiki.Service.Domain.ChatApplications.Aggregates.ChatApplication", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ChatModel") - .HasColumnType("TEXT"); - - b.Property("CreationTime") - .HasColumnType("TEXT"); - - b.Property("Creator") - .HasColumnType("TEXT"); - - b.Property("Extend") - .HasColumnType("TEXT"); - - b.Property("FunctionIds") - .HasColumnType("TEXT"); - - b.Property("IsDeleted") - .HasColumnType("INTEGER"); - - b.Property("MaxResponseToken") - .HasColumnType("INTEGER"); - - b.Property("ModificationTime") - .HasColumnType("TEXT"); - - b.Property("Modifier") - .HasColumnType("TEXT"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("NoReplyFoundTemplate") - .HasColumnType("TEXT"); - - b.Property("Opener") - .HasColumnType("TEXT"); - - b.Property("Parameter") - .HasColumnType("TEXT"); - - b.Property("Prompt") - .HasColumnType("TEXT"); - - b.Property("ReferenceUpperLimit") - .HasColumnType("INTEGER"); - - b.Property("Relevancy") - .HasColumnType("REAL"); - - b.Property("ShowSourceFile") - .HasColumnType("INTEGER"); - - b.Property("Temperature") - .HasColumnType("REAL"); - - b.Property("Template") - .HasColumnType("TEXT"); - - b.Property("WikiIds") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("Name"); - - b.ToTable("wiki-chat-application", (string)null); - }); - - modelBuilder.Entity("FastWiki.Service.Domain.ChatApplications.Aggregates.ChatRecord", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ApplicationId") - .HasColumnType("TEXT"); - - b.Property("CreationTime") - .HasColumnType("TEXT"); - - b.Property("Creator") - .HasColumnType("TEXT"); - - b.Property("ModificationTime") - .HasColumnType("TEXT"); - - b.Property("Modifier") - .HasColumnType("TEXT"); - - b.Property("Question") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("CreationTime"); - - b.ToTable("wiki-chat-record", (string)null); - }); - - modelBuilder.Entity("FastWiki.Service.Domain.ChatApplications.Aggregates.ChatShare", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("APIKey") - .HasColumnType("TEXT"); - - b.Property("AvailableQuantity") - .HasColumnType("INTEGER"); - - b.Property("AvailableToken") - .HasColumnType("INTEGER"); - - b.Property("ChatApplicationId") - .HasColumnType("TEXT"); - - b.Property("CreationTime") - .HasColumnType("TEXT"); - - b.Property("Creator") - .HasColumnType("TEXT"); - - b.Property("Expires") - .HasColumnType("TEXT"); - - b.Property("ModificationTime") - .HasColumnType("TEXT"); - - b.Property("Modifier") - .HasColumnType("TEXT"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("UsedToken") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ChatApplicationId"); - - b.ToTable("wiki-chat-share", (string)null); - }); - - modelBuilder.Entity("FastWiki.Service.Domain.ChatApplications.Aggregates.Questions", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ApplicationId") - .HasColumnType("TEXT"); - - b.Property("CreationTime") - .HasColumnType("TEXT"); - - b.Property("Order") - .HasColumnType("INTEGER"); - - b.Property("Question") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("wiki-questions", (string)null); - }); - - modelBuilder.Entity("FastWiki.Service.Domain.Function.Aggregates.FastWikiFunctionCall", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Content") - .HasColumnType("TEXT"); - - b.Property("CreationTime") - .HasColumnType("TEXT"); - - b.Property("Creator") - .HasColumnType("TEXT"); - - b.Property("Description") - .HasColumnType("TEXT"); - - b.Property("Enable") - .HasColumnType("INTEGER"); - - b.Property("Imports") - .HasColumnType("TEXT"); - - b.Property("IsDeleted") - .HasColumnType("INTEGER"); - - b.Property("Items") - .HasColumnType("TEXT"); - - b.Property("Main") - .HasColumnType("TEXT"); - - b.Property("ModificationTime") - .HasColumnType("TEXT"); - - b.Property("Modifier") - .HasColumnType("TEXT"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("Parameters") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("CreationTime"); - - b.ToTable("wiki-function-calls", (string)null); - }); - - modelBuilder.Entity("FastWiki.Service.Domain.Storage.Aggregates.FileStorage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("CreationTime") - .HasColumnType("TEXT"); - - b.Property("Creator") - .HasColumnType("TEXT"); - - b.Property("FullName") - .HasColumnType("TEXT"); - - b.Property("IsCompression") - .HasColumnType("INTEGER"); - - b.Property("IsDeleted") - .HasColumnType("INTEGER"); - - b.Property("ModificationTime") - .HasColumnType("TEXT"); - - b.Property("Modifier") - .HasColumnType("TEXT"); - - b.Property("Name") - .HasMaxLength(100) - .HasColumnType("TEXT"); - - b.Property("Path") - .HasMaxLength(200) - .HasColumnType("TEXT"); - - b.Property("Size") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.ToTable("wiki-file-storages", (string)null); - }); - - modelBuilder.Entity("FastWiki.Service.Domain.Users.Aggregates.User", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property("Account") - .HasColumnType("TEXT"); - - b.Property("Avatar") - .HasColumnType("TEXT"); - - b.Property("CreationTime") - .HasColumnType("TEXT"); - - b.Property("Creator") - .HasColumnType("TEXT"); - - b.Property("Email") - .HasColumnType("TEXT"); - - b.Property("IsDeleted") - .HasColumnType("INTEGER"); - - b.Property("IsDisable") - .HasColumnType("INTEGER"); - - b.Property("ModificationTime") - .HasColumnType("TEXT"); - - b.Property("Modifier") - .HasColumnType("TEXT"); - - b.Property("Name") - .HasMaxLength(100) - .HasColumnType("TEXT"); - - b.Property("Password") - .HasMaxLength(100) - .HasColumnType("TEXT"); - - b.Property("Phone") - .HasColumnType("TEXT"); - - b.Property("Role") - .HasColumnType("INTEGER"); - - b.Property("Salt") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("wiki-users", (string)null); - - b.HasData( - new - { - Id = new Guid("c61a32ee-9254-4018-a34d-6df4c9269946"), - Account = "admin", - Avatar = "https://blog-simple.oss-cn-shenzhen.aliyuncs.com/Avatar.jpg", - CreationTime = new DateTime(2024, 8, 18, 14, 7, 58, 699, DateTimeKind.Utc).AddTicks(6364), - Email = "239573049@qq.com", - IsDeleted = false, - IsDisable = false, - ModificationTime = new DateTime(2024, 8, 18, 14, 7, 58, 699, DateTimeKind.Utc).AddTicks(6367), - Name = "admin", - Password = "8b0378cf4c257b662603ccf76cc61d29", - Phone = "13049809673", - Role = 2, - Salt = "37c8e92134974dc4b28d875436da2afd" - }); - }); - - modelBuilder.Entity("FastWiki.Service.Domain.Wikis.Aggregates.QuantizedList", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("CreationTime") - .HasColumnType("TEXT"); - - b.Property("ProcessTime") - .HasColumnType("TEXT"); - - b.Property("Remark") - .HasColumnType("TEXT"); - - b.Property("State") - .HasColumnType("INTEGER"); - - b.Property("WikiDetailId") - .HasColumnType("INTEGER"); - - b.Property("WikiId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("WikiDetailId"); - - b.HasIndex("WikiId"); - - b.ToTable("wiki-quantized-lists", (string)null); - }); - - modelBuilder.Entity("FastWiki.Service.Domain.Wikis.Aggregates.Wiki", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("CreationTime") - .HasColumnType("TEXT"); - - b.Property("Creator") - .HasColumnType("TEXT"); - - b.Property("EmbeddingModel") - .HasColumnType("TEXT"); - - b.Property("Icon") - .HasColumnType("TEXT"); - - b.Property("IsDeleted") - .HasColumnType("INTEGER"); - - b.Property("Model") - .HasColumnType("TEXT"); - - b.Property("ModificationTime") - .HasColumnType("TEXT"); - - b.Property("Modifier") - .HasColumnType("TEXT"); - - b.Property("Name") - .HasMaxLength(100) - .HasColumnType("TEXT"); - - b.Property("VectorType") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("Name"); - - b.ToTable("wiki-wikis", (string)null); - }); - - modelBuilder.Entity("FastWiki.Service.Domain.Wikis.Aggregates.WikiDetail", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("CreationTime") - .HasColumnType("TEXT"); - - b.Property("Creator") - .HasColumnType("INTEGER"); - - b.Property("DataCount") - .HasColumnType("INTEGER"); - - b.Property("FileId") - .HasColumnType("INTEGER"); - - b.Property("FileName") - .HasMaxLength(100) - .HasColumnType("TEXT"); - - b.Property("MaxTokensPerLine") - .HasColumnType("INTEGER"); - - b.Property("MaxTokensPerParagraph") - .HasColumnType("INTEGER"); - - b.Property("Mode") - .HasColumnType("INTEGER"); - - b.Property("ModificationTime") - .HasColumnType("TEXT"); - - b.Property("Modifier") - .HasColumnType("INTEGER"); - - b.Property("OverlappingTokens") - .HasColumnType("INTEGER"); - - b.Property("Path") - .HasMaxLength(200) - .HasColumnType("TEXT"); - - b.Property("QAPromptTemplate") - .HasColumnType("TEXT"); - - b.Property("State") - .HasColumnType("INTEGER"); - - b.Property("TrainingPattern") - .HasColumnType("INTEGER"); - - b.Property("Type") - .HasMaxLength(100) - .HasColumnType("TEXT"); - - b.Property("WikiId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.ToTable("wiki-wiki-details", (string)null); - }); - - modelBuilder.Entity("mem0.Core.Model.History", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property("DateTime") - .HasColumnType("TEXT"); - - b.Property("Event") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("IsDeleted") - .HasColumnType("INTEGER"); - - b.Property("MemoryId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("NewValue") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("PrevValue") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("TrackId") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("MemoryId"); - - b.HasIndex("TrackId"); - - b.HasIndex("UserId"); - - b.ToTable("wiki-histories", (string)null); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Service/FastWiki.Service/Migrations/PostgreSQL/20240818140758_AddWikiQuantized.cs b/src/Service/FastWiki.Service/Migrations/PostgreSQL/20240818140758_AddWikiQuantized.cs deleted file mode 100644 index 8e5c3208..00000000 --- a/src/Service/FastWiki.Service/Migrations/PostgreSQL/20240818140758_AddWikiQuantized.cs +++ /dev/null @@ -1,70 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace FastWiki.Service.Migrations.PostgreSQL -{ - /// - public partial class AddWikiQuantized : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DeleteData( - table: "wiki-users", - keyColumn: "Id", - keyValue: new Guid("3667f5ec-65d4-4543-84cd-00a246c77215")); - - migrationBuilder.CreateTable( - name: "wiki-quantized-lists", - columns: table => new - { - Id = table.Column(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - WikiId = table.Column(type: "INTEGER", nullable: false), - WikiDetailId = table.Column(type: "INTEGER", nullable: false), - State = table.Column(type: "INTEGER", nullable: false), - Remark = table.Column(type: "TEXT", nullable: true), - ProcessTime = table.Column(type: "TEXT", nullable: true), - CreationTime = table.Column(type: "TEXT", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_wiki-quantized-lists", x => x.Id); - }); - - migrationBuilder.InsertData( - table: "wiki-users", - columns: new[] { "Id", "Account", "Avatar", "CreationTime", "Creator", "Email", "IsDeleted", "IsDisable", "ModificationTime", "Modifier", "Name", "Password", "Phone", "Role", "Salt" }, - values: new object[] { new Guid("c61a32ee-9254-4018-a34d-6df4c9269946"), "admin", "https://blog-simple.oss-cn-shenzhen.aliyuncs.com/Avatar.jpg", new DateTime(2024, 8, 18, 14, 7, 58, 699, DateTimeKind.Utc).AddTicks(6364), null, "239573049@qq.com", false, false, new DateTime(2024, 8, 18, 14, 7, 58, 699, DateTimeKind.Utc).AddTicks(6367), null, "admin", "8b0378cf4c257b662603ccf76cc61d29", "13049809673", 2, "37c8e92134974dc4b28d875436da2afd" }); - - migrationBuilder.CreateIndex( - name: "IX_wiki-quantized-lists_WikiDetailId", - table: "wiki-quantized-lists", - column: "WikiDetailId"); - - migrationBuilder.CreateIndex( - name: "IX_wiki-quantized-lists_WikiId", - table: "wiki-quantized-lists", - column: "WikiId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "wiki-quantized-lists"); - - migrationBuilder.DeleteData( - table: "wiki-users", - keyColumn: "Id", - keyValue: new Guid("c61a32ee-9254-4018-a34d-6df4c9269946")); - - migrationBuilder.InsertData( - table: "wiki-users", - columns: new[] { "Id", "Account", "Avatar", "CreationTime", "Creator", "Email", "IsDeleted", "IsDisable", "ModificationTime", "Modifier", "Name", "Password", "Phone", "Role", "Salt" }, - values: new object[] { new Guid("3667f5ec-65d4-4543-84cd-00a246c77215"), "admin", "https://blog-simple.oss-cn-shenzhen.aliyuncs.com/Avatar.jpg", new DateTime(2024, 8, 18, 8, 7, 12, 702, DateTimeKind.Utc).AddTicks(9179), null, "239573049@qq.com", false, false, new DateTime(2024, 8, 18, 8, 7, 12, 702, DateTimeKind.Utc).AddTicks(9183), null, "admin", "6726a2a303e85cffa4eb309d66715aee", "13049809673", 2, "93b6fe5a96f94c64b7ddff515a007e2f" }); - } - } -} diff --git a/src/Service/FastWiki.Service/Migrations/PostgreSQL/20240422143639_Initial.Designer.cs b/src/Service/FastWiki.Service/Migrations/PostgreSQL/20240818181423_Initial.Designer.cs similarity index 84% rename from src/Service/FastWiki.Service/Migrations/PostgreSQL/20240422143639_Initial.Designer.cs rename to src/Service/FastWiki.Service/Migrations/PostgreSQL/20240818181423_Initial.Designer.cs index 8b17eef1..66d3d921 100644 --- a/src/Service/FastWiki.Service/Migrations/PostgreSQL/20240422143639_Initial.Designer.cs +++ b/src/Service/FastWiki.Service/Migrations/PostgreSQL/20240818181423_Initial.Designer.cs @@ -12,7 +12,7 @@ namespace FastWiki.Service.Migrations.PostgreSQL { [DbContext(typeof(WikiDbContext))] - [Migration("20240422143639_Initial")] + [Migration("20240818181423_Initial")] partial class Initial { /// @@ -20,7 +20,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "8.0.0") + .HasAnnotation("ProductVersion", "8.0.7") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); @@ -31,7 +31,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnType("text"); b.Property("ChatModel") - .IsRequired() .HasColumnType("text"); b.Property("CreationTime") @@ -41,11 +40,9 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnType("uuid"); b.Property("Extend") - .IsRequired() .HasColumnType("text"); b.Property("FunctionIds") - .IsRequired() .HasColumnType("text"); b.Property("IsDeleted") @@ -61,22 +58,18 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnType("uuid"); b.Property("Name") - .IsRequired() .HasColumnType("text"); b.Property("NoReplyFoundTemplate") .HasColumnType("text"); b.Property("Opener") - .IsRequired() .HasColumnType("text"); b.Property("Parameter") - .IsRequired() .HasColumnType("text"); b.Property("Prompt") - .IsRequired() .HasColumnType("text"); b.Property("ReferenceUpperLimit") @@ -92,11 +85,9 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnType("double precision"); b.Property("Template") - .IsRequired() .HasColumnType("text"); b.Property("WikiIds") - .IsRequired() .HasColumnType("text"); b.HasKey("Id"); @@ -106,63 +97,12 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("wiki-chat-application", (string)null); }); - modelBuilder.Entity("FastWiki.Service.Domain.ChatApplications.Aggregates.ChatDialog", b => + modelBuilder.Entity("FastWiki.Service.Domain.ChatApplications.Aggregates.ChatRecord", b => { b.Property("Id") .HasColumnType("text"); b.Property("ApplicationId") - .IsRequired() - .HasColumnType("text"); - - b.Property("ChatId") - .HasColumnType("text"); - - b.Property("CreationTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Creator") - .HasColumnType("uuid"); - - b.Property("Description") - .IsRequired() - .HasColumnType("text"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - - b.Property("ModificationTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Modifier") - .HasColumnType("uuid"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("Type") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("ChatId"); - - b.ToTable("wiki-chat-dialog", (string)null); - }); - - modelBuilder.Entity("FastWiki.Service.Domain.ChatApplications.Aggregates.ChatDialogHistory", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ChatDialogId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Content") - .IsRequired() - .HasMaxLength(-1) .HasColumnType("text"); b.Property("CreationTime") @@ -171,35 +111,20 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("Creator") .HasColumnType("uuid"); - b.Property("Current") - .HasColumnType("boolean"); - - b.Property("IsDeleted") - .HasColumnType("boolean"); - b.Property("ModificationTime") .HasColumnType("timestamp without time zone"); b.Property("Modifier") .HasColumnType("uuid"); - b.Property("ReferenceFile") - .IsRequired() + b.Property("Question") .HasColumnType("text"); - b.Property("TokenConsumption") - .HasColumnType("integer"); - - b.Property("Type") - .HasColumnType("integer"); - b.HasKey("Id"); - b.HasIndex("ChatDialogId"); - - b.HasIndex("Creator"); + b.HasIndex("CreationTime"); - b.ToTable("wiki-chat-dialog-history", (string)null); + b.ToTable("wiki-chat-record", (string)null); }); modelBuilder.Entity("FastWiki.Service.Domain.ChatApplications.Aggregates.ChatShare", b => @@ -217,7 +142,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnType("bigint"); b.Property("ChatApplicationId") - .IsRequired() .HasColumnType("text"); b.Property("CreationTime") @@ -236,7 +160,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnType("uuid"); b.Property("Name") - .IsRequired() .HasColumnType("text"); b.Property("UsedToken") @@ -249,6 +172,28 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("wiki-chat-share", (string)null); }); + modelBuilder.Entity("FastWiki.Service.Domain.ChatApplications.Aggregates.Questions", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("ApplicationId") + .HasColumnType("text"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone"); + + b.Property("Order") + .HasColumnType("integer"); + + b.Property("Question") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("wiki-questions", (string)null); + }); + modelBuilder.Entity("FastWiki.Service.Domain.Function.Aggregates.FastWikiFunctionCall", b => { b.Property("Id") @@ -258,7 +203,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Content") - .IsRequired() .HasColumnType("text"); b.Property("CreationTime") @@ -268,25 +212,21 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnType("uuid"); b.Property("Description") - .IsRequired() .HasColumnType("text"); b.Property("Enable") .HasColumnType("boolean"); b.Property("Imports") - .IsRequired() .HasColumnType("text"); b.Property("IsDeleted") .HasColumnType("boolean"); b.Property("Items") - .IsRequired() .HasColumnType("text"); b.Property("Main") - .IsRequired() .HasColumnType("text"); b.Property("ModificationTime") @@ -296,11 +236,9 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnType("uuid"); b.Property("Name") - .IsRequired() .HasColumnType("text"); b.Property("Parameters") - .IsRequired() .HasColumnType("text"); b.HasKey("Id"); @@ -325,7 +263,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnType("uuid"); b.Property("FullName") - .IsRequired() .HasColumnType("text"); b.Property("IsCompression") @@ -341,12 +278,10 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnType("uuid"); b.Property("Name") - .IsRequired() .HasMaxLength(100) .HasColumnType("character varying(100)"); b.Property("Path") - .IsRequired() .HasMaxLength(200) .HasColumnType("character varying(200)"); @@ -365,11 +300,9 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnType("uuid"); b.Property("Account") - .IsRequired() .HasColumnType("text"); b.Property("Avatar") - .IsRequired() .HasColumnType("text"); b.Property("CreationTime") @@ -379,7 +312,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnType("uuid"); b.Property("Email") - .IsRequired() .HasColumnType("text"); b.Property("IsDeleted") @@ -395,24 +327,20 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnType("uuid"); b.Property("Name") - .IsRequired() .HasMaxLength(100) .HasColumnType("character varying(100)"); b.Property("Password") - .IsRequired() .HasMaxLength(100) .HasColumnType("character varying(100)"); b.Property("Phone") - .IsRequired() .HasColumnType("text"); b.Property("Role") .HasColumnType("integer"); b.Property("Salt") - .IsRequired() .HasColumnType("text"); b.HasKey("Id"); @@ -422,22 +350,57 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasData( new { - Id = new Guid("81ba41a1-27df-4f6c-b327-dfec1bce8c85"), + Id = new Guid("cd7b65ff-6d9c-4f78-930e-58cb452f1395"), Account = "admin", Avatar = "https://blog-simple.oss-cn-shenzhen.aliyuncs.com/Avatar.jpg", - CreationTime = new DateTime(2024, 4, 22, 14, 36, 39, 431, DateTimeKind.Utc).AddTicks(7635), + CreationTime = new DateTime(2024, 8, 18, 18, 14, 22, 847, DateTimeKind.Utc).AddTicks(2836), Email = "239573049@qq.com", IsDeleted = false, IsDisable = false, - ModificationTime = new DateTime(2024, 4, 22, 14, 36, 39, 431, DateTimeKind.Utc).AddTicks(7638), + ModificationTime = new DateTime(2024, 8, 18, 18, 14, 22, 847, DateTimeKind.Utc).AddTicks(2838), Name = "admin", - Password = "ae322a2c4c237df3b8683703e51442aa", + Password = "805f068fde592b9798123d686ce56984", Phone = "13049809673", Role = 2, - Salt = "19ea5ff625024a1d80bbf86c054e132c" + Salt = "48e878a34df94d04bc9c8033ddc5f8bb" }); }); + modelBuilder.Entity("FastWiki.Service.Domain.Wikis.Aggregates.QuantizedList", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone"); + + b.Property("ProcessTime") + .HasColumnType("timestamp without time zone"); + + b.Property("Remark") + .HasColumnType("text"); + + b.Property("State") + .HasColumnType("integer"); + + b.Property("WikiDetailId") + .HasColumnType("bigint"); + + b.Property("WikiId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("WikiDetailId"); + + b.HasIndex("WikiId"); + + b.ToTable("wiki-quantized-lists", (string)null); + }); + modelBuilder.Entity("FastWiki.Service.Domain.Wikis.Aggregates.Wiki", b => { b.Property("Id") @@ -453,18 +416,15 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnType("uuid"); b.Property("EmbeddingModel") - .IsRequired() .HasColumnType("text"); b.Property("Icon") - .IsRequired() .HasColumnType("text"); b.Property("IsDeleted") .HasColumnType("boolean"); b.Property("Model") - .IsRequired() .HasColumnType("text"); b.Property("ModificationTime") @@ -474,10 +434,12 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnType("uuid"); b.Property("Name") - .IsRequired() .HasMaxLength(100) .HasColumnType("character varying(100)"); + b.Property("VectorType") + .HasColumnType("integer"); + b.HasKey("Id"); b.HasIndex("Name"); @@ -506,7 +468,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnType("bigint"); b.Property("FileName") - .IsRequired() .HasMaxLength(100) .HasColumnType("character varying(100)"); @@ -529,7 +490,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnType("integer"); b.Property("Path") - .IsRequired() .HasMaxLength(200) .HasColumnType("character varying(200)"); @@ -543,7 +503,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnType("integer"); b.Property("Type") - .IsRequired() .HasMaxLength(100) .HasColumnType("character varying(100)"); @@ -554,6 +513,51 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("wiki-wiki-details", (string)null); }); + + modelBuilder.Entity("mem0.Core.Model.History", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateTime") + .HasColumnType("timestamp without time zone"); + + b.Property("Event") + .IsRequired() + .HasColumnType("text"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("MemoryId") + .IsRequired() + .HasColumnType("text"); + + b.Property("NewValue") + .IsRequired() + .HasColumnType("text"); + + b.Property("PrevValue") + .IsRequired() + .HasColumnType("text"); + + b.Property("TrackId") + .HasColumnType("text"); + + b.Property("UserId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("MemoryId"); + + b.HasIndex("TrackId"); + + b.HasIndex("UserId"); + + b.ToTable("wiki-histories", (string)null); + }); #pragma warning restore 612, 618 } } diff --git a/src/Service/FastWiki.Service/Migrations/PostgreSQL/20240818181423_Initial.cs b/src/Service/FastWiki.Service/Migrations/PostgreSQL/20240818181423_Initial.cs new file mode 100644 index 00000000..d2ad6e42 --- /dev/null +++ b/src/Service/FastWiki.Service/Migrations/PostgreSQL/20240818181423_Initial.cs @@ -0,0 +1,353 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace FastWiki.Service.Migrations.PostgreSQL +{ + /// + public partial class Initial : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "wiki-chat-application", + columns: table => new + { + Id = table.Column(type: "text", nullable: false), + Name = table.Column(type: "text", nullable: true), + Prompt = table.Column(type: "text", nullable: true), + ChatModel = table.Column(type: "text", nullable: true), + Temperature = table.Column(type: "double precision", nullable: false), + MaxResponseToken = table.Column(type: "integer", nullable: false), + Template = table.Column(type: "text", nullable: true), + Parameter = table.Column(type: "text", nullable: true), + Opener = table.Column(type: "text", nullable: true), + WikiIds = table.Column(type: "text", nullable: true), + ReferenceUpperLimit = table.Column(type: "integer", nullable: false), + Relevancy = table.Column(type: "double precision", nullable: false), + NoReplyFoundTemplate = table.Column(type: "text", nullable: true), + ShowSourceFile = table.Column(type: "boolean", nullable: false), + Extend = table.Column(type: "text", nullable: true), + FunctionIds = table.Column(type: "text", nullable: true), + Creator = table.Column(type: "uuid", nullable: true), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + Modifier = table.Column(type: "uuid", nullable: true), + ModificationTime = table.Column(type: "timestamp without time zone", nullable: false), + IsDeleted = table.Column(type: "boolean", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_wiki-chat-application", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "wiki-chat-record", + columns: table => new + { + Id = table.Column(type: "text", nullable: false), + ApplicationId = table.Column(type: "text", nullable: true), + Question = table.Column(type: "text", nullable: true), + Creator = table.Column(type: "uuid", nullable: false), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + Modifier = table.Column(type: "uuid", nullable: false), + ModificationTime = table.Column(type: "timestamp without time zone", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_wiki-chat-record", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "wiki-chat-share", + columns: table => new + { + Id = table.Column(type: "text", nullable: false), + Name = table.Column(type: "text", nullable: true), + ChatApplicationId = table.Column(type: "text", nullable: true), + Expires = table.Column(type: "timestamp without time zone", nullable: true), + UsedToken = table.Column(type: "bigint", nullable: false), + AvailableToken = table.Column(type: "bigint", nullable: false), + AvailableQuantity = table.Column(type: "integer", nullable: false), + APIKey = table.Column(type: "text", nullable: true), + Creator = table.Column(type: "uuid", nullable: false), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + Modifier = table.Column(type: "uuid", nullable: false), + ModificationTime = table.Column(type: "timestamp without time zone", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_wiki-chat-share", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "wiki-file-storages", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Name = table.Column(type: "character varying(100)", maxLength: 100, nullable: true), + Path = table.Column(type: "character varying(200)", maxLength: 200, nullable: true), + Size = table.Column(type: "bigint", nullable: false), + IsCompression = table.Column(type: "boolean", nullable: false), + FullName = table.Column(type: "text", nullable: true), + Creator = table.Column(type: "uuid", nullable: true), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + Modifier = table.Column(type: "uuid", nullable: true), + ModificationTime = table.Column(type: "timestamp without time zone", nullable: false), + IsDeleted = table.Column(type: "boolean", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_wiki-file-storages", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "wiki-function-calls", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Name = table.Column(type: "text", nullable: true), + Description = table.Column(type: "text", nullable: true), + Content = table.Column(type: "text", nullable: true), + Parameters = table.Column(type: "text", nullable: true), + Items = table.Column(type: "text", nullable: true), + Enable = table.Column(type: "boolean", nullable: false), + Imports = table.Column(type: "text", nullable: true), + Main = table.Column(type: "text", nullable: true), + Creator = table.Column(type: "uuid", nullable: false), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + Modifier = table.Column(type: "uuid", nullable: false), + ModificationTime = table.Column(type: "timestamp without time zone", nullable: false), + IsDeleted = table.Column(type: "boolean", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_wiki-function-calls", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "wiki-histories", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + MemoryId = table.Column(type: "text", nullable: false), + PrevValue = table.Column(type: "text", nullable: false), + NewValue = table.Column(type: "text", nullable: false), + Event = table.Column(type: "text", nullable: false), + DateTime = table.Column(type: "timestamp without time zone", nullable: false), + IsDeleted = table.Column(type: "boolean", nullable: false), + UserId = table.Column(type: "text", nullable: true), + TrackId = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_wiki-histories", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "wiki-quantized-lists", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + WikiId = table.Column(type: "bigint", nullable: false), + WikiDetailId = table.Column(type: "bigint", nullable: false), + State = table.Column(type: "integer", nullable: false), + Remark = table.Column(type: "text", nullable: true), + ProcessTime = table.Column(type: "timestamp without time zone", nullable: true), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_wiki-quantized-lists", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "wiki-questions", + columns: table => new + { + Id = table.Column(type: "text", nullable: false), + ApplicationId = table.Column(type: "text", nullable: true), + Question = table.Column(type: "text", nullable: true), + Order = table.Column(type: "integer", nullable: false), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_wiki-questions", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "wiki-users", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + Account = table.Column(type: "text", nullable: true), + Name = table.Column(type: "character varying(100)", maxLength: 100, nullable: true), + Password = table.Column(type: "character varying(100)", maxLength: 100, nullable: true), + Salt = table.Column(type: "text", nullable: true), + Avatar = table.Column(type: "text", nullable: true), + Email = table.Column(type: "text", nullable: true), + Phone = table.Column(type: "text", nullable: true), + IsDisable = table.Column(type: "boolean", nullable: false), + Role = table.Column(type: "integer", nullable: false), + Creator = table.Column(type: "uuid", nullable: true), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + Modifier = table.Column(type: "uuid", nullable: true), + ModificationTime = table.Column(type: "timestamp without time zone", nullable: false), + IsDeleted = table.Column(type: "boolean", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_wiki-users", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "wiki-wiki-details", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + WikiId = table.Column(type: "bigint", nullable: false), + FileName = table.Column(type: "character varying(100)", maxLength: 100, nullable: true), + Path = table.Column(type: "character varying(200)", maxLength: 200, nullable: true), + FileId = table.Column(type: "bigint", nullable: false), + DataCount = table.Column(type: "integer", nullable: false), + Type = table.Column(type: "character varying(100)", maxLength: 100, nullable: true), + State = table.Column(type: "integer", nullable: false), + MaxTokensPerParagraph = table.Column(type: "integer", nullable: false), + MaxTokensPerLine = table.Column(type: "integer", nullable: false), + OverlappingTokens = table.Column(type: "integer", nullable: false), + Mode = table.Column(type: "integer", nullable: false), + TrainingPattern = table.Column(type: "integer", nullable: false), + QAPromptTemplate = table.Column(type: "text", nullable: true), + Creator = table.Column(type: "bigint", nullable: false), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + Modifier = table.Column(type: "bigint", nullable: false), + ModificationTime = table.Column(type: "timestamp without time zone", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_wiki-wiki-details", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "wiki-wikis", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Icon = table.Column(type: "text", nullable: true), + Name = table.Column(type: "character varying(100)", maxLength: 100, nullable: true), + Model = table.Column(type: "text", nullable: true), + EmbeddingModel = table.Column(type: "text", nullable: true), + VectorType = table.Column(type: "integer", nullable: false), + Creator = table.Column(type: "uuid", nullable: true), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + Modifier = table.Column(type: "uuid", nullable: true), + ModificationTime = table.Column(type: "timestamp without time zone", nullable: false), + IsDeleted = table.Column(type: "boolean", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_wiki-wikis", x => x.Id); + }); + + migrationBuilder.InsertData( + table: "wiki-users", + columns: new[] { "Id", "Account", "Avatar", "CreationTime", "Creator", "Email", "IsDeleted", "IsDisable", "ModificationTime", "Modifier", "Name", "Password", "Phone", "Role", "Salt" }, + values: new object[] { new Guid("cd7b65ff-6d9c-4f78-930e-58cb452f1395"), "admin", "https://blog-simple.oss-cn-shenzhen.aliyuncs.com/Avatar.jpg", new DateTime(2024, 8, 18, 18, 14, 22, 847, DateTimeKind.Utc).AddTicks(2836), null, "239573049@qq.com", false, false, new DateTime(2024, 8, 18, 18, 14, 22, 847, DateTimeKind.Utc).AddTicks(2838), null, "admin", "805f068fde592b9798123d686ce56984", "13049809673", 2, "48e878a34df94d04bc9c8033ddc5f8bb" }); + + migrationBuilder.CreateIndex( + name: "IX_wiki-chat-application_Name", + table: "wiki-chat-application", + column: "Name"); + + migrationBuilder.CreateIndex( + name: "IX_wiki-chat-record_CreationTime", + table: "wiki-chat-record", + column: "CreationTime"); + + migrationBuilder.CreateIndex( + name: "IX_wiki-chat-share_ChatApplicationId", + table: "wiki-chat-share", + column: "ChatApplicationId"); + + migrationBuilder.CreateIndex( + name: "IX_wiki-function-calls_CreationTime", + table: "wiki-function-calls", + column: "CreationTime"); + + migrationBuilder.CreateIndex( + name: "IX_wiki-histories_MemoryId", + table: "wiki-histories", + column: "MemoryId"); + + migrationBuilder.CreateIndex( + name: "IX_wiki-histories_TrackId", + table: "wiki-histories", + column: "TrackId"); + + migrationBuilder.CreateIndex( + name: "IX_wiki-histories_UserId", + table: "wiki-histories", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_wiki-quantized-lists_WikiDetailId", + table: "wiki-quantized-lists", + column: "WikiDetailId"); + + migrationBuilder.CreateIndex( + name: "IX_wiki-quantized-lists_WikiId", + table: "wiki-quantized-lists", + column: "WikiId"); + + migrationBuilder.CreateIndex( + name: "IX_wiki-wikis_Name", + table: "wiki-wikis", + column: "Name"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "wiki-chat-application"); + + migrationBuilder.DropTable( + name: "wiki-chat-record"); + + migrationBuilder.DropTable( + name: "wiki-chat-share"); + + migrationBuilder.DropTable( + name: "wiki-file-storages"); + + migrationBuilder.DropTable( + name: "wiki-function-calls"); + + migrationBuilder.DropTable( + name: "wiki-histories"); + + migrationBuilder.DropTable( + name: "wiki-quantized-lists"); + + migrationBuilder.DropTable( + name: "wiki-questions"); + + migrationBuilder.DropTable( + name: "wiki-users"); + + migrationBuilder.DropTable( + name: "wiki-wiki-details"); + + migrationBuilder.DropTable( + name: "wiki-wikis"); + } + } +} diff --git a/src/Service/FastWiki.Service/Migrations/PostgreSQL/WikiDbContextModelSnapshot.cs b/src/Service/FastWiki.Service/Migrations/PostgreSQL/WikiDbContextModelSnapshot.cs deleted file mode 100644 index 0a346a7a..00000000 --- a/src/Service/FastWiki.Service/Migrations/PostgreSQL/WikiDbContextModelSnapshot.cs +++ /dev/null @@ -1,546 +0,0 @@ -// -using System; -using FastWiki.Service.DataAccess; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace FastWiki.Service.Migrations.PostgreSQL -{ - [DbContext(typeof(WikiDbContext))] - partial class WikiDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.7"); - - modelBuilder.Entity("FastWiki.Service.Domain.ChatApplications.Aggregates.ChatApplication", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ChatModel") - .HasColumnType("TEXT"); - - b.Property("CreationTime") - .HasColumnType("TEXT"); - - b.Property("Creator") - .HasColumnType("TEXT"); - - b.Property("Extend") - .HasColumnType("TEXT"); - - b.Property("FunctionIds") - .HasColumnType("TEXT"); - - b.Property("IsDeleted") - .HasColumnType("INTEGER"); - - b.Property("MaxResponseToken") - .HasColumnType("INTEGER"); - - b.Property("ModificationTime") - .HasColumnType("TEXT"); - - b.Property("Modifier") - .HasColumnType("TEXT"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("NoReplyFoundTemplate") - .HasColumnType("TEXT"); - - b.Property("Opener") - .HasColumnType("TEXT"); - - b.Property("Parameter") - .HasColumnType("TEXT"); - - b.Property("Prompt") - .HasColumnType("TEXT"); - - b.Property("ReferenceUpperLimit") - .HasColumnType("INTEGER"); - - b.Property("Relevancy") - .HasColumnType("REAL"); - - b.Property("ShowSourceFile") - .HasColumnType("INTEGER"); - - b.Property("Temperature") - .HasColumnType("REAL"); - - b.Property("Template") - .HasColumnType("TEXT"); - - b.Property("WikiIds") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("Name"); - - b.ToTable("wiki-chat-application", (string)null); - }); - - modelBuilder.Entity("FastWiki.Service.Domain.ChatApplications.Aggregates.ChatRecord", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ApplicationId") - .HasColumnType("TEXT"); - - b.Property("CreationTime") - .HasColumnType("TEXT"); - - b.Property("Creator") - .HasColumnType("TEXT"); - - b.Property("ModificationTime") - .HasColumnType("TEXT"); - - b.Property("Modifier") - .HasColumnType("TEXT"); - - b.Property("Question") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("CreationTime"); - - b.ToTable("wiki-chat-record", (string)null); - }); - - modelBuilder.Entity("FastWiki.Service.Domain.ChatApplications.Aggregates.ChatShare", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("APIKey") - .HasColumnType("TEXT"); - - b.Property("AvailableQuantity") - .HasColumnType("INTEGER"); - - b.Property("AvailableToken") - .HasColumnType("INTEGER"); - - b.Property("ChatApplicationId") - .HasColumnType("TEXT"); - - b.Property("CreationTime") - .HasColumnType("TEXT"); - - b.Property("Creator") - .HasColumnType("TEXT"); - - b.Property("Expires") - .HasColumnType("TEXT"); - - b.Property("ModificationTime") - .HasColumnType("TEXT"); - - b.Property("Modifier") - .HasColumnType("TEXT"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("UsedToken") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ChatApplicationId"); - - b.ToTable("wiki-chat-share", (string)null); - }); - - modelBuilder.Entity("FastWiki.Service.Domain.ChatApplications.Aggregates.Questions", b => - { - b.Property("Id") - .HasColumnType("TEXT"); - - b.Property("ApplicationId") - .HasColumnType("TEXT"); - - b.Property("CreationTime") - .HasColumnType("TEXT"); - - b.Property("Order") - .HasColumnType("INTEGER"); - - b.Property("Question") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("wiki-questions", (string)null); - }); - - modelBuilder.Entity("FastWiki.Service.Domain.Function.Aggregates.FastWikiFunctionCall", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Content") - .HasColumnType("TEXT"); - - b.Property("CreationTime") - .HasColumnType("TEXT"); - - b.Property("Creator") - .HasColumnType("TEXT"); - - b.Property("Description") - .HasColumnType("TEXT"); - - b.Property("Enable") - .HasColumnType("INTEGER"); - - b.Property("Imports") - .HasColumnType("TEXT"); - - b.Property("IsDeleted") - .HasColumnType("INTEGER"); - - b.Property("Items") - .HasColumnType("TEXT"); - - b.Property("Main") - .HasColumnType("TEXT"); - - b.Property("ModificationTime") - .HasColumnType("TEXT"); - - b.Property("Modifier") - .HasColumnType("TEXT"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("Parameters") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("CreationTime"); - - b.ToTable("wiki-function-calls", (string)null); - }); - - modelBuilder.Entity("FastWiki.Service.Domain.Storage.Aggregates.FileStorage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("CreationTime") - .HasColumnType("TEXT"); - - b.Property("Creator") - .HasColumnType("TEXT"); - - b.Property("FullName") - .HasColumnType("TEXT"); - - b.Property("IsCompression") - .HasColumnType("INTEGER"); - - b.Property("IsDeleted") - .HasColumnType("INTEGER"); - - b.Property("ModificationTime") - .HasColumnType("TEXT"); - - b.Property("Modifier") - .HasColumnType("TEXT"); - - b.Property("Name") - .HasMaxLength(100) - .HasColumnType("TEXT"); - - b.Property("Path") - .HasMaxLength(200) - .HasColumnType("TEXT"); - - b.Property("Size") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.ToTable("wiki-file-storages", (string)null); - }); - - modelBuilder.Entity("FastWiki.Service.Domain.Users.Aggregates.User", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property("Account") - .HasColumnType("TEXT"); - - b.Property("Avatar") - .HasColumnType("TEXT"); - - b.Property("CreationTime") - .HasColumnType("TEXT"); - - b.Property("Creator") - .HasColumnType("TEXT"); - - b.Property("Email") - .HasColumnType("TEXT"); - - b.Property("IsDeleted") - .HasColumnType("INTEGER"); - - b.Property("IsDisable") - .HasColumnType("INTEGER"); - - b.Property("ModificationTime") - .HasColumnType("TEXT"); - - b.Property("Modifier") - .HasColumnType("TEXT"); - - b.Property("Name") - .HasMaxLength(100) - .HasColumnType("TEXT"); - - b.Property("Password") - .HasMaxLength(100) - .HasColumnType("TEXT"); - - b.Property("Phone") - .HasColumnType("TEXT"); - - b.Property("Role") - .HasColumnType("INTEGER"); - - b.Property("Salt") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("wiki-users", (string)null); - - b.HasData( - new - { - Id = new Guid("c61a32ee-9254-4018-a34d-6df4c9269946"), - Account = "admin", - Avatar = "https://blog-simple.oss-cn-shenzhen.aliyuncs.com/Avatar.jpg", - CreationTime = new DateTime(2024, 8, 18, 14, 7, 58, 699, DateTimeKind.Utc).AddTicks(6364), - Email = "239573049@qq.com", - IsDeleted = false, - IsDisable = false, - ModificationTime = new DateTime(2024, 8, 18, 14, 7, 58, 699, DateTimeKind.Utc).AddTicks(6367), - Name = "admin", - Password = "8b0378cf4c257b662603ccf76cc61d29", - Phone = "13049809673", - Role = 2, - Salt = "37c8e92134974dc4b28d875436da2afd" - }); - }); - - modelBuilder.Entity("FastWiki.Service.Domain.Wikis.Aggregates.QuantizedList", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("CreationTime") - .HasColumnType("TEXT"); - - b.Property("ProcessTime") - .HasColumnType("TEXT"); - - b.Property("Remark") - .HasColumnType("TEXT"); - - b.Property("State") - .HasColumnType("INTEGER"); - - b.Property("WikiDetailId") - .HasColumnType("INTEGER"); - - b.Property("WikiId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("WikiDetailId"); - - b.HasIndex("WikiId"); - - b.ToTable("wiki-quantized-lists", (string)null); - }); - - modelBuilder.Entity("FastWiki.Service.Domain.Wikis.Aggregates.Wiki", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("CreationTime") - .HasColumnType("TEXT"); - - b.Property("Creator") - .HasColumnType("TEXT"); - - b.Property("EmbeddingModel") - .HasColumnType("TEXT"); - - b.Property("Icon") - .HasColumnType("TEXT"); - - b.Property("IsDeleted") - .HasColumnType("INTEGER"); - - b.Property("Model") - .HasColumnType("TEXT"); - - b.Property("ModificationTime") - .HasColumnType("TEXT"); - - b.Property("Modifier") - .HasColumnType("TEXT"); - - b.Property("Name") - .HasMaxLength(100) - .HasColumnType("TEXT"); - - b.Property("VectorType") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("Name"); - - b.ToTable("wiki-wikis", (string)null); - }); - - modelBuilder.Entity("FastWiki.Service.Domain.Wikis.Aggregates.WikiDetail", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("CreationTime") - .HasColumnType("TEXT"); - - b.Property("Creator") - .HasColumnType("INTEGER"); - - b.Property("DataCount") - .HasColumnType("INTEGER"); - - b.Property("FileId") - .HasColumnType("INTEGER"); - - b.Property("FileName") - .HasMaxLength(100) - .HasColumnType("TEXT"); - - b.Property("MaxTokensPerLine") - .HasColumnType("INTEGER"); - - b.Property("MaxTokensPerParagraph") - .HasColumnType("INTEGER"); - - b.Property("Mode") - .HasColumnType("INTEGER"); - - b.Property("ModificationTime") - .HasColumnType("TEXT"); - - b.Property("Modifier") - .HasColumnType("INTEGER"); - - b.Property("OverlappingTokens") - .HasColumnType("INTEGER"); - - b.Property("Path") - .HasMaxLength(200) - .HasColumnType("TEXT"); - - b.Property("QAPromptTemplate") - .HasColumnType("TEXT"); - - b.Property("State") - .HasColumnType("INTEGER"); - - b.Property("TrainingPattern") - .HasColumnType("INTEGER"); - - b.Property("Type") - .HasMaxLength(100) - .HasColumnType("TEXT"); - - b.Property("WikiId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.ToTable("wiki-wiki-details", (string)null); - }); - - modelBuilder.Entity("mem0.Core.Model.History", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property("DateTime") - .HasColumnType("TEXT"); - - b.Property("Event") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("IsDeleted") - .HasColumnType("INTEGER"); - - b.Property("MemoryId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("NewValue") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("PrevValue") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("TrackId") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("MemoryId"); - - b.HasIndex("TrackId"); - - b.HasIndex("UserId"); - - b.ToTable("wiki-histories", (string)null); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Service/FastWiki.Service/appsettings.json b/src/Service/FastWiki.Service/appsettings.json index d0125360..d3cd2d12 100644 --- a/src/Service/FastWiki.Service/appsettings.json +++ b/src/Service/FastWiki.Service/appsettings.json @@ -7,7 +7,7 @@ }, "AllowedHosts": "*", "ConnectionStrings": { - "DefaultType": "sqlite", + "DefaultType": "postgresql", "DefaultConnection": "data source=./wiki.db", "WikiConnection": "http://127.0.0.1:6333", "WikiAPIKey": "dd666666", @@ -18,6 +18,7 @@ "EmbeddingEndpoint": "https://api.token-ai.cn/", "ChatToken": "", "EmbeddingToken": "", + // ̬ļҪһվַƴӾ̬ļַ "Site": "" }, "Jwt": {