Test Failed
Push — develop ( 5be0e5...3f5c00 )
by Paul
14:23
created

TableTmp::dropForeignConstraints()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 0
dl 0
loc 2
rs 10
c 1
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace GeminiLabs\SiteReviews\Database\Tables;
4
5
use GeminiLabs\SiteReviews\Database\Query;
6
use GeminiLabs\SiteReviews\Database\Tables;
7
8
class TableTmp extends AbstractTable
9
{
10
    public string $name = 'tmp';
11
12
    public function addForeignConstraints(): void
13
    {
14
    }
15
16
    public function dropForeignConstraints(): void
17
    {
18
    }
19
20
    public function removeInvalidRows(): void
21
    {
22
    }
23
24
    /**
25
     * WordPress codex says there must be two spaces between PRIMARY KEY and the key definition.
26
     *
27
     * @see https://codex.wordpress.org/Creating_Tables_with_Plugins
28
     */
29
    public function structure(): string
30
    {
31
        $max_index_length = 191;
0 ignored issues
show
Unused Code introduced by
The assignment to $max_index_length is dead and can be removed.
Loading history...
32
        return glsr(Query::class)->sql("
33
            CREATE TABLE {$this->tablename} (
34
                ID bigint(20) unsigned NOT NULL AUTO_INCREMENT,
35
                type varchar(20) NOT NULL,
36
                data longtext NOT NULL,
37
                PRIMARY KEY  (ID),
38
                KEY type (type)
39
            ) ENGINE=InnoDB {$this->db->get_charset_collate()};
40
        ");
41
    }
42
}
43