Loris
Loris copied to clipboard
[tools] `generate_tables_sql.php` generates broken SQL
Describe the bug
While trying to add an instrument to my dev VM, I encountered a bug in which the SQL generated by generate_tables_sql.php
is syntactically broken. I believe this is a regression introduced in #8674, see the results bellow.
Expected output:
CREATE TABLE `SYNHOME_Montreal_Cognitive_Assessment` (
`CommentID` varchar(255) NOT NULL default '',
`UserID` varchar(255) default NULL,
`Examiner` varchar(255) default NULL,
`Testdate` timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`Date_taken` date default NULL,
`Candidate_Age` varchar(255) default NULL,
`Window_Difference` varchar(255) default NULL,
PRIMARY KEY (`CommentID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Actual output:
`SYNHOME_Montreal_Cognitive_Assessment` testname default NULL,
CREATE TABLE `SYNHOME_Montreal_Cognitive_Assessment` (
`CommentID` varchar(255) NOT NULL default '',
`UserID` varchar(255) default NULL,
`Examiner` varchar(255) default NULL,
`Testdate` timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`Date_taken` date default NULL,
`Candidate_Age` varchar(255) default NULL,
`Window_Difference` varchar(255) default NULL,
PRIMARY KEY (`CommentID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
The error is obviously in the first line. PR coming soon.