<?php
	if ($old_version < 81 && $new_version == 81) {
		// -- recuperation du champs 'repeat' --
			//on cree repeat_mode
			$sql = "ALTER TABLE `mgw_calendar` ADD `repeat_mode` INT NOT NULL";
			if(!$res = $conn->Execute($sql)) die(showSQLerror($sql, $conn->ErrorMsg(), __LINE__, __FILE__));
			$sql = "ALTER TABLE `mgw_calendar_tmp` ADD `repeat_mode` INT NOT NULL";
			if(!$res = $conn->Execute($sql)) die(showSQLerror($sql, $conn->ErrorMsg(), __LINE__, __FILE__));

			//on copie les valeurs de repeat dans repeat_mode
			$sql = "UPDATE `mgw_calendar` SET `repeat_mode` = `repeat` WHERE 1";
			if(!$res = $conn->Execute($sql)) die(showSQLerror($sql, $conn->ErrorMsg(), __LINE__, __FILE__));
			$sql = "UPDATE `mgw_calendar_tmp` SET `repeat_mode` = `repeat` WHERE 1";
			if(!$res = $conn->Execute($sql)) die(showSQLerror($sql, $conn->ErrorMsg(), __LINE__, __FILE__));

			//le champs repeat sera automatiquement effacé lors de la MAJ du schéma de la base.
		// ----
	}
?>