using System; using Microsoft.EntityFrameworkCore.Migrations; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable namespace vendorApproverBackend.Migrations { /// public partial class UpdateNotificationModelEntity : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "notificationmodel", columns: table => new { notificatoin_id = table.Column(type: "bigint", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), SenderId = table.Column(type: "bigint", nullable: true), ReciverId = table.Column(type: "bigint", nullable: true), action = table.Column(type: "text", nullable: false), action_id = table.Column(type: "bigint", nullable: true), subject = table.Column(type: "text", nullable: false), content = table.Column(type: "text", nullable: false), logUrl = table.Column(type: "text", nullable: false), status = table.Column(type: "text", nullable: false), timestmp = table.Column(type: "timestamp with time zone", nullable: false) }, constraints: table => { table.PrimaryKey("PK_notificationmodel", x => x.notificatoin_id); table.ForeignKey( name: "FK_notificationmodel_users_table_ReciverId", column: x => x.ReciverId, principalTable: "users_table", principalColumn: "user_id"); table.ForeignKey( name: "FK_notificationmodel_users_table_SenderId", column: x => x.SenderId, principalTable: "users_table", principalColumn: "user_id"); }); migrationBuilder.CreateIndex( name: "IX_notificationmodel_ReciverId", table: "notificationmodel", column: "ReciverId"); migrationBuilder.CreateIndex( name: "IX_notificationmodel_SenderId", table: "notificationmodel", column: "SenderId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "notificationmodel"); } } }