[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [12974] prepare merge trunk to Syncromind
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [12974] prepare merge trunk to Syncromind |
Date: |
Thu, 09 Apr 2015 11:54:43 +0000 |
Revision: 12974
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=12974
Author: sigurdne
Date: 2015-04-09 11:54:43 +0000 (Thu, 09 Apr 2015)
Log Message:
-----------
prepare merge trunk to Syncromind
Modified Paths:
--------------
trunk/property/setup/setup.inc.php
trunk/property/setup/tables_current.inc.php
trunk/property/setup/tables_update.inc.php
Modified: trunk/property/setup/setup.inc.php
===================================================================
--- trunk/property/setup/setup.inc.php 2015-04-09 10:39:19 UTC (rev 12973)
+++ trunk/property/setup/setup.inc.php 2015-04-09 11:54:43 UTC (rev 12974)
@@ -12,7 +12,7 @@
*/
$setup_info['property']['name'] = 'property';
- $setup_info['property']['version'] = '0.9.17.686';
+ $setup_info['property']['version'] = '0.9.17.688';
$setup_info['property']['app_order'] = 8;
$setup_info['property']['enable'] = 1;
$setup_info['property']['app_group'] = 'office';
Modified: trunk/property/setup/tables_current.inc.php
===================================================================
--- trunk/property/setup/tables_current.inc.php 2015-04-09 10:39:19 UTC (rev
12973)
+++ trunk/property/setup/tables_current.inc.php 2015-04-09 11:54:43 UTC (rev
12974)
@@ -982,21 +982,22 @@
),
'fm_ns3420' => array(
'fd' => array(
- 'id' => array('type' => 'varchar','precision'
=> '20','nullable' => False),
+ 'id' => array('type' => 'int','precision' =>
'4','nullable' => False),
+ 'num' => array('type' => 'varchar','precision'
=> '20','nullable' => False),
+ 'parent_id' => array('type' =>
'int','precision' => '4','nullable' => True),
+ 'enhet' => array('type' =>
'varchar','precision' => '6','nullable' => True),
'tekst1' => array('type' =>
'varchar','precision' => '50','nullable' => True),
- 'enhet' => array('type' =>
'varchar','precision' => '6','nullable' => True),
'tekst2' => array('type' =>
'varchar','precision' => '50','nullable' => True),
'tekst3' => array('type' =>
'varchar','precision' => '50','nullable' => True),
'tekst4' => array('type' =>
'varchar','precision' => '50','nullable' => True),
'tekst5' => array('type' =>
'varchar','precision' => '50','nullable' => True),
'tekst6' => array('type' =>
'varchar','precision' => '50','nullable' => True),
- 'parent' => array('type' =>
'varchar','precision' => '20','nullable' => True),
'type' => array('type' => 'varchar','precision'
=> '20','nullable' => True)
),
'pk' => array('id'),
'fk' => array(),
'ix' => array(),
- 'uc' => array()
+ 'uc' => array('name')
),
'fm_tts_status' => array(
'fd' => array(
Modified: trunk/property/setup/tables_update.inc.php
===================================================================
--- trunk/property/setup/tables_update.inc.php 2015-04-09 10:39:19 UTC (rev
12973)
+++ trunk/property/setup/tables_update.inc.php 2015-04-09 11:54:43 UTC (rev
12974)
@@ -8169,13 +8169,152 @@
/**
* Update property version from 0.9.17.685 to 0.9.17.686
- * Add controller-flag to entities
+ * Convert id from character to integer for fm_vendor_category::id
*/
$test[] = '0.9.17.685';
function property_upgrade0_9_17_685()
{
$GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+ $metadata =
$GLOBALS['phpgw_setup']->oProc->m_odb->metadata('fm_vendor_category');
+
+ if($metadata['id']->type == 'varchar')
+ {
+ $GLOBALS['phpgw_setup']->oProc->query("SELECT * FROM
fm_vendor_category");
+ $cats = array();
+ while ($GLOBALS['phpgw_setup']->oProc->next_record())
+ {
+ $cats[] = array
+ (
+ 'id' =>
$GLOBALS['phpgw_setup']->oProc->f('id'),
+ 'descr' =>
$GLOBALS['phpgw_setup']->oProc->f('descr',true),
+ );
+ }
+
+
$GLOBALS['phpgw_setup']->oProc->DropTable('fm_vendor_category');
+ $GLOBALS['phpgw_setup']->oProc->CreateTable(
+ 'fm_vendor_category', array(
+ 'fd' => array(
+ 'id' => array('type' =>
'int','precision' => 4,'nullable' => false),
+ 'descr' => array('type' =>
'varchar','precision' => 255,'nullable' => false),
+ ),
+ 'pk' => array('id'),
+ 'fk' => array(),
+ 'ix' => array(),
+ 'uc' => array()
+ )
+ );
+
$GLOBALS['phpgw_setup']->oProc->RenameColumn('fm_vendor','category','_category');
+
+
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_vendor','category',array('type'
=> 'int','precision' => 4,'nullable' => True));
+
+ $id = 1;
+ foreach($cats as $cat)
+ {
+ $value_set = array
+ (
+ 'id' => $id,
+ 'descr' => $cat['descr']
+ );
+ $cols = implode(',', array_keys($value_set));
+ $values =
$GLOBALS['phpgw_setup']->oProc->validate_insert(array_values($value_set));
+ $sql = "INSERT INTO fm_vendor_category
({$cols}) VALUES ({$values})";
+
$GLOBALS['phpgw_setup']->oProc->query($sql,__LINE__,__FILE__);
+
+ $GLOBALS['phpgw_setup']->oProc->query("UPDATE
fm_vendor SET category = {$id} WHERE _category =
'{$cat['id']}'",__LINE__,__FILE__);
+
+ $id++;
+ }
+
$GLOBALS['phpgw_setup']->oProc->DropColumn('fm_vendor',array(),'_category');
+
+ }
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
+ $GLOBALS['setup_info']['property']['currentver'] =
'0.9.17.686';
+ return $GLOBALS['setup_info']['property']['currentver'];
+ }
+ }
+
+
+ /**
+ * Update property version from 0.9.17.686 to 0.9.17.687
+ * Convert ns3420 table
+ */
+ $test[] = '0.9.17.686';
+ function property_upgrade0_9_17_686()
+ {
+ $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+ $GLOBALS['phpgw_setup']->oProc->query("SELECT * FROM fm_ns3420
ORDER BY id");
+
+ $ns3420 = array();
+ $id = 1;
+
+ while ($GLOBALS['phpgw_setup']->oProc->next_record())
+ {
+ $ns3420[]=array
+ (
+ 'id' => $id,
+ 'num' =>
$GLOBALS['phpgw_setup']->oProc->f('id'),
+ 'enhet' =>
$GLOBALS['phpgw_setup']->oProc->f('enhet'),
+ 'tekst1' =>
$GLOBALS['phpgw_setup']->oProc->f('tekst1'),
+ 'tekst2' =>
$GLOBALS['phpgw_setup']->oProc->f('tekst2'),
+ 'tekst3' =>
$GLOBALS['phpgw_setup']->oProc->f('tekst3'),
+ 'tekst4' =>
$GLOBALS['phpgw_setup']->oProc->f('tekst4'),
+ 'tekst5' =>
$GLOBALS['phpgw_setup']->oProc->f('tekst5'),
+ 'tekst6' =>
$GLOBALS['phpgw_setup']->oProc->f('tekst6'),
+ );
+ $id ++;
+ }
+
+ $GLOBALS['phpgw_setup']->oProc->DropTable('fm_ns3420');
+
+ $GLOBALS['phpgw_setup']->oProc->CreateTable(
+ 'fm_ns3420', array(
+ 'fd' => array(
+ 'id' => array('type' =>
'int','precision' => '4','nullable' => False),
+ 'num' => array('type' =>
'varchar','precision' => '20','nullable' => False),
+ 'parent_id' => array('type' =>
'int','precision' => '4','nullable' => True),
+ 'enhet' => array('type' =>
'varchar','precision' => '6','nullable' => True),
+ 'tekst1' => array('type' =>
'varchar','precision' => '50','nullable' => True),
+ 'tekst2' => array('type' =>
'varchar','precision' => '50','nullable' => True),
+ 'tekst3' => array('type' =>
'varchar','precision' => '50','nullable' => True),
+ 'tekst4' => array('type' =>
'varchar','precision' => '50','nullable' => True),
+ 'tekst5' => array('type' =>
'varchar','precision' => '50','nullable' => True),
+ 'tekst6' => array('type' =>
'varchar','precision' => '50','nullable' => True),
+ 'type' => array('type' =>
'varchar','precision' => '20','nullable' => True)
+ ),
+ 'pk' => array('id'),
+ 'fk' => array(),
+ 'ix' => array(),
+ 'uc' => array('num')
+ )
+ );
+
+ foreach ($ns3420 as $value_set)
+ {
+ $cols = implode(',', array_keys($value_set));
+ $values =
$GLOBALS['phpgw_setup']->oProc->validate_insert(array_values($value_set));
+ $sql = "INSERT INTO fm_ns3420 ({$cols}) VALUES
({$values})";
+
$GLOBALS['phpgw_setup']->oProc->query($sql,__LINE__,__FILE__);
+ }
+
+
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
+ $GLOBALS['setup_info']['property']['currentver'] =
'0.9.17.687';
+ return $GLOBALS['setup_info']['property']['currentver'];
+ }
+ }
+/**
+ * Update property version from 0.9.17.685 to 0.9.17.686
+ * Add controller-flag to entities
+ */
+ $test[] = '0.9.17.687';
+ function property_upgrade0_9_17_687()
+ {
+ $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_entity_category','enable_controller',array(
'type' => 'int',
'precision' => 2,
@@ -8185,7 +8324,7 @@
if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
{
- $GLOBALS['setup_info']['property']['currentver'] =
'0.9.17.686';
+ $GLOBALS['setup_info']['property']['currentver'] =
'0.9.17.688';
return $GLOBALS['setup_info']['property']['currentver'];
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [12974] prepare merge trunk to Syncromind,
Sigurd Nes <=