using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace GestorFacturas.API.Migrations { /// public partial class InitialCreate : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Configuraciones", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Periodicidad = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: false), ValorPeriodicidad = table.Column(type: "int", nullable: false), HoraEjecucion = table.Column(type: "nvarchar(10)", maxLength: 10, nullable: false), UltimaEjecucion = table.Column(type: "datetime2", nullable: true), Estado = table.Column(type: "bit", nullable: false), EnEjecucion = table.Column(type: "bit", nullable: false), DBServidor = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), DBNombre = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), DBUsuario = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), DBClave = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), DBTrusted = table.Column(type: "bit", nullable: false), RutaFacturas = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: false), RutaDestino = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: false), SMTPServidor = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), SMTPPuerto = table.Column(type: "int", nullable: false), SMTPUsuario = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), SMTPClave = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), SMTPSSL = table.Column(type: "bit", nullable: false), SMTPDestinatario = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), AvisoMail = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Configuraciones", x => x.Id); }); migrationBuilder.CreateTable( name: "Eventos", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Fecha = table.Column(type: "datetime2", nullable: false), Mensaje = table.Column(type: "nvarchar(max)", nullable: false), Tipo = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: false), Enviado = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Eventos", x => x.Id); }); migrationBuilder.InsertData( table: "Configuraciones", columns: new[] { "Id", "AvisoMail", "DBClave", "DBNombre", "DBServidor", "DBTrusted", "DBUsuario", "EnEjecucion", "Estado", "HoraEjecucion", "Periodicidad", "RutaDestino", "RutaFacturas", "SMTPClave", "SMTPDestinatario", "SMTPPuerto", "SMTPSSL", "SMTPServidor", "SMTPUsuario", "UltimaEjecucion", "ValorPeriodicidad" }, values: new object[] { 1, false, null, "", "TECNICA3", true, null, false, true, "00:00:00", "Dias", "", "", null, null, 587, true, null, null, null, 1 }); migrationBuilder.CreateIndex( name: "IX_Eventos_Fecha", table: "Eventos", column: "Fecha"); migrationBuilder.CreateIndex( name: "IX_Eventos_Tipo", table: "Eventos", column: "Tipo"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Configuraciones"); migrationBuilder.DropTable( name: "Eventos"); } } }