using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace backend.Migrations { /// public partial class InitialCreate : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "AuthLevels", columns: table => new { AuthLevelId = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), AuthLevelAuthLevel = table.Column(type: "nvarchar(max)", nullable: false), Description = table.Column(type: "nvarchar(max)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_AuthLevels", x => x.AuthLevelId); }); migrationBuilder.CreateTable( name: "Auths", columns: table => new { AuthId = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), UserId = table.Column(type: "int", nullable: false), AuthLevelId = table.Column(type: "int", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Auths", x => x.AuthId); }); migrationBuilder.CreateTable( name: "Companies", columns: table => new { CompanyId = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), CompanyName = table.Column(type: "nvarchar(max)", nullable: false), MainContact = table.Column(type: "int", nullable: false), State = table.Column(type: "nvarchar(max)", nullable: false), Created = table.Column(type: "datetimeoffset", nullable: false), Updated = table.Column(type: "datetimeoffset", nullable: false), LastLogin = table.Column(type: "datetimeoffset", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Companies", x => x.CompanyId); }); migrationBuilder.CreateTable( name: "LeafHeaders", columns: table => new { LeafHeaderId = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), LeafHeaderLeafHeader = table.Column(type: "nvarchar(max)", nullable: false), HeaderRegex = table.Column(type: "nvarchar(max)", nullable: false), LeafHeaderRequired = table.Column(type: "bit", nullable: false), Nullable = table.Column(type: "bit", nullable: false), ValueRegex = table.Column(type: "nvarchar(max)", nullable: false), Active = table.Column(type: "bit", nullable: false), Version = table.Column(type: "int", nullable: false), Created = table.Column(type: "datetimeoffset", nullable: false) }, constraints: table => { table.PrimaryKey("PK_LeafHeaders", x => x.LeafHeaderId); }); migrationBuilder.CreateTable( name: "PortfolioData", columns: table => new { PortfolioDataID = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), PortfolioID = table.Column(type: "int", nullable: false), ContractNumber = table.Column(type: "nvarchar(max)", nullable: false), CustomerName = table.Column(type: "nvarchar(max)", nullable: false), CustomerPhoneNumber = table.Column(type: "nvarchar(max)", nullable: false), CustomerTaxID = table.Column(type: "nvarchar(max)", nullable: false), CustomerPhysicalAddress1 = table.Column(type: "nvarchar(max)", nullable: false), CustomerPhysicalAddress2 = table.Column(type: "nvarchar(max)", nullable: false), CustomerPhysicalCity = table.Column(type: "nvarchar(max)", nullable: false), CustomerPhysicalState = table.Column(type: "nvarchar(max)", nullable: false), CustomerPhysicalZip = table.Column(type: "nvarchar(max)", nullable: false), DateBooked = table.Column(type: "datetime2", nullable: false), Term = table.Column(type: "tinyint", nullable: false), PaymentAmount = table.Column(type: "decimal(18,2)", nullable: false), FinancedAmount = table.Column(type: "decimal(18,2)", nullable: false), Receivablebalance = table.Column(type: "decimal(18,2)", nullable: false), AssetDescription = table.Column(type: "nvarchar(max)", nullable: false), SerialNumberVIN = table.Column(type: "nvarchar(max)", nullable: false), BusinessType = table.Column(type: "nvarchar(max)", nullable: false), PGName = table.Column(type: "nvarchar(max)", nullable: false), PGAddress1 = table.Column(type: "nvarchar(max)", nullable: false), PGAddress2 = table.Column(type: "nvarchar(max)", nullable: false), PGCity = table.Column(type: "nvarchar(max)", nullable: false), PGState = table.Column(type: "nvarchar(max)", nullable: false), PGZip = table.Column(type: "nvarchar(max)", nullable: false), PGSSN = table.Column(type: "nvarchar(max)", nullable: false), DOB = table.Column(type: "datetime2", nullable: false), PG1FICO = table.Column(type: "smallint", nullable: false), ScheduleNumber = table.Column(type: "nvarchar(max)", nullable: false), CustomerNumber = table.Column(type: "nvarchar(max)", nullable: false), CustomerBillingStreet = table.Column(type: "nvarchar(max)", nullable: false), CustomerBillingCity = table.Column(type: "nvarchar(max)", nullable: false), CustomerBillingState = table.Column(type: "nvarchar(max)", nullable: false), CustomerBillingZip = table.Column(type: "nvarchar(max)", nullable: false), DirectInDirectChannel = table.Column(type: "nvarchar(max)", nullable: false), DaysDelinquent = table.Column(type: "smallint", nullable: false), Times30DaysDelinq = table.Column(type: "smallint", nullable: false), Times60DaysDelinq = table.Column(type: "smallint", nullable: false), Times90PlusDaysDelinq = table.Column(type: "smallint", nullable: false), DBAName = table.Column(type: "nvarchar(max)", nullable: false), AssetEquipmentAddress1 = table.Column(type: "nvarchar(max)", nullable: false), AssetEquipmentAddress2 = table.Column(type: "nvarchar(max)", nullable: false), AssetEquipmentCity = table.Column(type: "nvarchar(max)", nullable: false), AssetEquipmentState = table.Column(type: "nvarchar(max)", nullable: false), AssetEquipmentZip = table.Column(type: "nvarchar(max)", nullable: false), Assumption = table.Column(type: "nvarchar(max)", nullable: false), Resturcture = table.Column(type: "nvarchar(max)", nullable: false), Bankruptcy = table.Column(type: "nvarchar(max)", nullable: false), ResidualTypeTo = table.Column(type: "nvarchar(max)", nullable: false), CSC = table.Column(type: "nvarchar(max)", nullable: false), CommencementDate = table.Column(type: "datetime2", nullable: false), MaturityDate = table.Column(type: "datetime2", nullable: false), PaidThruDate = table.Column(type: "datetime2", nullable: false), NextDueDate = table.Column(type: "datetime2", nullable: false), LastPaymentDate = table.Column(type: "datetime2", nullable: false), Dateincomesuspended = table.Column(type: "datetime2", nullable: false), TerminationDate = table.Column(type: "datetime2", nullable: false), RemainingMonthsCash = table.Column(type: "smallint", nullable: false), PaymentType = table.Column(type: "nvarchar(max)", nullable: false), ResidualAmount = table.Column(type: "real", nullable: false), SecurityDeposit = table.Column(type: "decimal(18,2)", nullable: false), SICCode = table.Column(type: "smallint", nullable: false), AssetType = table.Column(type: "nvarchar(max)", nullable: false), YearsinBusiness = table.Column(type: "smallint", nullable: false), Vendorname = table.Column(type: "nvarchar(max)", nullable: false), PG2Name = table.Column(type: "nvarchar(max)", nullable: false), PG2Address1 = table.Column(type: "nvarchar(max)", nullable: false), PG2Address2 = table.Column(type: "nvarchar(max)", nullable: false), PG2City = table.Column(type: "nvarchar(max)", nullable: false), PG2State = table.Column(type: "nvarchar(max)", nullable: false), PG2Zip = table.Column(type: "nvarchar(max)", nullable: false), PG2SSN = table.Column(type: "nvarchar(max)", nullable: false), PG2DOB = table.Column(type: "datetime2", nullable: false), PG2FICO = table.Column(type: "smallint", nullable: false), CGName = table.Column(type: "nvarchar(max)", nullable: false), CGAddress1 = table.Column(type: "nvarchar(max)", nullable: false), CGAddress2 = table.Column(type: "nvarchar(max)", nullable: false), CGCity = table.Column(type: "nvarchar(max)", nullable: false), CGState = table.Column(type: "nvarchar(max)", nullable: false), CGZip = table.Column(type: "nvarchar(max)", nullable: false), NextDue = table.Column(type: "datetime2", nullable: false), NumDays = table.Column(type: "smallint", nullable: false), PerDiem = table.Column(type: "nvarchar(max)", nullable: false), TotalNetFunding = table.Column(type: "decimal(18,2)", nullable: false), NPV = table.Column(type: "decimal(18,2)", nullable: false), AdditionalData = table.Column(type: "nvarchar(max)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_PortfolioData", x => x.PortfolioDataID); }); migrationBuilder.CreateTable( name: "Portfolios", columns: table => new { PortfolioID = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), CompanyID = table.Column(type: "smallint", nullable: false), Uploaded = table.Column(type: "datetimeoffset", nullable: false), NumContracts = table.Column(type: "smallint", nullable: false), Value = table.Column(type: "decimal(18,2)", nullable: false), UploadUser = table.Column(type: "smallint", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Portfolios", x => x.PortfolioID); }); migrationBuilder.CreateTable( name: "Users", columns: table => new { UserId = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Username = table.Column(type: "nvarchar(max)", nullable: false), Email = table.Column(type: "nvarchar(max)", nullable: false), PasswordHash = table.Column(type: "nvarchar(max)", nullable: false), Created = table.Column(type: "nvarchar(max)", nullable: false), Updated = table.Column(type: "nvarchar(max)", nullable: false), PasswordUpdated = table.Column(type: "datetimeoffset", nullable: false), CompanyId = table.Column(type: "int", nullable: false), LastLogin = table.Column(type: "datetimeoffset", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Users", x => x.UserId); }); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "AuthLevels"); migrationBuilder.DropTable( name: "Auths"); migrationBuilder.DropTable( name: "Companies"); migrationBuilder.DropTable( name: "LeafHeaders"); migrationBuilder.DropTable( name: "PortfolioData"); migrationBuilder.DropTable( name: "Portfolios"); migrationBuilder.DropTable( name: "Users"); } } }