using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace ApiTools.Database.Migrations.Migrations.LogDb { /// public partial class Init : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "ConsoleLog", columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), Access = table.Column(type: "int", nullable: false), Level = table.Column(type: "int", nullable: false), Content = table.Column(type: "nvarchar(max)", nullable: false), StackTrace = table.Column(type: "nvarchar(max)", nullable: true), Url = table.Column(type: "nvarchar(max)", nullable: true), Request = table.Column(type: "nvarchar(max)", nullable: true), Ext = table.Column(type: "nvarchar(max)", nullable: true), ClientIpAddress = table.Column(type: "nvarchar(32)", maxLength: 32, nullable: true), Sort = table.Column(type: "int", nullable: false), TraceId = table.Column(type: "nvarchar(max)", nullable: true), CreatedTime = table.Column(type: "datetimeoffset", nullable: false), CreatedUserId = table.Column(type: "uniqueidentifier", nullable: true), CreatedChannelId = table.Column(type: "uniqueidentifier", nullable: true), UpdatedTime = table.Column(type: "datetimeoffset", nullable: true), UpdatedUserId = table.Column(type: "uniqueidentifier", nullable: true), IsDeleted = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_ConsoleLog", x => x.Id); }); migrationBuilder.CreateTable( name: "DbAuditLog", columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), TableName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), PrimaryKey = table.Column(type: "uniqueidentifier", nullable: false), Operate = table.Column(type: "int", nullable: false), OldValues = table.Column(type: "nvarchar(max)", nullable: true), NewValues = table.Column(type: "nvarchar(max)", nullable: true), Sort = table.Column(type: "int", nullable: false), TraceId = table.Column(type: "nvarchar(max)", nullable: true), CreatedTime = table.Column(type: "datetimeoffset", nullable: false), CreatedUserId = table.Column(type: "uniqueidentifier", nullable: true), CreatedChannelId = table.Column(type: "uniqueidentifier", nullable: true), UpdatedTime = table.Column(type: "datetimeoffset", nullable: true), UpdatedUserId = table.Column(type: "uniqueidentifier", nullable: true), IsDeleted = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_DbAuditLog", x => x.Id); }); migrationBuilder.CreateTable( name: "ExceptionLog", columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), Type = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), Code = table.Column(type: "nvarchar(32)", maxLength: 32, nullable: true), Message = table.Column(type: "nvarchar(max)", nullable: true), StackTrace = table.Column(type: "nvarchar(max)", nullable: true), Sort = table.Column(type: "int", nullable: false), TraceId = table.Column(type: "nvarchar(max)", nullable: true), CreatedTime = table.Column(type: "datetimeoffset", nullable: false), CreatedUserId = table.Column(type: "uniqueidentifier", nullable: true), CreatedChannelId = table.Column(type: "uniqueidentifier", nullable: true), UpdatedTime = table.Column(type: "datetimeoffset", nullable: true), UpdatedUserId = table.Column(type: "uniqueidentifier", nullable: true), IsDeleted = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_ExceptionLog", x => x.Id); }); migrationBuilder.CreateTable( name: "QueueLog", columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), Access = table.Column(type: "int", nullable: false), EventId = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), Data = table.Column(type: "nvarchar(max)", nullable: false), IsConsumOnce = table.Column(type: "bit", nullable: false), ElapsedMilliseconds = table.Column(type: "bigint", nullable: false), Sort = table.Column(type: "int", nullable: false), TraceId = table.Column(type: "nvarchar(max)", nullable: true), CreatedTime = table.Column(type: "datetimeoffset", nullable: false), CreatedUserId = table.Column(type: "uniqueidentifier", nullable: true), CreatedChannelId = table.Column(type: "uniqueidentifier", nullable: true), UpdatedTime = table.Column(type: "datetimeoffset", nullable: true), UpdatedUserId = table.Column(type: "uniqueidentifier", nullable: true), IsDeleted = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_QueueLog", x => x.Id); }); migrationBuilder.CreateTable( name: "ResourceLog", columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), Method = table.Column(type: "int", nullable: false), Domain = table.Column(type: "nvarchar(max)", nullable: true), Path = table.Column(type: "nvarchar(max)", nullable: true), RequestHeaders = table.Column(type: "nvarchar(max)", nullable: true), Request = table.Column(type: "nvarchar(max)", nullable: true), ResponseHeaders = table.Column(type: "nvarchar(max)", nullable: true), Response = table.Column(type: "nvarchar(max)", nullable: true), IsSuccess = table.Column(type: "bit", nullable: false), ClientIpAddress = table.Column(type: "nvarchar(max)", nullable: true), RefererUrl = table.Column(type: "nvarchar(max)", nullable: true), ConsoleLogs = table.Column(type: "nvarchar(max)", nullable: true), ElapsedMilliseconds = table.Column(type: "bigint", nullable: false), Sort = table.Column(type: "int", nullable: false), TraceId = table.Column(type: "nvarchar(max)", nullable: true), CreatedTime = table.Column(type: "datetimeoffset", nullable: false), CreatedUserId = table.Column(type: "uniqueidentifier", nullable: true), CreatedChannelId = table.Column(type: "uniqueidentifier", nullable: true), UpdatedTime = table.Column(type: "datetimeoffset", nullable: true), UpdatedUserId = table.Column(type: "uniqueidentifier", nullable: true), IsDeleted = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_ResourceLog", x => x.Id); }); migrationBuilder.CreateTable( name: "ScheduleJobTriggerTimeline", columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), JobId = table.Column(type: "nvarchar(max)", nullable: true), TriggerId = table.Column(type: "nvarchar(max)", nullable: true), NumberOfRuns = table.Column(type: "bigint", nullable: false), LastRunTime = table.Column(type: "datetime2", nullable: true), NextRunTime = table.Column(type: "datetime2", nullable: true), Status = table.Column(type: "bigint", nullable: false), Result = table.Column(type: "nvarchar(max)", nullable: true), ElapsedTime = table.Column(type: "bigint", nullable: false), Mode = table.Column(type: "int", nullable: false), Exception = table.Column(type: "nvarchar(max)", nullable: true), Sort = table.Column(type: "int", nullable: false), TraceId = table.Column(type: "nvarchar(max)", nullable: true), CreatedTime = table.Column(type: "datetimeoffset", nullable: false), CreatedUserId = table.Column(type: "uniqueidentifier", nullable: true), CreatedChannelId = table.Column(type: "uniqueidentifier", nullable: true), UpdatedTime = table.Column(type: "datetimeoffset", nullable: true), UpdatedUserId = table.Column(type: "uniqueidentifier", nullable: true), IsDeleted = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_ScheduleJobTriggerTimeline", x => x.Id); }); migrationBuilder.CreateTable( name: "ThreeResourceLog", columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), Method = table.Column(type: "int", nullable: false), Domain = table.Column(type: "nvarchar(max)", nullable: true), Path = table.Column(type: "nvarchar(max)", nullable: true), RequestHeaders = table.Column(type: "nvarchar(max)", nullable: true), Request = table.Column(type: "nvarchar(max)", nullable: true), ResponseHeaders = table.Column(type: "nvarchar(max)", nullable: true), Response = table.Column(type: "nvarchar(max)", nullable: true), IsSuccess = table.Column(type: "bit", nullable: false), ClientIpAddress = table.Column(type: "nvarchar(max)", nullable: true), RefererUrl = table.Column(type: "nvarchar(max)", nullable: true), ConsoleLogs = table.Column(type: "nvarchar(max)", nullable: true), ElapsedMilliseconds = table.Column(type: "bigint", nullable: false), Sort = table.Column(type: "int", nullable: false), TraceId = table.Column(type: "nvarchar(max)", nullable: true), CreatedTime = table.Column(type: "datetimeoffset", nullable: false), CreatedUserId = table.Column(type: "uniqueidentifier", nullable: true), CreatedChannelId = table.Column(type: "uniqueidentifier", nullable: true), UpdatedTime = table.Column(type: "datetimeoffset", nullable: true), UpdatedUserId = table.Column(type: "uniqueidentifier", nullable: true), IsDeleted = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_ThreeResourceLog", x => x.Id); }); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "ConsoleLog"); migrationBuilder.DropTable( name: "DbAuditLog"); migrationBuilder.DropTable( name: "ExceptionLog"); migrationBuilder.DropTable( name: "QueueLog"); migrationBuilder.DropTable( name: "ResourceLog"); migrationBuilder.DropTable( name: "ScheduleJobTriggerTimeline"); migrationBuilder.DropTable( name: "ThreeResourceLog"); } } }