Passed
Push — develop ( 788941...24632c )
by Anton
13:36
created

PagesData::down()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
use Phinx\Migration\AbstractMigration;
4
5
class PagesData extends AbstractMigration
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
6
{
7
    /**
8
     * Migrate Up.
9
     */
10
    public function up()
11
    {
12
        $data = [
13
            [
14
                'title' => 'About',
15
                'alias' => 'about',
16
                'content' => '<p>Describe your site here!</p>',
17
                'keywords' => 'about, help',
18
                'description' => 'About service',
19
                'created' => date('Y-m-d H:i:s'),
20
                'userId' => 1
21
            ],
22
            [
23
                'title' => 'Terms and conditions',
24
                'alias' => 'terms-and-conditions',
25
                'content' => '<p>Place your terms and conditions here!</p>',
26
                'keywords' => 'terms, conditions',
27
                'description' => 'Terms and conditions',
28
                'created' => date('Y-m-d H:i:s'),
29
                'userId' => 1
30
            ],
31
            [
32
                'title' => 'Legal notices',
33
                'alias' => 'legal-notices',
34
                'content' => '<p>Place legal notices here!</p>',
35
                'keywords' => 'legal notices',
36
                'description' => 'Legal notices',
37
                'created' => date('Y-m-d H:i:s'),
38
                'userId' => 1
39
            ]
40
        ];
41
42
        $pages = $this->table('pages');
43
        $pages->insert($data)
44
            ->save();
45
    }
46
47
    /**
48
     * Migrate Down.
49
     */
50
    public function down()
51
    {
52
        $this->execute('DELETE FROM pages');
53
    }
54
}
55