using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace line_gestao_api.Migrations { /// public partial class AddNotifications : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Notifications", columns: table => new { Id = table.Column(type: "uuid", nullable: false), Tipo = table.Column(type: "text", nullable: false), Titulo = table.Column(type: "text", nullable: false), Mensagem = table.Column(type: "text", nullable: false), Data = table.Column(type: "timestamp with time zone", nullable: false), ReferenciaData = table.Column(type: "timestamp with time zone", nullable: true), DiasParaVencer = table.Column(type: "integer", nullable: true), Lida = table.Column(type: "boolean", nullable: false), LidaEm = table.Column(type: "timestamp with time zone", nullable: true), DedupKey = table.Column(type: "text", nullable: false), UserId = table.Column(type: "uuid", nullable: true), VigenciaLineId = table.Column(type: "uuid", nullable: true), Usuario = table.Column(type: "text", nullable: true), Cliente = table.Column(type: "text", nullable: true), Linha = table.Column(type: "text", nullable: true) }, constraints: table => { table.PrimaryKey("PK_Notifications", x => x.Id); table.ForeignKey( name: "FK_Notifications_Users_UserId", column: x => x.UserId, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_Notifications_VigenciaLines_VigenciaLineId", column: x => x.VigenciaLineId, principalTable: "VigenciaLines", principalColumn: "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateIndex( name: "IX_Notifications_Cliente", table: "Notifications", column: "Cliente"); migrationBuilder.CreateIndex( name: "IX_Notifications_Data", table: "Notifications", column: "Data"); migrationBuilder.CreateIndex( name: "IX_Notifications_DedupKey", table: "Notifications", column: "DedupKey", unique: true); migrationBuilder.CreateIndex( name: "IX_Notifications_Lida", table: "Notifications", column: "Lida"); migrationBuilder.CreateIndex( name: "IX_Notifications_UserId", table: "Notifications", column: "UserId"); migrationBuilder.CreateIndex( name: "IX_Notifications_VigenciaLineId", table: "Notifications", column: "VigenciaLineId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Notifications"); } } }