You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
PortfolioLink/backend/Migrations/20230314000540_InitialCreat...

240 lines
15 KiB

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