aboutsummaryrefslogtreecommitdiff
path: root/db/migrations/6.2.3_add_short_urls.php
blob: eea9548e90f4754d6e52647605bd7a18c1b2a44b (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
32
33
34
<?php

/**
 * Description of class.
 * Second line
 */
final class AddShortUrls extends Migration
{
    public function description()
    {
        return 'Adds the short_urls table.';
    }

    public function up()
    {
        DBManager::get()->exec(
            "CREATE TABLE IF NOT EXISTS short_urls (
                id INT PRIMARY KEY NOT NULL AUTO_INCREMENT,
                alias VARCHAR(255) UNIQUE NOT NULL,
                path VARCHAR(255) NOT NULL,
                title VARCHAR(255) NOT NULL,
                user_id VARCHAR(32) COLLATE latin1_bin NOT NULL,
                mkdate INT(11) UNSIGNED NOT NULL,
                chdate INT(11) UNSIGNED NOT NULL
            )"
        );
    }


    public function down()
    {
        DBManager::get()->exec("DROP TABLE short_urls");
    }
}