using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace EonaCat.Logger.LogServer.Migrations { /// public partial class InitialCreate : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Applications", columns: table => new { Id = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), Name = table.Column(type: "TEXT", nullable: false), ApiKey = table.Column(type: "TEXT", nullable: false), CreatedAt = table.Column(type: "TEXT", nullable: false), IsActive = table.Column(type: "INTEGER", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Applications", x => x.Id); }); migrationBuilder.CreateTable( name: "LogEntries", columns: table => new { Id = table.Column(type: "TEXT", nullable: false), Timestamp = table.Column(type: "TEXT", nullable: false), ApplicationName = table.Column(type: "TEXT", nullable: false), ApplicationVersion = table.Column(type: "TEXT", nullable: false), Environment = table.Column(type: "TEXT", nullable: false), MachineName = table.Column(type: "TEXT", nullable: false), Level = table.Column(type: "INTEGER", nullable: false), Category = table.Column(type: "TEXT", nullable: false), Message = table.Column(type: "TEXT", nullable: false), Exception = table.Column(type: "TEXT", nullable: true), StackTrace = table.Column(type: "TEXT", nullable: true), PropertiesJson = table.Column(type: "TEXT", nullable: true), UserId = table.Column(type: "TEXT", nullable: true), SessionId = table.Column(type: "TEXT", nullable: true), RequestId = table.Column(type: "TEXT", nullable: true), CorrelationId = table.Column(type: "TEXT", nullable: true) }, constraints: table => { table.PrimaryKey("PK_LogEntries", x => x.Id); }); migrationBuilder.CreateIndex( name: "IX_Applications_Name", table: "Applications", column: "Name", unique: true); migrationBuilder.CreateIndex( name: "IX_LogEntries_ApplicationName", table: "LogEntries", column: "ApplicationName"); migrationBuilder.CreateIndex( name: "IX_LogEntries_Environment", table: "LogEntries", column: "Environment"); migrationBuilder.CreateIndex( name: "IX_LogEntries_Level", table: "LogEntries", column: "Level"); migrationBuilder.CreateIndex( name: "IX_LogEntries_Timestamp", table: "LogEntries", column: "Timestamp"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Applications"); migrationBuilder.DropTable( name: "LogEntries"); } } }