emo Bug on installation

  • Angelos Hadjiphilippou
  • Angelos Hadjiphilippou's Avatar Topic Author
  • Offline
  • User is blocked
More
#1

cannot install. SQL fails.
basically datetime cannot be timestamp with newer mysql versions!!! (Your Default value... i hope further queries will be correct when the plugin records data)


×
Warning
JInstaller: :Install: Error SQL Invalid default value for 'date_created'
Extension Install: SQL error processing query: DB function failed with error number 1067
Invalid default value for 'date_created'
SQL =
CREATE TABLE `#__j2store_btc_orders` (
`order_id` varchar(64) NOT NULL PRIMARY KEY,
`invoice_id` varchar(64) NOT NULL,
`wallet_id` varchar(64) NOT NULL,
`qr_code` text,
`original_cart_total` double DEFAULT '0',
`discounted_cart_total` double DEFAULT '0',
`transaction_fee` double DEFAULT '0',
`final_cart_total_btc` double DEFAULT '0',
`date_created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
KEY `invoice_id` (`invoice_id`),
FOREIGN KEY (order_id)
REFERENCES `#__j2store_orders` (order_id)
ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

Last Edit: by Bitcopay.uk Admin. Reason: Solved
The following user(s) said Thank You: Bitcopay.uk Admin

Please Log in to join the conversation.

  • Bitcopay.uk Admin
  • Bitcopay.uk Admin's Avatar Moderator
  • Offline
  • Administrator
More
#2

Thank you for your bug report Angelos.
Can you please tell us which version of MySQL you have an issue with?

Please Log in to join the conversation.

  • Angelos Hadjiphilippou
  • Angelos Hadjiphilippou's Avatar Topic Author
  • Offline
  • User is blocked
More
#3

PHP Built On Linux linode.servodns.com 4.15.12-x86_64-linode105 #1 SMP Thu Mar 22 02:13:40 UTC 2018 x86_64
Database Type mysql
Database Version 5.5.60-cll
Database Collation latin1_swedish_ci
Database Connection Collation utf8mb4_general_ci
PHP Version 5.6.37
Web Server Apache
WebServer to PHP Interface cgi-fcgi
Joomla! Version Joomla! 3.8.12 Stable [ Amani ] 28-August-2018 14:00 GMT

Please Log in to join the conversation.

  • Bitcopay.uk Admin
  • Bitcopay.uk Admin's Avatar Moderator
  • Offline
  • Administrator
More
#4

Thank you for posting your configuration.

The plugin was developed on a LATER version of mySQL (5.6.40) than you have installed.

For others that may be in a similar position with old versions of MySQL server:

The DEFAULT CURRENT_TIMESTAMP support for a DATETIME (datatype) was added in MySQL 5.6. In 5.5 and earlier versions, this applied only to TIMESTAMP (datatype) columns.

It is possible to use a BEFORE INSERT trigger in 5.5 to assign a default value to the column.


DELIMITER $$

CREATE TRIGGER ...
BEFORE INSERT ON `#__j2store_btc_orders`
FOR EACH ROW
BEGIN
IF NEW.date_created IS NULL THEN
SET NEW.date_created= NOW();
END IF;
END$$

Please Log in to join the conversation.

Template design by BaseTwoData