Missed this field when upgrade scripts refactored to migrations.
authorMichael J. Rubinsky <mrubinsk@horde.org>
Tue, 19 Oct 2010 03:44:26 +0000 (23:44 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Tue, 19 Oct 2010 03:45:08 +0000 (23:45 -0400)
kronolith/migration/14_kronolith_upgrade_missingresourcefield.php [new file with mode: 0644]

diff --git a/kronolith/migration/14_kronolith_upgrade_missingresourcefield.php b/kronolith/migration/14_kronolith_upgrade_missingresourcefield.php
new file mode 100644 (file)
index 0000000..585650d
--- /dev/null
@@ -0,0 +1,37 @@
+<?php
+/**
+ * Adds event_resource field
+ *
+ * Copyright 2010 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @author   Michael J. Rubinsky <mrubinsk@horde.org>
+ * @category Horde
+ * @license  http://www.fsf.org/copyleft/gpl.html GPL
+ * @package  Kronolith
+ */
+class KronolithUpgradeMissingResourceField extends Horde_Db_Migration_Base
+{
+    /**
+     * Upgrade.
+     */
+    public function up()
+    {
+        $t = $this->_connection->table('kronolith_events');
+        $cols = $t->getColumns();
+        if (!in_array('event_resources', array_keys($cols))) {
+            $this->addColumn('kronolith_events', 'event_resources', 'text');
+        }
+    }
+
+    /**
+     * Downgrade
+     */
+    public function down()
+    {
+        $this->removeColumn('kronolith_events', 'event_resources');
+    }
+
+}
\ No newline at end of file