Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions forward_engineering/helpers/viewHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ const createView = ({ viewData, isActivated, scriptFormat, getViewSelectStatemen
const ifNotExist = preSpace(viewData.ifNotExist && 'IF NOT EXISTS');
const { columnList, tableColumns, tables } = viewData.keys.reduce(
(result, key) => {
// Keys without an entityName are plain columns that don't reference any table/view column.
// They exist for documentation purposes only and can't take part in the SELECT statement.
if (!key.entityName) {
return result;
}

result.columnList.push({
name: `${getName(viewData.isCaseSensitive, key.alias || key.name)}`,
isActivated: key.isActivated,
Expand All @@ -23,12 +29,10 @@ const createView = ({ viewData, isActivated, scriptFormat, getViewSelectStatemen
isActivated: key.isActivated,
});

if (key.entityName) {
const tableName = getFullName(key.dbName, key.entityName);
const tableName = getFullName(key.dbName, key.entityName);

if (!result.tables.includes(tableName)) {
result.tables.push(tableName);
}
if (!result.tables.includes(tableName)) {
result.tables.push(tableName);
}

return result;
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"enabled": true,
"viewLevel": "model",
"disablePipelines": true,
"includeViews": true
"includeViews": true,
"allowNonReferenceAttributes": true
},
"nestedCollections": false,
"disablePatternField": true,
Expand Down
1 change: 0 additions & 1 deletion types/array.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"parentType": "array",
"useSample": true,
"default": true,
"hiddenOnEntity": "view",
"defaultValues": {
"properties": [],
"primaryKey": false,
Expand Down
1 change: 0 additions & 1 deletion types/binary.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"erdAbbreviation": "<bin>",
"dtdAbbreviation": "{BIN}",
"parentType": "binary",
"hiddenOnEntity": "view",
"useSample": false,
"default": true,
"defaultValues": {
Expand Down
1 change: 0 additions & 1 deletion types/boolean.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"erdAbbreviation": "<bool>",
"dtdAbbreviation": "{0/1}",
"parentType": "boolean",
"hiddenOnEntity": "view",
"sample": true,
"useSample": true,
"defaultValues": {
Expand Down
1 change: 0 additions & 1 deletion types/date.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"erdAbbreviation": "<date>",
"dtdAbbreviation": "{dt}",
"parentType": "string",
"hiddenOnEntity": "view",
"sample": "2018/03/15",
"useSample": true,
"defaultValues": {
Expand Down
1 change: 0 additions & 1 deletion types/double.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"erdAbbreviation": "<dbl>",
"dtdAbbreviation": "{dbl}",
"parentType": "numeric",
"hiddenOnEntity": "view",
"sample": 15,
"useSample": true,
"defaultValues": {
Expand Down
1 change: 0 additions & 1 deletion types/float.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"erdAbbreviation": "<flt>",
"dtdAbbreviation": "{flt}",
"parentType": "numeric",
"hiddenOnEntity": "view",
"sample": 15,
"useSample": true,
"defaultValues": {
Expand Down
1 change: 0 additions & 1 deletion types/geography.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"erdAbbreviation": "<geog>",
"dtdAbbreviation": "{...}",
"parentType": "document",
"hiddenOnEntity": "view",
"jsonType": {
"order": 1,
"name": "geography",
Expand Down
1 change: 0 additions & 1 deletion types/integer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"erdAbbreviation": "<int>",
"dtdAbbreviation": "{123}",
"parentType": "numeric",
"hiddenOnEntity": "view",
"sample": 15,
"useSample": true,
"defaultValues": {
Expand Down
1 change: 0 additions & 1 deletion types/number.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"erdAbbreviation": "<num>",
"dtdAbbreviation": "{123}",
"parentType": "numeric",
"hiddenOnEntity": "view",
"sample": 15,
"useSample": true,
"default": true,
Expand Down
1 change: 0 additions & 1 deletion types/object.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"dtdAbbreviation": "{...}",
"parentType": "document",
"sample": {},
"hiddenOnEntity": "view",
"useSample": true,
"default": true,
"defaultValues": {
Expand Down
1 change: 0 additions & 1 deletion types/time.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"dtdAbbreviation": "{tm}",
"parentType": "string",
"useSample": true,
"hiddenOnEntity": "view",
"sample": "08:45:12.123123",
"defaultValues": {
"primaryKey": false,
Expand Down
1 change: 0 additions & 1 deletion types/timestamp_ltz.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"dtdAbbreviation": "{ts-ltz}",
"parentType": "string",
"useSample": true,
"hiddenOnEntity": "view",
"sample": "2011-02-03 04:05:00 +0000",
"defaultValues": {
"primaryKey": false,
Expand Down
1 change: 0 additions & 1 deletion types/timestamp_ntz.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"dtdAbbreviation": "{ts-ntz}",
"parentType": "string",
"useSample": true,
"hiddenOnEntity": "view",
"sample": "2011-02-03 04:05:00 +0000",
"defaultValues": {
"primaryKey": false,
Expand Down
1 change: 0 additions & 1 deletion types/timestamp_tz.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"dtdAbbreviation": "{ts-tz}",
"parentType": "string",
"useSample": true,
"hiddenOnEntity": "view",
"sample": "2011-02-03 04:05:00 +0000",
"defaultValues": {
"primaryKey": false,
Expand Down
1 change: 0 additions & 1 deletion types/varchar.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"erdAbbreviation": "<vchar>",
"dtdAbbreviation": "{vchar}",
"parentType": "string",
"hiddenOnEntity": "view",
"useSample": true,
"default": true,
"defaultValues": {
Expand Down
1 change: 0 additions & 1 deletion types/variant.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"dtdAbbreviation": "{...}",
"default": true,
"parentType": "document",
"hiddenOnEntity": "view",
"jsonType": {
"order": 1,
"name": "variant",
Expand Down
Loading