aboutsummaryrefslogtreecommitdiff
path: root/db/migrations/1.270_tic8458_add_upload_description.php
blob: 5b26b2493c71698b90780c361fa01f389de525a0 (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
35
36
<?php


class Tic8458AddUploadDescription extends Migration
{
    public function up()
    {
        $db = DBManager::get();

        $db->exec(
            "INSERT INTO `config`
            (`field`, `value`, `type`, `range`, `section`, `mkdate`, `chdate`,
            `description`)
            VALUES
            ('ENABLE_DESCRIPTION_ENTRY_ON_UPLOAD', '1', 'boolean', 'global', 'files', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(),
            'Whether to allow adding a description directly after file upload (true) or not (false). Defaults to true.')"
        );
    }


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

        $db->exec(
            "DELETE FROM `config`
            WHERE `field` = 'ENABLE_DESCRIPTION_ENTRY_ON_UPLOAD'"
        );
    }


    public function description()
    {
        return 'Adds the configuration entry ENABLE_DESCRIPTION_ENTRY_ON_UPLOAD to make it possible to enter a file description directly after uploading the file(s).';
    }
}