fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [6526] booking: enable install at MySQL


From: Sigurd Nes
Subject: [Fmsystem-commits] [6526] booking: enable install at MySQL
Date: Sun, 31 Oct 2010 15:09:35 +0000

Revision: 6526
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=6526
Author:   sigurdne
Date:     2010-10-31 15:09:34 +0000 (Sun, 31 Oct 2010)
Log Message:
-----------
booking: enable install at MySQL

Modified Paths:
--------------
    trunk/booking/setup/default_records.inc.php
    trunk/booking/setup/tables_current.inc.php

Modified: trunk/booking/setup/default_records.inc.php
===================================================================
--- trunk/booking/setup/default_records.inc.php 2010-10-31 13:21:19 UTC (rev 
6525)
+++ trunk/booking/setup/default_records.inc.php 2010-10-31 15:09:34 UTC (rev 
6526)
@@ -1,18 +1,24 @@
 <?php
-       $GLOBALS['phpgw_setup']->oProc->query(
-               "CREATE OR REPLACE VIEW bb_document_view ".
-               "AS SELECT bb_document.id AS id, bb_document.name AS name, 
bb_document.owner_id AS owner_id, bb_document.category AS category, 
bb_document.description AS description, bb_document.type AS type ".
-               "FROM ". 
-                       "((SELECT *, 'building' as type from 
bb_document_building) UNION ALL (SELECT *, 'resource' as type from 
bb_document_resource)) ".
-               "as bb_document;"
-       );
+       switch ( $GLOBALS['phpgw_info']['server']['db_type'] )
+       {
+               case 'postgres':
+                       $GLOBALS['phpgw_setup']->oProc->query(
+                               "CREATE OR REPLACE VIEW bb_document_view ".
+                               "AS SELECT bb_document.id AS id, 
bb_document.name AS name, bb_document.owner_id AS owner_id, 
bb_document.category AS category, bb_document.description AS description, 
bb_document.type AS type ".
+                               "FROM ". 
+                                       "((SELECT *, 'building' as type from 
bb_document_building) UNION ALL (SELECT *, 'resource' as type from 
bb_document_resource)) ".
+                               "as bb_document;"
+                       );
 
-       $GLOBALS['phpgw_setup']->oProc->query(
-               "CREATE OR REPLACE VIEW bb_application_association AS ".
-               "SELECT 'booking' AS type, application_id, id, from_, to_ FROM 
bb_booking WHERE application_id IS NOT NULL ".
-               "UNION ".
-               "SELECT 'allocation' AS type, application_id, id, from_, to_ 
FROM bb_allocation  WHERE application_id IS NOT NULL ".
-               "UNION ".
-               "SELECT 'event' AS type, application_id, id, from_, to_ FROM 
bb_event  WHERE application_id IS NOT NULL"
-       );
-
+                       $GLOBALS['phpgw_setup']->oProc->query(
+                               "CREATE OR REPLACE VIEW 
bb_application_association AS ".
+                               "SELECT 'booking' AS type, application_id, id, 
from_, to_ FROM bb_booking WHERE application_id IS NOT NULL ".
+                               "UNION ".
+                               "SELECT 'allocation' AS type, application_id, 
id, from_, to_ FROM bb_allocation  WHERE application_id IS NOT NULL ".
+                               "UNION ".
+                               "SELECT 'event' AS type, application_id, id, 
from_, to_ FROM bb_event  WHERE application_id IS NOT NULL"
+                       );
+                       break;
+               default:
+                       //do nothing for now
+       }

Modified: trunk/booking/setup/tables_current.inc.php
===================================================================
--- trunk/booking/setup/tables_current.inc.php  2010-10-31 13:21:19 UTC (rev 
6525)
+++ trunk/booking/setup/tables_current.inc.php  2010-10-31 15:09:34 UTC (rev 
6526)
@@ -166,8 +166,8 @@
                                'active' => array('type' => 'int', 'nullable' 
=> False,'precision' => '4', 'default' => 1),
                                'display_in_dashboard' => array('type' => 
'int', 'nullable' => False, 'precision' => '4', 'default' => 1),
                                'status' => array('type' => 'text', 
'nullable'=> False),
-                               'created' => array('type' => 'timestamp', 
'nullable'=> False, 'default' => 'now'),
-                               'modified' => array('type' => 'timestamp', 
'nullable'=> False, 'default' => 'now'),
+                               'created' => array('type' => 'timestamp', 
'nullable'=> False, 'default' => 'current_timestamp'),
+                               'modified' => array('type' => 'timestamp', 
'nullable'=> False),
                                'frontend_modified' => array('type' => 
'timestamp', 'nullable'=> True),
                                'building_name' => array('type' => 'varchar', 
'precision' => 50,'nullable' => False),
                                'activity_id' => array('type' => 
'int','precision' => '4','nullable' => False),
@@ -331,7 +331,7 @@
                                'time' => array('type' => 'timestamp', 
'nullable' => False),
                                'author' => array('type' => 'text', 'nullable' 
=> False),
                                'comment' => array('type' => 'text', 'nullable' 
=> False),
-                               'type' => array('type' => 'text', 'nullable' => 
False, 'default'=>'comment'),
+                               'type' => array('type' => 'varchar',  
'precision' => '20', 'nullable' => false, 'default' => 'comment'),
                        ),
                        'pk' => array('id'),
                        'fk' => array(
@@ -586,7 +586,7 @@
                                'time' => array('type' => 'timestamp', 
'nullable' => False),
                                'author' => array('type' => 'text', 'nullable' 
=> False),
                                'comment' => array('type' => 'text', 'nullable' 
=> False),
-                               'type' => array('type' => 'text', 'nullable' => 
False, 'default'=>'comment'),
+                               'type' => array('type' => 'varchar',  
'precision' => '20', 'nullable' => false, 'default' => 'comment'),
                        ),
                        'pk' => array('id'),
                        'fk' => array(
@@ -733,7 +733,7 @@
                'bb_billing_sequential_number_generator' => array(
                        'fd' => array(
                                'id'            => array('type' => 'auto', 
'nullable' => False),
-                               'name'   => array('type' => 'text', 'nullable' 
=> False),
+                               'name' => array('type' => 'varchar','precision' 
=> '100','nullable' => False),// FIXME
                                'value' => array('type' => 'int', 'precision' 
=> '4', 'nullable' => False, 'default' => 0),
                        ),
                        'pk' => array('id'),
@@ -752,8 +752,8 @@
                                'phone' => array('type' => 
'varchar','precision' => '50','nullable' => true),
                                'email' => array('type' => 
'varchar','precision' => '50','nullable' => true),
                                'message' => array('type' => 'text', 'nullable' 
=> False),
-                               'type' => array('type' => 'text', 'nullable' => 
False, 'default'=>'message'),
-                               'status' => array('type' => 'text', 'nullable' 
=> False, 'default'=>'NEW'),
+                               'type' => array('type' => 'varchar',  
'precision' => '20', 'nullable' => false, 'default' => 'comment'),
+                               'status' => array('type' => 'varchar',  
'precision' => '20', 'nullable' => false, 'default' => 'NEW'),
                        ),
                        'pk' => array('id'),
                        'fk' => array(),




reply via email to

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