Module - Database Field Problem with Null
I have had a module for a while that I wrote that creates a "Products Per Case" ppcField field in xcProducts .. For some reason everytime I update the site (or disable a module) it attempts to reset this field to Not Null (this field can be null and default is set to Null). How do I prevent Xcart redeploy (step 5 I believe) to stop trying to set this field to Not Null?
Here is the error in the php_error log Code:
[06-Jan-2017 15:33:21] Error (code: 0): An exception occurred while executing 'ALTER TABLE xc_products CHANGE PPCField PPCField VARCHAR(32) NOT NULL': |
Re: Module - Database Field Problem with Null
How does your Model class (the one that adds the field) look like?
|
Re: Module - Database Field Problem with Null
Quote:
Code:
<?php http://devs.x-cart.com/en/basics/understanding_models.html - This doesn't seem to reference Not Null vs Null... Edit: Does Xlite follow the doctrine? http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/annotations-reference.html Would this work to my PPCField set to null? Code:
{ |
Re: Module - Database Field Problem with Null
Quote:
Yes, this should work. Also, if you need the opposite, you can it like this: Code:
@Column (type="integer", options={ "unsigned": true, "default": 0 }) |
All times are GMT -8. The time now is 03:31 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.