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 would like to be able to perform a query like to have the : INSERT INTO customer (name, customer_id) VALUES ( 'paco', currval('customer_id_seq') + 10)
class CustomerModel(db.Model):
name = db.Column(db.String)
customer_id = db.Column(db.Integer, unique=True, index=True)
The idea is to have a secondary colum which is the Primary Key + offset of 10.
Based on documentation, this should work, but it ends inserting a NULL in such value.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I would like to be able to perform a query like to have the :
INSERT INTO customer (name, customer_id) VALUES ( 'paco', currval('customer_id_seq') + 10)
The idea is to have a secondary colum which is the Primary Key + offset of 10.
Based on documentation, this should work, but it ends inserting a NULL in such value.
Any idea on how to fix it?
Beta Was this translation helpful? Give feedback.
All reactions