I'm not sure if this is an issue within JCB or just within the Joomla code base related to MySQL (or just me doing something completely wrong).
BACKGROUND
I'm developing in WAMP with MySQL 5.7.x.
I'm installing into at least one web site with MySQL 5.5.x
PROBLEM
Creating a date/time field that defaults to the current date/time causes problems when installing into MyXQL 5.5.x site (works fine on 5.7.x site).
CONFIGURATION
Here's the configuration for the field.
Type - Calendar
Data Type - DATETIME
Data Length/Values - None Set
Data Default - CURRENT_TIMESTAMP
Indexes Type - None
Null Switch - NOT NULL
XML definition:
type="calendar"
name="edition_release_date"
label="Edition Date"
default="NOW"
description="The date this edition was released"
readonly=""
disabled=""
class=""
format="%Y-%m-%d"
filter=""
size=""
required="true"
showon=""
translateformat=""
showtime=""
timeformat=""
singleheader=""
todaybutton=""
weeknumbers=""
filltable=""
minyear="-2"
maxyear="1"
GENERATED CODE (in the CREATE TABLE IF NOT EXISTS)
`edition_release_date` DATETIME CURRENT_TIMESTAMP NOT NULL,
ERROR NOTICE
JInstaller: :Install: Error SQL You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CURRENT_TIMESTAMP NOT NULL, `has_cover` INT(1) NOT NULL DEFAULT 0, `has_epub' at line 15
Extension Install: SQL error processing query: DB function failed with error number 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CURRENT_TIMESTAMP NOT NULL, `has_cover` INT(1) NOT NULL DEFAULT 0, `has_epub' at line 15
I've 'made' it work by changing the default to "0000-00-00 00:00:00"; however, that causes other problems.
I've tried to find out what the proper default and NOT NULL settings should be, but can't seem to make this work. (And strange that it works fine in 5.7.x).
Any tips/help would be appreciated.