PropelMigration_1475694269::getUpSQL()   B
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 34
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 34
rs 8.8571
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
/**
4
 * Data object containing the SQL and PHP code to migrate the database
5
 * up to version 1475694269.
6
 * Generated on 2016-10-05 22:04:29 
7
 */
8
class PropelMigration_1475694269
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...
9
{
10
    public $comment = '';
11
12
    public function preUp($manager)
0 ignored issues
show
Unused Code introduced by
The parameter $manager is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
13
    {
14
        // add the pre-migration code here
15
    }
16
17
    public function postUp($manager)
0 ignored issues
show
Unused Code introduced by
The parameter $manager is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
18
    {
19
        // add the post-migration code here
20
    }
21
22
    public function preDown($manager)
0 ignored issues
show
Unused Code introduced by
The parameter $manager is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
23
    {
24
        // add the pre-migration code here
25
    }
26
27
    public function postDown($manager)
0 ignored issues
show
Unused Code introduced by
The parameter $manager is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
28
    {
29
        // add the post-migration code here
30
    }
31
32
    /**
33
     * Get the SQL statements for the Up migration
34
     *
35
     * @return array list of the SQL strings to execute for the Up migration
36
     *               the keys being the datasources
37
     */
38
    public function getUpSQL()
39
    {
40
        return array (
41
  'default' => '
42
# This is a fix for InnoDB in MySQL >= 4.1.x
43
# It "suspends judgement" for fkey relationships until are tables are set.
44
SET FOREIGN_KEY_CHECKS = 0;
45
46
CREATE TABLE `tasks`
47
(
48
    `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
49
    `created_at` DATETIME,
50
    `updated_at` DATETIME,
51
    PRIMARY KEY (`id`)
52
) ENGINE=InnoDB;
53
54
CREATE TABLE `users`
55
(
56
    `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
57
    `name` VARCHAR(255) NOT NULL,
58
    `email` VARCHAR(255) NOT NULL,
59
    `password` VARCHAR(255) NOT NULL,
60
    `remember_token` VARCHAR(100),
61
    `created_at` DATETIME,
62
    `updated_at` DATETIME,
63
    PRIMARY KEY (`id`),
64
    UNIQUE INDEX `users_email_unique` (`email`)
65
) ENGINE=InnoDB;
66
67
# This restores the fkey checks, after having unset them earlier
68
SET FOREIGN_KEY_CHECKS = 1;
69
',
70
);
71
    }
72
73
    /**
74
     * Get the SQL statements for the Down migration
75
     *
76
     * @return array list of the SQL strings to execute for the Down migration
77
     *               the keys being the datasources
78
     */
79
    public function getDownSQL()
80
    {
81
        return array (
82
  'default' => '
83
# This is a fix for InnoDB in MySQL >= 4.1.x
84
# It "suspends judgement" for fkey relationships until are tables are set.
85
SET FOREIGN_KEY_CHECKS = 0;
86
87
DROP TABLE IF EXISTS `tasks`;
88
89
DROP TABLE IF EXISTS `users`;
90
91
# This restores the fkey checks, after having unset them earlier
92
SET FOREIGN_KEY_CHECKS = 1;
93
',
94
);
95
    }
96
97
}