HI everyone! Last week I've done the migration of ...
# support
b
HI everyone! Last week I've done the migration of my Solidus development database from Sqlite to Postgres. Today I can not clone or create new products. I receive this error...
1
Translation from Spanish; PG:NotNullViolation ERROR: the null value in the <<id>> column in <<spree_prices>> relation, violates the NotNullViolation DETAIL: The row wich fails contains (null, 104, 30.00, EUR, null, 2023-02-22 133841.276947+00, 2023-02-22 133841.276947+00, null).
My `schema.rb`looks like this...
And in the server I found this line...
There is a problem with the spree_price id. But I don't know how to fix it. I don't understand why it is not working because I've changed nothing in the `schema.rb`or the migrate files. I've make the db migration from Sqlite with PGloader.
s
Not a PG expert, but your id column is marked as
serial
, so the insert action should auto-generate an ID if none is provided (which appears to be the case in your server log!) - but it looks like that's not happening for some reason. I would double check in PG that
spree_prices
id actually is
serial
, or if that somehow got missed in the migration?
b
Thanks @Sean Denny (he/him), I'll check it out.
It works. 👍🏻😀
s
🎉 Awesome!
b
I've changed the constraints to serial in pgAdmin. But the first time I've created a new product, I've received and error; the ID (1) was already been used. So I've changed the start row number to 130 because a had 129 prices ID.
Now it works fine.
Thanks for your help @Sean Denny (he/him).
🎉 1