fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [15021] API


From: sigurdne
Subject: [Fmsystem-commits] [15021] API
Date: Fri, 13 May 2016 11:42:37 +0000 (UTC)

Revision: 15021
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15021
Author:   sigurdne
Date:     2016-05-13 11:42:37 +0000 (Fri, 13 May 2016)
Log Message:
-----------
API

Modified Paths:
--------------
    trunk/phpgwapi/setup/tables_update.inc.php

Modified: trunk/phpgwapi/setup/tables_update.inc.php
===================================================================
--- trunk/phpgwapi/setup/tables_update.inc.php  2016-05-13 11:42:34 UTC (rev 
15020)
+++ trunk/phpgwapi/setup/tables_update.inc.php  2016-05-13 11:42:37 UTC (rev 
15021)
@@ -3359,3 +3359,42 @@
                        return $GLOBALS['setup_info']['phpgwapi']['currentver'];
                }
        }
+
+       $test[] = '0.9.17.550';
+       /**
+       * Add table for file relation to multiple items
+       * @return string the new version number
+       */
+       function phpgwapi_upgrade0_9_17_550()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+               $metadata = 
$GLOBALS['phpgw_setup']->oProc->m_odb->metadata('phpgw_vfs_filedata');
+               if(isset($metadata['location_id']))
+               {
+                       
$GLOBALS['phpgw_setup']->oProc->DropColumn('phpgw_vfs_filedata',null,'location_id');
+                       
$GLOBALS['phpgw_setup']->oProc->DropColumn('phpgw_vfs_filedata',null,'metadata');
+                       
$GLOBALS['phpgw_setup']->oProc->AddColumn('phpgw_vfs_filedata', 'metadata', 
array(
+                               'type' => 'jsonb',
+                               'nullable' => true
+                               )
+                       );
+
+                       $GLOBALS['phpgw_setup']->oProc->query("CREATE SEQUENCE 
public.seq_phpgw_vfs_file_relation"
+                               . " INCREMENT 1"
+                               . " MINVALUE 1"
+                               . " MAXVALUE 9223372036854775807"
+                               . " START 1"
+                               . " CACHE 1",__LINE__,__FILE__);
+
+                       $GLOBALS['phpgw_setup']->oProc->query("ALTER TABLE 
public.phpgw_vfs_file_relation"
+                               . " ALTER COLUMN relation_id SET DEFAULT 
nextval('seq_phpgw_vfs_file_relation'::regclass)",__LINE__,__FILE__);
+
+               }
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['phpgwapi']['currentver'] = 
'0.9.17.551';
+                       return $GLOBALS['setup_info']['phpgwapi']['currentver'];
+               }
+       }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]