Completed
Pull Request — master (#881)
by
unknown
08:41
created
core/data_migration_scripts/EE_DMS_Core_4_10_0.dms.php 2 patches
Indentation   +191 added lines, -191 removed lines patch added patch discarded remove patch
@@ -16,9 +16,9 @@  discard block
 block discarded – undo
16 16
 $stages = glob(EE_CORE . 'data_migration_scripts/4_10_0_stages/*');
17 17
 $class_to_filepath = [];
18 18
 foreach ($stages as $filepath) {
19
-    $matches = [];
20
-    preg_match('~4_10_0_stages/(.*).dmsstage.php~', $filepath, $matches);
21
-    $class_to_filepath[ $matches[1] ] = $filepath;
19
+	$matches = [];
20
+	preg_match('~4_10_0_stages/(.*).dmsstage.php~', $filepath, $matches);
21
+	$class_to_filepath[ $matches[1] ] = $filepath;
22 22
 }
23 23
 // give addons a chance to autoload their stages too
24 24
 $class_to_filepath = apply_filters('FHEE__EE_DMS_4_10_0__autoloaded_stages', $class_to_filepath);
@@ -36,72 +36,72 @@  discard block
 block discarded – undo
36 36
  */
37 37
 class EE_DMS_Core_4_10_0 extends EE_Data_Migration_Script_Base
38 38
 {
39
-    /**
40
-     *
41
-     * @param TableManager  $table_manager
42
-     * @param TableAnalysis $table_analysis
43
-     */
44
-    public function __construct(
45
-        TableManager $table_manager = null,
46
-        TableAnalysis $table_analysis = null,
47
-        EE_DMS_Core_4_9_0 $dms_4_9
48
-    ) {
49
-        if (! $dms_4_9 instanceof EE_DMS_Core_4_9_0) {
50
-            $dms_4_9 = LoaderFactory::getLoader()->getShared('EE_DMS_Core_4_9_0');
51
-        }
52
-        $this->previous_dms = $dms_4_9;
53
-        $this->_pretty_name = esc_html__("Data Update to Event Espresso 4.10.0", "event_espresso");
54
-        $this->_priority = 10;
55
-        $this->_migration_stages = array(
56
-            new EE_DMS_4_10_0_Event_Question_Group(),
57
-        );
58
-        parent::__construct($table_manager, $table_analysis);
59
-    }
39
+	/**
40
+	 *
41
+	 * @param TableManager  $table_manager
42
+	 * @param TableAnalysis $table_analysis
43
+	 */
44
+	public function __construct(
45
+		TableManager $table_manager = null,
46
+		TableAnalysis $table_analysis = null,
47
+		EE_DMS_Core_4_9_0 $dms_4_9
48
+	) {
49
+		if (! $dms_4_9 instanceof EE_DMS_Core_4_9_0) {
50
+			$dms_4_9 = LoaderFactory::getLoader()->getShared('EE_DMS_Core_4_9_0');
51
+		}
52
+		$this->previous_dms = $dms_4_9;
53
+		$this->_pretty_name = esc_html__("Data Update to Event Espresso 4.10.0", "event_espresso");
54
+		$this->_priority = 10;
55
+		$this->_migration_stages = array(
56
+			new EE_DMS_4_10_0_Event_Question_Group(),
57
+		);
58
+		parent::__construct($table_manager, $table_analysis);
59
+	}
60 60
 
61 61
 
62 62
 
63
-    /**
64
-     * Whether to migrate or not.
65
-     *
66
-     * @param array $version_array
67
-     * @return bool
68
-     */
69
-    public function can_migrate_from_version($version_array)
70
-    {
71
-        $version_string = $version_array['Core'];
72
-        if (version_compare($version_string, '4.10.0.rc.000', '<') && version_compare($version_string, '4.9.0', '>=')) {
73
-            //          echo "$version_string can be migrated from";
74
-            return true;
75
-        } elseif (! $version_string) {
76
-            //          echo "no version string provided: $version_string";
77
-            // no version string provided... this must be pre 4.3
78
-            return false;// changed mind. dont want people thinking they should migrate yet because they cant
79
-        } else {
80
-            //          echo "$version_string doesnt apply";
81
-            return false;
82
-        }
83
-    }
63
+	/**
64
+	 * Whether to migrate or not.
65
+	 *
66
+	 * @param array $version_array
67
+	 * @return bool
68
+	 */
69
+	public function can_migrate_from_version($version_array)
70
+	{
71
+		$version_string = $version_array['Core'];
72
+		if (version_compare($version_string, '4.10.0.rc.000', '<') && version_compare($version_string, '4.9.0', '>=')) {
73
+			//          echo "$version_string can be migrated from";
74
+			return true;
75
+		} elseif (! $version_string) {
76
+			//          echo "no version string provided: $version_string";
77
+			// no version string provided... this must be pre 4.3
78
+			return false;// changed mind. dont want people thinking they should migrate yet because they cant
79
+		} else {
80
+			//          echo "$version_string doesnt apply";
81
+			return false;
82
+		}
83
+	}
84 84
 
85 85
 
86 86
 
87
-    /**
88
-     * @return bool
89
-     */
90
-    public function schema_changes_before_migration()
91
-    {
92
-        require_once(EE_HELPERS . 'EEH_Activation.helper.php');
93
-        $now_in_mysql = current_time('mysql', true);
94
-        $table_name = 'esp_answer';
95
-        $sql = " ANS_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
87
+	/**
88
+	 * @return bool
89
+	 */
90
+	public function schema_changes_before_migration()
91
+	{
92
+		require_once(EE_HELPERS . 'EEH_Activation.helper.php');
93
+		$now_in_mysql = current_time('mysql', true);
94
+		$table_name = 'esp_answer';
95
+		$sql = " ANS_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
96 96
 					REG_ID int(10) unsigned NOT NULL,
97 97
 					QST_ID int(10) unsigned NOT NULL,
98 98
 					ANS_value text NOT NULL,
99 99
 					PRIMARY KEY  (ANS_ID),
100 100
 					KEY REG_ID (REG_ID),
101 101
 					KEY QST_ID (QST_ID)";
102
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
103
-        $table_name = 'esp_attendee_meta';
104
-        $sql = "ATTM_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
102
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
103
+		$table_name = 'esp_attendee_meta';
104
+		$sql = "ATTM_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
105 105
 				ATT_ID bigint(20) unsigned NOT NULL,
106 106
 				ATT_fname varchar(45) NOT NULL,
107 107
 				ATT_lname varchar(45) NOT NULL,
@@ -118,9 +118,9 @@  discard block
 block discarded – undo
118 118
 				KEY ATT_email (ATT_email(191)),
119 119
 				KEY ATT_lname (ATT_lname),
120 120
 				KEY ATT_fname (ATT_fname)";
121
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB ');
122
-        $table_name = 'esp_checkin';
123
-        $sql = "CHK_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
121
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB ');
122
+		$table_name = 'esp_checkin';
123
+		$sql = "CHK_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
124 124
 				REG_ID int(10) unsigned NOT NULL,
125 125
 				DTT_ID int(10) unsigned NOT NULL,
126 126
 				CHK_in tinyint(1) unsigned NOT NULL DEFAULT 1,
@@ -128,9 +128,9 @@  discard block
 block discarded – undo
128 128
 				PRIMARY KEY  (CHK_ID),
129 129
 				KEY REG_ID (REG_ID),
130 130
 				KEY DTT_ID (DTT_ID)";
131
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
132
-        $table_name = 'esp_country';
133
-        $sql = "CNT_ISO varchar(2) NOT NULL,
131
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
132
+		$table_name = 'esp_country';
133
+		$sql = "CNT_ISO varchar(2) NOT NULL,
134 134
 				CNT_ISO3 varchar(3) NOT NULL,
135 135
 				RGN_ID tinyint(3) unsigned DEFAULT NULL,
136 136
 				CNT_name varchar(45) NOT NULL,
@@ -146,29 +146,29 @@  discard block
 block discarded – undo
146 146
 				CNT_is_EU tinyint(1) DEFAULT '0',
147 147
 				CNT_active tinyint(1) DEFAULT '0',
148 148
 				PRIMARY KEY  (CNT_ISO)";
149
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
150
-        $table_name = 'esp_currency';
151
-        $sql = "CUR_code varchar(6) NOT NULL,
149
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
150
+		$table_name = 'esp_currency';
151
+		$sql = "CUR_code varchar(6) NOT NULL,
152 152
 				CUR_single varchar(45) DEFAULT 'dollar',
153 153
 				CUR_plural varchar(45) DEFAULT 'dollars',
154 154
 				CUR_sign varchar(45) DEFAULT '$',
155 155
 				CUR_dec_plc varchar(1) NOT NULL DEFAULT '2',
156 156
 				CUR_active tinyint(1) DEFAULT '0',
157 157
 				PRIMARY KEY  (CUR_code)";
158
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
159
-        // note: although this table is no longer in use,
160
-        // it hasn't been removed because then queries to the model will have errors.
161
-        // but you should expect this table and its corresponding model to be removed in
162
-        // the next few months
163
-        $table_name = 'esp_currency_payment_method';
164
-        $sql = "CPM_ID int(11) NOT NULL AUTO_INCREMENT,
158
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
159
+		// note: although this table is no longer in use,
160
+		// it hasn't been removed because then queries to the model will have errors.
161
+		// but you should expect this table and its corresponding model to be removed in
162
+		// the next few months
163
+		$table_name = 'esp_currency_payment_method';
164
+		$sql = "CPM_ID int(11) NOT NULL AUTO_INCREMENT,
165 165
 				CUR_code varchar(6) NOT NULL,
166 166
 				PMD_ID int(11) NOT NULL,
167 167
 				PRIMARY KEY  (CPM_ID),
168 168
 				KEY PMD_ID (PMD_ID)";
169
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB ');
170
-        $table_name = 'esp_datetime';
171
-        $sql = "DTT_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
169
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB ');
170
+		$table_name = 'esp_datetime';
171
+		$sql = "DTT_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
172 172
 				EVT_ID bigint(20) unsigned NOT NULL,
173 173
 				DTT_name varchar(255) NOT NULL DEFAULT '',
174 174
 				DTT_description text NOT NULL,
@@ -185,25 +185,25 @@  discard block
 block discarded – undo
185 185
 				KEY DTT_EVT_start (DTT_EVT_start),
186 186
 				KEY EVT_ID (EVT_ID),
187 187
 				KEY DTT_is_primary (DTT_is_primary)";
188
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
189
-        $table_name = "esp_datetime_ticket";
190
-        $sql = "DTK_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
188
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
189
+		$table_name = "esp_datetime_ticket";
190
+		$sql = "DTK_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
191 191
 				DTT_ID int(10) unsigned NOT NULL,
192 192
 				TKT_ID int(10) unsigned NOT NULL,
193 193
 				PRIMARY KEY  (DTK_ID),
194 194
 				KEY DTT_ID (DTT_ID),
195 195
 				KEY TKT_ID (TKT_ID)";
196
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
197
-        $table_name = 'esp_event_message_template';
198
-        $sql = "EMT_ID bigint(20) unsigned NOT NULL AUTO_INCREMENT,
196
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
197
+		$table_name = 'esp_event_message_template';
198
+		$sql = "EMT_ID bigint(20) unsigned NOT NULL AUTO_INCREMENT,
199 199
 				EVT_ID bigint(20) unsigned NOT NULL DEFAULT 0,
200 200
 				GRP_ID int(10) unsigned NOT NULL DEFAULT 0,
201 201
 				PRIMARY KEY  (EMT_ID),
202 202
 				KEY EVT_ID (EVT_ID),
203 203
 				KEY GRP_ID (GRP_ID)";
204
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
205
-        $table_name = 'esp_event_meta';
206
-        $sql = "EVTM_ID int(10) NOT NULL AUTO_INCREMENT,
204
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
205
+		$table_name = 'esp_event_meta';
206
+		$sql = "EVTM_ID int(10) NOT NULL AUTO_INCREMENT,
207 207
 				EVT_ID bigint(20) unsigned NOT NULL,
208 208
 				EVT_display_desc tinyint(1) unsigned NOT NULL DEFAULT 1,
209 209
 				EVT_display_ticket_selector tinyint(1) unsigned NOT NULL DEFAULT 1,
@@ -218,9 +218,9 @@  discard block
 block discarded – undo
218 218
 				EVT_donations tinyint(1) NULL,
219 219
 				PRIMARY KEY  (EVTM_ID),
220 220
 				KEY EVT_ID (EVT_ID)";
221
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
222
-        $table_name = 'esp_event_question_group';
223
-        $sql = "EQG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
221
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
222
+		$table_name = 'esp_event_question_group';
223
+		$sql = "EQG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
224 224
 				EVT_ID bigint(20) unsigned NOT NULL,
225 225
 				QSG_ID int(10) unsigned NOT NULL,
226 226
 				EQG_primary tinyint(1) unsigned NOT NULL DEFAULT 0,
@@ -228,25 +228,25 @@  discard block
 block discarded – undo
228 228
 				PRIMARY KEY  (EQG_ID),
229 229
 				KEY EVT_ID (EVT_ID),
230 230
 				KEY QSG_ID (QSG_ID)";
231
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
232
-        $table_name = 'esp_event_venue';
233
-        $sql = "EVV_ID int(11) NOT NULL AUTO_INCREMENT,
231
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
232
+		$table_name = 'esp_event_venue';
233
+		$sql = "EVV_ID int(11) NOT NULL AUTO_INCREMENT,
234 234
 				EVT_ID bigint(20) unsigned NOT NULL,
235 235
 				VNU_ID bigint(20) unsigned NOT NULL,
236 236
 				EVV_primary tinyint(1) unsigned NOT NULL DEFAULT 0,
237 237
 				PRIMARY KEY  (EVV_ID)";
238
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
239
-        $table_name = 'esp_extra_meta';
240
-        $sql = "EXM_ID int(11) NOT NULL AUTO_INCREMENT,
238
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
239
+		$table_name = 'esp_extra_meta';
240
+		$sql = "EXM_ID int(11) NOT NULL AUTO_INCREMENT,
241 241
 				OBJ_ID int(11) DEFAULT NULL,
242 242
 				EXM_type varchar(45) DEFAULT NULL,
243 243
 				EXM_key varchar(45) DEFAULT NULL,
244 244
 				EXM_value text,
245 245
 				PRIMARY KEY  (EXM_ID),
246 246
 				KEY EXM_type (EXM_type,OBJ_ID,EXM_key)";
247
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
248
-        $table_name = 'esp_extra_join';
249
-        $sql = "EXJ_ID int(11) NOT NULL AUTO_INCREMENT,
247
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
248
+		$table_name = 'esp_extra_join';
249
+		$sql = "EXJ_ID int(11) NOT NULL AUTO_INCREMENT,
250 250
 				EXJ_first_model_id varchar(6) NOT NULL,
251 251
 				EXJ_first_model_name varchar(20) NOT NULL,
252 252
 				EXJ_second_model_id varchar(6) NOT NULL,
@@ -254,9 +254,9 @@  discard block
 block discarded – undo
254 254
 				PRIMARY KEY  (EXJ_ID),
255 255
 				KEY first_model (EXJ_first_model_name,EXJ_first_model_id),
256 256
 				KEY second_model (EXJ_second_model_name,EXJ_second_model_id)";
257
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB ');
258
-        $table_name = 'esp_line_item';
259
-        $sql = "LIN_ID int(11) NOT NULL AUTO_INCREMENT,
257
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB ');
258
+		$table_name = 'esp_line_item';
259
+		$sql = "LIN_ID int(11) NOT NULL AUTO_INCREMENT,
260 260
 				LIN_code varchar(245) NOT NULL DEFAULT '',
261 261
 				TXN_ID int(11) DEFAULT NULL,
262 262
 				LIN_name varchar(245) NOT NULL DEFAULT '',
@@ -277,9 +277,9 @@  discard block
 block discarded – undo
277 277
 				KEY txn_type_timestamp (TXN_ID,LIN_type,LIN_timestamp),
278 278
 				KEY txn_obj_id_obj_type (TXN_ID,OBJ_ID,OBJ_type),
279 279
 				KEY obj_id_obj_type (OBJ_ID,OBJ_type)";
280
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
281
-        $table_name = 'esp_log';
282
-        $sql = "LOG_ID int(11) NOT NULL AUTO_INCREMENT,
280
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
281
+		$table_name = 'esp_log';
282
+		$sql = "LOG_ID int(11) NOT NULL AUTO_INCREMENT,
283 283
 				LOG_time datetime DEFAULT NULL,
284 284
 				OBJ_ID varchar(45) DEFAULT NULL,
285 285
 				OBJ_type varchar(45) DEFAULT NULL,
@@ -290,9 +290,9 @@  discard block
 block discarded – undo
290 290
 				KEY LOG_time (LOG_time),
291 291
 				KEY OBJ (OBJ_type,OBJ_ID),
292 292
 				KEY LOG_type (LOG_type)";
293
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
294
-        $table_name = 'esp_message';
295
-        $sql = "MSG_ID bigint(20) unsigned NOT NULL AUTO_INCREMENT,
293
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
294
+		$table_name = 'esp_message';
295
+		$sql = "MSG_ID bigint(20) unsigned NOT NULL AUTO_INCREMENT,
296 296
 				GRP_ID int(10) unsigned NULL,
297 297
 				MSG_token varchar(255) NULL,
298 298
 				TXN_ID int(10) unsigned NULL,
@@ -324,18 +324,18 @@  discard block
 block discarded – undo
324 324
 				KEY STS_ID (STS_ID),
325 325
 				KEY MSG_created (MSG_created),
326 326
 				KEY MSG_modified (MSG_modified)";
327
-        $this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
328
-        $table_name = 'esp_message_template';
329
-        $sql = "MTP_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
327
+		$this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
328
+		$table_name = 'esp_message_template';
329
+		$sql = "MTP_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
330 330
 				GRP_ID int(10) unsigned NOT NULL,
331 331
 				MTP_context varchar(50) NOT NULL,
332 332
 				MTP_template_field varchar(30) NOT NULL,
333 333
 				MTP_content text NOT NULL,
334 334
 				PRIMARY KEY  (MTP_ID),
335 335
 				KEY GRP_ID (GRP_ID)";
336
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
337
-        $table_name = 'esp_message_template_group';
338
-        $sql = "GRP_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
336
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
337
+		$table_name = 'esp_message_template_group';
338
+		$sql = "GRP_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
339 339
 				MTP_user_id int(10) NOT NULL DEFAULT '1',
340 340
 				MTP_name varchar(245) NOT NULL DEFAULT '',
341 341
 				MTP_description varchar(245) NOT NULL DEFAULT '',
@@ -347,9 +347,9 @@  discard block
 block discarded – undo
347 347
 				MTP_is_active tinyint(1) NOT NULL DEFAULT '1',
348 348
 				PRIMARY KEY  (GRP_ID),
349 349
 				KEY MTP_user_id (MTP_user_id)";
350
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
351
-        $table_name = 'esp_payment';
352
-        $sql = "PAY_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
350
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
351
+		$table_name = 'esp_payment';
352
+		$sql = "PAY_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
353 353
 				TXN_ID int(10) unsigned DEFAULT NULL,
354 354
 				STS_ID varchar(3) DEFAULT NULL,
355 355
 				PAY_timestamp datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
@@ -366,9 +366,9 @@  discard block
 block discarded – undo
366 366
 				PRIMARY KEY  (PAY_ID),
367 367
 				KEY PAY_timestamp (PAY_timestamp),
368 368
 				KEY TXN_ID (TXN_ID)";
369
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB ');
370
-        $table_name = 'esp_payment_method';
371
-        $sql = "PMD_ID int(11) NOT NULL AUTO_INCREMENT,
369
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB ');
370
+		$table_name = 'esp_payment_method';
371
+		$sql = "PMD_ID int(11) NOT NULL AUTO_INCREMENT,
372 372
 				PMD_type varchar(124) DEFAULT NULL,
373 373
 				PMD_name varchar(255) DEFAULT NULL,
374 374
 				PMD_desc text,
@@ -384,24 +384,24 @@  discard block
 block discarded – undo
384 384
 				PRIMARY KEY  (PMD_ID),
385 385
 				UNIQUE KEY PMD_slug_UNIQUE (PMD_slug),
386 386
 				KEY PMD_type (PMD_type)";
387
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB ');
388
-        $table_name = "esp_ticket_price";
389
-        $sql = "TKP_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
387
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB ');
388
+		$table_name = "esp_ticket_price";
389
+		$sql = "TKP_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
390 390
 				TKT_ID int(10) unsigned NOT NULL,
391 391
 				PRC_ID int(10) unsigned NOT NULL,
392 392
 				PRIMARY KEY  (TKP_ID),
393 393
 				KEY TKT_ID (TKT_ID),
394 394
 				KEY PRC_ID (PRC_ID)";
395
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
396
-        $table_name = "esp_ticket_template";
397
-        $sql = "TTM_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
395
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
396
+		$table_name = "esp_ticket_template";
397
+		$sql = "TTM_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
398 398
 				TTM_name varchar(45) NOT NULL,
399 399
 				TTM_description text,
400 400
 				TTM_file varchar(45),
401 401
 				PRIMARY KEY  (TTM_ID)";
402
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
403
-        $table_name = 'esp_question';
404
-        $sql = 'QST_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
402
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
403
+		$table_name = 'esp_question';
404
+		$sql = 'QST_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
405 405
 				QST_display_text text NOT NULL,
406 406
 				QST_admin_label varchar(255) NOT NULL,
407 407
 				QST_system varchar(25) DEFAULT NULL,
@@ -415,18 +415,18 @@  discard block
 block discarded – undo
415 415
 				QST_deleted tinyint(2) unsigned NOT NULL DEFAULT 0,
416 416
 				PRIMARY KEY  (QST_ID),
417 417
 				KEY QST_order (QST_order)';
418
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
419
-        $table_name = 'esp_question_group_question';
420
-        $sql = "QGQ_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
418
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
419
+		$table_name = 'esp_question_group_question';
420
+		$sql = "QGQ_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
421 421
 				QSG_ID int(10) unsigned NOT NULL,
422 422
 				QST_ID int(10) unsigned NOT NULL,
423 423
 				QGQ_order int(10) unsigned NOT NULL DEFAULT 0,
424 424
 				PRIMARY KEY  (QGQ_ID),
425 425
 				KEY QST_ID (QST_ID),
426 426
 				KEY QSG_ID_order (QSG_ID,QGQ_order)";
427
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
428
-        $table_name = 'esp_question_option';
429
-        $sql = "QSO_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
427
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
428
+		$table_name = 'esp_question_option';
429
+		$sql = "QSO_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
430 430
 				QSO_value varchar(255) NOT NULL,
431 431
 				QSO_desc text NOT NULL,
432 432
 				QST_ID int(10) unsigned NOT NULL,
@@ -436,9 +436,9 @@  discard block
 block discarded – undo
436 436
 				PRIMARY KEY  (QSO_ID),
437 437
 				KEY QST_ID (QST_ID),
438 438
 				KEY QSO_order (QSO_order)";
439
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
440
-        $table_name = 'esp_registration';
441
-        $sql = "REG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
439
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
440
+		$table_name = 'esp_registration';
441
+		$sql = "REG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
442 442
 				EVT_ID bigint(20) unsigned NOT NULL,
443 443
 				ATT_ID bigint(20) unsigned NOT NULL,
444 444
 				TXN_ID int(10) unsigned NOT NULL,
@@ -462,18 +462,18 @@  discard block
 block discarded – undo
462 462
 				KEY TKT_ID (TKT_ID),
463 463
 				KEY EVT_ID (EVT_ID),
464 464
 				KEY STS_ID (STS_ID)";
465
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB ');
466
-        $table_name = 'esp_registration_payment';
467
-        $sql = "RPY_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
465
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB ');
466
+		$table_name = 'esp_registration_payment';
467
+		$sql = "RPY_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
468 468
 					  REG_ID int(10) unsigned NOT NULL,
469 469
 					  PAY_ID int(10) unsigned NULL,
470 470
 					  RPY_amount decimal(12,3) NOT NULL DEFAULT '0.00',
471 471
 					  PRIMARY KEY  (RPY_ID),
472 472
 					  KEY REG_ID (REG_ID),
473 473
 					  KEY PAY_ID (PAY_ID)";
474
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB ');
475
-        $table_name = 'esp_state';
476
-        $sql = "STA_ID smallint(5) unsigned NOT NULL AUTO_INCREMENT,
474
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB ');
475
+		$table_name = 'esp_state';
476
+		$sql = "STA_ID smallint(5) unsigned NOT NULL AUTO_INCREMENT,
477 477
 				CNT_ISO varchar(2) NOT NULL,
478 478
 				STA_abbrev varchar(24) NOT NULL,
479 479
 				STA_name varchar(100) NOT NULL,
@@ -481,9 +481,9 @@  discard block
 block discarded – undo
481 481
 				PRIMARY KEY  (STA_ID),
482 482
 				KEY STA_abbrev (STA_abbrev),
483 483
 				KEY CNT_ISO (CNT_ISO)";
484
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
485
-        $table_name = 'esp_status';
486
-        $sql = "STS_ID varchar(3) NOT NULL,
484
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
485
+		$table_name = 'esp_status';
486
+		$sql = "STS_ID varchar(3) NOT NULL,
487 487
 				STS_code varchar(45) NOT NULL,
488 488
 				STS_type varchar(45) NOT NULL,
489 489
 				STS_can_edit tinyint(1) NOT NULL DEFAULT 0,
@@ -491,9 +491,9 @@  discard block
 block discarded – undo
491 491
 				STS_open tinyint(1) NOT NULL DEFAULT 1,
492 492
 				UNIQUE KEY STS_ID_UNIQUE (STS_ID),
493 493
 				KEY STS_type (STS_type)";
494
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
495
-        $table_name = 'esp_transaction';
496
-        $sql = "TXN_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
494
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
495
+		$table_name = 'esp_transaction';
496
+		$sql = "TXN_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
497 497
 				TXN_timestamp datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
498 498
 				TXN_total decimal(12,3) DEFAULT '0.00',
499 499
 				TXN_paid decimal(12,3) NOT NULL DEFAULT '0.00',
@@ -505,9 +505,9 @@  discard block
 block discarded – undo
505 505
 				PRIMARY KEY  (TXN_ID),
506 506
 				KEY TXN_timestamp (TXN_timestamp),
507 507
 				KEY STS_ID (STS_ID)";
508
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
509
-        $table_name = 'esp_venue_meta';
510
-        $sql = "VNUM_ID int(11) NOT NULL AUTO_INCREMENT,
508
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
509
+		$table_name = 'esp_venue_meta';
510
+		$sql = "VNUM_ID int(11) NOT NULL AUTO_INCREMENT,
511 511
 			VNU_ID bigint(20) unsigned NOT NULL DEFAULT 0,
512 512
 			VNU_address varchar(255) DEFAULT NULL,
513 513
 			VNU_address2 varchar(255) DEFAULT NULL,
@@ -526,10 +526,10 @@  discard block
 block discarded – undo
526 526
 			KEY VNU_ID (VNU_ID),
527 527
 			KEY STA_ID (STA_ID),
528 528
 			KEY CNT_ISO (CNT_ISO)";
529
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
530
-        // modified tables
531
-        $table_name = "esp_price";
532
-        $sql = "PRC_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
529
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
530
+		// modified tables
531
+		$table_name = "esp_price";
532
+		$sql = "PRC_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
533 533
 				PRT_ID tinyint(3) unsigned NOT NULL,
534 534
 				PRC_amount decimal(12,3) NOT NULL DEFAULT '0.00',
535 535
 				PRC_name varchar(245) NOT NULL,
@@ -542,9 +542,9 @@  discard block
 block discarded – undo
542 542
 				PRC_parent int(10) unsigned DEFAULT 0,
543 543
 				PRIMARY KEY  (PRC_ID),
544 544
 				KEY PRT_ID (PRT_ID)";
545
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
546
-        $table_name = "esp_price_type";
547
-        $sql = "PRT_ID tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
545
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
546
+		$table_name = "esp_price_type";
547
+		$sql = "PRT_ID tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
548 548
 				PRT_name varchar(45) NOT NULL,
549 549
 				PBT_ID tinyint(3) unsigned NOT NULL DEFAULT '1',
550 550
 				PRT_is_percent tinyint(1) NOT NULL DEFAULT '0',
@@ -553,9 +553,9 @@  discard block
 block discarded – undo
553 553
 				PRT_deleted tinyint(1) NOT NULL DEFAULT '0',
554 554
 				UNIQUE KEY PRT_name_UNIQUE (PRT_name),
555 555
 				PRIMARY KEY  (PRT_ID)";
556
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB ');
557
-        $table_name = "esp_ticket";
558
-        $sql = "TKT_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
556
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB ');
557
+		$table_name = "esp_ticket";
558
+		$sql = "TKT_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
559 559
 				TTM_ID int(10) unsigned NOT NULL,
560 560
 				TKT_name varchar(245) NOT NULL DEFAULT '',
561 561
 				TKT_description text NOT NULL,
@@ -578,9 +578,9 @@  discard block
 block discarded – undo
578 578
 				TKT_deleted tinyint(1) NOT NULL DEFAULT '0',
579 579
 				PRIMARY KEY  (TKT_ID),
580 580
 				KEY TKT_start_date (TKT_start_date)";
581
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
582
-        $table_name = 'esp_question_group';
583
-        $sql = 'QSG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
581
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
582
+		$table_name = 'esp_question_group';
583
+		$sql = 'QSG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
584 584
 				QSG_name varchar(255) NOT NULL,
585 585
 				QSG_identifier varchar(100) NOT NULL,
586 586
 				QSG_desc text NULL,
@@ -593,38 +593,38 @@  discard block
 block discarded – undo
593 593
 				PRIMARY KEY  (QSG_ID),
594 594
 				UNIQUE KEY QSG_identifier_UNIQUE (QSG_identifier),
595 595
 				KEY QSG_order (QSG_order)';
596
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
597
-        $this->insert_default_data();
598
-        return true;
599
-    }
596
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
597
+		$this->insert_default_data();
598
+		return true;
599
+	}
600 600
 
601
-    /**
602
-     * Inserts default data on new installs
603
-     * @since $VID:$
604
-     * @throws EE_Error
605
-     * @throws InvalidArgumentException
606
-     * @throws ReflectionException
607
-     * @throws InvalidDataTypeException
608
-     * @throws InvalidInterfaceException
609
-     */
610
-    public function insert_default_data()
611
-    {
612
-        $this->previous_dms->insert_default_data();
613
-    }
601
+	/**
602
+	 * Inserts default data on new installs
603
+	 * @since $VID:$
604
+	 * @throws EE_Error
605
+	 * @throws InvalidArgumentException
606
+	 * @throws ReflectionException
607
+	 * @throws InvalidDataTypeException
608
+	 * @throws InvalidInterfaceException
609
+	 */
610
+	public function insert_default_data()
611
+	{
612
+		$this->previous_dms->insert_default_data();
613
+	}
614 614
 
615 615
 
616 616
 
617
-    /**
618
-     * @return boolean
619
-     */
620
-    public function schema_changes_after_migration()
621
-    {
622
-        return true;
623
-    }
617
+	/**
618
+	 * @return boolean
619
+	 */
620
+	public function schema_changes_after_migration()
621
+	{
622
+		return true;
623
+	}
624 624
 
625 625
 
626 626
 
627
-    public function migration_page_hooks()
628
-    {
629
-    }
627
+	public function migration_page_hooks()
628
+	{
629
+	}
630 630
 }
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -13,12 +13,12 @@  discard block
 block discarded – undo
13 13
 // unfortunately, this needs to be done upon INCLUSION of this file,
14 14
 // instead of construction, because it only gets constructed on first page load
15 15
 // (all other times it gets resurrected from a wordpress option)
16
-$stages = glob(EE_CORE . 'data_migration_scripts/4_10_0_stages/*');
16
+$stages = glob(EE_CORE.'data_migration_scripts/4_10_0_stages/*');
17 17
 $class_to_filepath = [];
18 18
 foreach ($stages as $filepath) {
19 19
     $matches = [];
20 20
     preg_match('~4_10_0_stages/(.*).dmsstage.php~', $filepath, $matches);
21
-    $class_to_filepath[ $matches[1] ] = $filepath;
21
+    $class_to_filepath[$matches[1]] = $filepath;
22 22
 }
23 23
 // give addons a chance to autoload their stages too
24 24
 $class_to_filepath = apply_filters('FHEE__EE_DMS_4_10_0__autoloaded_stages', $class_to_filepath);
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
         TableAnalysis $table_analysis = null,
47 47
         EE_DMS_Core_4_9_0 $dms_4_9
48 48
     ) {
49
-        if (! $dms_4_9 instanceof EE_DMS_Core_4_9_0) {
49
+        if ( ! $dms_4_9 instanceof EE_DMS_Core_4_9_0) {
50 50
             $dms_4_9 = LoaderFactory::getLoader()->getShared('EE_DMS_Core_4_9_0');
51 51
         }
52 52
         $this->previous_dms = $dms_4_9;
@@ -72,10 +72,10 @@  discard block
 block discarded – undo
72 72
         if (version_compare($version_string, '4.10.0.rc.000', '<') && version_compare($version_string, '4.9.0', '>=')) {
73 73
             //          echo "$version_string can be migrated from";
74 74
             return true;
75
-        } elseif (! $version_string) {
75
+        } elseif ( ! $version_string) {
76 76
             //          echo "no version string provided: $version_string";
77 77
             // no version string provided... this must be pre 4.3
78
-            return false;// changed mind. dont want people thinking they should migrate yet because they cant
78
+            return false; // changed mind. dont want people thinking they should migrate yet because they cant
79 79
         } else {
80 80
             //          echo "$version_string doesnt apply";
81 81
             return false;
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
      */
90 90
     public function schema_changes_before_migration()
91 91
     {
92
-        require_once(EE_HELPERS . 'EEH_Activation.helper.php');
92
+        require_once(EE_HELPERS.'EEH_Activation.helper.php');
93 93
         $now_in_mysql = current_time('mysql', true);
94 94
         $table_name = 'esp_answer';
95 95
         $sql = " ANS_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
Please login to merge, or discard this patch.