using System; using Microsoft.EntityFrameworkCore.Migrations; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable namespace BlueLaminate.EFCore.Migrations { /// public partial class AddScrapeRunAndWeaponNameIndex : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "scrape_runs", schema: "skintracker", columns: table => new { id = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), source = table.Column(type: "text", nullable: false), ran_at = table.Column(type: "timestamp with time zone", nullable: false), item_count = table.Column(type: "integer", nullable: false) }, constraints: table => { table.PrimaryKey("pk_scrape_runs", x => x.id); }); migrationBuilder.CreateIndex( name: "ix_weapons_name", schema: "skintracker", table: "weapons", column: "name", unique: true); migrationBuilder.CreateIndex( name: "ix_scrape_runs_source_ran_at", schema: "skintracker", table: "scrape_runs", columns: new[] { "source", "ran_at" }); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "scrape_runs", schema: "skintracker"); migrationBuilder.DropIndex( name: "ix_weapons_name", schema: "skintracker", table: "weapons"); } } }