/
1_klutz_base_tables.php
40 lines (38 loc) · 1.28 KB
/
1_klutz_base_tables.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
/**
* Create Klutz base tables (as of Klutz 2.x).
*
* Copyright 2010-2016 Horde LLC (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (GPL). If you
* did not receive this file, see http://www.horde.org/licenses/gpl.
*
* @author Chuck Hagenbuch <chuck@horde.org>
* @category Horde
* @license http://www.horde.org/licenses/gpl GPL
* @package Klutz
*/
class KlutzBaseTables extends Horde_Db_Migration_Base
{
/**
* Upgrade.
*/
public function up()
{
$tableList = $this->tables();
if (!in_array('klutz_comics', $tableList)) {
$t = $this->createTable('klutz_comics', array('autoincrementKey' => 'comicpic_id'));
$t->column('comicpic_date', 'integer', array('null' => false));
$t->column('comicpic_key', 'string', array('limit' => 255, 'null' => false));
$t->column('comicpic_hash', 'string', array('limit' => 255, 'null' => false));
$t->end();
$this->addIndex('klutz_comics', array('comicpic_date', 'comicpic_hash'));
$this->addIndex('klutz_comics', array('comicpic_key'));
$this->addIndex('klutz_comics', array('comicpic_hash'));
}
}
public function down()
{
$this->dropTable('klutz_comics');
}
}