Admin note: Anyone that is failing on the database upgrade at the eye forms tables, run sql_upgrade.php from browser again and this error will be skipped and the rest of the upgrade should complete allowing system use. I’ll try to fix this in first v5.0.2 patch.
This error:
…
OSREDDESAT
varchar (20) DEFAULT NULL, PRIMARY KEY neuro_link
(id
), UNIQUE KEY id_pid
(id
,pid
)) ENGINE = InnoDB
CREATE TABLE form_eye_locking
( id
bigint(20) NOT NULL COMMENT ‘Links to forms.form_id’, pid
bigint(20) DEFAULT NULL, IMP
text, PLAN
text, Resource
varchar(50) DEFAULT NULL, Technician
varchar(50) DEFAULT NULL, LOCKED
varchar(3) DEFAULT NULL, LOCKEDDATE
timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, LOCKEDBY
varchar(50) DEFAULT NULL, PRIMARY KEY locking_link
(id
), UNIQUE KEY id_pid
(id
,pid
)) ENGINE = InnoDB
ALTER TABLE form_eye_mag_orders
CHANGE id
id
BIGINT(20) NOT NULL AUTO_INCREMENT, CHANGE ORDER_PID
pid
BIGINT(20) NOT NULL, ADD form_id
bigint(20) NOT NULL AFTER id
, DROP INDEX VISIT_ID
ALTER TABLE form_eye_mag_orders
ADD UNIQUE KEY VISIT_ID
(pid
, ORDER_DETAILS
, ORDER_DATE_PLACED
)
Query Error
ERROR: query failed: ALTER TABLE form_eye_mag_orders
ADD UNIQUE KEY VISIT_ID
(pid
, ORDER_DETAILS
, ORDER_DATE_PLACED
)
Error: Duplicate entry ‘1–0000-00-00’ for key ‘VISIT_ID’
C:\xampp\htdocs\openemr\library\sql_upgrade_fx.php at 933:sqlStatement
C:\xampp\htdocs\openemr\sql_upgrade.php at 88:upgradeFromSqlFile(5_0_1-to-5_0_2_upgrade.sql)
…
My table:
Thank
Luis