using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace PageFetcher.Data.Migrations { /// public partial class InitialSchema : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.EnsureSchema( name: MigrationConstants.SchemaName); migrationBuilder.CreateTable( name: "PageFetches", schema: MigrationConstants.SchemaName, columns: table => new { Id = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), Url = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: false), CallerService = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), HttpStatusCode = table.Column(type: "int", nullable: true), Html = table.Column(type: "nvarchar(max)", nullable: false), Text = table.Column(type: "nvarchar(max)", nullable: false), DurationMs = table.Column(type: "bigint", nullable: false), Success = table.Column(type: "bit", nullable: false), ErrorMessage = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: true), CreatedAt = table.Column(type: "datetime2", nullable: false, defaultValueSql: "SYSUTCDATETIME()") }, constraints: table => { table.PrimaryKey("PK_PageFetches", x => x.Id); }); migrationBuilder.CreateIndex( name: "IX_PageFetches_CreatedAt", schema: MigrationConstants.SchemaName, table: "PageFetches", column: "CreatedAt"); migrationBuilder.CreateIndex( name: "IX_PageFetches_Url", schema: MigrationConstants.SchemaName, table: "PageFetches", column: "Url"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "PageFetches", schema: MigrationConstants.SchemaName); } } }