@@ -15,9 +15,9 @@ discard block |
||
15 | 15 | $stages = glob(EE_CORE . 'data_migration_scripts/4_10_0_stages/*'); |
16 | 16 | $class_to_filepath = []; |
17 | 17 | foreach ($stages as $filepath) { |
18 | - $matches = []; |
|
19 | - preg_match('~4_10_0_stages/(.*).dmsstage.php~', $filepath, $matches); |
|
20 | - $class_to_filepath[ $matches[1] ] = $filepath; |
|
18 | + $matches = []; |
|
19 | + preg_match('~4_10_0_stages/(.*).dmsstage.php~', $filepath, $matches); |
|
20 | + $class_to_filepath[ $matches[1] ] = $filepath; |
|
21 | 21 | } |
22 | 22 | // give addons a chance to autoload their stages too |
23 | 23 | $class_to_filepath = apply_filters('FHEE__EE_DMS_4_10_0__autoloaded_stages', $class_to_filepath); |
@@ -35,67 +35,67 @@ discard block |
||
35 | 35 | */ |
36 | 36 | class EE_DMS_Core_4_10_0 extends EE_Data_Migration_Script_Base |
37 | 37 | { |
38 | - /** |
|
39 | - * |
|
40 | - * @param TableManager $table_manager |
|
41 | - * @param TableAnalysis $table_analysis |
|
42 | - */ |
|
43 | - public function __construct( |
|
44 | - TableManager $table_manager = null, |
|
45 | - TableAnalysis $table_analysis = null, |
|
46 | - EE_DMS_Core_4_9_0 $dms_4_9 |
|
47 | - ) { |
|
48 | - $this->previous_dms = $dms_4_9; |
|
49 | - $this->_pretty_name = esc_html__("Data Update to Event Espresso 4.10.0", "event_espresso"); |
|
50 | - $this->_priority = 10; |
|
51 | - $this->_migration_stages = array( |
|
52 | - new EE_DMS_4_10_0_Event_Question_Group(), |
|
53 | - ); |
|
54 | - parent::__construct($table_manager, $table_analysis); |
|
55 | - } |
|
38 | + /** |
|
39 | + * |
|
40 | + * @param TableManager $table_manager |
|
41 | + * @param TableAnalysis $table_analysis |
|
42 | + */ |
|
43 | + public function __construct( |
|
44 | + TableManager $table_manager = null, |
|
45 | + TableAnalysis $table_analysis = null, |
|
46 | + EE_DMS_Core_4_9_0 $dms_4_9 |
|
47 | + ) { |
|
48 | + $this->previous_dms = $dms_4_9; |
|
49 | + $this->_pretty_name = esc_html__("Data Update to Event Espresso 4.10.0", "event_espresso"); |
|
50 | + $this->_priority = 10; |
|
51 | + $this->_migration_stages = array( |
|
52 | + new EE_DMS_4_10_0_Event_Question_Group(), |
|
53 | + ); |
|
54 | + parent::__construct($table_manager, $table_analysis); |
|
55 | + } |
|
56 | 56 | |
57 | 57 | |
58 | 58 | |
59 | - /** |
|
60 | - * Whether to migrate or not. |
|
61 | - * |
|
62 | - * @param array $version_array |
|
63 | - * @return bool |
|
64 | - */ |
|
65 | - public function can_migrate_from_version($version_array) |
|
66 | - { |
|
67 | - $version_string = $version_array['Core']; |
|
68 | - if (version_compare($version_string, '4.10.0.rc.000', '<') && version_compare($version_string, '4.9.0', '>=')) { |
|
69 | - // echo "$version_string can be migrated from"; |
|
70 | - return true; |
|
71 | - } elseif (! $version_string) { |
|
72 | - // echo "no version string provided: $version_string"; |
|
73 | - // no version string provided... this must be pre 4.3 |
|
74 | - return false;// changed mind. dont want people thinking they should migrate yet because they cant |
|
75 | - } |
|
76 | - return false; |
|
77 | - } |
|
59 | + /** |
|
60 | + * Whether to migrate or not. |
|
61 | + * |
|
62 | + * @param array $version_array |
|
63 | + * @return bool |
|
64 | + */ |
|
65 | + public function can_migrate_from_version($version_array) |
|
66 | + { |
|
67 | + $version_string = $version_array['Core']; |
|
68 | + if (version_compare($version_string, '4.10.0.rc.000', '<') && version_compare($version_string, '4.9.0', '>=')) { |
|
69 | + // echo "$version_string can be migrated from"; |
|
70 | + return true; |
|
71 | + } elseif (! $version_string) { |
|
72 | + // echo "no version string provided: $version_string"; |
|
73 | + // no version string provided... this must be pre 4.3 |
|
74 | + return false;// changed mind. dont want people thinking they should migrate yet because they cant |
|
75 | + } |
|
76 | + return false; |
|
77 | + } |
|
78 | 78 | |
79 | 79 | |
80 | 80 | |
81 | - /** |
|
82 | - * @return bool |
|
83 | - */ |
|
84 | - public function schema_changes_before_migration() |
|
85 | - { |
|
86 | - require_once(EE_HELPERS . 'EEH_Activation.helper.php'); |
|
87 | - $now_in_mysql = current_time('mysql', true); |
|
88 | - $table_name = 'esp_answer'; |
|
89 | - $sql = " ANS_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
81 | + /** |
|
82 | + * @return bool |
|
83 | + */ |
|
84 | + public function schema_changes_before_migration() |
|
85 | + { |
|
86 | + require_once(EE_HELPERS . 'EEH_Activation.helper.php'); |
|
87 | + $now_in_mysql = current_time('mysql', true); |
|
88 | + $table_name = 'esp_answer'; |
|
89 | + $sql = " ANS_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
90 | 90 | REG_ID int(10) unsigned NOT NULL, |
91 | 91 | QST_ID int(10) unsigned NOT NULL, |
92 | 92 | ANS_value text NOT NULL, |
93 | 93 | PRIMARY KEY (ANS_ID), |
94 | 94 | KEY REG_ID (REG_ID), |
95 | 95 | KEY QST_ID (QST_ID)"; |
96 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
97 | - $table_name = 'esp_attendee_meta'; |
|
98 | - $sql = "ATTM_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
96 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
97 | + $table_name = 'esp_attendee_meta'; |
|
98 | + $sql = "ATTM_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
99 | 99 | ATT_ID bigint(20) unsigned NOT NULL, |
100 | 100 | ATT_fname varchar(45) NOT NULL, |
101 | 101 | ATT_lname varchar(45) NOT NULL, |
@@ -112,9 +112,9 @@ discard block |
||
112 | 112 | KEY ATT_email (ATT_email(191)), |
113 | 113 | KEY ATT_lname (ATT_lname), |
114 | 114 | KEY ATT_fname (ATT_fname)"; |
115 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB '); |
|
116 | - $table_name = 'esp_checkin'; |
|
117 | - $sql = "CHK_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
115 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB '); |
|
116 | + $table_name = 'esp_checkin'; |
|
117 | + $sql = "CHK_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
118 | 118 | REG_ID int(10) unsigned NOT NULL, |
119 | 119 | DTT_ID int(10) unsigned NOT NULL, |
120 | 120 | CHK_in tinyint(1) unsigned NOT NULL DEFAULT 1, |
@@ -122,9 +122,9 @@ discard block |
||
122 | 122 | PRIMARY KEY (CHK_ID), |
123 | 123 | KEY REG_ID (REG_ID), |
124 | 124 | KEY DTT_ID (DTT_ID)"; |
125 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
126 | - $table_name = 'esp_country'; |
|
127 | - $sql = "CNT_ISO varchar(2) NOT NULL, |
|
125 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
126 | + $table_name = 'esp_country'; |
|
127 | + $sql = "CNT_ISO varchar(2) NOT NULL, |
|
128 | 128 | CNT_ISO3 varchar(3) NOT NULL, |
129 | 129 | RGN_ID tinyint(3) unsigned DEFAULT NULL, |
130 | 130 | CNT_name varchar(45) NOT NULL, |
@@ -140,29 +140,29 @@ discard block |
||
140 | 140 | CNT_is_EU tinyint(1) DEFAULT '0', |
141 | 141 | CNT_active tinyint(1) DEFAULT '0', |
142 | 142 | PRIMARY KEY (CNT_ISO)"; |
143 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
144 | - $table_name = 'esp_currency'; |
|
145 | - $sql = "CUR_code varchar(6) NOT NULL, |
|
143 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
144 | + $table_name = 'esp_currency'; |
|
145 | + $sql = "CUR_code varchar(6) NOT NULL, |
|
146 | 146 | CUR_single varchar(45) DEFAULT 'dollar', |
147 | 147 | CUR_plural varchar(45) DEFAULT 'dollars', |
148 | 148 | CUR_sign varchar(45) DEFAULT '$', |
149 | 149 | CUR_dec_plc varchar(1) NOT NULL DEFAULT '2', |
150 | 150 | CUR_active tinyint(1) DEFAULT '0', |
151 | 151 | PRIMARY KEY (CUR_code)"; |
152 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
153 | - // note: although this table is no longer in use, |
|
154 | - // it hasn't been removed because then queries to the model will have errors. |
|
155 | - // but you should expect this table and its corresponding model to be removed in |
|
156 | - // the next few months |
|
157 | - $table_name = 'esp_currency_payment_method'; |
|
158 | - $sql = "CPM_ID int(11) NOT NULL AUTO_INCREMENT, |
|
152 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
153 | + // note: although this table is no longer in use, |
|
154 | + // it hasn't been removed because then queries to the model will have errors. |
|
155 | + // but you should expect this table and its corresponding model to be removed in |
|
156 | + // the next few months |
|
157 | + $table_name = 'esp_currency_payment_method'; |
|
158 | + $sql = "CPM_ID int(11) NOT NULL AUTO_INCREMENT, |
|
159 | 159 | CUR_code varchar(6) NOT NULL, |
160 | 160 | PMD_ID int(11) NOT NULL, |
161 | 161 | PRIMARY KEY (CPM_ID), |
162 | 162 | KEY PMD_ID (PMD_ID)"; |
163 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB '); |
|
164 | - $table_name = 'esp_datetime'; |
|
165 | - $sql = "DTT_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
163 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB '); |
|
164 | + $table_name = 'esp_datetime'; |
|
165 | + $sql = "DTT_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
166 | 166 | EVT_ID bigint(20) unsigned NOT NULL, |
167 | 167 | DTT_name varchar(255) NOT NULL DEFAULT '', |
168 | 168 | DTT_description text NOT NULL, |
@@ -179,25 +179,25 @@ discard block |
||
179 | 179 | KEY DTT_EVT_start (DTT_EVT_start), |
180 | 180 | KEY EVT_ID (EVT_ID), |
181 | 181 | KEY DTT_is_primary (DTT_is_primary)"; |
182 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
183 | - $table_name = "esp_datetime_ticket"; |
|
184 | - $sql = "DTK_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
182 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
183 | + $table_name = "esp_datetime_ticket"; |
|
184 | + $sql = "DTK_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
185 | 185 | DTT_ID int(10) unsigned NOT NULL, |
186 | 186 | TKT_ID int(10) unsigned NOT NULL, |
187 | 187 | PRIMARY KEY (DTK_ID), |
188 | 188 | KEY DTT_ID (DTT_ID), |
189 | 189 | KEY TKT_ID (TKT_ID)"; |
190 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
191 | - $table_name = 'esp_event_message_template'; |
|
192 | - $sql = "EMT_ID bigint(20) unsigned NOT NULL AUTO_INCREMENT, |
|
190 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
191 | + $table_name = 'esp_event_message_template'; |
|
192 | + $sql = "EMT_ID bigint(20) unsigned NOT NULL AUTO_INCREMENT, |
|
193 | 193 | EVT_ID bigint(20) unsigned NOT NULL DEFAULT 0, |
194 | 194 | GRP_ID int(10) unsigned NOT NULL DEFAULT 0, |
195 | 195 | PRIMARY KEY (EMT_ID), |
196 | 196 | KEY EVT_ID (EVT_ID), |
197 | 197 | KEY GRP_ID (GRP_ID)"; |
198 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
199 | - $table_name = 'esp_event_meta'; |
|
200 | - $sql = "EVTM_ID int(10) NOT NULL AUTO_INCREMENT, |
|
198 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
199 | + $table_name = 'esp_event_meta'; |
|
200 | + $sql = "EVTM_ID int(10) NOT NULL AUTO_INCREMENT, |
|
201 | 201 | EVT_ID bigint(20) unsigned NOT NULL, |
202 | 202 | EVT_display_desc tinyint(1) unsigned NOT NULL DEFAULT 1, |
203 | 203 | EVT_display_ticket_selector tinyint(1) unsigned NOT NULL DEFAULT 1, |
@@ -212,9 +212,9 @@ discard block |
||
212 | 212 | EVT_donations tinyint(1) NULL, |
213 | 213 | PRIMARY KEY (EVTM_ID), |
214 | 214 | KEY EVT_ID (EVT_ID)"; |
215 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
216 | - $table_name = 'esp_event_question_group'; |
|
217 | - $sql = "EQG_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
215 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
216 | + $table_name = 'esp_event_question_group'; |
|
217 | + $sql = "EQG_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
218 | 218 | EVT_ID bigint(20) unsigned NOT NULL, |
219 | 219 | QSG_ID int(10) unsigned NOT NULL, |
220 | 220 | EQG_primary tinyint(1) unsigned NOT NULL DEFAULT 0, |
@@ -222,25 +222,25 @@ discard block |
||
222 | 222 | PRIMARY KEY (EQG_ID), |
223 | 223 | KEY EVT_ID (EVT_ID), |
224 | 224 | KEY QSG_ID (QSG_ID)"; |
225 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
226 | - $table_name = 'esp_event_venue'; |
|
227 | - $sql = "EVV_ID int(11) NOT NULL AUTO_INCREMENT, |
|
225 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
226 | + $table_name = 'esp_event_venue'; |
|
227 | + $sql = "EVV_ID int(11) NOT NULL AUTO_INCREMENT, |
|
228 | 228 | EVT_ID bigint(20) unsigned NOT NULL, |
229 | 229 | VNU_ID bigint(20) unsigned NOT NULL, |
230 | 230 | EVV_primary tinyint(1) unsigned NOT NULL DEFAULT 0, |
231 | 231 | PRIMARY KEY (EVV_ID)"; |
232 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
233 | - $table_name = 'esp_extra_meta'; |
|
234 | - $sql = "EXM_ID int(11) NOT NULL AUTO_INCREMENT, |
|
232 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
233 | + $table_name = 'esp_extra_meta'; |
|
234 | + $sql = "EXM_ID int(11) NOT NULL AUTO_INCREMENT, |
|
235 | 235 | OBJ_ID int(11) DEFAULT NULL, |
236 | 236 | EXM_type varchar(45) DEFAULT NULL, |
237 | 237 | EXM_key varchar(45) DEFAULT NULL, |
238 | 238 | EXM_value text, |
239 | 239 | PRIMARY KEY (EXM_ID), |
240 | 240 | KEY EXM_type (EXM_type,OBJ_ID,EXM_key)"; |
241 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
242 | - $table_name = 'esp_extra_join'; |
|
243 | - $sql = "EXJ_ID int(11) NOT NULL AUTO_INCREMENT, |
|
241 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
242 | + $table_name = 'esp_extra_join'; |
|
243 | + $sql = "EXJ_ID int(11) NOT NULL AUTO_INCREMENT, |
|
244 | 244 | EXJ_first_model_id varchar(6) NOT NULL, |
245 | 245 | EXJ_first_model_name varchar(20) NOT NULL, |
246 | 246 | EXJ_second_model_id varchar(6) NOT NULL, |
@@ -248,9 +248,9 @@ discard block |
||
248 | 248 | PRIMARY KEY (EXJ_ID), |
249 | 249 | KEY first_model (EXJ_first_model_name,EXJ_first_model_id), |
250 | 250 | KEY second_model (EXJ_second_model_name,EXJ_second_model_id)"; |
251 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB '); |
|
252 | - $table_name = 'esp_line_item'; |
|
253 | - $sql = "LIN_ID int(11) NOT NULL AUTO_INCREMENT, |
|
251 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB '); |
|
252 | + $table_name = 'esp_line_item'; |
|
253 | + $sql = "LIN_ID int(11) NOT NULL AUTO_INCREMENT, |
|
254 | 254 | LIN_code varchar(245) NOT NULL DEFAULT '', |
255 | 255 | TXN_ID int(11) DEFAULT NULL, |
256 | 256 | LIN_name varchar(245) NOT NULL DEFAULT '', |
@@ -271,9 +271,9 @@ discard block |
||
271 | 271 | KEY txn_type_timestamp (TXN_ID,LIN_type,LIN_timestamp), |
272 | 272 | KEY txn_obj_id_obj_type (TXN_ID,OBJ_ID,OBJ_type), |
273 | 273 | KEY obj_id_obj_type (OBJ_ID,OBJ_type)"; |
274 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
275 | - $table_name = 'esp_log'; |
|
276 | - $sql = "LOG_ID int(11) NOT NULL AUTO_INCREMENT, |
|
274 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
275 | + $table_name = 'esp_log'; |
|
276 | + $sql = "LOG_ID int(11) NOT NULL AUTO_INCREMENT, |
|
277 | 277 | LOG_time datetime DEFAULT NULL, |
278 | 278 | OBJ_ID varchar(45) DEFAULT NULL, |
279 | 279 | OBJ_type varchar(45) DEFAULT NULL, |
@@ -284,9 +284,9 @@ discard block |
||
284 | 284 | KEY LOG_time (LOG_time), |
285 | 285 | KEY OBJ (OBJ_type,OBJ_ID), |
286 | 286 | KEY LOG_type (LOG_type)"; |
287 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
288 | - $table_name = 'esp_message'; |
|
289 | - $sql = "MSG_ID bigint(20) unsigned NOT NULL AUTO_INCREMENT, |
|
287 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
288 | + $table_name = 'esp_message'; |
|
289 | + $sql = "MSG_ID bigint(20) unsigned NOT NULL AUTO_INCREMENT, |
|
290 | 290 | GRP_ID int(10) unsigned NULL, |
291 | 291 | MSG_token varchar(255) NULL, |
292 | 292 | TXN_ID int(10) unsigned NULL, |
@@ -318,18 +318,18 @@ discard block |
||
318 | 318 | KEY STS_ID (STS_ID), |
319 | 319 | KEY MSG_created (MSG_created), |
320 | 320 | KEY MSG_modified (MSG_modified)"; |
321 | - $this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
322 | - $table_name = 'esp_message_template'; |
|
323 | - $sql = "MTP_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
321 | + $this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
322 | + $table_name = 'esp_message_template'; |
|
323 | + $sql = "MTP_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
324 | 324 | GRP_ID int(10) unsigned NOT NULL, |
325 | 325 | MTP_context varchar(50) NOT NULL, |
326 | 326 | MTP_template_field varchar(30) NOT NULL, |
327 | 327 | MTP_content text NOT NULL, |
328 | 328 | PRIMARY KEY (MTP_ID), |
329 | 329 | KEY GRP_ID (GRP_ID)"; |
330 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
331 | - $table_name = 'esp_message_template_group'; |
|
332 | - $sql = "GRP_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
330 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
331 | + $table_name = 'esp_message_template_group'; |
|
332 | + $sql = "GRP_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
333 | 333 | MTP_user_id int(10) NOT NULL DEFAULT '1', |
334 | 334 | MTP_name varchar(245) NOT NULL DEFAULT '', |
335 | 335 | MTP_description varchar(245) NOT NULL DEFAULT '', |
@@ -341,9 +341,9 @@ discard block |
||
341 | 341 | MTP_is_active tinyint(1) NOT NULL DEFAULT '1', |
342 | 342 | PRIMARY KEY (GRP_ID), |
343 | 343 | KEY MTP_user_id (MTP_user_id)"; |
344 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
345 | - $table_name = 'esp_payment'; |
|
346 | - $sql = "PAY_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
344 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
345 | + $table_name = 'esp_payment'; |
|
346 | + $sql = "PAY_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
347 | 347 | TXN_ID int(10) unsigned DEFAULT NULL, |
348 | 348 | STS_ID varchar(3) DEFAULT NULL, |
349 | 349 | PAY_timestamp datetime NOT NULL DEFAULT '0000-00-00 00:00:00', |
@@ -360,9 +360,9 @@ discard block |
||
360 | 360 | PRIMARY KEY (PAY_ID), |
361 | 361 | KEY PAY_timestamp (PAY_timestamp), |
362 | 362 | KEY TXN_ID (TXN_ID)"; |
363 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB '); |
|
364 | - $table_name = 'esp_payment_method'; |
|
365 | - $sql = "PMD_ID int(11) NOT NULL AUTO_INCREMENT, |
|
363 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB '); |
|
364 | + $table_name = 'esp_payment_method'; |
|
365 | + $sql = "PMD_ID int(11) NOT NULL AUTO_INCREMENT, |
|
366 | 366 | PMD_type varchar(124) DEFAULT NULL, |
367 | 367 | PMD_name varchar(255) DEFAULT NULL, |
368 | 368 | PMD_desc text, |
@@ -378,24 +378,24 @@ discard block |
||
378 | 378 | PRIMARY KEY (PMD_ID), |
379 | 379 | UNIQUE KEY PMD_slug_UNIQUE (PMD_slug), |
380 | 380 | KEY PMD_type (PMD_type)"; |
381 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB '); |
|
382 | - $table_name = "esp_ticket_price"; |
|
383 | - $sql = "TKP_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
381 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB '); |
|
382 | + $table_name = "esp_ticket_price"; |
|
383 | + $sql = "TKP_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
384 | 384 | TKT_ID int(10) unsigned NOT NULL, |
385 | 385 | PRC_ID int(10) unsigned NOT NULL, |
386 | 386 | PRIMARY KEY (TKP_ID), |
387 | 387 | KEY TKT_ID (TKT_ID), |
388 | 388 | KEY PRC_ID (PRC_ID)"; |
389 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
390 | - $table_name = "esp_ticket_template"; |
|
391 | - $sql = "TTM_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
389 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
390 | + $table_name = "esp_ticket_template"; |
|
391 | + $sql = "TTM_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
392 | 392 | TTM_name varchar(45) NOT NULL, |
393 | 393 | TTM_description text, |
394 | 394 | TTM_file varchar(45), |
395 | 395 | PRIMARY KEY (TTM_ID)"; |
396 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
397 | - $table_name = 'esp_question'; |
|
398 | - $sql = 'QST_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
396 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
397 | + $table_name = 'esp_question'; |
|
398 | + $sql = 'QST_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
399 | 399 | QST_display_text text NOT NULL, |
400 | 400 | QST_admin_label varchar(255) NOT NULL, |
401 | 401 | QST_system varchar(25) DEFAULT NULL, |
@@ -409,18 +409,18 @@ discard block |
||
409 | 409 | QST_deleted tinyint(2) unsigned NOT NULL DEFAULT 0, |
410 | 410 | PRIMARY KEY (QST_ID), |
411 | 411 | KEY QST_order (QST_order)'; |
412 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
413 | - $table_name = 'esp_question_group_question'; |
|
414 | - $sql = "QGQ_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
412 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
413 | + $table_name = 'esp_question_group_question'; |
|
414 | + $sql = "QGQ_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
415 | 415 | QSG_ID int(10) unsigned NOT NULL, |
416 | 416 | QST_ID int(10) unsigned NOT NULL, |
417 | 417 | QGQ_order int(10) unsigned NOT NULL DEFAULT 0, |
418 | 418 | PRIMARY KEY (QGQ_ID), |
419 | 419 | KEY QST_ID (QST_ID), |
420 | 420 | KEY QSG_ID_order (QSG_ID,QGQ_order)"; |
421 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
422 | - $table_name = 'esp_question_option'; |
|
423 | - $sql = "QSO_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
421 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
422 | + $table_name = 'esp_question_option'; |
|
423 | + $sql = "QSO_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
424 | 424 | QSO_value varchar(255) NOT NULL, |
425 | 425 | QSO_desc text NOT NULL, |
426 | 426 | QST_ID int(10) unsigned NOT NULL, |
@@ -430,9 +430,9 @@ discard block |
||
430 | 430 | PRIMARY KEY (QSO_ID), |
431 | 431 | KEY QST_ID (QST_ID), |
432 | 432 | KEY QSO_order (QSO_order)"; |
433 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
434 | - $table_name = 'esp_registration'; |
|
435 | - $sql = "REG_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
433 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
434 | + $table_name = 'esp_registration'; |
|
435 | + $sql = "REG_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
436 | 436 | EVT_ID bigint(20) unsigned NOT NULL, |
437 | 437 | ATT_ID bigint(20) unsigned NOT NULL, |
438 | 438 | TXN_ID int(10) unsigned NOT NULL, |
@@ -456,18 +456,18 @@ discard block |
||
456 | 456 | KEY TKT_ID (TKT_ID), |
457 | 457 | KEY EVT_ID (EVT_ID), |
458 | 458 | KEY STS_ID (STS_ID)"; |
459 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB '); |
|
460 | - $table_name = 'esp_registration_payment'; |
|
461 | - $sql = "RPY_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
459 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB '); |
|
460 | + $table_name = 'esp_registration_payment'; |
|
461 | + $sql = "RPY_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
462 | 462 | REG_ID int(10) unsigned NOT NULL, |
463 | 463 | PAY_ID int(10) unsigned NULL, |
464 | 464 | RPY_amount decimal(12,3) NOT NULL DEFAULT '0.00', |
465 | 465 | PRIMARY KEY (RPY_ID), |
466 | 466 | KEY REG_ID (REG_ID), |
467 | 467 | KEY PAY_ID (PAY_ID)"; |
468 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB '); |
|
469 | - $table_name = 'esp_state'; |
|
470 | - $sql = "STA_ID smallint(5) unsigned NOT NULL AUTO_INCREMENT, |
|
468 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB '); |
|
469 | + $table_name = 'esp_state'; |
|
470 | + $sql = "STA_ID smallint(5) unsigned NOT NULL AUTO_INCREMENT, |
|
471 | 471 | CNT_ISO varchar(2) NOT NULL, |
472 | 472 | STA_abbrev varchar(24) NOT NULL, |
473 | 473 | STA_name varchar(100) NOT NULL, |
@@ -475,9 +475,9 @@ discard block |
||
475 | 475 | PRIMARY KEY (STA_ID), |
476 | 476 | KEY STA_abbrev (STA_abbrev), |
477 | 477 | KEY CNT_ISO (CNT_ISO)"; |
478 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
479 | - $table_name = 'esp_status'; |
|
480 | - $sql = "STS_ID varchar(3) NOT NULL, |
|
478 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
479 | + $table_name = 'esp_status'; |
|
480 | + $sql = "STS_ID varchar(3) NOT NULL, |
|
481 | 481 | STS_code varchar(45) NOT NULL, |
482 | 482 | STS_type varchar(45) NOT NULL, |
483 | 483 | STS_can_edit tinyint(1) NOT NULL DEFAULT 0, |
@@ -485,9 +485,9 @@ discard block |
||
485 | 485 | STS_open tinyint(1) NOT NULL DEFAULT 1, |
486 | 486 | UNIQUE KEY STS_ID_UNIQUE (STS_ID), |
487 | 487 | KEY STS_type (STS_type)"; |
488 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
489 | - $table_name = 'esp_transaction'; |
|
490 | - $sql = "TXN_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
488 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
489 | + $table_name = 'esp_transaction'; |
|
490 | + $sql = "TXN_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
491 | 491 | TXN_timestamp datetime NOT NULL DEFAULT '0000-00-00 00:00:00', |
492 | 492 | TXN_total decimal(12,3) DEFAULT '0.00', |
493 | 493 | TXN_paid decimal(12,3) NOT NULL DEFAULT '0.00', |
@@ -499,9 +499,9 @@ discard block |
||
499 | 499 | PRIMARY KEY (TXN_ID), |
500 | 500 | KEY TXN_timestamp (TXN_timestamp), |
501 | 501 | KEY STS_ID (STS_ID)"; |
502 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
503 | - $table_name = 'esp_venue_meta'; |
|
504 | - $sql = "VNUM_ID int(11) NOT NULL AUTO_INCREMENT, |
|
502 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
503 | + $table_name = 'esp_venue_meta'; |
|
504 | + $sql = "VNUM_ID int(11) NOT NULL AUTO_INCREMENT, |
|
505 | 505 | VNU_ID bigint(20) unsigned NOT NULL DEFAULT 0, |
506 | 506 | VNU_address varchar(255) DEFAULT NULL, |
507 | 507 | VNU_address2 varchar(255) DEFAULT NULL, |
@@ -520,10 +520,10 @@ discard block |
||
520 | 520 | KEY VNU_ID (VNU_ID), |
521 | 521 | KEY STA_ID (STA_ID), |
522 | 522 | KEY CNT_ISO (CNT_ISO)"; |
523 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
524 | - // modified tables |
|
525 | - $table_name = "esp_price"; |
|
526 | - $sql = "PRC_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
523 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
524 | + // modified tables |
|
525 | + $table_name = "esp_price"; |
|
526 | + $sql = "PRC_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
527 | 527 | PRT_ID tinyint(3) unsigned NOT NULL, |
528 | 528 | PRC_amount decimal(12,3) NOT NULL DEFAULT '0.00', |
529 | 529 | PRC_name varchar(245) NOT NULL, |
@@ -536,9 +536,9 @@ discard block |
||
536 | 536 | PRC_parent int(10) unsigned DEFAULT 0, |
537 | 537 | PRIMARY KEY (PRC_ID), |
538 | 538 | KEY PRT_ID (PRT_ID)"; |
539 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
540 | - $table_name = "esp_price_type"; |
|
541 | - $sql = "PRT_ID tinyint(3) unsigned NOT NULL AUTO_INCREMENT, |
|
539 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
540 | + $table_name = "esp_price_type"; |
|
541 | + $sql = "PRT_ID tinyint(3) unsigned NOT NULL AUTO_INCREMENT, |
|
542 | 542 | PRT_name varchar(45) NOT NULL, |
543 | 543 | PBT_ID tinyint(3) unsigned NOT NULL DEFAULT '1', |
544 | 544 | PRT_is_percent tinyint(1) NOT NULL DEFAULT '0', |
@@ -547,9 +547,9 @@ discard block |
||
547 | 547 | PRT_deleted tinyint(1) NOT NULL DEFAULT '0', |
548 | 548 | UNIQUE KEY PRT_name_UNIQUE (PRT_name), |
549 | 549 | PRIMARY KEY (PRT_ID)"; |
550 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB '); |
|
551 | - $table_name = "esp_ticket"; |
|
552 | - $sql = "TKT_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
550 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB '); |
|
551 | + $table_name = "esp_ticket"; |
|
552 | + $sql = "TKT_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
553 | 553 | TTM_ID int(10) unsigned NOT NULL, |
554 | 554 | TKT_name varchar(245) NOT NULL DEFAULT '', |
555 | 555 | TKT_description text NOT NULL, |
@@ -572,9 +572,9 @@ discard block |
||
572 | 572 | TKT_deleted tinyint(1) NOT NULL DEFAULT '0', |
573 | 573 | PRIMARY KEY (TKT_ID), |
574 | 574 | KEY TKT_start_date (TKT_start_date)"; |
575 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
576 | - $table_name = 'esp_question_group'; |
|
577 | - $sql = 'QSG_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
575 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
576 | + $table_name = 'esp_question_group'; |
|
577 | + $sql = 'QSG_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
578 | 578 | QSG_name varchar(255) NOT NULL, |
579 | 579 | QSG_identifier varchar(100) NOT NULL, |
580 | 580 | QSG_desc text NULL, |
@@ -587,38 +587,38 @@ discard block |
||
587 | 587 | PRIMARY KEY (QSG_ID), |
588 | 588 | UNIQUE KEY QSG_identifier_UNIQUE (QSG_identifier), |
589 | 589 | KEY QSG_order (QSG_order)'; |
590 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
591 | - $this->insert_default_data(); |
|
592 | - return true; |
|
593 | - } |
|
590 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
591 | + $this->insert_default_data(); |
|
592 | + return true; |
|
593 | + } |
|
594 | 594 | |
595 | - /** |
|
596 | - * Inserts default data on new installs |
|
597 | - * @since $VID:$ |
|
598 | - * @throws EE_Error |
|
599 | - * @throws InvalidArgumentException |
|
600 | - * @throws ReflectionException |
|
601 | - * @throws InvalidDataTypeException |
|
602 | - * @throws InvalidInterfaceException |
|
603 | - */ |
|
604 | - public function insert_default_data() |
|
605 | - { |
|
606 | - $this->previous_dms->insert_default_data(); |
|
607 | - } |
|
595 | + /** |
|
596 | + * Inserts default data on new installs |
|
597 | + * @since $VID:$ |
|
598 | + * @throws EE_Error |
|
599 | + * @throws InvalidArgumentException |
|
600 | + * @throws ReflectionException |
|
601 | + * @throws InvalidDataTypeException |
|
602 | + * @throws InvalidInterfaceException |
|
603 | + */ |
|
604 | + public function insert_default_data() |
|
605 | + { |
|
606 | + $this->previous_dms->insert_default_data(); |
|
607 | + } |
|
608 | 608 | |
609 | 609 | |
610 | 610 | |
611 | - /** |
|
612 | - * @return boolean |
|
613 | - */ |
|
614 | - public function schema_changes_after_migration() |
|
615 | - { |
|
616 | - return true; |
|
617 | - } |
|
611 | + /** |
|
612 | + * @return boolean |
|
613 | + */ |
|
614 | + public function schema_changes_after_migration() |
|
615 | + { |
|
616 | + return true; |
|
617 | + } |
|
618 | 618 | |
619 | 619 | |
620 | 620 | |
621 | - public function migration_page_hooks() |
|
622 | - { |
|
623 | - } |
|
621 | + public function migration_page_hooks() |
|
622 | + { |
|
623 | + } |
|
624 | 624 | } |
@@ -12,12 +12,12 @@ discard block |
||
12 | 12 | // unfortunately, this needs to be done upon INCLUSION of this file, |
13 | 13 | // instead of construction, because it only gets constructed on first page load |
14 | 14 | // (all other times it gets resurrected from a wordpress option) |
15 | -$stages = glob(EE_CORE . 'data_migration_scripts/4_10_0_stages/*'); |
|
15 | +$stages = glob(EE_CORE.'data_migration_scripts/4_10_0_stages/*'); |
|
16 | 16 | $class_to_filepath = []; |
17 | 17 | foreach ($stages as $filepath) { |
18 | 18 | $matches = []; |
19 | 19 | preg_match('~4_10_0_stages/(.*).dmsstage.php~', $filepath, $matches); |
20 | - $class_to_filepath[ $matches[1] ] = $filepath; |
|
20 | + $class_to_filepath[$matches[1]] = $filepath; |
|
21 | 21 | } |
22 | 22 | // give addons a chance to autoload their stages too |
23 | 23 | $class_to_filepath = apply_filters('FHEE__EE_DMS_4_10_0__autoloaded_stages', $class_to_filepath); |
@@ -68,10 +68,10 @@ discard block |
||
68 | 68 | if (version_compare($version_string, '4.10.0.rc.000', '<') && version_compare($version_string, '4.9.0', '>=')) { |
69 | 69 | // echo "$version_string can be migrated from"; |
70 | 70 | return true; |
71 | - } elseif (! $version_string) { |
|
71 | + } elseif ( ! $version_string) { |
|
72 | 72 | // echo "no version string provided: $version_string"; |
73 | 73 | // no version string provided... this must be pre 4.3 |
74 | - return false;// changed mind. dont want people thinking they should migrate yet because they cant |
|
74 | + return false; // changed mind. dont want people thinking they should migrate yet because they cant |
|
75 | 75 | } |
76 | 76 | return false; |
77 | 77 | } |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | */ |
84 | 84 | public function schema_changes_before_migration() |
85 | 85 | { |
86 | - require_once(EE_HELPERS . 'EEH_Activation.helper.php'); |
|
86 | + require_once(EE_HELPERS.'EEH_Activation.helper.php'); |
|
87 | 87 | $now_in_mysql = current_time('mysql', true); |
88 | 88 | $table_name = 'esp_answer'; |
89 | 89 | $sql = " ANS_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |