Skip to content

Commit bbe9ec9

Browse files
committed
Data object creation update
1 parent e400a83 commit bbe9ec9

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{{#each dataObjectMappings}}{{#if @first}}
22
--
33
-- Table creation statement for {{targetDataObject.name}}
4-
-- Generated at {{now}}
54
--
65

76
IF OBJECT_ID('[{{targetDataObject.name}}]', 'U') IS NOT NULL
@@ -10,10 +9,11 @@ IF OBJECT_ID('[{{targetDataObject.name}}]', 'U') IS NOT NULL
109
CREATE TABLE [{{targetDataObject.name}}]
1110
(
1211
[{{#each businessKeys}}{{#if @first}}{{surrogateKey}}{{/if}}{{/each}}] binary(16) NOT NULL,
13-
[MODULE_INSTANCE_ID] [int] NOT NULL,
12+
[{{../metadataConfiguration.etlProcessAttribute}}] [int] NOT NULL,
1413
[{{../metadataConfiguration.loadDateTimeAttribute}}] [datetime2](7) NOT NULL,
1514
[{{../metadataConfiguration.recordSourceAttribute}}] [nvarchar](100) NOT NULL,
16-
{{#each businessKeys}}{{#each businessKeyComponentMapping}}[{{targetDataItem.name}}] [nvarchar](100) NOT NULL{{#unless @last}},{{/unless}}
17-
{{/each}}{{/each}}
15+
{{#each businessKeys.0.businessKeyComponentMapping}}
16+
[{{targetDataItem.name}}] [nvarchar](100) NOT NULL{{#unless @last}},{{/unless}}
17+
{{/each}}
1818
){{/if}}
1919
{{/each}}

Virtual_EDW/Templates/templateLinkGenerateTables.Handlebars

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ CREATE TABLE [{{targetDataObject.name}}]
1313
,[{{../metadataConfiguration.loadDateTimeAttribute}}] [datetime2](7) NOT NULL
1414
,[{{../metadataConfiguration.recordSourceAttribute}}] [nvarchar](100) NOT NULL
1515
{{#each relatedDataObjects}}
16-
,[{{name "LNK_", ""}}_SK] binary(16) NOT NULL
16+
,[{{StringReplace name "HUB_" ""}}_SK] binary(16) NOT NULL
1717
{{/each}}
18-
){{/if}}{{/each}}
18+
){{/if}}{{/each}}

Virtual_EDW/Templates/templateStagingGenerateTables.Handlebars

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,11 @@ CREATE TABLE [{{targetDataObject.dataObjectConnection.extensions.0.value}}].[{{t
1515
[{{../metadataConfiguration.eventDateTimeAttribute}}] [datetime2](7) NOT NULL,
1616
[{{../metadataConfiguration.changeDataCaptureAttribute}}] [nvarchar](100) NOT NULL,
1717
[{{../metadataConfiguration.etlProcessAttribute}}] [int] NOT NULL,
18-
[{{../metadataConfiguration.loadDateTimeAttribute}}] [datetime2](7) NOT NULL DEFAULT (SYSDATETIME()),
1918
--[{{../metadataConfiguration.recordSourceAttribute}}] [nvarchar](100) NOT NULL,
2019
[{{../metadataConfiguration.recordChecksumAttribute}}] binary(16) NOT NULL,
21-
{{#each dataItemMappings}}
22-
[{{sourceDataItems.0.name}}] [varchar](100){{#unless @last}},{{/unless}}
20+
{{#each sourceDataObjects.0.dataItems}}
21+
[{{name}}] [varchar](1000){{#unless @last}},{{/unless}}
2322
{{/each}}
2423
)
2524

26-
{{/each}}
25+
{{/each}}

0 commit comments

Comments
 (0)