1<?php
2class HordePermsBaseTables extends Horde_Db_Migration_Base
3{
4    public function up()
5    {
6        if (!in_array('horde_perms', $this->tables())) {
7            $t = $this->createTable('horde_perms', array('autoincrementKey' => array('perm_id')));
8            $t->column('perm_id', 'integer', array('null' => false));
9            $t->column('perm_name', 'string', array('limit' => 255, 'null' => false));
10            $t->column('perm_parents', 'string', array('limit' => 255, 'null' => false));
11            $t->column('perm_data', 'text');
12            $t->end();
13            $this->addIndex('horde_perms', array('perm_name'), array('unique' => true));
14        }
15    }
16
17    public function down()
18    {
19        $this->dropTable('horde_perms');
20    }
21}
22