Completed
Push — master ( 33443d...de9a4e )
by Sam
03:47
created

PropelMigration_1455269307   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 84
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0
Metric Value
wmc 6
lcom 0
cbo 0
dl 0
loc 84
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A preUp() 0 4 1
A postUp() 0 4 1
A preDown() 0 4 1
A postDown() 0 4 1
A getUpSQL() 0 12 1
B getDownSQL() 0 33 1
1
<?php
2
3
/**
4
 * Data object containing the SQL and PHP code to migrate the database
5
 * up to version 1455269307.
6
 * Generated on 2016-02-12 09:28:27 by vagrant
7
 */
8
class PropelMigration_1455269307
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
  'tvheadend_status_manager' => '
42
PRAGMA foreign_keys = OFF;
43
44
ALTER TABLE [subscription] ADD [input_id] INTEGER;
45
46
PRAGMA foreign_keys = ON;
47
',
48
);
49
    }
50
51
    /**
52
     * Get the SQL statements for the Down migration
53
     *
54
     * @return array list of the SQL strings to execute for the Down migration
55
     *               the keys being the datasources
56
     */
57
    public function getDownSQL()
58
    {
59
        return array (
60
  'tvheadend_status_manager' => '
61
PRAGMA foreign_keys = OFF;
62
63
CREATE TEMPORARY TABLE [subscription__temp__56bda5bb0fcd8] AS SELECT [id],[instance_name],[input_id],[user_id],[channel_id],[subscription_id],[started],[stopped],[title],[service] FROM [subscription];
64
DROP TABLE [subscription];
65
66
CREATE TABLE [subscription]
67
(
68
    [id] INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
69
    [instance_name] VARCHAR(255) NOT NULL,
70
    [user_id] INTEGER,
71
    [channel_id] INTEGER NOT NULL,
72
    [subscription_id] INTEGER NOT NULL,
73
    [started] TIMESTAMP NOT NULL,
74
    [stopped] TIMESTAMP,
75
    [title] VARCHAR(255) NOT NULL,
76
    [service] VARCHAR(255) NOT NULL,
77
    UNIQUE ([id]),
78
    FOREIGN KEY ([channel_id]) REFERENCES [channel] ([id]),
79
    FOREIGN KEY ([user_id]) REFERENCES [user] ([id]),
80
    FOREIGN KEY ([instance_name]) REFERENCES [instance] ([name])
81
);
82
83
INSERT INTO [subscription] (id, instance_name, user_id, channel_id, subscription_id, started, stopped, title, service) SELECT id, instance_name, user_id, channel_id, subscription_id, started, stopped, title, service FROM [subscription__temp__56bda5bb0fcd8];
84
DROP TABLE [subscription__temp__56bda5bb0fcd8];
85
86
PRAGMA foreign_keys = ON;
87
',
88
);
89
    }
90
91
}