OSDN Git Service

End of developing 3.5 series and prepare for 3.6 series.
[nucleus-jp/nucleus-jp-ancient.git] / utf8 / nucleus / upgrades / upgrade3.3.php
diff --git a/utf8/nucleus/upgrades/upgrade3.3.php b/utf8/nucleus/upgrades/upgrade3.3.php
new file mode 100644 (file)
index 0000000..a491301
--- /dev/null
@@ -0,0 +1,72 @@
+<?php
+/*
+ * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)
+ * Copyright (C) 2002-2010 The Nucleus Group
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ * (see nucleus/documentation/index.html#license for more info)
+ */
+/**
+ * @license http://nucleuscms.org/license.txt GNU General Public License
+ * @copyright Copyright (C) 2002-2010 The Nucleus Group
+ * @version $Id$
+ * $NucleusJP: upgrade3.3.php,v 1.5.2.1 2007/10/24 05:39:16 kimitake Exp $
+ *
+ */
+
+function upgrade_do330() {
+
+    if (upgrade_checkinstall(330))
+        return 'インストール済みです';
+
+    if (!upgrade_checkIfColumnExists('comment','cemail')) {
+        $query = "  ALTER TABLE `" . sql_table('comment') . "`
+                    ADD `cemail` VARCHAR( 100 ) AFTER `cmail` ;";
+
+        upgrade_query('Altering ' . sql_table('comment') . ' table', $query);
+    }
+
+    if (!upgrade_checkIfColumnExists('blog','breqemail')) {
+        $query = "  ALTER TABLE `" . sql_table('blog') . "`
+                    ADD `breqemail` TINYINT( 2 ) DEFAULT '0' NOT NULL ;";
+
+        upgrade_query('Altering ' . sql_table('blog') . ' table', $query);
+    }
+
+    // check cmail column to separate to URL and cemail
+    mysql_query(
+        'UPDATE ' . sql_table('comment') . ' ' . 
+        "SET cemail = cmail, cmail = '' " .
+        "WHERE cmail LIKE '%@%'"
+    );
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    // 3.2 -> 3.3
+    // update database version
+    update_version('330');
+
+
+
+
+
+
+
+}
+
+?>