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 |
|
|
|
|
9
|
|
|
{ |
10
|
|
|
public $comment = ''; |
11
|
|
|
|
12
|
|
|
public function preUp($manager) |
|
|
|
|
13
|
|
|
{ |
14
|
|
|
// add the pre-migration code here |
15
|
|
|
} |
16
|
|
|
|
17
|
|
|
public function postUp($manager) |
|
|
|
|
18
|
|
|
{ |
19
|
|
|
// add the post-migration code here |
20
|
|
|
} |
21
|
|
|
|
22
|
|
|
public function preDown($manager) |
|
|
|
|
23
|
|
|
{ |
24
|
|
|
// add the pre-migration code here |
25
|
|
|
} |
26
|
|
|
|
27
|
|
|
public function postDown($manager) |
|
|
|
|
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
|
|
|
} |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.