Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE development » Bug Reports » Change to 2000-01-01 00:00:00 everywhere
Change to 2000-01-01 00:00:00 everywhere [message #6310] Sun, 16 April 2017 03:43 Go to next message
apmuthu
Messages: 30
Registered: April 2017
Location: Chennai Singapore
Member
All schema / data sqls to have all 0000-00-00 00:00:00 changed to 2000-01-01 00:00:00 for later MySQL compatibility.
Re: Change to 2000-01-01 00:00:00 everywhere [message #6311 is a reply to message #6310] Sun, 16 April 2017 04:05 Go to previous messageGo to next message
apmuthu
Messages: 30
Registered: April 2017
Location: Chennai Singapore
Member
Attached is the changed file for survey schema sql file.
Re: Change to 2000-01-01 00:00:00 everywhere [message #6312 is a reply to message #6311] Sun, 16 April 2017 05:28 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2371
Registered: April 2006
Location: Surrey, UK
Senior Member
I have updated my script accordingly.

Re: Change to 2000-01-01 00:00:00 everywhere [message #6315 is a reply to message #6312] Sun, 16 April 2017 06:16 Go to previous messageGo to next message
apmuthu
Messages: 30
Registered: April 2017
Location: Chennai Singapore
Member
For those who want to do in for an existing installation here goes:
ALTER TABLE `survey`.`answer_option` CHANGE `created_date` `created_date` DATETIME DEFAULT '2000-01-01 00:00:00' NOT NULL;
ALTER TABLE `survey`.`asset_type` CHANGE `created_date` `created_date` DATETIME DEFAULT '2000-01-01 00:00:00' NOT NULL;
ALTER TABLE `survey`.`default_prompt` CHANGE `created_date` `created_date` DATETIME DEFAULT '2000-01-01 00:00:00' NOT NULL;
ALTER TABLE `survey`.`location_address` CHANGE `created_date` `created_date` DATETIME DEFAULT '2000-01-01 00:00:00' NOT NULL;
ALTER TABLE `survey`.`location_type` CHANGE `created_date` `created_date` DATETIME DEFAULT '2000-01-01 00:00:00' NOT NULL;
ALTER TABLE `survey`.`number_option` CHANGE `created_date` `created_date` DATETIME DEFAULT '2000-01-01 00:00:00' NOT NULL;
ALTER TABLE `survey`.`org_type` CHANGE `created_date` `created_date` DATETIME DEFAULT '2000-01-01 00:00:00' NOT NULL;
ALTER TABLE `survey`.`question_prompt` CHANGE `created_date` `created_date` DATETIME DEFAULT '2000-01-01 00:00:00' NOT NULL;
ALTER TABLE `survey`.`risk_status` CHANGE `created_date` `created_date` DATETIME DEFAULT '2000-01-01 00:00:00' NOT NULL;
ALTER TABLE `survey`.`risk_weighting` CHANGE `created_date` `created_date` DATETIME DEFAULT '2000-01-01 00:00:00' NOT NULL;
ALTER TABLE `survey`.`survey_answer_dtl` CHANGE `created_date` `created_date` DATETIME DEFAULT '2000-01-01 00:00:00' NOT NULL;
ALTER TABLE `survey`.`survey_answer_hdr` CHANGE `created_date` `created_date` DATETIME DEFAULT '2000-01-01 00:00:00' NOT NULL;
ALTER TABLE `survey`.`survey_hdr` CHANGE `created_date` `created_date` DATETIME DEFAULT '2000-01-01 00:00:00' NOT NULL;
ALTER TABLE `survey`.`survey_question` CHANGE `created_date` `created_date` DATETIME DEFAULT '2000-01-01 00:00:00' NOT NULL;
ALTER TABLE `survey`.`survey_section` CHANGE `created_date` `created_date` DATETIME DEFAULT '2000-01-01 00:00:00' NOT NULL;
ALTER TABLE `survey`.`survey_type` CHANGE `created_date` `created_date` DATETIME DEFAULT '2000-01-01 00:00:00' NOT NULL;
ALTER TABLE `survey`.`tree_node` CHANGE `created_date` `created_date` DATETIME DEFAULT '2000-01-01 00:00:00' NOT NULL;

Re: Change to 2000-01-01 00:00:00 everywhere [message #6316 is a reply to message #6315] Sun, 16 April 2017 06:23 Go to previous message
apmuthu
Messages: 30
Registered: April 2017
Location: Chennai Singapore
Member
The classroom-schema.sql too has the same issue.
ALTER TABLE `classroom`.`crs_class` CHANGE `created_date` `created_date` DATETIME DEFAULT '2000-01-01 00:00:00' NOT NULL;
ALTER TABLE `classroom`.`crs_lesson` CHANGE `created_date` `created_date` DATETIME DEFAULT '2000-01-01 00:00:00' NOT NULL;
ALTER TABLE `classroom`.`crs_room` CHANGE `created_date` `created_date` DATETIME DEFAULT '2000-01-01 00:00:00' NOT NULL;
ALTER TABLE `classroom`.`crs_schedule` CHANGE `created_date` `created_date` DATETIME DEFAULT '2000-01-01 00:00:00' NOT NULL;
ALTER TABLE `classroom`.`crs_schedule_hdr` CHANGE `created_date` `created_date` DATETIME DEFAULT '2000-01-01 00:00:00' NOT NULL;
ALTER TABLE `classroom`.`crs_student` CHANGE `created_date` `created_date` DATETIME DEFAULT '2000-01-01 00:00:00' NOT NULL;
ALTER TABLE `classroom`.`crs_subject` CHANGE `created_date` `created_date` DATETIME DEFAULT '2000-01-01 00:00:00' NOT NULL;
ALTER TABLE `classroom`.`crs_teacher` CHANGE `created_date` `created_date` DATETIME DEFAULT '2000-01-01 00:00:00' NOT NULL;


There are still several references in the code to '0000-00-00 00:00:00' like in
$fieldvalue == '0000-00-00 00:00:00'

in both sql and .inc files,

Will NULL values (and empty checks) be useful and how do earlier (Pre 5.6) MySQL DBs be managed?
Scripts that generate PHP pages too should be taken into account.

[Updated on: Sun, 16 April 2017 06:54]

Report message to a moderator

Previous Topic: Performance Issues v1.97 - 2.0 with list screens
Next Topic: Legacy file carryover
Goto Forum:
  


Current Time: Wed Dec 11 17:28:41 EST 2024

Total time taken to generate the page: 0.01080 seconds