"Fossies" - the Fresh Open Source Software Archive 
Member "opendocman-1.4.4-release/install/upgrade_136.php" (20 Mar 2021, 1721 Bytes) of package /linux/www/opendocman-1.4.4-release.tar.gz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file.
1 <?php
2 /*
3 * Copyright (C) 2000-2021. Stephen Lawrence
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 */
19
20 // For users upgrading from DB version 1.3.6 to 1.4.0
21
22 global $pdo;
23
24 echo 'Altering the data table...<br />';
25 $query = "ALTER TABLE `{$_SESSION['db_prefix']}data` DROP key `description`";
26 $stmt = $pdo->prepare($query);
27 $stmt->execute();
28 $query = "ALTER TABLE `{$_SESSION['db_prefix']}data` ADD KEY `description` (`description`(200))";
29 $stmt = $pdo->prepare($query);
30 $stmt->execute();
31
32
33 echo 'Altering the settings table...<br />';
34 $query = "ALTER TABLE `{$_SESSION['db_prefix']}settings` DROP INDEX `name`";
35 $stmt = $pdo->prepare($query);
36 $stmt->execute();
37 $query = "ALTER TABLE `{$_SESSION['db_prefix']}settings` ADD CONSTRAINT `name` UNIQUE (`name`(200))";
38 $stmt = $pdo->prepare($query);
39 $stmt->execute();
40
41 echo 'Updating db version...<br />';
42 $query = "UPDATE {$_SESSION['db_prefix']}odmsys SET sys_value='1.4.0' WHERE sys_name='version'";
43 $stmt = $pdo->prepare($query);
44 $stmt->execute();
45
46 echo 'Database update from 1.3.6 complete.<br />';