using Microsoft.EntityFrameworkCore.Migrations; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable namespace JobsMedical.Web.Migrations { /// public partial class ContactMethods : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "ContactMethods", columns: table => new { Id = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), TalentListingId = table.Column(type: "integer", nullable: false), Type = table.Column(type: "integer", nullable: false), Value = table.Column(type: "character varying(250)", maxLength: 250, nullable: false), SortOrder = table.Column(type: "integer", nullable: false) }, constraints: table => { table.PrimaryKey("PK_ContactMethods", x => x.Id); table.ForeignKey( name: "FK_ContactMethods_TalentListings_TalentListingId", column: x => x.TalentListingId, principalTable: "TalentListings", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_ContactMethods_TalentListingId", table: "ContactMethods", column: "TalentListingId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "ContactMethods"); } } }