diff options
author | redmatrix <git@macgirvin.com> | 2016-06-01 21:48:54 -0700 |
---|---|---|
committer | redmatrix <git@macgirvin.com> | 2016-06-01 21:48:54 -0700 |
commit | a9d7acda279ebb7f2b3cd61a91a5e1d8b590dcf2 (patch) | |
tree | de0ac6910e13926df60cfed458e50310c5642055 /install/update.php | |
parent | b1259876bf398880e7b0c1b44d90f94983243e72 (diff) | |
download | volse-hubzilla-a9d7acda279ebb7f2b3cd61a91a5e1d8b590dcf2.tar.gz volse-hubzilla-a9d7acda279ebb7f2b3cd61a91a5e1d8b590dcf2.tar.bz2 volse-hubzilla-a9d7acda279ebb7f2b3cd61a91a5e1d8b590dcf2.zip |
the rest of the schema updates - WARNING: some third party plugins may fail; e.g. embedphotos and chess. $item['object'] is now $item['obj'] and $photo['type'] is $photo['mimetype'], $photo['scale'] is $photo['imgscale'] and $photo['data'] is now $photo['content']. There are a number of other changes, but these are the ones noted to cause issues with third-party plugins. The project plugins have been updated. Please note any new issues as this effort touched a lot of code in a lot of files.
Diffstat (limited to 'install/update.php')
-rw-r--r-- | install/update.php | 70 |
1 files changed, 69 insertions, 1 deletions
diff --git a/install/update.php b/install/update.php index dd0131ee8..3e18c9840 100644 --- a/install/update.php +++ b/install/update.php @@ -1,6 +1,6 @@ <?php -define( 'UPDATE_VERSION' , 1173 ); +define( 'UPDATE_VERSION' , 1176 ); /** * @@ -2186,3 +2186,71 @@ function update_r1172() { return UPDATE_FAILED; } + +function update_r1173() { + + + if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) { + $r1 = q("ALTER TABLE notify CHANGE `name` `xname` TEXT NOT NULL "); + $r2 = q("ALTER TABLE notify CHANGE `date` `created` timestamp NOT NULL DEFAULT '0001-01-01 00:00:00' "); + $r3 = q("ALTER TABLE notify CHANGE `type` `ntype` numeric(3) NOT NULL DEFAULT '0' "); + } + else { + $r1 = q("ALTER TABLE notify CHANGE `name` `xname` char(255) NOT NULL DEFAULT '' "); + $r2 = q("ALTER TABLE notify CHANGE `date` `created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' "); + $r3 = q("ALTER TABLE notify CHANGE `type` `ntype` smallint(3) NOT NULL DEFAULT '0' "); + } + + if($r1 && $r2 && $r3) + return UPDATE_SUCCESS; + return UPDATE_FAILED; + +} + +function update_r1174() { + + if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) { + $r1 = q("ALTER TABLE event CHANGE `type` `etype` varchar(255) NOT NULL DEFAULT '' "); + $r2 = q("ALTER TABLE event CHANGE `start` `dtstart` timestamp NOT NULL DEFAULT '0001-01-01 00:00:00' "); + $r3 = q("ALTER TABLE event CHANGE `finish` `dtend` timestamp NOT NULL DEFAULT '0001-01-01 00:00:00' "); + $r4 = q("ALTER TABLE event CHANGE `ignore` `dismissed` numeric(1) NOT NULL DEFAULT '0' "); + $r5 = q("ALTER TABLE attach CHANGE `data` `content` bytea NOT NULL "); + $r6 = q("ALTER TABLE photo CHANGE `data` `content` bytea NOT NULL "); + } + else { + $r1 = q("ALTER TABLE event CHANGE `type` `etype` char(255) NOT NULL DEFAULT '' "); + $r2 = q("ALTER TABLE event CHANGE `start` `dtstart` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' "); + $r3 = q("ALTER TABLE event CHANGE `finish` `dtend` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' "); + $r4 = q("ALTER TABLE event CHANGE `ignore` `dismissed` tinyint(1) NOT NULL DEFAULT '0' "); + $r5 = q("ALTER TABLE attach CHANGE `data` `content` longblob NOT NULL "); + $r6 = q("ALTER TABLE photo CHANGE `data` `content` mediumblob NOT NULL "); + } + + if($r1 && $r2 && $r3 && $r4 && $r5 && $r6) + return UPDATE_SUCCESS; + return UPDATE_FAILED; + +} + +function update_r1175() { + + if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) { + $r1 = q("ALTER TABLE item CHANGE `object` `obj` text NOT NULL"); + $r2 = q("ALTER TABLE photo CHANGE `size` `filesize` bigint NOT NULL DEFAULT '0' "); + $r3 = q("ALTER TABLE photo CHANGE `scale` `imgscale` numeric(3) NOT NULL DEFAULT '0' "); + $r4 = q("ALTER TABLE photo CHANGE `type` `mimetype` varchar(128) NOT NULL DEFAULT 'image/jpeg' "); + + } + else { + $r1 = q("ALTER TABLE item CHANGE `object` `obj` text NOT NULL"); + $r2 = q("ALTER TABLE photo CHANGE `size` `filesize` int(10) unsigned NOT NULL DEFAULT '0' "); + $r3 = q("ALTER TABLE photo CHANGE `scale` `imgscale` tinyint(3) unsigned NOT NULL DEFAULT '0' "); + $r4 = q("ALTER TABLE photo CHANGE `type` `mimetype` char(128) NOT NULL DEFAULT 'image/jpeg' "); + + } + + if($r1) + return UPDATE_SUCCESS; + return UPDATE_FAILED; + +} |