mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix(Postgres Node): RMC do not mark collumn as required if identity_generation is BY DEFAULT (#13752)
Co-authored-by: Dana <152518854+dana-gill@users.noreply.github.com>
This commit is contained in:
@@ -241,6 +241,10 @@ export async function execute(
|
||||
|
||||
const outputColumns = this.getNodeParameter('options.outputColumns', i, ['*']) as string[];
|
||||
|
||||
if (nodeVersion >= 2.6 && Object.keys(item).length === 0) {
|
||||
query = 'INSERT INTO $1:name.$2:name DEFAULT VALUES';
|
||||
}
|
||||
|
||||
[query, values] = addReturning(query, outputColumns, values);
|
||||
|
||||
queries.push({ query, values });
|
||||
|
||||
@@ -8,7 +8,7 @@ export const versionDescription: INodeTypeDescription = {
|
||||
name: 'postgres',
|
||||
icon: 'file:postgres.svg',
|
||||
group: ['input'],
|
||||
version: [2, 2.1, 2.2, 2.3, 2.4, 2.5],
|
||||
version: [2, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6],
|
||||
subtitle: '={{ $parameter["operation"] }}',
|
||||
description: 'Get, add and update data in Postgres',
|
||||
defaults: {
|
||||
|
||||
@@ -74,7 +74,9 @@ export async function getMappingColumns(
|
||||
const options =
|
||||
type === 'options' ? getEnumValues(enumInfo, col.udt_name as string) : undefined;
|
||||
const hasDefault = Boolean(col.column_default);
|
||||
const isGenerated = col.is_generated === 'ALWAYS' || col.identity_generation === 'ALWAYS';
|
||||
const isGenerated =
|
||||
col.is_generated === 'ALWAYS' ||
|
||||
['ALWAYS', 'BY DEFAULT'].includes(col.identity_generation ?? '');
|
||||
const nullable = col.is_nullable === 'YES';
|
||||
return {
|
||||
id: col.column_name,
|
||||
|
||||
Reference in New Issue
Block a user