~ubuntu-branches/debian/sid/php-horde-turba/sid

« back to all changes in this revision

Viewing changes to turba-4.1.1/migration/2_turba_upgrade_autoincrement.php

  • Committer: Package Import Robot
  • Author(s): Mathieu Parent
  • Date: 2013-08-11 13:16:25 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20130811131625-z91stjvq51jr9onv
Tags: 4.1.1-1
New upstream version 4.1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
/**
 
3
 * Adds autoincrement flags
 
4
 *
 
5
 * Copyright 2010-2013 Horde LLC (http://www.horde.org/)
 
6
 *
 
7
 * See the enclosed file LICENSE for license information (ASL).  If you
 
8
 * did not receive this file, see http://www.horde.org/licenses/apache.
 
9
 *
 
10
 * @author   Michael J. Rubinsky <mrubinsk@horde.org>
 
11
 * @category Horde
 
12
 * @license  http://www.horde.org/licenses/apache ASL
 
13
 * @package  Turba
 
14
 */
 
15
class TurbaUpgradeAutoIncrement extends Horde_Db_Migration_Base
 
16
{
 
17
    /**
 
18
     * Upgrade.
 
19
     */
 
20
    public function up()
 
21
    {
 
22
        $this->changeColumn('turba_shares', 'share_id', 'autoincrementKey');
 
23
        try {
 
24
            $this->dropTable('turba_shares_seq');
 
25
        } catch (Horde_Db_Exception $e) {
 
26
        }
 
27
    }
 
28
 
 
29
    /**
 
30
     * Downgrade
 
31
     */
 
32
    public function down()
 
33
    {
 
34
        $this->changeColumn('turba_shares', 'share_id', 'integer', array('autoincrement' => false));
 
35
    }
 
36
 
 
37
}