Jump to content

Own modules tables changed after Prestahop upgrade. DEFAULT NULL to NOT NULL


Recommended Posts

Hi, 

I recently upgraded to Prestashop 1.7.8.5 from Prestahop 1.7.6.1.

I have some self written modules where I use Doctrine to store my data in the database (like its explained here: https://devdocs.prestashop.com/1.7/modules/concepts/doctrine/

I created the databases with an sql script like this one: 

image.thumb.png.f40bb1b7fb1fb932df1f7867907e5c7e.png

And in src/Entity I have a File called MpOrder.php where I wrote this: 

image.thumb.png.53ea166e3565d89f016d7b8d7545b238.png

After the Prestashop upgrade the ps_mp_order was changed and id_shipment was not longer allowed to be nullable. I manually changed the table definition, so my modules works again, but why did this occur? I have a database dump from before the upgrade and the field is described there with 

image.thumb.png.8f2f4ac452e3ecdd467c48412dab16e1.png

After the upgrade a dump of the same table showed 

image.thumb.png.31cdfcdea53f6b08391fc9bf44742871.png

So I am quite sure, the upgrade changed something here. What have I done wrong? What do I have to do, to prevent the next Prestashop upgrade from changing my nullable fields to not nullable fields?

Edit: I can not write code blocks here. The website tells me my request have been blocked, when I click on submit/edit after inserting code in code blocks. That's why I use images instead.

Edited by Gneston
Adding code as images (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...