on 01-08-2024 2:33 PM
Hi Experts,
We are facing the db error "Database Error: Cannot Insert Null or update to Null" when trying to deploy the db changes in cloud foundry space. Please note that there is already a previous version which is in production and now as a new change we added a new field in db which is a primary key. I understand the issue is because of this new field being primary key as its expecting some value and can't accept null.
However we can't pass any default values to this field and need this as a primary key. Do we have any way to handle this situation without deleting the already deployed instances. (as productive db data will be lost).
Please suggest!
Thanks,
Rakesh
Deployment will try to insert the existing records into the table with the new field as primary key. This is bound to fail.
I guess, since you added a new primary key, the old content is not relevant. If so delete the content before deployment. If the content is relevant you will need to migrate the content; how do you plan to create primary keys for the existing rows?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
70 | |
8 | |
8 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.