From 6a84cbb2d527a0fb263a9104690bcfcb24f182e1 Mon Sep 17 00:00:00 2001
From: Andrei Karas <akaras@inbox.ru>
Date: Fri, 8 Jul 2016 02:59:20 +0300
Subject: Add sql upgrade scripts for convert date/datetime default values.

---
 sql-files/upgrades/rAthena-main-upgrade.sql | 13 +++++++++++++
 1 file changed, 13 insertions(+)

(limited to 'sql-files/upgrades/rAthena-main-upgrade.sql')

diff --git a/sql-files/upgrades/rAthena-main-upgrade.sql b/sql-files/upgrades/rAthena-main-upgrade.sql
index e214e8d34..5dd6111a5 100644
--- a/sql-files/upgrades/rAthena-main-upgrade.sql
+++ b/sql-files/upgrades/rAthena-main-upgrade.sql
@@ -337,3 +337,16 @@ INSERT INTO `global_acc_reg_str_db` (`account_id`, `key`, `index`, `value`) SELE
 -- Dropping now useless table
 DROP TABLE `global_reg_value`;
 
+ALTER TABLE `charlog` MODIFY `time` DATETIME NULL;
+ALTER TABLE `interlog` MODIFY `time` DATETIME NULL;
+ALTER TABLE `ipbanlist` MODIFY `btime` DATETIME NULL;
+ALTER TABLE `ipbanlist` MODIFY `rtime` DATETIME NULL;
+ALTER TABLE `login` MODIFY `lastlogin` DATETIME NULL;
+ALTER TABLE `login` MODIFY `birthdate` DATE NULL;
+
+UPDATE `charlog` SET `time` = NULL WHERE `time` = '0000-00-00 00:00:00';
+UPDATE `interlog` SET `time` = NULL WHERE `time` = '0000-00-00 00:00:00';
+UPDATE `ipbanlist` SET `btime` = NULL WHERE `btime` = '0000-00-00 00:00:00';
+UPDATE `ipbanlist` SET `rtime` = NULL WHERE `rtime` = '0000-00-00 00:00:00';
+UPDATE `login` SET `lastlogin` = NULL WHERE `lastlogin` = '0000-00-00 00:00:00';
+UPDATE `login` SET `birthdate` = NULL WHERE `birthdate` = '0000-00-00';
-- 
cgit v1.2.3-70-g09d2

