Completed
Push — master ( 15567c...76f1ad )
by
unknown
02:43
created

CreateTestTable   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 21
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 6 1
A down() 0 6 1
1
<?php
2
/**
3
 * @copyright Bluz PHP Team
4
 * @link https://github.com/bluzphp/skeleton
5
 */
6
7
use Phinx\Migration\AbstractMigration;
8
9
/**
10
 * CreateTestTable
11
 */
12
class CreateTestTable 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...
13
{
14
    /**
15
     * Migrate Up.
16
     */
17
    public function up()
18
    {
19
        $this->execute('REPLACE INTO `acl_privileges` (`roleId`, `module`, `privilege`) VALUES (\'2\',\'test\',\'Create\'),(\'2\',\'test\',\'Delete\'),(\'2\',\'test\',\'Read\'),(\'2\',\'test\',\'Update\');');
20
        $this->execute('CREATE TABLE `test` (`id` bigint(20) NOT NULL AUTO_INCREMENT, `name` varchar(255) DEFAULT NULL, `email` varchar(512) DEFAULT NULL, `status` enum(\'active\',\'disable\',\'delete\') DEFAULT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB AUTO_INCREMENT=51 DEFAULT CHARSET=utf8;');
21
        $this->execute('REPLACE INTO `test`(`id`,`name`,`email`,`status`) VALUES (10,\'Jonah\',\'dictum@pharetra . ca\',\'disable\'),(11,\'Connor\',\'congue . In . scelerisque@Integervulputaterisus . ca\',\'disable\');');
22
    }
23
    /**
24
     * Migrate Down.
25
     */
26
    public function down()
27
    {
28
        $this->dropTable('test');
29
        $this->execute('DELETE FROM `auth` WHERE foreignKey=\'test\'');
30
        $this->execute('DELETE FROM `acl_privileges` WHERE module=\'test\'');
31
    }
32
}
33