Code Duplication    Length = 44-44 lines in 2 locations

migrations/m161031_092433_create_flow_table.php 1 location

@@ 9-52 (lines=44) @@
6
 * Handles the creation of table `flow`.
7
 */
8
// @codingStandardsIgnoreLine
9
class m161031_092433_create_flow_table extends Migration
10
{
11
    /**
12
     * {@inheritdoc}
13
     */
14
    public function up()
15
    {
16
        $tableOptions = null;
17
        if ($this->db->driverName === 'mysql') {
18
            $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';
19
        }
20
21
        $this->createTable('flow', [
22
            'id' => $this->primaryKey()->notNull()->append('AUTO_INCREMENT'),
23
            'name' => $this->string(64)->notNull(),
24
            'description' => $this->string(1024),
25
            'parent_id' => $this->integer(),
26
        ], $tableOptions);
27
28
        $this->createIndex(
29
            'fk_flow_flow1_idx',
30
            'flow',
31
            'parent_id'
32
        );
33
34
        $this->addForeignKey(
35
            'fk_flow_flow1',
36
            'flow',
37
            'parent_id',
38
            'flow',
39
            'id',
40
            'SET NULL',
41
            'SET NULL'
42
        );
43
    }
44
45
    /**
46
     * {@inheritdoc}
47
     */
48
    public function down()
49
    {
50
        $this->dropTable('flow');
51
    }
52
}
53

migrations/m161031_104144_create_screen_template_table.php 1 location

@@ 9-52 (lines=44) @@
6
 * Handles the creation of table `screen_template`.
7
 */
8
// @codingStandardsIgnoreLine
9
class m161031_104144_create_screen_template_table extends Migration
10
{
11
    /**
12
     * {@inheritdoc}
13
     */
14
    public function up()
15
    {
16
        $tableOptions = null;
17
        if ($this->db->driverName === 'mysql') {
18
            $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';
19
        }
20
21
        $this->createTable('screen_template', [
22
            'id' => $this->primaryKey()->notNull()->append('AUTO_INCREMENT'),
23
            'name' => $this->string(64)->notNull(),
24
            'background_id' => $this->integer(),
25
            'css' => $this->text(),
26
        ], $tableOptions);
27
28
        $this->createIndex(
29
            'fk_screen_template_template_background1_idx',
30
            'screen_template',
31
            'background_id'
32
        );
33
34
        $this->addForeignKey(
35
            'fk_screen_template_template_background1',
36
            'screen_template',
37
            'background_id',
38
            'template_background',
39
            'id',
40
            'CASCADE',
41
            'CASCADE'
42
        );
43
    }
44
45
    /**
46
     * {@inheritdoc}
47
     */
48
    public function down()
49
    {
50
        $this->dropTable('screen_template');
51
    }
52
}
53