[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [11336] property: fix for MySQL
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [11336] property: fix for MySQL |
Date: |
Fri, 27 Sep 2013 10:24:39 +0000 |
Revision: 11336
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11336
Author: sigurdne
Date: 2013-09-27 10:24:38 +0000 (Fri, 27 Sep 2013)
Log Message:
-----------
property: fix for MySQL
Modified Paths:
--------------
trunk/phpgwapi/inc/class.db_adodb.inc.php
trunk/phpgwapi/inc/class.schema_proc_mysql.inc.php
trunk/phpgwapi/setup/tables_current.inc.php
trunk/property/setup/default_records.inc.php
trunk/property/setup/tables_current.inc.php
Modified: trunk/phpgwapi/inc/class.db_adodb.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.db_adodb.inc.php 2013-09-26 18:18:24 UTC (rev
11335)
+++ trunk/phpgwapi/inc/class.db_adodb.inc.php 2013-09-27 10:24:38 UTC (rev
11336)
@@ -124,9 +124,10 @@
$type = $this->Type;
if ( $type == 'mysql' )
{
- $type = 'mysqlt';
+ // $type = 'mysqlt';
+ $type = 'mysqli';
}
- $this->adodb = newADOConnection($this->Type);
+ $this->adodb = newADOConnection($type);
if($this->fetchmode == 'ASSOC')
{
Modified: trunk/phpgwapi/inc/class.schema_proc_mysql.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.schema_proc_mysql.inc.php 2013-09-26 18:18:24 UTC
(rev 11335)
+++ trunk/phpgwapi/inc/class.schema_proc_mysql.inc.php 2013-09-27 10:24:38 UTC
(rev 11336)
@@ -151,7 +151,7 @@
}
else if ($sDefault == 'current_date' || $sDefault ==
'current_timestamp')
{
- $ret= 'now()';
+ $ret= 'CURRENT_TIMESTAMP';
}
else
{
Modified: trunk/phpgwapi/setup/tables_current.inc.php
===================================================================
--- trunk/phpgwapi/setup/tables_current.inc.php 2013-09-26 18:18:24 UTC (rev
11335)
+++ trunk/phpgwapi/setup/tables_current.inc.php 2013-09-27 10:24:38 UTC (rev
11336)
@@ -277,8 +277,8 @@
'owner_id' => array('type' => 'int','precision'
=> 4,'nullable' => False),
'createdby_id' => array('type' =>
'int','precision' => 4,'nullable' => True),
'modifiedby_id' => array('type' =>
'int','precision' => 4,'nullable' => True),
- 'created' => array('type' => 'date','nullable'
=> False,'default' => 'current_date'),
- 'modified' => array('type' => 'date','nullable'
=> True),
+ 'created' => array('type' =>
'timestamp','nullable' => False,'default' => 'current_timestamp'),
+ 'modified' => array('type' =>
'timestamp','nullable' => True),
'size' => array('type' => 'int','precision' =>
4,'nullable' => True),
'mime_type' => array('type' =>
'varchar','precision' => '150','nullable' => True),
'deleteable' => array('type' =>
'char','precision' => 1,'nullable' => True,'default' => 'Y'),
Modified: trunk/property/setup/default_records.inc.php
===================================================================
--- trunk/property/setup/default_records.inc.php 2013-09-26 18:18:24 UTC
(rev 11335)
+++ trunk/property/setup/default_records.inc.php 2013-09-27 10:24:38 UTC
(rev 11336)
@@ -906,17 +906,24 @@
$GLOBALS['phpgw_setup']->oProc->query($sql,__LINE__,__FILE__);
- $sql = 'CREATE OR REPLACE VIEW fm_orders_paid_or_pending_view AS
- SELECT orders_paid_or_pending.order_id,
orders_paid_or_pending.periode, orders_paid_or_pending.amount
- FROM ( SELECT fm_ecobilagoverf.pmwrkord_code AS
order_id, fm_ecobilagoverf.periode, sum(fm_ecobilagoverf.godkjentbelop) AS
amount
- FROM fm_ecobilagoverf
- GROUP BY fm_ecobilagoverf.pmwrkord_code,
fm_ecobilagoverf.periode
- UNION ALL
- SELECT fm_ecobilag.pmwrkord_code AS order_id,
fm_ecobilag.periode, sum(fm_ecobilag.godkjentbelop) AS amount
- FROM fm_ecobilag
- GROUP BY fm_ecobilag.pmwrkord_code, fm_ecobilag.periode)
orders_paid_or_pending';
+ switch ( $GLOBALS['phpgw_info']['server']['db_type'] )
+ {
+ case 'postgres':
+ $sql = 'CREATE OR REPLACE VIEW
fm_orders_paid_or_pending_view AS
+ SELECT orders_paid_or_pending.order_id,
orders_paid_or_pending.periode, orders_paid_or_pending.amount
+ FROM ( SELECT
fm_ecobilagoverf.pmwrkord_code AS order_id, fm_ecobilagoverf.periode,
sum(fm_ecobilagoverf.godkjentbelop) AS amount
+ FROM fm_ecobilagoverf
+ GROUP BY
fm_ecobilagoverf.pmwrkord_code, fm_ecobilagoverf.periode
+ UNION ALL
+ SELECT
fm_ecobilag.pmwrkord_code AS order_id, fm_ecobilag.periode,
sum(fm_ecobilag.godkjentbelop) AS amount
+ FROM fm_ecobilag
+ GROUP BY fm_ecobilag.pmwrkord_code,
fm_ecobilag.periode) orders_paid_or_pending';
- $GLOBALS['phpgw_setup']->oProc->query($sql,__LINE__,__FILE__);
+
$GLOBALS['phpgw_setup']->oProc->query($sql,__LINE__,__FILE__);
+ break;
+ default:
+ //do nothing for now
+ }
$sql = 'CREATE OR REPLACE VIEW
fm_project_budget_year_from_order_view AS'
. ' SELECT DISTINCT fm_workorder.project_id,
fm_workorder_budget.year'
Modified: trunk/property/setup/tables_current.inc.php
===================================================================
--- trunk/property/setup/tables_current.inc.php 2013-09-26 18:18:24 UTC (rev
11335)
+++ trunk/property/setup/tables_current.inc.php 2013-09-27 10:24:38 UTC (rev
11336)
@@ -486,7 +486,7 @@
),
'fm_workorder' => array(
'fd' => array(
- 'id' => array('type' => 'int','precision' =>
'4','nullable' => False),
+ 'id' => array('type' => 'int','precision' =>
'8','nullable' => False),
'num' => array('type' => 'varchar','precision'
=> '20','nullable' => False),
'project_id' => array('type' =>
'int','precision' => '4','nullable' => False),
'user_id' => array('type' => 'int','precision'
=> '4','nullable' => False),
@@ -668,7 +668,7 @@
'id' => array('type' => 'auto','precision' =>
'4','nullable' => False),
'record' => array('type' => 'int','precision'
=> '4','nullable' => True),
'owner' => array('type' => 'int','precision' =>
'4','nullable' => False),
- 'workorder_id' => array('type' =>
'int','precision' => '4','nullable' => False),
+ 'workorder_id' => array('type' =>
'int','precision' => '8','nullable' => False),
'activity_id' => array('type' =>
'int','precision' => '4','nullable' => True),
'activity_num' => array('type' =>
'varchar','precision' => '15','nullable' => True),
'grouping_id' => array('type' =>
'int','precision' => '4','nullable' => True),
@@ -705,7 +705,7 @@
),
'fm_wo_h_deviation' => array(
'fd' => array(
- 'workorder_id' => array('type' =>
'int','precision' => '4','nullable' => False),
+ 'workorder_id' => array('type' =>
'int','precision' => '8','nullable' => False),
'hour_id' => array('type' => 'int','precision'
=> '4','nullable' => False),
'id' => array('type' => 'int','precision' =>
'4','nullable' => False),
'amount' => array('type' => 'int','precision'
=> '4','nullable' => False),
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [11336] property: fix for MySQL,
Sigurd Nes <=