diff --git a/ifrs17-template/Database/Configure.ipynb b/ifrs17-template/Database/Configure.ipynb index c536ff36..4ede3cfe 100644 --- a/ifrs17-template/Database/Configure.ipynb +++ b/ifrs17-template/Database/Configure.ipynb @@ -81,7 +81,10 @@ "cell_type": "code", "source": [ "await DataSource.Configure().UseMsSql(opt => opt.WithConnectionString(connectionStringMsSql)", - "\n .WithTypes(allTypes)) .ConnectAsync();" + "\n .WithTypes(allTypes)", + "\n // .WithMigration() // uncomment if run with migration", + "\n ) ", + "\n .ConnectAsync();" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17-template/Database/MigrationAndScaffolding/Initial.ipynb b/ifrs17-template/Database/MigrationAndScaffolding/Initial.ipynb new file mode 100644 index 00000000..e14369ba --- /dev/null +++ b/ifrs17-template/Database/MigrationAndScaffolding/Initial.ipynb @@ -0,0 +1,728 @@ +{ + "metadata": { + "authors": [], + "kernelspec": { + "display_name": "Formula Framework", + "language": "C#", + "name": "C#" + }, + "language_info": { + "file_extension": ".cs", + "mimetype": "text/plain", + "name": "C#" + } + }, + "nbformat": 4, + "nbformat_minor": 5, + "cells": [ + { + "cell_type": "markdown", + "source": [ + "

The Initial Migration Code

" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "This copy contains the copy of the initial migration code. It is a necessary input to execute the first migration flow. " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "[Migration(\"20230208105811_InitialTypes\")]", + "\npublic class InitialTypes : Migration", + "\n{", + "\n protected override void Up(MigrationBuilder migrationBuilder)", + "\n {", + "\n migrationBuilder.CreateTable(", + "\n name: \"AmountType\",", + "\n columns: table => new", + "\n {", + "\n SystemName = table.Column(type: \"nvarchar(16)\", maxLength: 16, nullable: false),", + "\n Parent = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n PeriodType = table.Column(type: \"int\", nullable: false),", + "\n Discriminator = table.Column(type: \"nvarchar(max)\", nullable: false),", + "\n DisplayName = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Order = table.Column(type: \"int\", nullable: false),", + "\n ExternalId = table.Column(type: \"nvarchar(max)\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_AmountType\", x => x.SystemName);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"AocConfiguration\",", + "\n columns: table => new", + "\n {", + "\n Id = table.Column(type: \"uniqueidentifier\", nullable: false),", + "\n Year = table.Column(type: \"int\", nullable: false),", + "\n Month = table.Column(type: \"int\", nullable: false),", + "\n AocType = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Novelty = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n DataType = table.Column(type: \"int\", nullable: false),", + "\n InputSource = table.Column(type: \"int\", nullable: false),", + "\n FxPeriod = table.Column(type: \"int\", nullable: false),", + "\n YcPeriod = table.Column(type: \"int\", nullable: false),", + "\n CdrPeriod = table.Column(type: \"int\", nullable: false),", + "\n ValuationPeriod = table.Column(type: \"int\", nullable: false),", + "\n RcPeriod = table.Column(type: \"int\", nullable: false),", + "\n Order = table.Column(type: \"int\", nullable: false)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_AocConfiguration\", x => x.Id);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"CreditDefaultRate\",", + "\n columns: table => new", + "\n {", + "\n Id = table.Column(type: \"uniqueidentifier\", nullable: false),", + "\n CreditRiskRating = table.Column(type: \"nvarchar(max)\", nullable: false),", + "\n Year = table.Column(type: \"int\", nullable: false),", + "\n Month = table.Column(type: \"int\", nullable: false),", + "\n Values = table.Column(type: \"varbinary(max)\", nullable: true),", + "\n Scenario = table.Column(type: \"nvarchar(max)\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_CreditDefaultRate\", x => x.Id);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"CreditRiskRating\",", + "\n columns: table => new", + "\n {", + "\n SystemName = table.Column(type: \"nvarchar(16)\", maxLength: 16, nullable: false),", + "\n DisplayName = table.Column(type: \"nvarchar(max)\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_CreditRiskRating\", x => x.SystemName);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"Currency\",", + "\n columns: table => new", + "\n {", + "\n SystemName = table.Column(type: \"nvarchar(16)\", maxLength: 16, nullable: false),", + "\n DisplayName = table.Column(type: \"nvarchar(max)\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_Currency\", x => x.SystemName);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"DataNode\",", + "\n columns: table => new", + "\n {", + "\n SystemName = table.Column(type: \"nvarchar(16)\", maxLength: 16, nullable: false),", + "\n Partition = table.Column(type: \"uniqueidentifier\", nullable: false),", + "\n ContractualCurrency = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n FunctionalCurrency = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n LineOfBusiness = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n ValuationApproach = table.Column(type: \"nvarchar(max)\", nullable: false),", + "\n OciType = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Discriminator = table.Column(type: \"nvarchar(max)\", nullable: false),", + "\n AnnualCohort = table.Column(type: \"int\", nullable: true),", + "\n LiabilityType = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Profitability = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Portfolio = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n YieldCurveName = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Partner = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n DisplayName = table.Column(type: \"nvarchar(max)\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_DataNode\", x => x.SystemName);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"DataNodeParameter\",", + "\n columns: table => new", + "\n {", + "\n Id = table.Column(type: \"uniqueidentifier\", nullable: false),", + "\n Partition = table.Column(type: \"uniqueidentifier\", nullable: false),", + "\n Year = table.Column(type: \"int\", nullable: false),", + "\n Month = table.Column(type: \"int\", nullable: false),", + "\n DataNode = table.Column(type: \"nvarchar(max)\", nullable: false),", + "\n Scenario = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Discriminator = table.Column(type: \"nvarchar(max)\", nullable: false),", + "\n LinkedDataNode = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n ReinsuranceCoverage = table.Column(type: \"float\", nullable: true),", + "\n PremiumAllocation = table.Column(type: \"float\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_DataNodeParameter\", x => x.Id);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"DataNodeState\",", + "\n columns: table => new", + "\n {", + "\n Id = table.Column(type: \"uniqueidentifier\", nullable: false),", + "\n Partition = table.Column(type: \"uniqueidentifier\", nullable: false),", + "\n DataNode = table.Column(type: \"nvarchar(max)\", nullable: false),", + "\n Year = table.Column(type: \"int\", nullable: false),", + "\n Month = table.Column(type: \"int\", nullable: false),", + "\n State = table.Column(type: \"int\", nullable: false),", + "\n Scenario = table.Column(type: \"nvarchar(max)\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_DataNodeState\", x => x.Id);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"EconomicBasis\",", + "\n columns: table => new", + "\n {", + "\n SystemName = table.Column(type: \"nvarchar(16)\", maxLength: 16, nullable: false),", + "\n DisplayName = table.Column(type: \"nvarchar(max)\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_EconomicBasis\", x => x.SystemName);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"EstimateType\",", + "\n columns: table => new", + "\n {", + "\n SystemName = table.Column(type: \"nvarchar(16)\", maxLength: 16, nullable: false),", + "\n InputSource = table.Column(type: \"int\", nullable: false),", + "\n StructureType = table.Column(type: \"int\", nullable: false),", + "\n PeriodType = table.Column(type: \"int\", nullable: false),", + "\n DisplayName = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Order = table.Column(type: \"int\", nullable: false),", + "\n ExternalId = table.Column(type: \"nvarchar(max)\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_EstimateType\", x => x.SystemName);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"ExchangeRate\",", + "\n columns: table => new", + "\n {", + "\n Id = table.Column(type: \"uniqueidentifier\", nullable: false),", + "\n Currency = table.Column(type: \"nvarchar(max)\", nullable: false),", + "\n Year = table.Column(type: \"int\", nullable: false),", + "\n Month = table.Column(type: \"int\", nullable: false),", + "\n FxType = table.Column(type: \"int\", nullable: false),", + "\n FxToGroupCurrency = table.Column(type: \"float\", nullable: false),", + "\n Scenario = table.Column(type: \"nvarchar(max)\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_ExchangeRate\", x => x.Id);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"ExportFile\",", + "\n columns: table => new", + "\n {", + "\n Id = table.Column(type: \"uniqueidentifier\", nullable: false),", + "\n Name = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n ContentType = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n CreationTime = table.Column(type: \"datetime2\", nullable: false),", + "\n SerializedContent = table.Column(type: \"varbinary(max)\", nullable: true),", + "\n Length = table.Column(type: \"bigint\", nullable: true),", + "\n Format = table.Column(type: \"nvarchar(max)\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_ExportFile\", x => x.Id);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"IfrsVariable\",", + "\n columns: table => new", + "\n {", + "\n Id = table.Column(type: \"uniqueidentifier\", nullable: false),", + "\n Value = table.Column(type: \"float\", nullable: false),", + "\n EstimateType = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n EconomicBasis = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n DataNode = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n AocType = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Novelty = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Partition = table.Column(type: \"uniqueidentifier\", nullable: false),", + "\n AmountType = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n AccidentYear = table.Column(type: \"int\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_IfrsVariable\", x => x.Id);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"ImportDataSet\",", + "\n columns: table => new", + "\n {", + "\n Id = table.Column(type: \"uniqueidentifier\", nullable: false),", + "\n CreationTime = table.Column(type: \"datetime2\", nullable: false),", + "\n SerializedContent = table.Column(type: \"varbinary(max)\", nullable: true),", + "\n Length = table.Column(type: \"bigint\", nullable: true),", + "\n Format = table.Column(type: \"nvarchar(max)\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_ImportDataSet\", x => x.Id);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"ImportExportActivity\",", + "\n columns: table => new", + "\n {", + "\n Id = table.Column(type: \"uniqueidentifier\", nullable: false),", + "\n Username = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n StartDateTime = table.Column(type: \"datetime2\", nullable: false),", + "\n EndDateTime = table.Column(type: \"datetime2\", nullable: false),", + "\n Status = table.Column(type: \"int\", nullable: false),", + "\n Category = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n ExceptionMessage = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n ErrorMessages = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n WarningMessages = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n InfoMessages = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n SourceId = table.Column(type: \"uniqueidentifier\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_ImportExportActivity\", x => x.Id);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"ImportFile\",", + "\n columns: table => new", + "\n {", + "\n Id = table.Column(type: \"uniqueidentifier\", nullable: false),", + "\n Name = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Directory = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n ContentType = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Partition = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Source = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n CreationTime = table.Column(type: \"datetime2\", nullable: false),", + "\n SerializedContent = table.Column(type: \"varbinary(max)\", nullable: true),", + "\n Length = table.Column(type: \"bigint\", nullable: true),", + "\n Format = table.Column(type: \"nvarchar(max)\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_ImportFile\", x => x.Id);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"ImportStream\",", + "\n columns: table => new", + "\n {", + "\n Id = table.Column(type: \"uniqueidentifier\", nullable: false),", + "\n CreationTime = table.Column(type: \"datetime2\", nullable: false),", + "\n SerializedContent = table.Column(type: \"varbinary(max)\", nullable: true),", + "\n Length = table.Column(type: \"bigint\", nullable: true),", + "\n Format = table.Column(type: \"nvarchar(max)\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_ImportStream\", x => x.Id);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"ImportString\",", + "\n columns: table => new", + "\n {", + "\n Id = table.Column(type: \"uniqueidentifier\", nullable: false),", + "\n Content = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n CreationTime = table.Column(type: \"datetime2\", nullable: false),", + "\n SerializedContent = table.Column(type: \"varbinary(max)\", nullable: true),", + "\n Length = table.Column(type: \"bigint\", nullable: true),", + "\n Format = table.Column(type: \"nvarchar(max)\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_ImportString\", x => x.Id);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"LiabilityType\",", + "\n columns: table => new", + "\n {", + "\n SystemName = table.Column(type: \"nvarchar(16)\", maxLength: 16, nullable: false),", + "\n Parent = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n DisplayName = table.Column(type: \"nvarchar(max)\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_LiabilityType\", x => x.SystemName);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"LineOfBusiness\",", + "\n columns: table => new", + "\n {", + "\n SystemName = table.Column(type: \"nvarchar(16)\", maxLength: 16, nullable: false),", + "\n Parent = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n DisplayName = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Order = table.Column(type: \"int\", nullable: false)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_LineOfBusiness\", x => x.SystemName);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"Novelty\",", + "\n columns: table => new", + "\n {", + "\n SystemName = table.Column(type: \"nvarchar(16)\", maxLength: 16, nullable: false),", + "\n DisplayName = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Order = table.Column(type: \"int\", nullable: false)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_Novelty\", x => x.SystemName);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"OciType\",", + "\n columns: table => new", + "\n {", + "\n SystemName = table.Column(type: \"nvarchar(16)\", maxLength: 16, nullable: false),", + "\n DisplayName = table.Column(type: \"nvarchar(max)\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_OciType\", x => x.SystemName);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"PartitionByReportingNode\",", + "\n columns: table => new", + "\n {", + "\n Id = table.Column(type: \"uniqueidentifier\", nullable: false),", + "\n ReportingNode = table.Column(type: \"nvarchar(max)\", nullable: false)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_PartitionByReportingNode\", x => x.Id);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"PartitionByReportingNodeAndPeriod\",", + "\n columns: table => new", + "\n {", + "\n Id = table.Column(type: \"uniqueidentifier\", nullable: false),", + "\n Year = table.Column(type: \"int\", nullable: false),", + "\n Month = table.Column(type: \"int\", nullable: false),", + "\n Scenario = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n ReportingNode = table.Column(type: \"nvarchar(max)\", nullable: false)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_PartitionByReportingNodeAndPeriod\", x => x.Id);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"Partner\",", + "\n columns: table => new", + "\n {", + "\n SystemName = table.Column(type: \"nvarchar(16)\", maxLength: 16, nullable: false),", + "\n DisplayName = table.Column(type: \"nvarchar(max)\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_Partner\", x => x.SystemName);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"PartnerRating\",", + "\n columns: table => new", + "\n {", + "\n Id = table.Column(type: \"uniqueidentifier\", nullable: false),", + "\n Partner = table.Column(type: \"nvarchar(max)\", nullable: false),", + "\n CreditRiskRating = table.Column(type: \"nvarchar(max)\", nullable: false),", + "\n Year = table.Column(type: \"int\", nullable: false),", + "\n Month = table.Column(type: \"int\", nullable: false),", + "\n Scenario = table.Column(type: \"nvarchar(max)\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_PartnerRating\", x => x.Id);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"Profitability\",", + "\n columns: table => new", + "\n {", + "\n SystemName = table.Column(type: \"nvarchar(16)\", maxLength: 16, nullable: false),", + "\n DisplayName = table.Column(type: \"nvarchar(max)\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_Profitability\", x => x.SystemName);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"ProjectionConfiguration\",", + "\n columns: table => new", + "\n {", + "\n SystemName = table.Column(type: \"nvarchar(16)\", maxLength: 16, nullable: false),", + "\n Shift = table.Column(type: \"int\", nullable: false),", + "\n TimeStep = table.Column(type: \"int\", nullable: false),", + "\n DisplayName = table.Column(type: \"nvarchar(max)\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_ProjectionConfiguration\", x => x.SystemName);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"RawVariable\",", + "\n columns: table => new", + "\n {", + "\n Id = table.Column(type: \"uniqueidentifier\", nullable: false),", + "\n Values = table.Column(type: \"varbinary(max)\", nullable: true),", + "\n EstimateType = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n DataNode = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n AocType = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Novelty = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Partition = table.Column(type: \"uniqueidentifier\", nullable: false),", + "\n AmountType = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n AccidentYear = table.Column(type: \"int\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_RawVariable\", x => x.Id);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"ReportingNode\",", + "\n columns: table => new", + "\n {", + "\n SystemName = table.Column(type: \"nvarchar(16)\", maxLength: 16, nullable: false),", + "\n Parent = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Currency = table.Column(type: \"nvarchar(max)\", nullable: false),", + "\n DisplayName = table.Column(type: \"nvarchar(max)\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_ReportingNode\", x => x.SystemName);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"RiskDriver\",", + "\n columns: table => new", + "\n {", + "\n SystemName = table.Column(type: \"nvarchar(16)\", maxLength: 16, nullable: false),", + "\n Parent = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n DisplayName = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Order = table.Column(type: \"int\", nullable: false)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_RiskDriver\", x => x.SystemName);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"Scenario\",", + "\n columns: table => new", + "\n {", + "\n SystemName = table.Column(type: \"nvarchar(16)\", maxLength: 16, nullable: false),", + "\n DisplayName = table.Column(type: \"nvarchar(max)\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_Scenario\", x => x.SystemName);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"ValuationApproach\",", + "\n columns: table => new", + "\n {", + "\n SystemName = table.Column(type: \"nvarchar(16)\", maxLength: 16, nullable: false),", + "\n DisplayName = table.Column(type: \"nvarchar(max)\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_ValuationApproach\", x => x.SystemName);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"VariableType\",", + "\n columns: table => new", + "\n {", + "\n SystemName = table.Column(type: \"nvarchar(16)\", maxLength: 16, nullable: false),", + "\n Parent = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Discriminator = table.Column(type: \"nvarchar(max)\", nullable: false),", + "\n DisplayName = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Order = table.Column(type: \"int\", nullable: false)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_VariableType\", x => x.SystemName);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"YieldCurve\",", + "\n columns: table => new", + "\n {", + "\n Id = table.Column(type: \"uniqueidentifier\", nullable: false),", + "\n Currency = table.Column(type: \"nvarchar(max)\", nullable: false),", + "\n Year = table.Column(type: \"int\", nullable: false),", + "\n Month = table.Column(type: \"int\", nullable: false),", + "\n Scenario = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Name = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Values = table.Column(type: \"varbinary(max)\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_YieldCurve\", x => x.Id);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"YieldCurveReport\",", + "\n columns: table => new", + "\n {", + "\n Id = table.Column(type: \"uniqueidentifier\", nullable: false),", + "\n Currency = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Year = table.Column(type: \"int\", nullable: false),", + "\n Month = table.Column(type: \"int\", nullable: false),", + "\n Scenario = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Index = table.Column(type: \"int\", nullable: false),", + "\n Value = table.Column(type: \"float\", nullable: false)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_YieldCurveReport\", x => x.Id);", + "\n });", + "\n }", + "\n", + "\n protected override void Down(MigrationBuilder migrationBuilder)", + "\n {", + "\n migrationBuilder.DropTable(", + "\n name: \"AmountType\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"AocConfiguration\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"CreditDefaultRate\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"CreditRiskRating\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"Currency\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"DataNode\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"DataNodeParameter\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"DataNodeState\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"EconomicBasis\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"EstimateType\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"ExchangeRate\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"ExportFile\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"IfrsVariable\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"ImportDataSet\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"ImportExportActivity\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"ImportFile\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"ImportStream\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"ImportString\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"LiabilityType\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"LineOfBusiness\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"Novelty\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"OciType\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"PartitionByReportingNode\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"PartitionByReportingNodeAndPeriod\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"Partner\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"PartnerRating\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"Profitability\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"ProjectionConfiguration\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"RawVariable\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"ReportingNode\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"RiskDriver\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"Scenario\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"ValuationApproach\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"VariableType\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"YieldCurve\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"YieldCurveReport\");", + "\n }", + "\n}", + "\n" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/ifrs17-template/Database/MigrationAndScaffolding/MigrationFlow.ipynb b/ifrs17-template/Database/MigrationAndScaffolding/MigrationFlow.ipynb new file mode 100644 index 00000000..99310591 --- /dev/null +++ b/ifrs17-template/Database/MigrationAndScaffolding/MigrationFlow.ipynb @@ -0,0 +1,86 @@ +{ + "metadata": { + "authors": [], + "kernelspec": { + "display_name": "Formula Framework", + "language": "C#", + "name": "C#" + }, + "language_info": { + "file_extension": ".cs", + "mimetype": "text/plain", + "name": "C#" + } + }, + "nbformat": 4, + "nbformat_minor": 5, + "cells": [ + { + "cell_type": "markdown", + "source": [ + "

Migration Flow

" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "#r \"nuget:Systemorph.SchemaMigrations,1.6.3\"", + "\n#!import \"../PersonalConnectionExample\"" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "For the initial migration one needs a migration code from the Initial notebook, so we import it here. For any subsequent migrations please change the next cell to import the notebook, where your stored the relevant migration code." + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "#!import \"Initial\"" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "Here is the migration of the data base. For all subsequent migrations, please replace the InitialTypes in the second row with the name, that you gave to your migration. " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await SchemaMigrations", + "\n .Apply() // Change the class in <> for future migrations", + "\n .ToMsSql(connectionStringMsSql)", + "\n .MigrateAsync();" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/ifrs17-template/Database/MigrationAndScaffolding/ReadMe.ipynb b/ifrs17-template/Database/MigrationAndScaffolding/ReadMe.ipynb new file mode 100644 index 00000000..afde3c4f --- /dev/null +++ b/ifrs17-template/Database/MigrationAndScaffolding/ReadMe.ipynb @@ -0,0 +1,126 @@ +{ + "metadata": { + "authors": [], + "kernelspec": { + "display_name": "Formula Framework", + "language": "C#", + "name": "C#" + }, + "language_info": { + "file_extension": ".cs", + "mimetype": "text/plain", + "name": "C#" + } + }, + "nbformat": 4, + "nbformat_minor": 5, + "cells": [ + { + "cell_type": "markdown", + "source": [ + "

Explanation of Migration and Scaffolding

" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Brief Explanation of Migration" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "Migration is a powerful tool that allows us to keep the same Database (DB) during the whole lifetime of the project, without any need to remove it if one needs to modify the DB, e.g. via addition or removing certain tables or columns. With the migration, if modification of the DB is needed, we do not remove the old DB, but rather migrate it incrementally. Note, however, that running a project with migration is a choice rather than a default option. If you are OK with removing the DB each time when some change in the tables structure is needed, migration is not necessary. ", + "\n", + "\nAt the first step we perform the [scaffolding](Scaffold). The scaffolding procedure naturally outputs the migration code and the model snapshot. The migration code is the code that we should run in order to change the DB according to our new requirements, or, alternatively, if we start from scratch, to create the DB. The snapshot contains all the information about the structure of the DB after the migration. It is necessary to have the snapshot, in order for us not to start from scratch at the next migration, but rather only *implement the changes*. Each time when the DB has to be changed, we should scaffold the new model, taking into account the snapshot of the previous step. The snapshot of the new scaffold should be copied manually without changes into the [Snapshot notebook](Snapshot). We have done it already for the initial migration, please do not forget to change the [Snapshot notebook](Snapshot) for any subsequent migration.", + "\n", + "\nAt the next step the migration code should be copied into a new notebook. The first one was copied into the [Initial notebook](Initial). Of course, it would make a lot of sense to add each new incremental migration into a new notebook inside this folder. ", + "\n", + "\nFinally, in order to update or initiate the DB, one should run the [Migration flow notebook](MigrationFlow) where we feed all the necessary information from the [personal connection](../PersonalConnectionExample) and the notebook that includes the migration code, which is the [Initial notebook](Initial) for the first migration. " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# A Handful of Comments on Migration" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Do Not Delete " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "Since the logic migration includes incremental changes, while adding or removing something from the DB, one should not delete the schema anymore. Therefore, the [schema deletion notebook](../SchemaDelete) must not be used. ", + "\n", + "\nSince migration is not a default mode, we are still leaving this notebook in the folder. However, note that now using it would contradict the logic of migration, so please do not do it light-headedly. Stick to migration if this is your choice." + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Configure" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "Before you execute the [Configure notebook](../Configure), please uncomment the row, that specifies that the Configuration is run with migration. " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Initialize" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "Note, that when the schema is created, it is not filled automatically via running the [Configure](../Configure) notebook. Therefore there is a need to initaliaze the DB manually via [this](../../Initialization/InitSystemorphToDatabase) notebook. Otherwise you will get a correctly structured, but completely empty DB " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/ifrs17-template/Database/MigrationAndScaffolding/Scaffold.ipynb b/ifrs17-template/Database/MigrationAndScaffolding/Scaffold.ipynb new file mode 100644 index 00000000..103c03ac --- /dev/null +++ b/ifrs17-template/Database/MigrationAndScaffolding/Scaffold.ipynb @@ -0,0 +1,130 @@ +{ + "metadata": { + "authors": [], + "kernelspec": { + "display_name": "Formula Framework", + "language": "C#", + "name": "C#" + }, + "language_info": { + "file_extension": ".cs", + "mimetype": "text/plain", + "name": "C#" + } + }, + "nbformat": 4, + "nbformat_minor": 5, + "cells": [ + { + "cell_type": "markdown", + "source": [ + "

Scaffolding

" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "#!import \"../../Constants/CalculationEngine\"", + "\n#!eval calculationEngine" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "At the first stage we generate an array of classes that we are about to scaffold. Here we scuffold old the suitable classes that have keys (we want to have a unique identifier of each object in the DB) and are not interfaces or abstract classes, because in general we are not going to have instance of such abstract objects like interface or abstract class. You personal choice might be even narrower than that, in this case just mofify the code in the cell below. Note that the array of types that you are going to scaffold must have no repetitions. " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var allTypes = AppDomain.CurrentDomain.GetAssemblies().SelectMany(a => a.GetTypes())", + "\n .Where(t => (t.IsAssignableTo(typeof(IKeyed)) || t.IsAssignableTo(typeof(KeyedDimension)))", + "\n && !t.IsInterface", + "\n && !t.IsAbstract", + "\n ).ToArray();" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "Start from the scaffolding of the initial types. Please make sure that you run this code *only at the first you create the DB*. For any subsequent changes, please comment this cell out and never use it again. " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var migration = SchemaMigrations", + "\n .ConfigureScaffolder(allTypes)", + "\n .ForMsSql()", + "\n .Scaffold(\"InitialTypes\");" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "In order to perform any subsequent change in the DB, there is no need to erase the DB and create a new from the scratch. It is sufficient to erase the cell above and uncomment the following cell. Please do not forget to insert a proper array of classes that you'd like to scaffold in the third row, as well as to give your own unique name to this migration in the 5th line. This is exactly the name that are going to use in the migration flow. " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "//#!import \"Snapshot\"", + "\n//var migration = SchemaMigrations", + "\n// .ConfigureScaffolder({your array of types here}, new DbModelSnapshot())", + "\n// .ForMsSql()", + "\n// .Scaffold({Your unique name here}); " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "migration.MigrationCode" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "migration.SnapshotCode" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/ifrs17-template/Database/MigrationAndScaffolding/Snapshot.ipynb b/ifrs17-template/Database/MigrationAndScaffolding/Snapshot.ipynb new file mode 100644 index 00000000..4f7e598d --- /dev/null +++ b/ifrs17-template/Database/MigrationAndScaffolding/Snapshot.ipynb @@ -0,0 +1,1080 @@ +{ + "metadata": { + "authors": [], + "kernelspec": { + "display_name": "Formula Framework", + "language": "C#", + "name": "C#" + }, + "language_info": { + "file_extension": ".cs", + "mimetype": "text/plain", + "name": "C#" + } + }, + "nbformat": 4, + "nbformat_minor": 5, + "cells": [ + { + "cell_type": "markdown", + "source": [ + "

The Current Snapshot

" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "Each time you produce a new migration, please copy and paste the snapshot code directly here. This must be the copy of the *most recent* migration snapshot. " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "using Microsoft.EntityFrameworkCore;", + "\nusing Microsoft.EntityFrameworkCore.Infrastructure;", + "\nusing Microsoft.EntityFrameworkCore.Metadata;", + "\n", + "\npublic class DbModelSnapshot : ModelSnapshot", + "\n{", + "\n protected override void BuildModel(ModelBuilder modelBuilder)", + "\n {", + "\n modelBuilder", + "\n .HasAnnotation(\"ProductVersion\", \"6.0.1\")", + "\n .HasAnnotation(\"Relational:MaxIdentifierLength\", 128);", + "\n", + "\n SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);", + "\n", + "\n modelBuilder.Entity(\"Submission_151+YieldCurveReport\", b =>", + "\n {", + "\n b.Property(\"Id\")", + "\n .ValueGeneratedOnAdd()", + "\n .HasColumnType(\"uniqueidentifier\");", + "\n", + "\n b.Property(\"Currency\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Index\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"Month\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"Scenario\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Value\")", + "\n .HasColumnType(\"float\");", + "\n", + "\n b.Property(\"Year\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.HasKey(\"Id\");", + "\n", + "\n b.ToTable(\"YieldCurveReport\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_287+ImportExportActivity\", b =>", + "\n {", + "\n b.Property(\"Id\")", + "\n .ValueGeneratedOnAdd()", + "\n .HasColumnType(\"uniqueidentifier\");", + "\n", + "\n b.Property(\"Category\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"EndDateTime\")", + "\n .HasColumnType(\"datetime2\");", + "\n", + "\n b.Property(\"ErrorMessages\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"ExceptionMessage\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"InfoMessages\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"SourceId\")", + "\n .HasColumnType(\"uniqueidentifier\");", + "\n", + "\n b.Property(\"StartDateTime\")", + "\n .HasColumnType(\"datetime2\");", + "\n", + "\n b.Property(\"Status\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"Username\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"WarningMessages\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.HasKey(\"Id\");", + "\n", + "\n b.ToTable(\"ImportExportActivity\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_289+ExportFile\", b =>", + "\n {", + "\n b.Property(\"Id\")", + "\n .ValueGeneratedOnAdd()", + "\n .HasColumnType(\"uniqueidentifier\");", + "\n", + "\n b.Property(\"ContentType\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"CreationTime\")", + "\n .HasColumnType(\"datetime2\");", + "\n", + "\n b.Property(\"Format\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Length\")", + "\n .HasColumnType(\"bigint\");", + "\n", + "\n b.Property(\"Name\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"SerializedContent\")", + "\n .HasColumnType(\"varbinary(max)\");", + "\n", + "\n b.HasKey(\"Id\");", + "\n", + "\n b.ToTable(\"ExportFile\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_291+ImportFile\", b =>", + "\n {", + "\n b.Property(\"Id\")", + "\n .ValueGeneratedOnAdd()", + "\n .HasColumnType(\"uniqueidentifier\");", + "\n", + "\n b.Property(\"ContentType\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"CreationTime\")", + "\n .HasColumnType(\"datetime2\");", + "\n", + "\n b.Property(\"Directory\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Format\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Length\")", + "\n .HasColumnType(\"bigint\");", + "\n", + "\n b.Property(\"Name\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Partition\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"SerializedContent\")", + "\n .HasColumnType(\"varbinary(max)\");", + "\n", + "\n b.Property(\"Source\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.HasKey(\"Id\");", + "\n", + "\n b.ToTable(\"ImportFile\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_292+ImportString\", b =>", + "\n {", + "\n b.Property(\"Id\")", + "\n .ValueGeneratedOnAdd()", + "\n .HasColumnType(\"uniqueidentifier\");", + "\n", + "\n b.Property(\"Content\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"CreationTime\")", + "\n .HasColumnType(\"datetime2\");", + "\n", + "\n b.Property(\"Format\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Length\")", + "\n .HasColumnType(\"bigint\");", + "\n", + "\n b.Property(\"SerializedContent\")", + "\n .HasColumnType(\"varbinary(max)\");", + "\n", + "\n b.HasKey(\"Id\");", + "\n", + "\n b.ToTable(\"ImportString\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_293+ImportDataSet\", b =>", + "\n {", + "\n b.Property(\"Id\")", + "\n .ValueGeneratedOnAdd()", + "\n .HasColumnType(\"uniqueidentifier\");", + "\n", + "\n b.Property(\"CreationTime\")", + "\n .HasColumnType(\"datetime2\");", + "\n", + "\n b.Property(\"Format\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Length\")", + "\n .HasColumnType(\"bigint\");", + "\n", + "\n b.Property(\"SerializedContent\")", + "\n .HasColumnType(\"varbinary(max)\");", + "\n", + "\n b.HasKey(\"Id\");", + "\n", + "\n b.ToTable(\"ImportDataSet\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_294+ImportStream\", b =>", + "\n {", + "\n b.Property(\"Id\")", + "\n .ValueGeneratedOnAdd()", + "\n .HasColumnType(\"uniqueidentifier\");", + "\n", + "\n b.Property(\"CreationTime\")", + "\n .HasColumnType(\"datetime2\");", + "\n", + "\n b.Property(\"Format\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Length\")", + "\n .HasColumnType(\"bigint\");", + "\n", + "\n b.Property(\"SerializedContent\")", + "\n .HasColumnType(\"varbinary(max)\");", + "\n", + "\n b.HasKey(\"Id\");", + "\n", + "\n b.ToTable(\"ImportStream\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_57+AmountType\", b =>", + "\n {", + "\n b.Property(\"SystemName\")", + "\n .HasMaxLength(16)", + "\n .HasColumnType(\"nvarchar(16)\");", + "\n", + "\n b.Property(\"Discriminator\")", + "\n .IsRequired()", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"DisplayName\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"ExternalId\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Order\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"Parent\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"PeriodType\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.HasKey(\"SystemName\");", + "\n", + "\n b.ToTable(\"AmountType\");", + "\n", + "\n b.HasDiscriminator(\"Discriminator\").HasValue(\"AmountType\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_59+RiskDriver\", b =>", + "\n {", + "\n b.Property(\"SystemName\")", + "\n .HasMaxLength(16)", + "\n .HasColumnType(\"nvarchar(16)\");", + "\n", + "\n b.Property(\"DisplayName\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Order\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"Parent\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.HasKey(\"SystemName\");", + "\n", + "\n b.ToTable(\"RiskDriver\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_60+EstimateType\", b =>", + "\n {", + "\n b.Property(\"SystemName\")", + "\n .HasMaxLength(16)", + "\n .HasColumnType(\"nvarchar(16)\");", + "\n", + "\n b.Property(\"DisplayName\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"ExternalId\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"InputSource\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"Order\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"PeriodType\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"StructureType\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.HasKey(\"SystemName\");", + "\n", + "\n b.ToTable(\"EstimateType\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_61+Novelty\", b =>", + "\n {", + "\n b.Property(\"SystemName\")", + "\n .HasMaxLength(16)", + "\n .HasColumnType(\"nvarchar(16)\");", + "\n", + "\n b.Property(\"DisplayName\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Order\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.HasKey(\"SystemName\");", + "\n", + "\n b.ToTable(\"Novelty\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_62+VariableType\", b =>", + "\n {", + "\n b.Property(\"SystemName\")", + "\n .HasMaxLength(16)", + "\n .HasColumnType(\"nvarchar(16)\");", + "\n", + "\n b.Property(\"Discriminator\")", + "\n .IsRequired()", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"DisplayName\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Order\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"Parent\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.HasKey(\"SystemName\");", + "\n", + "\n b.ToTable(\"VariableType\");", + "\n", + "\n b.HasDiscriminator(\"Discriminator\").HasValue(\"VariableType\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_68+Scenario\", b =>", + "\n {", + "\n b.Property(\"SystemName\")", + "\n .HasMaxLength(16)", + "\n .HasColumnType(\"nvarchar(16)\");", + "\n", + "\n b.Property(\"DisplayName\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.HasKey(\"SystemName\");", + "\n", + "\n b.ToTable(\"Scenario\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_69+LineOfBusiness\", b =>", + "\n {", + "\n b.Property(\"SystemName\")", + "\n .HasMaxLength(16)", + "\n .HasColumnType(\"nvarchar(16)\");", + "\n", + "\n b.Property(\"DisplayName\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Order\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"Parent\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.HasKey(\"SystemName\");", + "\n", + "\n b.ToTable(\"LineOfBusiness\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_70+Currency\", b =>", + "\n {", + "\n b.Property(\"SystemName\")", + "\n .HasMaxLength(16)", + "\n .HasColumnType(\"nvarchar(16)\");", + "\n", + "\n b.Property(\"DisplayName\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.HasKey(\"SystemName\");", + "\n", + "\n b.ToTable(\"Currency\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_71+EconomicBasis\", b =>", + "\n {", + "\n b.Property(\"SystemName\")", + "\n .HasMaxLength(16)", + "\n .HasColumnType(\"nvarchar(16)\");", + "\n", + "\n b.Property(\"DisplayName\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.HasKey(\"SystemName\");", + "\n", + "\n b.ToTable(\"EconomicBasis\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_72+ValuationApproach\", b =>", + "\n {", + "\n b.Property(\"SystemName\")", + "\n .HasMaxLength(16)", + "\n .HasColumnType(\"nvarchar(16)\");", + "\n", + "\n b.Property(\"DisplayName\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.HasKey(\"SystemName\");", + "\n", + "\n b.ToTable(\"ValuationApproach\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_73+LiabilityType\", b =>", + "\n {", + "\n b.Property(\"SystemName\")", + "\n .HasMaxLength(16)", + "\n .HasColumnType(\"nvarchar(16)\");", + "\n", + "\n b.Property(\"DisplayName\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Parent\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.HasKey(\"SystemName\");", + "\n", + "\n b.ToTable(\"LiabilityType\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_74+OciType\", b =>", + "\n {", + "\n b.Property(\"SystemName\")", + "\n .HasMaxLength(16)", + "\n .HasColumnType(\"nvarchar(16)\");", + "\n", + "\n b.Property(\"DisplayName\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.HasKey(\"SystemName\");", + "\n", + "\n b.ToTable(\"OciType\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_75+Profitability\", b =>", + "\n {", + "\n b.Property(\"SystemName\")", + "\n .HasMaxLength(16)", + "\n .HasColumnType(\"nvarchar(16)\");", + "\n", + "\n b.Property(\"DisplayName\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.HasKey(\"SystemName\");", + "\n", + "\n b.ToTable(\"Profitability\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_76+Partner\", b =>", + "\n {", + "\n b.Property(\"SystemName\")", + "\n .HasMaxLength(16)", + "\n .HasColumnType(\"nvarchar(16)\");", + "\n", + "\n b.Property(\"DisplayName\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.HasKey(\"SystemName\");", + "\n", + "\n b.ToTable(\"Partner\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_77+CreditRiskRating\", b =>", + "\n {", + "\n b.Property(\"SystemName\")", + "\n .HasMaxLength(16)", + "\n .HasColumnType(\"nvarchar(16)\");", + "\n", + "\n b.Property(\"DisplayName\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.HasKey(\"SystemName\");", + "\n", + "\n b.ToTable(\"CreditRiskRating\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_78+ReportingNode\", b =>", + "\n {", + "\n b.Property(\"SystemName\")", + "\n .HasMaxLength(16)", + "\n .HasColumnType(\"nvarchar(16)\");", + "\n", + "\n b.Property(\"Currency\")", + "\n .IsRequired()", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"DisplayName\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Parent\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.HasKey(\"SystemName\");", + "\n", + "\n b.ToTable(\"ReportingNode\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_79+ProjectionConfiguration\", b =>", + "\n {", + "\n b.Property(\"SystemName\")", + "\n .HasMaxLength(16)", + "\n .HasColumnType(\"nvarchar(16)\");", + "\n", + "\n b.Property(\"DisplayName\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Shift\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"TimeStep\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.HasKey(\"SystemName\");", + "\n", + "\n b.ToTable(\"ProjectionConfiguration\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_80+AocConfiguration\", b =>", + "\n {", + "\n b.Property(\"Id\")", + "\n .ValueGeneratedOnAdd()", + "\n .HasColumnType(\"uniqueidentifier\");", + "\n", + "\n b.Property(\"AocType\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"CdrPeriod\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"DataType\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"FxPeriod\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"InputSource\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"Month\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"Novelty\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Order\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"RcPeriod\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"ValuationPeriod\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"YcPeriod\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"Year\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.HasKey(\"Id\");", + "\n", + "\n b.ToTable(\"AocConfiguration\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_81+ExchangeRate\", b =>", + "\n {", + "\n b.Property(\"Id\")", + "\n .ValueGeneratedOnAdd()", + "\n .HasColumnType(\"uniqueidentifier\");", + "\n", + "\n b.Property(\"Currency\")", + "\n .IsRequired()", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"FxToGroupCurrency\")", + "\n .HasColumnType(\"float\");", + "\n", + "\n b.Property(\"FxType\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"Month\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"Scenario\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Year\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.HasKey(\"Id\");", + "\n", + "\n b.ToTable(\"ExchangeRate\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_82+CreditDefaultRate\", b =>", + "\n {", + "\n b.Property(\"Id\")", + "\n .ValueGeneratedOnAdd()", + "\n .HasColumnType(\"uniqueidentifier\");", + "\n", + "\n b.Property(\"CreditRiskRating\")", + "\n .IsRequired()", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Month\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"Scenario\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Values\")", + "\n .HasColumnType(\"varbinary(max)\");", + "\n", + "\n b.Property(\"Year\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.HasKey(\"Id\");", + "\n", + "\n b.ToTable(\"CreditDefaultRate\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_83+YieldCurve\", b =>", + "\n {", + "\n b.Property(\"Id\")", + "\n .ValueGeneratedOnAdd()", + "\n .HasColumnType(\"uniqueidentifier\");", + "\n", + "\n b.Property(\"Currency\")", + "\n .IsRequired()", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Month\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"Name\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Scenario\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Values\")", + "\n .HasColumnType(\"varbinary(max)\");", + "\n", + "\n b.Property(\"Year\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.HasKey(\"Id\");", + "\n", + "\n b.ToTable(\"YieldCurve\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_84+PartnerRating\", b =>", + "\n {", + "\n b.Property(\"Id\")", + "\n .ValueGeneratedOnAdd()", + "\n .HasColumnType(\"uniqueidentifier\");", + "\n", + "\n b.Property(\"CreditRiskRating\")", + "\n .IsRequired()", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Month\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"Partner\")", + "\n .IsRequired()", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Scenario\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Year\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.HasKey(\"Id\");", + "\n", + "\n b.ToTable(\"PartnerRating\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_86+PartitionByReportingNode\", b =>", + "\n {", + "\n b.Property(\"Id\")", + "\n .ValueGeneratedOnAdd()", + "\n .HasColumnType(\"uniqueidentifier\");", + "\n", + "\n b.Property(\"ReportingNode\")", + "\n .IsRequired()", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.HasKey(\"Id\");", + "\n", + "\n b.ToTable(\"PartitionByReportingNode\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_87+PartitionByReportingNodeAndPeriod\", b =>", + "\n {", + "\n b.Property(\"Id\")", + "\n .ValueGeneratedOnAdd()", + "\n .HasColumnType(\"uniqueidentifier\");", + "\n", + "\n b.Property(\"Month\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"ReportingNode\")", + "\n .IsRequired()", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Scenario\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Year\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.HasKey(\"Id\");", + "\n", + "\n b.ToTable(\"PartitionByReportingNodeAndPeriod\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_88+DataNode\", b =>", + "\n {", + "\n b.Property(\"SystemName\")", + "\n .HasMaxLength(16)", + "\n .HasColumnType(\"nvarchar(16)\");", + "\n", + "\n b.Property(\"ContractualCurrency\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Discriminator\")", + "\n .IsRequired()", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"DisplayName\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"FunctionalCurrency\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"LineOfBusiness\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"OciType\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Partition\")", + "\n .HasColumnType(\"uniqueidentifier\");", + "\n", + "\n b.Property(\"ValuationApproach\")", + "\n .IsRequired()", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.HasKey(\"SystemName\");", + "\n", + "\n b.ToTable(\"DataNode\");", + "\n", + "\n b.HasDiscriminator(\"Discriminator\").HasValue(\"DataNode\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_92+DataNodeState\", b =>", + "\n {", + "\n b.Property(\"Id\")", + "\n .ValueGeneratedOnAdd()", + "\n .HasColumnType(\"uniqueidentifier\");", + "\n", + "\n b.Property(\"DataNode\")", + "\n .IsRequired()", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Month\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"Partition\")", + "\n .HasColumnType(\"uniqueidentifier\");", + "\n", + "\n b.Property(\"Scenario\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"State\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"Year\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.HasKey(\"Id\");", + "\n", + "\n b.ToTable(\"DataNodeState\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_93+DataNodeParameter\", b =>", + "\n {", + "\n b.Property(\"Id\")", + "\n .ValueGeneratedOnAdd()", + "\n .HasColumnType(\"uniqueidentifier\");", + "\n", + "\n b.Property(\"DataNode\")", + "\n .IsRequired()", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Discriminator\")", + "\n .IsRequired()", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Month\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"Partition\")", + "\n .HasColumnType(\"uniqueidentifier\");", + "\n", + "\n b.Property(\"Scenario\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Year\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.HasKey(\"Id\");", + "\n", + "\n b.ToTable(\"DataNodeParameter\");", + "\n", + "\n b.HasDiscriminator(\"Discriminator\").HasValue(\"DataNodeParameter\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_98+RawVariable\", b =>", + "\n {", + "\n b.Property(\"Id\")", + "\n .ValueGeneratedOnAdd()", + "\n .HasColumnType(\"uniqueidentifier\");", + "\n", + "\n b.Property(\"AccidentYear\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"AmountType\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"AocType\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"DataNode\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"EstimateType\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Novelty\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Partition\")", + "\n .HasColumnType(\"uniqueidentifier\");", + "\n", + "\n b.Property(\"Values\")", + "\n .HasColumnType(\"varbinary(max)\");", + "\n", + "\n b.HasKey(\"Id\");", + "\n", + "\n b.ToTable(\"RawVariable\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_99+IfrsVariable\", b =>", + "\n {", + "\n b.Property(\"Id\")", + "\n .ValueGeneratedOnAdd()", + "\n .HasColumnType(\"uniqueidentifier\");", + "\n", + "\n b.Property(\"AccidentYear\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"AmountType\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"AocType\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"DataNode\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"EconomicBasis\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"EstimateType\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Novelty\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Partition\")", + "\n .HasColumnType(\"uniqueidentifier\");", + "\n", + "\n b.Property(\"Value\")", + "\n .HasColumnType(\"float\");", + "\n", + "\n b.HasKey(\"Id\");", + "\n", + "\n b.ToTable(\"IfrsVariable\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_58+DeferrableAmountType\", b =>", + "\n {", + "\n b.HasBaseType(\"Submission_57+AmountType\");", + "\n", + "\n b.HasDiscriminator().HasValue(\"DeferrableAmountType\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_63+AocType\", b =>", + "\n {", + "\n b.HasBaseType(\"Submission_62+VariableType\");", + "\n", + "\n b.HasDiscriminator().HasValue(\"AocType\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_65+PnlVariableType\", b =>", + "\n {", + "\n b.HasBaseType(\"Submission_62+VariableType\");", + "\n", + "\n b.HasDiscriminator().HasValue(\"PnlVariableType\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_66+BsVariableType\", b =>", + "\n {", + "\n b.HasBaseType(\"Submission_62+VariableType\");", + "\n", + "\n b.HasDiscriminator().HasValue(\"BsVariableType\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_67+AccountingVariableType\", b =>", + "\n {", + "\n b.HasBaseType(\"Submission_62+VariableType\");", + "\n", + "\n b.HasDiscriminator().HasValue(\"AccountingVariableType\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_89+Portfolio\", b =>", + "\n {", + "\n b.HasBaseType(\"Submission_88+DataNode\");", + "\n", + "\n b.HasDiscriminator().HasValue(\"Portfolio\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_90+GroupOfContract\", b =>", + "\n {", + "\n b.HasBaseType(\"Submission_88+DataNode\");", + "\n", + "\n b.Property(\"AnnualCohort\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"LiabilityType\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Partner\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Portfolio\")", + "\n .IsRequired()", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Profitability\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"YieldCurveName\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.HasDiscriminator().HasValue(\"GroupOfContract\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_94+InterDataNodeParameter\", b =>", + "\n {", + "\n b.HasBaseType(\"Submission_93+DataNodeParameter\");", + "\n", + "\n b.Property(\"LinkedDataNode\")", + "\n .IsRequired()", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"ReinsuranceCoverage\")", + "\n .HasColumnType(\"float\");", + "\n", + "\n b.HasDiscriminator().HasValue(\"InterDataNodeParameter\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_94+SingleDataNodeParameter\", b =>", + "\n {", + "\n b.HasBaseType(\"Submission_93+DataNodeParameter\");", + "\n", + "\n b.Property(\"PremiumAllocation\")", + "\n .HasColumnType(\"float\");", + "\n", + "\n b.HasDiscriminator().HasValue(\"SingleDataNodeParameter\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_89+InsurancePortfolio\", b =>", + "\n {", + "\n b.HasBaseType(\"Submission_89+Portfolio\");", + "\n", + "\n b.HasDiscriminator().HasValue(\"InsurancePortfolio\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_89+ReinsurancePortfolio\", b =>", + "\n {", + "\n b.HasBaseType(\"Submission_89+Portfolio\");", + "\n", + "\n b.HasDiscriminator().HasValue(\"ReinsurancePortfolio\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_91+GroupOfInsuranceContract\", b =>", + "\n {", + "\n b.HasBaseType(\"Submission_90+GroupOfContract\");", + "\n", + "\n b.HasDiscriminator().HasValue(\"GroupOfInsuranceContract\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_91+GroupOfReinsuranceContract\", b =>", + "\n {", + "\n b.HasBaseType(\"Submission_90+GroupOfContract\");", + "\n", + "\n b.HasDiscriminator().HasValue(\"GroupOfReinsuranceContract\");", + "\n });", + "\n }", + "\n}", + "\n" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + } + ] +} \ No newline at end of file