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
I have a model that has a few "virtual" fields implemented as getters. When I try to do an upsert on this model, it is attempting to set values on the getters, which causes Sequelize to get all sorts of cranky:
> Executing (default): CREATE OR REPLACE FUNCTION pg_temp.sequelize_upsert()
RETURNS integer AS $$ BEGIN INSERT INTO "OOS"
("certifications_na","previous_experience_na","recruited_by_na","oos_number","first_name","last_name",
"email","address","city","province","country","postal_code","phone","cell_phone","pre_recruited",
"recruited_by","previous_experience","certifications","dob","created_at","updated_at") VALUES (...);
RETURN 1; EXCEPTION WHEN unique_violation THEN UPDATE "OOS" SET ... WHERE
("oos_number"=173); RETURN 2; END; $$ LANGUAGE plpgsql; SELECT * FROM
pg_temp.sequelize_upsert();
Possibly unhandled SequelizeDatabaseError: column "certifications_na" of relation "OOS" does not exist
at module.exports.Query.formatError (/Users/grahamb/Dropbox/code/personal/pj/selection-app/node_modules/sequelize/lib/dialects/postgres/query.js:309:16)
at null.<anonymous> (/Users/grahamb/Dropbox/code/personal/pj/selection-app/node_modules/sequelize/lib/dialects/postgres/query.js:64:21)
at emit (events.js:95:17)
at Query.handleError (/Users/grahamb/Dropbox/code/personal/pj/selection-app/node_modules/pg/lib/query.js:99:8)
at null.<anonymous> (/Users/grahamb/Dropbox/code/personal/pj/selection-app/node_modules/pg/lib/client.js:166:26)
at emit (events.js:95:17)
at Socket.<anonymous> (/Users/grahamb/Dropbox/code/personal/pj/selection-app/node_modules/pg/lib/connection.js:109:12)
at Socket.emit (events.js:95:17)
at Socket.<anonymous> (_stream_readable.js:765:14)
at Socket.emit (events.js:92:17)
Sequelize 2.0.0rc8
The text was updated successfully, but these errors were encountered:
There should probably be some kind of internal "get values for db" method which takes into account virtuals and renamed field. Could be usefull for #2860 as well
This might be a duplicate of #2946.
I have a model that has a few "virtual" fields implemented as getters. When I try to do an upsert on this model, it is attempting to set values on the getters, which causes Sequelize to get all sorts of cranky:
Sequelize 2.0.0rc8
The text was updated successfully, but these errors were encountered: