using System; using Microsoft.EntityFrameworkCore.Migrations; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable namespace Core.Migrations { /// public partial class PendingInvites_Init : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "PendingInvites", columns: table => new { Id = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), InvitationId = table.Column(type: "text", nullable: false), Date = table.Column(type: "timestamp with time zone", nullable: false), RealmId = table.Column(type: "integer", nullable: true) }, constraints: table => { table.PrimaryKey("PK_PendingInvites", x => x.Id); table.ForeignKey( name: "FK_PendingInvites_Realms_RealmId", column: x => x.RealmId, principalTable: "Realms", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_PendingInvites_RealmId", table: "PendingInvites", column: "RealmId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "PendingInvites"); } } }