using Microsoft.EntityFrameworkCore.Migrations; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable namespace Content.Server.Database.Migrations.Postgres { /// public partial class Genital : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "genital", columns: table => new { genital_id = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), profile_id = table.Column(type: "integer", nullable: false), genital_prototype = table.Column(type: "text", nullable: false), color = table.Column(type: "text", nullable: false) }, constraints: table => { table.PrimaryKey("PK_genital", x => x.genital_id); table.ForeignKey( name: "FK_genital_profile_profile_id", column: x => x.profile_id, principalTable: "profile", principalColumn: "profile_id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_genital_profile_id_genital_prototype", table: "genital", columns: new[] { "profile_id", "genital_prototype" }, unique: true); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "genital"); } } }