stock_id cannot be null SQL error mysql Ver 14.14 Distrib 5.5.38
donske168 opened this issue · 0 comments
When trying to insert without stock_id value, I get the below error
mysql Ver 14.14 Distrib 5.5.38
2015-01-12T11:11:48+00:00 DEBUG (7): SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'stock_id' cannot be null, query was: INSERT INTO australia_eparcel
(website_id
, dest_country_id
, dest_region_id
, dest_zip
, condition_name
, condition_from_value
, condition_to_value
, price
, price_per_kg
, delivery_type
, charge_code_individual
, charge_code_business
, stock_id
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Table does not accept NULL and does not default to 0 but instead throws an error.
code/community/Fontis/Australia/sql/australia_setup/mysql4-upgrade-2.3.0-2.4.0.php
$installer->run(
"ALTER TABLE {$this->getTable('australia_eparcel')}
ADD stock_id INT NOT NULL DEFAULT '0' COMMENT 'Warehouse ID for Multi Warehouse extension';"
);
Fixed by removing NOT NULL