ALTER TABLE `greffe` CHANGE `gre_date_fin_fnc` `gre_date_fin_fnc` DATE NULL;
ALTER TABLE `greffe` CHANGE `gre_declampage` `gre_declampage` DATE NULL;


update greffe set gre_date_fin_fnc=null where gre_date_fin_fnc=0000-00-00;
update greffe set gre_declampage=null where gre_declampage=0000-00-00;


ALTER TABLE `greffe` CHANGE `per_code` `per_code` INT(11) NOT NULL;
ALTER TABLE `greffe` ADD INDEX(`per_code`);
ALTER TABLE `greffe` ADD CONSTRAINT `fk_greffe_personne` FOREIGN KEY (`per_code`) REFERENCES `personne`(`per_code`) ON DELETE RESTRICT ON UPDATE RESTRICT;

ALTER TABLE `greffe` CHANGE `gre_code` `gre_code` SMALLINT(6) NOT NULL AUTO_INCREMENT;
ALTER TABLE `greffe` CHANGE `gre_dialyse` `gre_dialyse` TINYINT(1) NULL DEFAULT NULL;
