• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

codeigniter4 / settings / 17488284278

05 Sep 2025 08:41AM UTC coverage: 85.088% (-0.4%) from 85.526%
17488284278

push

github

web-flow
update workflow for PHPUnit (#151)

194 of 228 relevant lines covered (85.09%)

18.6 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/src/Database/Migrations/2021-07-04-041948_CreateSettingsTable.php
1
<?php
2

3
namespace CodeIgniter\Settings\Database\Migrations;
4

5
use CodeIgniter\Database\Forge;
6
use CodeIgniter\Database\Migration;
7
use CodeIgniter\Settings\Config\Settings;
8

9
class CreateSettingsTable extends Migration
10
{
11
    private Settings $config;
12

13
    public function __construct(?Forge $forge = null)
14
    {
15
        $this->config  = config('Settings');
30✔
16
        $this->DBGroup = $this->config->database['group'] ?? null;
30✔
17

18
        parent::__construct($forge);
30✔
19
    }
20

21
    public function up()
22
    {
23
        $this->forge->addField('id');
30✔
24
        $this->forge->addField([
30✔
25
            'class' => [
30✔
26
                'type'       => 'varchar',
30✔
27
                'constraint' => 255,
30✔
28
            ],
30✔
29
            'key' => [
30✔
30
                'type'       => 'varchar',
30✔
31
                'constraint' => 255,
30✔
32
            ],
30✔
33
            'value' => [
30✔
34
                'type' => 'text',
30✔
35
                'null' => true,
30✔
36
            ],
30✔
37
            'type' => [
30✔
38
                'type'       => 'varchar',
30✔
39
                'constraint' => 31,
30✔
40
                'default'    => 'string',
30✔
41
            ],
30✔
42
            'created_at' => [
30✔
43
                'type' => 'datetime',
30✔
44
                'null' => false,
30✔
45
            ],
30✔
46
            'updated_at' => [
30✔
47
                'type' => 'datetime',
30✔
48
                'null' => false,
30✔
49
            ],
30✔
50
        ]);
30✔
51
        $this->forge->createTable($this->config->database['table'], true);
30✔
52
    }
53

54
    public function down()
55
    {
56
        $this->forge->dropTable($this->config->database['table']);
28✔
57
    }
58
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc