aboutsummaryrefslogtreecommitdiff
path: root/db/migrations/1.48_step_00174_plugin_interfaces.php
blob: 6478aa642fc9ddcccc779441a5c3c015c566c622 (plain)
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
<?
class Step00174PluginInterfaces extends Migration
{
    function description ()
    {
        return 'update database schema for plugin interfaces';
    }

    function up ()
    {
        $db = DBManager::get();

        $db->exec("ALTER TABLE plugins CHANGE plugintype
                      plugintype TEXT NOT NULL default ''");

        $db->exec("UPDATE plugins SET plugintype =
                      CONCAT(plugintype, 'Plugin')");
    }

    function down ()
    {
        $db = DBManager::get();

        $db->exec("UPDATE plugins SET plugintype =
                      TRIM(TRAILING 'Plugin' FROM plugintype)");

        $db->exec("ALTER TABLE plugins CHANGE plugintype
                      plugintype varchar(255) NOT NULL default 'Standard'");
    }
}
?>