Skip to content

Commit 80fb988

Browse files
committed
FE: fixed FE of array types
1 parent ca119f3 commit 80fb988

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

forward_engineering/helpers/columnDefinitionHelper.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ module.exports = ({
4242
}
4343
return type;
4444
}
45+
const addArrayDecorator = (type, array_type) => {
46+
const arrayDecorator = array_type?.map(item => `[${item?.array_size_limit ?? ''}]`).join('').trim() || '';
47+
48+
return `${type}${arrayDecorator}`;
49+
}
4550

4651
const canHaveLength = type => ['char', 'varchar', 'bit', 'varbit'].includes(type);
4752
const canHavePrecision = type => type === 'numeric';
@@ -69,7 +74,7 @@ module.exports = ({
6974
return addWithTimezone(addPrecision(type, columnDefinition.timePrecision), columnDefinition.timezone);
7075
}
7176

72-
return type;
77+
return addArrayDecorator(type, columnDefinition.array_type);
7378
};
7479

7580
const isString = type => ['char', 'varchar', 'text', 'bit', 'varbit'].includes(type);

0 commit comments

Comments
 (0)