aboutsummaryrefslogtreecommitdiff
path: root/db/migrations/5.2.10_add_link_to_cw_structural_elements.php
blob: 81ffaf7392e1831388e4d9c24b5a680f0d8a5c2f (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
<?php

final class AddLinkToCwStructuralElements extends Migration
{
    public function description()
    {
        return 'Adds columns for link funtions to cw_structural_elements table';
    }

    public function up()
    {
        DBManager::get()->exec("
            ALTER TABLE `cw_structural_elements`
                ADD COLUMN `is_link` tinyint(1) NOT NULL AFTER `parent_id`,
                ADD COLUMN `target_id` int(11) DEFAULT NULL AFTER `is_link`
        ");
    }

    public function down()
    {
        DBManager::get()->exec("
            ALTER TABLE `cw_structural_elements`
                DROP COLUMN `is_link`,
                DROP COLUMN `target_id`
        ");
    }
}