You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When i try to add a product along with the sales channel, it fails with the error below. If i ignore sales channel in my backend it works. But I'm unable to attach the sales channel after that also
error: null value in column "id" of relation "product_sales_channel" violates not-null constraint\n at Parser.parseErrorMessage (/node_modules/pg-protocol/dist/parser.js:287:98)\n at Parser.handlePacket (/node_modules/pg-protocol/dist/parser.js:126:29)\n at Parser.parse (/node_modules/pg-protocol/dist/parser.js:39:38)\n at Socket. (/node_modules/pg-protocol/dist/index.js:11:42)\n at Socket.emit (node:events:514:28)\n at Socket.emit (node:domain:489:12)\n at addChunk (node:internal/streams/readable:324:12)\n at readableAddChunk (node:internal/streams/readable:297:9)\n at Readable.push (node:internal/streams/readable:234:10)\n at TCP.onStreamRead (node:internal/stream_base_commons:190:23)\n at TCP.callbackTrampoline (node:internal/async_hooks:130:17) {length: 350, name: 'error', severity: 'ERROR', c…, …}
code:
'23502'
column:
'id'
constraint:
undefined
dataType:
undefined
detail:
'Failing row contains (prod_01HVTNVK32ZTD3DHMT2PHCHWWB, sc_01HAR7GSYPPQJS4RNE57J28EYD, null, 2024-04-19 07:59:17.868847+00, 2024-04-19 07:59:17.868847+00, null).'
file:
'execMain.c'
hint:
undefined
internalPosition:
undefined
internalQuery:
undefined
length:
350
line:
'2003'
name:
'error'
The text was updated successfully, but these errors were encountered:
CREATE SEQUENCE IF NOT EXISTS products_sales_channel_id_seq;
ALTER TABLE product_sales_channel ALTER COLUMN id SET DEFAULT nextval('product_sales_channel_id_seq');
CREATE OR REPLACE FUNCTION product_sales_channel_insert_trigger()
RETURNS TRIGGER AS $$
BEGIN
NEW.id := nextval('product_sales_channel_id_seq');
RETURN NEW;
END;
$$ LANGUAGE plpgsql;
CREATE TRIGGER IF NOT EXISTS product_sales_channel_insert_trigger
BEFORE INSERT ON product_sales_channel
FOR EACH ROW
WHEN (NEW.id IS NULL)
EXECUTE FUNCTION product_sales_channel_insert_trigger();
Hi
When i try to add a product along with the sales channel, it fails with the error below. If i ignore sales channel in my backend it works. But I'm unable to attach the sales channel after that also
error: null value in column "id" of relation "product_sales_channel" violates not-null constraint\n at Parser.parseErrorMessage (/node_modules/pg-protocol/dist/parser.js:287:98)\n at Parser.handlePacket (/node_modules/pg-protocol/dist/parser.js:126:29)\n at Parser.parse (/node_modules/pg-protocol/dist/parser.js:39:38)\n at Socket. (/node_modules/pg-protocol/dist/index.js:11:42)\n at Socket.emit (node:events:514:28)\n at Socket.emit (node:domain:489:12)\n at addChunk (node:internal/streams/readable:324:12)\n at readableAddChunk (node:internal/streams/readable:297:9)\n at Readable.push (node:internal/streams/readable:234:10)\n at TCP.onStreamRead (node:internal/stream_base_commons:190:23)\n at TCP.callbackTrampoline (node:internal/async_hooks:130:17) {length: 350, name: 'error', severity: 'ERROR', c…, …}
code:
'23502'
column:
'id'
constraint:
undefined
dataType:
undefined
detail:
'Failing row contains (prod_01HVTNVK32ZTD3DHMT2PHCHWWB, sc_01HAR7GSYPPQJS4RNE57J28EYD, null, 2024-04-19 07:59:17.868847+00, 2024-04-19 07:59:17.868847+00, null).'
file:
'execMain.c'
hint:
undefined
internalPosition:
undefined
internalQuery:
undefined
length:
350
line:
'2003'
name:
'error'
The text was updated successfully, but these errors were encountered: