Completed
Push — master ( 6b9e70...ab978f )
by dima
02:42
created

PropelMigration_1475520687::getUpSQL()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 23
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 23
rs 9.0856
c 0
b 0
f 0
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 1475520687.
6
 * Generated on 2016-10-03 21:51:27 
7
 */
8
class PropelMigration_1475520687
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
DROP TABLE IF EXISTS `migrations`;
47
48
DROP TABLE IF EXISTS `password_resets`;
49
50
ALTER TABLE `tasks`
51
52
  DROP `name`,
53
54
  DROP `user_id`;
55
56
# This restores the fkey checks, after having unset them earlier
57
SET FOREIGN_KEY_CHECKS = 1;
58
',
59
);
60
    }
61
62
    /**
63
     * Get the SQL statements for the Down migration
64
     *
65
     * @return array list of the SQL strings to execute for the Down migration
66
     *               the keys being the datasources
67
     */
68
    public function getDownSQL()
69
    {
70
        return array (
71
  'default' => '
72
# This is a fix for InnoDB in MySQL >= 4.1.x
73
# It "suspends judgement" for fkey relationships until are tables are set.
74
SET FOREIGN_KEY_CHECKS = 0;
75
76
ALTER TABLE `tasks`
77
78
  ADD `name` VARCHAR(50) AFTER `updated_at`,
79
80
  ADD `user_id` INTEGER AFTER `name`;
81
82
CREATE TABLE `migrations`
83
(
84
    `migration` VARCHAR(255) NOT NULL,
85
    `batch` INTEGER NOT NULL
86
) ENGINE=InnoDB;
87
88
CREATE TABLE `password_resets`
89
(
90
    `email` VARCHAR(255) NOT NULL,
91
    `token` VARCHAR(255) NOT NULL,
92
    `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
93
    INDEX `password_resets_email_index` (`email`),
94
    INDEX `password_resets_token_index` (`token`)
95
) ENGINE=InnoDB;
96
97
# This restores the fkey checks, after having unset them earlier
98
SET FOREIGN_KEY_CHECKS = 1;
99
',
100
);
101
    }
102
103
}