@@ -16,9 +16,9 @@ discard block |
||
| 16 | 16 | $stages = glob(EE_CORE . 'data_migration_scripts/4_5_0_stages/*'); |
| 17 | 17 | $class_to_filepath = array(); |
| 18 | 18 | foreach ($stages as $filepath) { |
| 19 | - $matches = array(); |
|
| 20 | - preg_match('~4_5_0_stages/(.*).dmsstage.php~', $filepath, $matches); |
|
| 21 | - $class_to_filepath[$matches[1]] = $filepath; |
|
| 19 | + $matches = array(); |
|
| 20 | + preg_match('~4_5_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_5_0__autoloaded_stages', $class_to_filepath); |
@@ -31,66 +31,66 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | |
| 33 | 33 | |
| 34 | - /** |
|
| 35 | - * EE_DMS_Core_4_5_0 constructor. |
|
| 36 | - * |
|
| 37 | - * @param TableManager $table_manager |
|
| 38 | - * @param TableAnalysis $table_analysis |
|
| 39 | - */ |
|
| 40 | - public function __construct(TableManager $table_manager = null, TableAnalysis $table_analysis = null) |
|
| 41 | - { |
|
| 42 | - $this->_pretty_name = __("Data Migration to Event Espresso 4.5.0.P", "event_espresso"); |
|
| 43 | - $this->_priority = 10; |
|
| 44 | - $this->_migration_stages = array( |
|
| 45 | - new EE_DMS_4_5_0_update_wp_user_for_tickets(), |
|
| 46 | - new EE_DMS_4_5_0_update_wp_user_for_prices(), |
|
| 47 | - new EE_DMS_4_5_0_update_wp_user_for_price_types(), |
|
| 48 | - new EE_DMS_4_5_0_update_wp_user_for_question_groups(), |
|
| 49 | - new EE_DMS_4_5_0_invoice_settings(), |
|
| 50 | - ); |
|
| 51 | - parent::__construct($table_manager, $table_analysis); |
|
| 52 | - } |
|
| 53 | - |
|
| 54 | - |
|
| 55 | - |
|
| 56 | - public function can_migrate_from_version($version_array) |
|
| 57 | - { |
|
| 58 | - $version_string = $version_array['Core']; |
|
| 59 | - if (version_compare($version_string, '4.5.0', '<=') && version_compare($version_string, '4.3.0', '>=')) { |
|
| 34 | + /** |
|
| 35 | + * EE_DMS_Core_4_5_0 constructor. |
|
| 36 | + * |
|
| 37 | + * @param TableManager $table_manager |
|
| 38 | + * @param TableAnalysis $table_analysis |
|
| 39 | + */ |
|
| 40 | + public function __construct(TableManager $table_manager = null, TableAnalysis $table_analysis = null) |
|
| 41 | + { |
|
| 42 | + $this->_pretty_name = __("Data Migration to Event Espresso 4.5.0.P", "event_espresso"); |
|
| 43 | + $this->_priority = 10; |
|
| 44 | + $this->_migration_stages = array( |
|
| 45 | + new EE_DMS_4_5_0_update_wp_user_for_tickets(), |
|
| 46 | + new EE_DMS_4_5_0_update_wp_user_for_prices(), |
|
| 47 | + new EE_DMS_4_5_0_update_wp_user_for_price_types(), |
|
| 48 | + new EE_DMS_4_5_0_update_wp_user_for_question_groups(), |
|
| 49 | + new EE_DMS_4_5_0_invoice_settings(), |
|
| 50 | + ); |
|
| 51 | + parent::__construct($table_manager, $table_analysis); |
|
| 52 | + } |
|
| 53 | + |
|
| 54 | + |
|
| 55 | + |
|
| 56 | + public function can_migrate_from_version($version_array) |
|
| 57 | + { |
|
| 58 | + $version_string = $version_array['Core']; |
|
| 59 | + if (version_compare($version_string, '4.5.0', '<=') && version_compare($version_string, '4.3.0', '>=')) { |
|
| 60 | 60 | // echo "$version_string can be migrated from"; |
| 61 | - return true; |
|
| 62 | - } elseif ( ! $version_string) { |
|
| 61 | + return true; |
|
| 62 | + } elseif ( ! $version_string) { |
|
| 63 | 63 | // echo "no version string provided: $version_string"; |
| 64 | - //no version string provided... this must be pre 4.3 |
|
| 65 | - return false;//changed mind. dont want people thinking they should migrate yet because they cant |
|
| 66 | - } else { |
|
| 64 | + //no version string provided... this must be pre 4.3 |
|
| 65 | + return false;//changed mind. dont want people thinking they should migrate yet because they cant |
|
| 66 | + } else { |
|
| 67 | 67 | // echo "$version_string doesnt apply"; |
| 68 | - return false; |
|
| 69 | - } |
|
| 70 | - } |
|
| 68 | + return false; |
|
| 69 | + } |
|
| 70 | + } |
|
| 71 | 71 | |
| 72 | 72 | |
| 73 | 73 | |
| 74 | - public function pretty_name() |
|
| 75 | - { |
|
| 76 | - return __("Core Data Migration to version 4.5.0", "event_espresso"); |
|
| 77 | - } |
|
| 74 | + public function pretty_name() |
|
| 75 | + { |
|
| 76 | + return __("Core Data Migration to version 4.5.0", "event_espresso"); |
|
| 77 | + } |
|
| 78 | 78 | |
| 79 | 79 | |
| 80 | 80 | |
| 81 | - public function schema_changes_before_migration() |
|
| 82 | - { |
|
| 83 | - //relies on 4.1's EEH_Activation::create_table |
|
| 84 | - require_once(EE_HELPERS . 'EEH_Activation.helper.php'); |
|
| 85 | - $table_name = 'esp_answer'; |
|
| 86 | - $sql = " ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 81 | + public function schema_changes_before_migration() |
|
| 82 | + { |
|
| 83 | + //relies on 4.1's EEH_Activation::create_table |
|
| 84 | + require_once(EE_HELPERS . 'EEH_Activation.helper.php'); |
|
| 85 | + $table_name = 'esp_answer'; |
|
| 86 | + $sql = " ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 87 | 87 | REG_ID INT UNSIGNED NOT NULL, |
| 88 | 88 | QST_ID INT UNSIGNED NOT NULL, |
| 89 | 89 | ANS_value TEXT NOT NULL, |
| 90 | 90 | PRIMARY KEY (ANS_ID)"; |
| 91 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 92 | - $table_name = 'esp_attendee_meta'; |
|
| 93 | - $sql = "ATTM_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 91 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 92 | + $table_name = 'esp_attendee_meta'; |
|
| 93 | + $sql = "ATTM_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 94 | 94 | ATT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 95 | 95 | ATT_fname VARCHAR(45) NOT NULL, |
| 96 | 96 | ATT_lname VARCHAR(45) NOT NULL, |
@@ -106,9 +106,9 @@ discard block |
||
| 106 | 106 | KEY ATT_fname (ATT_fname), |
| 107 | 107 | KEY ATT_lname (ATT_lname), |
| 108 | 108 | KEY ATT_email (ATT_email)"; |
| 109 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 110 | - $table_name = 'esp_country'; |
|
| 111 | - $sql = "CNT_ISO VARCHAR(2) COLLATE utf8_bin NOT NULL, |
|
| 109 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 110 | + $table_name = 'esp_country'; |
|
| 111 | + $sql = "CNT_ISO VARCHAR(2) COLLATE utf8_bin NOT NULL, |
|
| 112 | 112 | CNT_ISO3 VARCHAR(3) COLLATE utf8_bin NOT NULL, |
| 113 | 113 | RGN_ID TINYINT(3) UNSIGNED DEFAULT NULL, |
| 114 | 114 | CNT_name VARCHAR(45) COLLATE utf8_bin NOT NULL, |
@@ -124,9 +124,9 @@ discard block |
||
| 124 | 124 | CNT_is_EU TINYINT(1) DEFAULT '0', |
| 125 | 125 | CNT_active TINYINT(1) DEFAULT '0', |
| 126 | 126 | PRIMARY KEY (CNT_ISO)"; |
| 127 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 128 | - $table_name = 'esp_datetime'; |
|
| 129 | - $sql = "DTT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 127 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 128 | + $table_name = 'esp_datetime'; |
|
| 129 | + $sql = "DTT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 130 | 130 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 131 | 131 | DTT_name VARCHAR(255) NOT NULL DEFAULT '', |
| 132 | 132 | DTT_description TEXT NOT NULL, |
@@ -141,9 +141,9 @@ discard block |
||
| 141 | 141 | PRIMARY KEY (DTT_ID), |
| 142 | 142 | KEY EVT_ID (EVT_ID), |
| 143 | 143 | KEY DTT_is_primary (DTT_is_primary)"; |
| 144 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 145 | - $table_name = 'esp_event_meta'; |
|
| 146 | - $sql = " |
|
| 144 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 145 | + $table_name = 'esp_event_meta'; |
|
| 146 | + $sql = " |
|
| 147 | 147 | EVTM_ID INT NOT NULL AUTO_INCREMENT, |
| 148 | 148 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 149 | 149 | EVT_display_desc TINYINT(1) UNSIGNED NOT NULL DEFAULT 1, |
@@ -158,31 +158,31 @@ discard block |
||
| 158 | 158 | EVT_external_URL VARCHAR(200) NULL, |
| 159 | 159 | EVT_donations TINYINT(1) NULL, |
| 160 | 160 | PRIMARY KEY (EVTM_ID)"; |
| 161 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 162 | - $table_name = 'esp_event_question_group'; |
|
| 163 | - $sql = "EQG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 161 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 162 | + $table_name = 'esp_event_question_group'; |
|
| 163 | + $sql = "EQG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 164 | 164 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 165 | 165 | QSG_ID INT UNSIGNED NOT NULL, |
| 166 | 166 | EQG_primary TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, |
| 167 | 167 | PRIMARY KEY (EQG_ID)"; |
| 168 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 169 | - $table_name = 'esp_event_venue'; |
|
| 170 | - $sql = "EVV_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 168 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 169 | + $table_name = 'esp_event_venue'; |
|
| 170 | + $sql = "EVV_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 171 | 171 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 172 | 172 | VNU_ID BIGINT(20) UNSIGNED NOT NULL, |
| 173 | 173 | EVV_primary TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, |
| 174 | 174 | PRIMARY KEY (EVV_ID)"; |
| 175 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 176 | - $table_name = 'esp_extra_meta'; |
|
| 177 | - $sql = "EXM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 175 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 176 | + $table_name = 'esp_extra_meta'; |
|
| 177 | + $sql = "EXM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 178 | 178 | OBJ_ID INT(11) DEFAULT NULL, |
| 179 | 179 | EXM_type VARCHAR(45) DEFAULT NULL, |
| 180 | 180 | EXM_key VARCHAR(45) DEFAULT NULL, |
| 181 | 181 | EXM_value TEXT, |
| 182 | 182 | PRIMARY KEY (EXM_ID)"; |
| 183 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 184 | - $table_name = 'esp_line_item'; |
|
| 185 | - $sql = "LIN_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 183 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 184 | + $table_name = 'esp_line_item'; |
|
| 185 | + $sql = "LIN_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 186 | 186 | LIN_code VARCHAR(245) NOT NULL DEFAULT '', |
| 187 | 187 | TXN_ID INT(11) DEFAULT NULL, |
| 188 | 188 | LIN_name VARCHAR(245) NOT NULL DEFAULT '', |
@@ -198,19 +198,19 @@ discard block |
||
| 198 | 198 | OBJ_ID INT(11) DEFAULT NULL, |
| 199 | 199 | OBJ_type VARCHAR(45)DEFAULT NULL, |
| 200 | 200 | PRIMARY KEY (LIN_ID)"; |
| 201 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 202 | - $table_name = 'esp_message_template'; |
|
| 203 | - $sql = "MTP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 201 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 202 | + $table_name = 'esp_message_template'; |
|
| 203 | + $sql = "MTP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 204 | 204 | GRP_ID INT(10) UNSIGNED NOT NULL, |
| 205 | 205 | MTP_context VARCHAR(50) NOT NULL, |
| 206 | 206 | MTP_template_field VARCHAR(30) NOT NULL, |
| 207 | 207 | MTP_content TEXT NOT NULL, |
| 208 | 208 | PRIMARY KEY (MTP_ID), |
| 209 | 209 | KEY GRP_ID (GRP_ID)"; |
| 210 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 211 | - $this->_get_table_manager()->dropIndex('esp_message_template_group', 'EVT_ID'); |
|
| 212 | - $table_name = 'esp_message_template_group'; |
|
| 213 | - $sql = "GRP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 210 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 211 | + $this->_get_table_manager()->dropIndex('esp_message_template_group', 'EVT_ID'); |
|
| 212 | + $table_name = 'esp_message_template_group'; |
|
| 213 | + $sql = "GRP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 214 | 214 | MTP_user_id INT(10) NOT NULL DEFAULT '1', |
| 215 | 215 | MTP_name VARCHAR(245) NOT NULL DEFAULT '', |
| 216 | 216 | MTP_description VARCHAR(245) NOT NULL DEFAULT '', |
@@ -222,17 +222,17 @@ discard block |
||
| 222 | 222 | MTP_is_active TINYINT(1) NOT NULL DEFAULT '1', |
| 223 | 223 | PRIMARY KEY (GRP_ID), |
| 224 | 224 | KEY MTP_user_id (MTP_user_id)"; |
| 225 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 226 | - $table_name = 'esp_event_message_template'; |
|
| 227 | - $sql = "EMT_ID BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 225 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 226 | + $table_name = 'esp_event_message_template'; |
|
| 227 | + $sql = "EMT_ID BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 228 | 228 | EVT_ID BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, |
| 229 | 229 | GRP_ID INT(10) UNSIGNED NOT NULL DEFAULT 0, |
| 230 | 230 | PRIMARY KEY (EMT_ID), |
| 231 | 231 | KEY EVT_ID (EVT_ID), |
| 232 | 232 | KEY GRP_ID (GRP_ID)"; |
| 233 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 234 | - $table_name = 'esp_payment'; |
|
| 235 | - $sql = "PAY_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 233 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 234 | + $table_name = 'esp_payment'; |
|
| 235 | + $sql = "PAY_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 236 | 236 | TXN_ID INT(10) UNSIGNED DEFAULT NULL, |
| 237 | 237 | STS_ID VARCHAR(3) COLLATE utf8_bin DEFAULT NULL, |
| 238 | 238 | PAY_timestamp DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', |
@@ -248,28 +248,28 @@ discard block |
||
| 248 | 248 | PRIMARY KEY (PAY_ID), |
| 249 | 249 | KEY TXN_ID (TXN_ID), |
| 250 | 250 | KEY PAY_timestamp (PAY_timestamp)"; |
| 251 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 252 | - $table_name = "esp_ticket_price"; |
|
| 253 | - $sql = "TKP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 251 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 252 | + $table_name = "esp_ticket_price"; |
|
| 253 | + $sql = "TKP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 254 | 254 | TKT_ID INT(10) UNSIGNED NOT NULL, |
| 255 | 255 | PRC_ID INT(10) UNSIGNED NOT NULL, |
| 256 | 256 | PRIMARY KEY (TKP_ID)"; |
| 257 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 258 | - $table_name = "esp_datetime_ticket"; |
|
| 259 | - $sql = "DTK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 257 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 258 | + $table_name = "esp_datetime_ticket"; |
|
| 259 | + $sql = "DTK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 260 | 260 | DTT_ID INT(10) UNSIGNED NOT NULL, |
| 261 | 261 | TKT_ID INT(10) UNSIGNED NOT NULL, |
| 262 | 262 | PRIMARY KEY (DTK_ID)"; |
| 263 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 264 | - $table_name = "esp_ticket_template"; |
|
| 265 | - $sql = "TTM_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 263 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 264 | + $table_name = "esp_ticket_template"; |
|
| 265 | + $sql = "TTM_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 266 | 266 | TTM_name VARCHAR(45) NOT NULL, |
| 267 | 267 | TTM_description TEXT, |
| 268 | 268 | TTM_file VARCHAR(45), |
| 269 | 269 | PRIMARY KEY (TTM_ID)"; |
| 270 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 271 | - $table_name = 'esp_question'; |
|
| 272 | - $sql = 'QST_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 270 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 271 | + $table_name = 'esp_question'; |
|
| 272 | + $sql = 'QST_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 273 | 273 | QST_display_text TEXT NOT NULL, |
| 274 | 274 | QST_admin_label VARCHAR(255) NOT NULL, |
| 275 | 275 | QST_system VARCHAR(25) DEFAULT NULL, |
@@ -281,25 +281,25 @@ discard block |
||
| 281 | 281 | QST_wp_user BIGINT UNSIGNED NULL, |
| 282 | 282 | QST_deleted TINYINT UNSIGNED NOT NULL DEFAULT 0, |
| 283 | 283 | PRIMARY KEY (QST_ID)'; |
| 284 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 285 | - $table_name = 'esp_question_group_question'; |
|
| 286 | - $sql = "QGQ_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 284 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 285 | + $table_name = 'esp_question_group_question'; |
|
| 286 | + $sql = "QGQ_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 287 | 287 | QSG_ID INT UNSIGNED NOT NULL, |
| 288 | 288 | QST_ID INT UNSIGNED NOT NULL, |
| 289 | 289 | QGQ_order INT UNSIGNED NOT NULL DEFAULT 0, |
| 290 | 290 | PRIMARY KEY (QGQ_ID) "; |
| 291 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 292 | - $table_name = 'esp_question_option'; |
|
| 293 | - $sql = "QSO_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 291 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 292 | + $table_name = 'esp_question_option'; |
|
| 293 | + $sql = "QSO_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 294 | 294 | QSO_value VARCHAR(255) NOT NULL, |
| 295 | 295 | QSO_desc TEXT NOT NULL, |
| 296 | 296 | QST_ID INT UNSIGNED NOT NULL, |
| 297 | 297 | QSO_order INT UNSIGNED NOT NULL DEFAULT 0, |
| 298 | 298 | QSO_deleted TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, |
| 299 | 299 | PRIMARY KEY (QSO_ID)"; |
| 300 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 301 | - $table_name = 'esp_registration'; |
|
| 302 | - $sql = "REG_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 300 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 301 | + $table_name = 'esp_registration'; |
|
| 302 | + $sql = "REG_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 303 | 303 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 304 | 304 | ATT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 305 | 305 | TXN_ID INT(10) UNSIGNED NOT NULL, |
@@ -322,25 +322,25 @@ discard block |
||
| 322 | 322 | KEY STS_ID (STS_ID), |
| 323 | 323 | KEY REG_url_link (REG_url_link), |
| 324 | 324 | KEY REG_code (REG_code)"; |
| 325 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 326 | - $table_name = 'esp_checkin'; |
|
| 327 | - $sql = "CHK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 325 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 326 | + $table_name = 'esp_checkin'; |
|
| 327 | + $sql = "CHK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 328 | 328 | REG_ID INT(10) UNSIGNED NOT NULL, |
| 329 | 329 | DTT_ID INT(10) UNSIGNED NOT NULL, |
| 330 | 330 | CHK_in TINYINT(1) UNSIGNED NOT NULL DEFAULT 1, |
| 331 | 331 | CHK_timestamp DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', |
| 332 | 332 | PRIMARY KEY (CHK_ID)"; |
| 333 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 334 | - $table_name = 'esp_state'; |
|
| 335 | - $sql = "STA_ID smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 333 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 334 | + $table_name = 'esp_state'; |
|
| 335 | + $sql = "STA_ID smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 336 | 336 | CNT_ISO VARCHAR(2) COLLATE utf8_bin NOT NULL, |
| 337 | 337 | STA_abbrev VARCHAR(6) COLLATE utf8_bin NOT NULL, |
| 338 | 338 | STA_name VARCHAR(100) COLLATE utf8_bin NOT NULL, |
| 339 | 339 | STA_active TINYINT(1) DEFAULT '1', |
| 340 | 340 | PRIMARY KEY (STA_ID)"; |
| 341 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 342 | - $table_name = 'esp_status'; |
|
| 343 | - $sql = "STS_ID VARCHAR(3) COLLATE utf8_bin NOT NULL, |
|
| 341 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 342 | + $table_name = 'esp_status'; |
|
| 343 | + $sql = "STS_ID VARCHAR(3) COLLATE utf8_bin NOT NULL, |
|
| 344 | 344 | STS_code VARCHAR(45) COLLATE utf8_bin NOT NULL, |
| 345 | 345 | STS_type set('event','registration','transaction','payment','email') COLLATE utf8_bin NOT NULL, |
| 346 | 346 | STS_can_edit TINYINT(1) NOT NULL DEFAULT 0, |
@@ -348,9 +348,9 @@ discard block |
||
| 348 | 348 | STS_open TINYINT(1) NOT NULL DEFAULT 1, |
| 349 | 349 | UNIQUE KEY STS_ID_UNIQUE (STS_ID), |
| 350 | 350 | KEY STS_type (STS_type)"; |
| 351 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 352 | - $table_name = 'esp_transaction'; |
|
| 353 | - $sql = "TXN_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 351 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 352 | + $table_name = 'esp_transaction'; |
|
| 353 | + $sql = "TXN_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 354 | 354 | TXN_timestamp DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', |
| 355 | 355 | TXN_total DECIMAL(10,3) DEFAULT '0.00', |
| 356 | 356 | TXN_paid DECIMAL(10,3) NOT NULL DEFAULT '0.00', |
@@ -361,9 +361,9 @@ discard block |
||
| 361 | 361 | PRIMARY KEY (TXN_ID), |
| 362 | 362 | KEY TXN_timestamp (TXN_timestamp), |
| 363 | 363 | KEY STS_ID (STS_ID)"; |
| 364 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 365 | - $table_name = 'esp_venue_meta'; |
|
| 366 | - $sql = "VNUM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 364 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 365 | + $table_name = 'esp_venue_meta'; |
|
| 366 | + $sql = "VNUM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 367 | 367 | VNU_ID BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, |
| 368 | 368 | VNU_address VARCHAR(255) DEFAULT NULL, |
| 369 | 369 | VNU_address2 VARCHAR(255) DEFAULT NULL, |
@@ -381,10 +381,10 @@ discard block |
||
| 381 | 381 | PRIMARY KEY (VNUM_ID), |
| 382 | 382 | KEY STA_ID (STA_ID), |
| 383 | 383 | KEY CNT_ISO (CNT_ISO)"; |
| 384 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 385 | - //modified tables |
|
| 386 | - $table_name = "esp_price"; |
|
| 387 | - $sql = "PRC_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 384 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 385 | + //modified tables |
|
| 386 | + $table_name = "esp_price"; |
|
| 387 | + $sql = "PRC_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 388 | 388 | PRT_ID TINYINT(3) UNSIGNED NOT NULL, |
| 389 | 389 | PRC_amount DECIMAL(10,3) NOT NULL DEFAULT '0.00', |
| 390 | 390 | PRC_name VARCHAR(245) NOT NULL, |
@@ -396,9 +396,9 @@ discard block |
||
| 396 | 396 | PRC_wp_user BIGINT UNSIGNED NULL, |
| 397 | 397 | PRC_parent INT(10) UNSIGNED DEFAULT 0, |
| 398 | 398 | PRIMARY KEY (PRC_ID)"; |
| 399 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 400 | - $table_name = "esp_price_type"; |
|
| 401 | - $sql = "PRT_ID TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 399 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 400 | + $table_name = "esp_price_type"; |
|
| 401 | + $sql = "PRT_ID TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 402 | 402 | PRT_name VARCHAR(45) NOT NULL, |
| 403 | 403 | PBT_ID TINYINT(3) UNSIGNED NOT NULL DEFAULT '1', |
| 404 | 404 | PRT_is_percent TINYINT(1) NOT NULL DEFAULT '0', |
@@ -407,9 +407,9 @@ discard block |
||
| 407 | 407 | PRT_deleted TINYINT(1) NOT NULL DEFAULT '0', |
| 408 | 408 | UNIQUE KEY PRT_name_UNIQUE (PRT_name), |
| 409 | 409 | PRIMARY KEY (PRT_ID)"; |
| 410 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 411 | - $table_name = "esp_ticket"; |
|
| 412 | - $sql = "TKT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 410 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 411 | + $table_name = "esp_ticket"; |
|
| 412 | + $sql = "TKT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 413 | 413 | TTM_ID INT(10) UNSIGNED NOT NULL, |
| 414 | 414 | TKT_name VARCHAR(245) NOT NULL DEFAULT '', |
| 415 | 415 | TKT_description TEXT NOT NULL, |
@@ -430,10 +430,10 @@ discard block |
||
| 430 | 430 | TKT_parent INT(10) UNSIGNED DEFAULT '0', |
| 431 | 431 | TKT_deleted TINYINT(1) NOT NULL DEFAULT '0', |
| 432 | 432 | PRIMARY KEY (TKT_ID)"; |
| 433 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 434 | - $this->_get_table_manager()->dropIndex('esp_question_group', 'QSG_identifier_UNIQUE'); |
|
| 435 | - $table_name = 'esp_question_group'; |
|
| 436 | - $sql = 'QSG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 433 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 434 | + $this->_get_table_manager()->dropIndex('esp_question_group', 'QSG_identifier_UNIQUE'); |
|
| 435 | + $table_name = 'esp_question_group'; |
|
| 436 | + $sql = 'QSG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 437 | 437 | QSG_name VARCHAR(255) NOT NULL, |
| 438 | 438 | QSG_identifier VARCHAR(100) NOT NULL, |
| 439 | 439 | QSG_desc TEXT NULL, |
@@ -445,135 +445,135 @@ discard block |
||
| 445 | 445 | QSG_wp_user BIGINT UNSIGNED NULL, |
| 446 | 446 | PRIMARY KEY (QSG_ID), |
| 447 | 447 | UNIQUE KEY QSG_identifier_UNIQUE (QSG_identifier ASC)'; |
| 448 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 449 | - $script_4_1_defaults = EE_Registry::instance()->load_dms('Core_4_1_0'); |
|
| 450 | - //(because many need to convert old string states to foreign keys into the states table) |
|
| 451 | - $script_4_1_defaults->insert_default_states(); |
|
| 452 | - $script_4_1_defaults->insert_default_countries(); |
|
| 453 | - //schema on price, price_types and tickets has changed so use the DEFAULT method in here instead of 4.1's and later. |
|
| 454 | - $this->insert_default_price_types(); |
|
| 455 | - $this->insert_default_prices(); |
|
| 456 | - $this->insert_default_tickets(); |
|
| 457 | - //setting up the config wp option pretty well counts as a 'schema change', or at least should happen ehre |
|
| 458 | - EE_Config::instance()->update_espresso_config(false, true); |
|
| 459 | - return true; |
|
| 460 | - } |
|
| 461 | - |
|
| 462 | - |
|
| 463 | - |
|
| 464 | - /** |
|
| 465 | - * @return boolean |
|
| 466 | - */ |
|
| 467 | - public function schema_changes_after_migration() |
|
| 468 | - { |
|
| 469 | - return true; |
|
| 470 | - } |
|
| 471 | - |
|
| 472 | - |
|
| 473 | - |
|
| 474 | - public function migration_page_hooks() |
|
| 475 | - { |
|
| 476 | - } |
|
| 477 | - |
|
| 478 | - |
|
| 479 | - |
|
| 480 | - /** |
|
| 481 | - * insert_default_price_types |
|
| 482 | - * |
|
| 483 | - * @since 4.5.0 |
|
| 484 | - * @return void |
|
| 485 | - */ |
|
| 486 | - public function insert_default_price_types() |
|
| 487 | - { |
|
| 488 | - global $wpdb; |
|
| 489 | - $price_type_table = $wpdb->prefix . "esp_price_type"; |
|
| 490 | - if ($this->_get_table_analysis()->tableExists($price_type_table)) { |
|
| 491 | - $SQL = 'SELECT COUNT(PRT_ID) FROM ' . $price_type_table; |
|
| 492 | - $price_types_exist = $wpdb->get_var($SQL); |
|
| 493 | - if ( ! $price_types_exist) { |
|
| 494 | - $user_id = EEH_Activation::get_default_creator_id(); |
|
| 495 | - $SQL = "INSERT INTO $price_type_table ( PRT_ID, PRT_name, PBT_ID, PRT_is_percent, PRT_order, PRT_wp_user, PRT_deleted ) VALUES |
|
| 448 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 449 | + $script_4_1_defaults = EE_Registry::instance()->load_dms('Core_4_1_0'); |
|
| 450 | + //(because many need to convert old string states to foreign keys into the states table) |
|
| 451 | + $script_4_1_defaults->insert_default_states(); |
|
| 452 | + $script_4_1_defaults->insert_default_countries(); |
|
| 453 | + //schema on price, price_types and tickets has changed so use the DEFAULT method in here instead of 4.1's and later. |
|
| 454 | + $this->insert_default_price_types(); |
|
| 455 | + $this->insert_default_prices(); |
|
| 456 | + $this->insert_default_tickets(); |
|
| 457 | + //setting up the config wp option pretty well counts as a 'schema change', or at least should happen ehre |
|
| 458 | + EE_Config::instance()->update_espresso_config(false, true); |
|
| 459 | + return true; |
|
| 460 | + } |
|
| 461 | + |
|
| 462 | + |
|
| 463 | + |
|
| 464 | + /** |
|
| 465 | + * @return boolean |
|
| 466 | + */ |
|
| 467 | + public function schema_changes_after_migration() |
|
| 468 | + { |
|
| 469 | + return true; |
|
| 470 | + } |
|
| 471 | + |
|
| 472 | + |
|
| 473 | + |
|
| 474 | + public function migration_page_hooks() |
|
| 475 | + { |
|
| 476 | + } |
|
| 477 | + |
|
| 478 | + |
|
| 479 | + |
|
| 480 | + /** |
|
| 481 | + * insert_default_price_types |
|
| 482 | + * |
|
| 483 | + * @since 4.5.0 |
|
| 484 | + * @return void |
|
| 485 | + */ |
|
| 486 | + public function insert_default_price_types() |
|
| 487 | + { |
|
| 488 | + global $wpdb; |
|
| 489 | + $price_type_table = $wpdb->prefix . "esp_price_type"; |
|
| 490 | + if ($this->_get_table_analysis()->tableExists($price_type_table)) { |
|
| 491 | + $SQL = 'SELECT COUNT(PRT_ID) FROM ' . $price_type_table; |
|
| 492 | + $price_types_exist = $wpdb->get_var($SQL); |
|
| 493 | + if ( ! $price_types_exist) { |
|
| 494 | + $user_id = EEH_Activation::get_default_creator_id(); |
|
| 495 | + $SQL = "INSERT INTO $price_type_table ( PRT_ID, PRT_name, PBT_ID, PRT_is_percent, PRT_order, PRT_wp_user, PRT_deleted ) VALUES |
|
| 496 | 496 | (1, '" . __('Base Price', 'event_espresso') . "', 1, 0, 0, $user_id, 0), |
| 497 | 497 | (2, '" . __('Percent Discount', 'event_espresso') . "', 2, 1, 20, $user_id, 0), |
| 498 | 498 | (3, '" . __('Dollar Discount', 'event_espresso') . "', 2, 0, 30, $user_id, 0), |
| 499 | 499 | (4, '" . __('Percent Surcharge', 'event_espresso') . "', 3, 1, 40, $user_id, 0), |
| 500 | 500 | (5, '" . __('Dollar Surcharge', 'event_espresso') . "', 3, 0, 50, $user_id, 0);"; |
| 501 | - $SQL = apply_filters('FHEE__EE_DMS_4_5_0__insert_default_price_types__SQL', $SQL); |
|
| 502 | - $wpdb->query($SQL); |
|
| 503 | - } |
|
| 504 | - } |
|
| 505 | - } |
|
| 506 | - |
|
| 507 | - |
|
| 508 | - |
|
| 509 | - /** |
|
| 510 | - * insert DEFAULT prices. |
|
| 511 | - * If we're INSTALLING 4.x CAF, then we add a few extra DEFAULT prices |
|
| 512 | - * when EEH_Activaion's initialize_db_content is called via ahook in |
|
| 513 | - * EE_Brewing_regular |
|
| 514 | - * |
|
| 515 | - * @since 4.5.0 |
|
| 516 | - * @return void |
|
| 517 | - */ |
|
| 518 | - public function insert_default_prices() |
|
| 519 | - { |
|
| 520 | - global $wpdb; |
|
| 521 | - $price_table = $wpdb->prefix . "esp_price"; |
|
| 522 | - if ($this->_get_table_analysis()->tableExists($price_table)) { |
|
| 523 | - $SQL = 'SELECT COUNT(PRC_ID) FROM ' . $price_table; |
|
| 524 | - $prices_exist = $wpdb->get_var($SQL); |
|
| 525 | - if ( ! $prices_exist) { |
|
| 526 | - $user_id = EEH_Activation::get_default_creator_id(); |
|
| 527 | - $SQL = "INSERT INTO $price_table |
|
| 501 | + $SQL = apply_filters('FHEE__EE_DMS_4_5_0__insert_default_price_types__SQL', $SQL); |
|
| 502 | + $wpdb->query($SQL); |
|
| 503 | + } |
|
| 504 | + } |
|
| 505 | + } |
|
| 506 | + |
|
| 507 | + |
|
| 508 | + |
|
| 509 | + /** |
|
| 510 | + * insert DEFAULT prices. |
|
| 511 | + * If we're INSTALLING 4.x CAF, then we add a few extra DEFAULT prices |
|
| 512 | + * when EEH_Activaion's initialize_db_content is called via ahook in |
|
| 513 | + * EE_Brewing_regular |
|
| 514 | + * |
|
| 515 | + * @since 4.5.0 |
|
| 516 | + * @return void |
|
| 517 | + */ |
|
| 518 | + public function insert_default_prices() |
|
| 519 | + { |
|
| 520 | + global $wpdb; |
|
| 521 | + $price_table = $wpdb->prefix . "esp_price"; |
|
| 522 | + if ($this->_get_table_analysis()->tableExists($price_table)) { |
|
| 523 | + $SQL = 'SELECT COUNT(PRC_ID) FROM ' . $price_table; |
|
| 524 | + $prices_exist = $wpdb->get_var($SQL); |
|
| 525 | + if ( ! $prices_exist) { |
|
| 526 | + $user_id = EEH_Activation::get_default_creator_id(); |
|
| 527 | + $SQL = "INSERT INTO $price_table |
|
| 528 | 528 | (PRC_ID, PRT_ID, PRC_amount, PRC_name, PRC_desc, PRC_is_default, PRC_overrides, PRC_wp_user, PRC_order, PRC_deleted, PRC_parent ) VALUES |
| 529 | 529 | (1, 1, '0.00', 'Free Admission', '', 1, NULL, $user_id, 0, 0, 0);"; |
| 530 | - $SQL = apply_filters('FHEE__EE_DMS_4_5_0__insert_default_prices__SQL', $SQL); |
|
| 531 | - $wpdb->query($SQL); |
|
| 532 | - } |
|
| 533 | - } |
|
| 534 | - } |
|
| 535 | - |
|
| 536 | - |
|
| 537 | - |
|
| 538 | - /** |
|
| 539 | - * insert DEFAULT ticket |
|
| 540 | - * Almost identical to EE_DMS_Core_4_3_0::insert_default_tickets, except is aware of the TKT_wp_user field |
|
| 541 | - * |
|
| 542 | - * @since 4.5.0 |
|
| 543 | - * @return void |
|
| 544 | - */ |
|
| 545 | - public function insert_default_tickets() |
|
| 546 | - { |
|
| 547 | - global $wpdb; |
|
| 548 | - $ticket_table = $wpdb->prefix . "esp_ticket"; |
|
| 549 | - if ($this->_get_table_analysis()->tableExists($ticket_table)) { |
|
| 550 | - $SQL = 'SELECT COUNT(TKT_ID) FROM ' . $ticket_table; |
|
| 551 | - $tickets_exist = $wpdb->get_var($SQL); |
|
| 552 | - if ( ! $tickets_exist) { |
|
| 553 | - $user_id = EEH_Activation::get_default_creator_id(); |
|
| 554 | - $SQL = "INSERT INTO $ticket_table |
|
| 530 | + $SQL = apply_filters('FHEE__EE_DMS_4_5_0__insert_default_prices__SQL', $SQL); |
|
| 531 | + $wpdb->query($SQL); |
|
| 532 | + } |
|
| 533 | + } |
|
| 534 | + } |
|
| 535 | + |
|
| 536 | + |
|
| 537 | + |
|
| 538 | + /** |
|
| 539 | + * insert DEFAULT ticket |
|
| 540 | + * Almost identical to EE_DMS_Core_4_3_0::insert_default_tickets, except is aware of the TKT_wp_user field |
|
| 541 | + * |
|
| 542 | + * @since 4.5.0 |
|
| 543 | + * @return void |
|
| 544 | + */ |
|
| 545 | + public function insert_default_tickets() |
|
| 546 | + { |
|
| 547 | + global $wpdb; |
|
| 548 | + $ticket_table = $wpdb->prefix . "esp_ticket"; |
|
| 549 | + if ($this->_get_table_analysis()->tableExists($ticket_table)) { |
|
| 550 | + $SQL = 'SELECT COUNT(TKT_ID) FROM ' . $ticket_table; |
|
| 551 | + $tickets_exist = $wpdb->get_var($SQL); |
|
| 552 | + if ( ! $tickets_exist) { |
|
| 553 | + $user_id = EEH_Activation::get_default_creator_id(); |
|
| 554 | + $SQL = "INSERT INTO $ticket_table |
|
| 555 | 555 | ( TKT_ID, TTM_ID, TKT_name, TKT_description, TKT_qty, TKT_sold, TKT_uses, TKT_required, TKT_min, TKT_max, TKT_price, TKT_start_date, TKT_end_date, TKT_taxable, TKT_order, TKT_row, TKT_is_default, TKT_parent, TKT_wp_user, TKT_deleted ) VALUES |
| 556 | 556 | ( 1, 0, '" |
| 557 | - . __("Free Ticket", "event_espresso") |
|
| 558 | - . "', '', 100, 0, -1, 0, 0, -1, 0.00, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0, 0, 1, 1, 0, $user_id, 0);"; |
|
| 559 | - $SQL = apply_filters('FHEE__EE_DMS_4_5_0__insert_default_tickets__SQL', $SQL); |
|
| 560 | - $wpdb->query($SQL); |
|
| 561 | - } |
|
| 562 | - } |
|
| 563 | - $ticket_price_table = $wpdb->prefix . "esp_ticket_price"; |
|
| 564 | - if ($this->_get_table_analysis()->tableExists($ticket_price_table)) { |
|
| 565 | - $SQL = 'SELECT COUNT(TKP_ID) FROM ' . $ticket_price_table; |
|
| 566 | - $ticket_prc_exist = $wpdb->get_var($SQL); |
|
| 567 | - if ( ! $ticket_prc_exist) { |
|
| 568 | - $SQL = "INSERT INTO $ticket_price_table |
|
| 557 | + . __("Free Ticket", "event_espresso") |
|
| 558 | + . "', '', 100, 0, -1, 0, 0, -1, 0.00, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0, 0, 1, 1, 0, $user_id, 0);"; |
|
| 559 | + $SQL = apply_filters('FHEE__EE_DMS_4_5_0__insert_default_tickets__SQL', $SQL); |
|
| 560 | + $wpdb->query($SQL); |
|
| 561 | + } |
|
| 562 | + } |
|
| 563 | + $ticket_price_table = $wpdb->prefix . "esp_ticket_price"; |
|
| 564 | + if ($this->_get_table_analysis()->tableExists($ticket_price_table)) { |
|
| 565 | + $SQL = 'SELECT COUNT(TKP_ID) FROM ' . $ticket_price_table; |
|
| 566 | + $ticket_prc_exist = $wpdb->get_var($SQL); |
|
| 567 | + if ( ! $ticket_prc_exist) { |
|
| 568 | + $SQL = "INSERT INTO $ticket_price_table |
|
| 569 | 569 | ( TKP_ID, TKT_ID, PRC_ID ) VALUES |
| 570 | 570 | ( 1, 1, 1 ) |
| 571 | 571 | "; |
| 572 | - $SQL = apply_filters('FHEE__EE_DMS_4_5_0__insert_default_tickets__SQL__ticket_price', $SQL); |
|
| 573 | - $wpdb->query($SQL); |
|
| 574 | - } |
|
| 575 | - } |
|
| 576 | - } |
|
| 572 | + $SQL = apply_filters('FHEE__EE_DMS_4_5_0__insert_default_tickets__SQL__ticket_price', $SQL); |
|
| 573 | + $wpdb->query($SQL); |
|
| 574 | + } |
|
| 575 | + } |
|
| 576 | + } |
|
| 577 | 577 | |
| 578 | 578 | } |
| 579 | 579 | |
@@ -13,7 +13,7 @@ discard block |
||
| 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_5_0_stages/*'); |
|
| 16 | +$stages = glob(EE_CORE.'data_migration_scripts/4_5_0_stages/*'); |
|
| 17 | 17 | $class_to_filepath = array(); |
| 18 | 18 | foreach ($stages as $filepath) { |
| 19 | 19 | $matches = array(); |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | } elseif ( ! $version_string) { |
| 63 | 63 | // echo "no version string provided: $version_string"; |
| 64 | 64 | //no version string provided... this must be pre 4.3 |
| 65 | - return false;//changed mind. dont want people thinking they should migrate yet because they cant |
|
| 65 | + return false; //changed mind. dont want people thinking they should migrate yet because they cant |
|
| 66 | 66 | } else { |
| 67 | 67 | // echo "$version_string doesnt apply"; |
| 68 | 68 | return false; |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | public function schema_changes_before_migration() |
| 82 | 82 | { |
| 83 | 83 | //relies on 4.1's EEH_Activation::create_table |
| 84 | - require_once(EE_HELPERS . 'EEH_Activation.helper.php'); |
|
| 84 | + require_once(EE_HELPERS.'EEH_Activation.helper.php'); |
|
| 85 | 85 | $table_name = 'esp_answer'; |
| 86 | 86 | $sql = " ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
| 87 | 87 | REG_ID INT UNSIGNED NOT NULL, |
@@ -486,18 +486,18 @@ discard block |
||
| 486 | 486 | public function insert_default_price_types() |
| 487 | 487 | { |
| 488 | 488 | global $wpdb; |
| 489 | - $price_type_table = $wpdb->prefix . "esp_price_type"; |
|
| 489 | + $price_type_table = $wpdb->prefix."esp_price_type"; |
|
| 490 | 490 | if ($this->_get_table_analysis()->tableExists($price_type_table)) { |
| 491 | - $SQL = 'SELECT COUNT(PRT_ID) FROM ' . $price_type_table; |
|
| 491 | + $SQL = 'SELECT COUNT(PRT_ID) FROM '.$price_type_table; |
|
| 492 | 492 | $price_types_exist = $wpdb->get_var($SQL); |
| 493 | 493 | if ( ! $price_types_exist) { |
| 494 | 494 | $user_id = EEH_Activation::get_default_creator_id(); |
| 495 | 495 | $SQL = "INSERT INTO $price_type_table ( PRT_ID, PRT_name, PBT_ID, PRT_is_percent, PRT_order, PRT_wp_user, PRT_deleted ) VALUES |
| 496 | - (1, '" . __('Base Price', 'event_espresso') . "', 1, 0, 0, $user_id, 0), |
|
| 497 | - (2, '" . __('Percent Discount', 'event_espresso') . "', 2, 1, 20, $user_id, 0), |
|
| 498 | - (3, '" . __('Dollar Discount', 'event_espresso') . "', 2, 0, 30, $user_id, 0), |
|
| 499 | - (4, '" . __('Percent Surcharge', 'event_espresso') . "', 3, 1, 40, $user_id, 0), |
|
| 500 | - (5, '" . __('Dollar Surcharge', 'event_espresso') . "', 3, 0, 50, $user_id, 0);"; |
|
| 496 | + (1, '".__('Base Price', 'event_espresso')."', 1, 0, 0, $user_id, 0), |
|
| 497 | + (2, '".__('Percent Discount', 'event_espresso')."', 2, 1, 20, $user_id, 0), |
|
| 498 | + (3, '".__('Dollar Discount', 'event_espresso')."', 2, 0, 30, $user_id, 0), |
|
| 499 | + (4, '".__('Percent Surcharge', 'event_espresso')."', 3, 1, 40, $user_id, 0), |
|
| 500 | + (5, '".__('Dollar Surcharge', 'event_espresso')."', 3, 0, 50, $user_id, 0);"; |
|
| 501 | 501 | $SQL = apply_filters('FHEE__EE_DMS_4_5_0__insert_default_price_types__SQL', $SQL); |
| 502 | 502 | $wpdb->query($SQL); |
| 503 | 503 | } |
@@ -518,9 +518,9 @@ discard block |
||
| 518 | 518 | public function insert_default_prices() |
| 519 | 519 | { |
| 520 | 520 | global $wpdb; |
| 521 | - $price_table = $wpdb->prefix . "esp_price"; |
|
| 521 | + $price_table = $wpdb->prefix."esp_price"; |
|
| 522 | 522 | if ($this->_get_table_analysis()->tableExists($price_table)) { |
| 523 | - $SQL = 'SELECT COUNT(PRC_ID) FROM ' . $price_table; |
|
| 523 | + $SQL = 'SELECT COUNT(PRC_ID) FROM '.$price_table; |
|
| 524 | 524 | $prices_exist = $wpdb->get_var($SQL); |
| 525 | 525 | if ( ! $prices_exist) { |
| 526 | 526 | $user_id = EEH_Activation::get_default_creator_id(); |
@@ -545,9 +545,9 @@ discard block |
||
| 545 | 545 | public function insert_default_tickets() |
| 546 | 546 | { |
| 547 | 547 | global $wpdb; |
| 548 | - $ticket_table = $wpdb->prefix . "esp_ticket"; |
|
| 548 | + $ticket_table = $wpdb->prefix."esp_ticket"; |
|
| 549 | 549 | if ($this->_get_table_analysis()->tableExists($ticket_table)) { |
| 550 | - $SQL = 'SELECT COUNT(TKT_ID) FROM ' . $ticket_table; |
|
| 550 | + $SQL = 'SELECT COUNT(TKT_ID) FROM '.$ticket_table; |
|
| 551 | 551 | $tickets_exist = $wpdb->get_var($SQL); |
| 552 | 552 | if ( ! $tickets_exist) { |
| 553 | 553 | $user_id = EEH_Activation::get_default_creator_id(); |
@@ -560,9 +560,9 @@ discard block |
||
| 560 | 560 | $wpdb->query($SQL); |
| 561 | 561 | } |
| 562 | 562 | } |
| 563 | - $ticket_price_table = $wpdb->prefix . "esp_ticket_price"; |
|
| 563 | + $ticket_price_table = $wpdb->prefix."esp_ticket_price"; |
|
| 564 | 564 | if ($this->_get_table_analysis()->tableExists($ticket_price_table)) { |
| 565 | - $SQL = 'SELECT COUNT(TKP_ID) FROM ' . $ticket_price_table; |
|
| 565 | + $SQL = 'SELECT COUNT(TKP_ID) FROM '.$ticket_price_table; |
|
| 566 | 566 | $ticket_prc_exist = $wpdb->get_var($SQL); |
| 567 | 567 | if ( ! $ticket_prc_exist) { |
| 568 | 568 | $SQL = "INSERT INTO $ticket_price_table |
@@ -9,7 +9,6 @@ discard block |
||
| 9 | 9 | * and recalculates esp_registration.REG_final_price to actually be the final price |
| 10 | 10 | * for that registration (before this it was just the ticket's price, NOT including |
| 11 | 11 | * taxes or other price modifiers) |
| 12 | - |
|
| 13 | 12 | */ |
| 14 | 13 | // make sure we have all the stages loaded too |
| 15 | 14 | // unfortunately, this needs to be done upon INCLUSION of this file, |
@@ -18,9 +17,9 @@ discard block |
||
| 18 | 17 | $stages = glob(EE_CORE . 'data_migration_scripts/4_7_0_stages/*'); |
| 19 | 18 | $class_to_filepath = array(); |
| 20 | 19 | foreach ($stages as $filepath) { |
| 21 | - $matches = array(); |
|
| 22 | - preg_match('~4_7_0_stages/(.*).dmsstage.php~', $filepath, $matches); |
|
| 23 | - $class_to_filepath[$matches[1]] = $filepath; |
|
| 20 | + $matches = array(); |
|
| 21 | + preg_match('~4_7_0_stages/(.*).dmsstage.php~', $filepath, $matches); |
|
| 22 | + $class_to_filepath[$matches[1]] = $filepath; |
|
| 24 | 23 | } |
| 25 | 24 | //give addons a chance to autoload their stages too |
| 26 | 25 | $class_to_filepath = apply_filters('FHEE__EE_DMS_4_7_0__autoloaded_stages', $class_to_filepath); |
@@ -39,82 +38,82 @@ discard block |
||
| 39 | 38 | class EE_DMS_Core_4_7_0 extends EE_Data_Migration_Script_Base |
| 40 | 39 | { |
| 41 | 40 | |
| 42 | - /** |
|
| 43 | - * return EE_DMS_Core_4_7_0 |
|
| 44 | - * |
|
| 45 | - * @param TableManager $table_manager |
|
| 46 | - * @param TableAnalysis $table_analysis |
|
| 47 | - */ |
|
| 48 | - public function __construct(TableManager $table_manager = null, TableAnalysis $table_analysis = null) |
|
| 49 | - { |
|
| 50 | - $this->_pretty_name = __("Data Migration to Event Espresso 4.7.0.p", "event_espresso"); |
|
| 51 | - $this->_priority = 10; |
|
| 52 | - $this->_migration_stages = array( |
|
| 53 | - new EE_DMS_4_7_0_Add_Taxes_To_REG_Final_Price(), |
|
| 54 | - new EE_DMS_4_7_0_Registration_Payments(), |
|
| 55 | - ); |
|
| 56 | - parent::__construct($table_manager, $table_analysis); |
|
| 57 | - } |
|
| 41 | + /** |
|
| 42 | + * return EE_DMS_Core_4_7_0 |
|
| 43 | + * |
|
| 44 | + * @param TableManager $table_manager |
|
| 45 | + * @param TableAnalysis $table_analysis |
|
| 46 | + */ |
|
| 47 | + public function __construct(TableManager $table_manager = null, TableAnalysis $table_analysis = null) |
|
| 48 | + { |
|
| 49 | + $this->_pretty_name = __("Data Migration to Event Espresso 4.7.0.p", "event_espresso"); |
|
| 50 | + $this->_priority = 10; |
|
| 51 | + $this->_migration_stages = array( |
|
| 52 | + new EE_DMS_4_7_0_Add_Taxes_To_REG_Final_Price(), |
|
| 53 | + new EE_DMS_4_7_0_Registration_Payments(), |
|
| 54 | + ); |
|
| 55 | + parent::__construct($table_manager, $table_analysis); |
|
| 56 | + } |
|
| 58 | 57 | |
| 59 | 58 | |
| 60 | 59 | |
| 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 ( |
|
| 69 | - ( |
|
| 70 | - version_compare($version_string, '4.7.0', '<=') |
|
| 71 | - && version_compare($version_string, '4.6.0', '>=') |
|
| 72 | - ) |
|
| 73 | - || ( |
|
| 74 | - version_compare($version_string, '4.7.0', '>=') |
|
| 75 | - && ! $this->_get_table_analysis()->tableExists('esp_registration_payment') |
|
| 76 | - && $this->_get_table_analysis()->tableExists('esp_registration') |
|
| 77 | - ) |
|
| 78 | - ) { |
|
| 79 | - return true; |
|
| 80 | - } elseif ( ! $version_string) { |
|
| 81 | - //no version string provided... this must be pre 4.3 |
|
| 82 | - return false;//changed mind. dont want people thinking they should migrate yet because they cant |
|
| 83 | - } else { |
|
| 84 | - return false; |
|
| 85 | - } |
|
| 86 | - } |
|
| 60 | + /** |
|
| 61 | + * @param array $version_array |
|
| 62 | + * @return bool |
|
| 63 | + */ |
|
| 64 | + public function can_migrate_from_version($version_array) |
|
| 65 | + { |
|
| 66 | + $version_string = $version_array['Core']; |
|
| 67 | + if ( |
|
| 68 | + ( |
|
| 69 | + version_compare($version_string, '4.7.0', '<=') |
|
| 70 | + && version_compare($version_string, '4.6.0', '>=') |
|
| 71 | + ) |
|
| 72 | + || ( |
|
| 73 | + version_compare($version_string, '4.7.0', '>=') |
|
| 74 | + && ! $this->_get_table_analysis()->tableExists('esp_registration_payment') |
|
| 75 | + && $this->_get_table_analysis()->tableExists('esp_registration') |
|
| 76 | + ) |
|
| 77 | + ) { |
|
| 78 | + return true; |
|
| 79 | + } elseif ( ! $version_string) { |
|
| 80 | + //no version string provided... this must be pre 4.3 |
|
| 81 | + return false;//changed mind. dont want people thinking they should migrate yet because they cant |
|
| 82 | + } else { |
|
| 83 | + return false; |
|
| 84 | + } |
|
| 85 | + } |
|
| 87 | 86 | |
| 88 | 87 | |
| 89 | 88 | |
| 90 | - /** |
|
| 91 | - * @return string|void |
|
| 92 | - */ |
|
| 93 | - public function pretty_name() |
|
| 94 | - { |
|
| 95 | - return __("Core Data Migration to version 4.7.0", "event_espresso"); |
|
| 96 | - } |
|
| 89 | + /** |
|
| 90 | + * @return string|void |
|
| 91 | + */ |
|
| 92 | + public function pretty_name() |
|
| 93 | + { |
|
| 94 | + return __("Core Data Migration to version 4.7.0", "event_espresso"); |
|
| 95 | + } |
|
| 97 | 96 | |
| 98 | 97 | |
| 99 | 98 | |
| 100 | - /** |
|
| 101 | - * @return bool |
|
| 102 | - */ |
|
| 103 | - public function schema_changes_before_migration() |
|
| 104 | - { |
|
| 105 | - //relies on 4.1's EEH_Activation::create_table |
|
| 106 | - require_once(EE_HELPERS . 'EEH_Activation.helper.php'); |
|
| 107 | - $table_name = 'esp_answer'; |
|
| 108 | - $sql = " ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 99 | + /** |
|
| 100 | + * @return bool |
|
| 101 | + */ |
|
| 102 | + public function schema_changes_before_migration() |
|
| 103 | + { |
|
| 104 | + //relies on 4.1's EEH_Activation::create_table |
|
| 105 | + require_once(EE_HELPERS . 'EEH_Activation.helper.php'); |
|
| 106 | + $table_name = 'esp_answer'; |
|
| 107 | + $sql = " ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 109 | 108 | REG_ID INT UNSIGNED NOT NULL, |
| 110 | 109 | QST_ID INT UNSIGNED NOT NULL, |
| 111 | 110 | ANS_value TEXT NOT NULL, |
| 112 | 111 | PRIMARY KEY (ANS_ID), |
| 113 | 112 | KEY REG_ID (REG_ID), |
| 114 | 113 | KEY QST_ID (QST_ID)"; |
| 115 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 116 | - $table_name = 'esp_attendee_meta'; |
|
| 117 | - $sql = "ATTM_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 114 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 115 | + $table_name = 'esp_attendee_meta'; |
|
| 116 | + $sql = "ATTM_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 118 | 117 | ATT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 119 | 118 | ATT_fname VARCHAR(45) NOT NULL, |
| 120 | 119 | ATT_lname VARCHAR(45) NOT NULL, |
@@ -131,9 +130,9 @@ discard block |
||
| 131 | 130 | KEY ATT_email (ATT_email), |
| 132 | 131 | KEY ATT_lname (ATT_lname), |
| 133 | 132 | KEY ATT_fname (ATT_fname)"; |
| 134 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 135 | - $table_name = 'esp_country'; |
|
| 136 | - $sql = "CNT_ISO VARCHAR(2) COLLATE utf8_bin NOT NULL, |
|
| 133 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 134 | + $table_name = 'esp_country'; |
|
| 135 | + $sql = "CNT_ISO VARCHAR(2) COLLATE utf8_bin NOT NULL, |
|
| 137 | 136 | CNT_ISO3 VARCHAR(3) COLLATE utf8_bin NOT NULL, |
| 138 | 137 | RGN_ID TINYINT(3) UNSIGNED DEFAULT NULL, |
| 139 | 138 | CNT_name VARCHAR(45) COLLATE utf8_bin NOT NULL, |
@@ -149,25 +148,25 @@ discard block |
||
| 149 | 148 | CNT_is_EU TINYINT(1) DEFAULT '0', |
| 150 | 149 | CNT_active TINYINT(1) DEFAULT '0', |
| 151 | 150 | PRIMARY KEY (CNT_ISO)"; |
| 152 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 153 | - $table_name = 'esp_currency'; |
|
| 154 | - $sql = "CUR_code VARCHAR(6) COLLATE utf8_bin NOT NULL, |
|
| 151 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 152 | + $table_name = 'esp_currency'; |
|
| 153 | + $sql = "CUR_code VARCHAR(6) COLLATE utf8_bin NOT NULL, |
|
| 155 | 154 | CUR_single VARCHAR(45) COLLATE utf8_bin DEFAULT 'dollar', |
| 156 | 155 | CUR_plural VARCHAR(45) COLLATE utf8_bin DEFAULT 'dollars', |
| 157 | 156 | CUR_sign VARCHAR(45) COLLATE utf8_bin DEFAULT '$', |
| 158 | 157 | CUR_dec_plc VARCHAR(1) COLLATE utf8_bin NOT NULL DEFAULT '2', |
| 159 | 158 | CUR_active TINYINT(1) DEFAULT '0', |
| 160 | 159 | PRIMARY KEY (CUR_code)"; |
| 161 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 162 | - $table_name = 'esp_currency_payment_method'; |
|
| 163 | - $sql = "CPM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 160 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 161 | + $table_name = 'esp_currency_payment_method'; |
|
| 162 | + $sql = "CPM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 164 | 163 | CUR_code VARCHAR(6) COLLATE utf8_bin NOT NULL, |
| 165 | 164 | PMD_ID INT(11) NOT NULL, |
| 166 | 165 | PRIMARY KEY (CPM_ID), |
| 167 | 166 | KEY PMD_ID (PMD_ID)"; |
| 168 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 169 | - $table_name = 'esp_datetime'; |
|
| 170 | - $sql = "DTT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 167 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 168 | + $table_name = 'esp_datetime'; |
|
| 169 | + $sql = "DTT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 171 | 170 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 172 | 171 | DTT_name VARCHAR(255) NOT NULL DEFAULT '', |
| 173 | 172 | DTT_description TEXT NOT NULL, |
@@ -183,9 +182,9 @@ discard block |
||
| 183 | 182 | KEY DTT_EVT_start (DTT_EVT_start), |
| 184 | 183 | KEY EVT_ID (EVT_ID), |
| 185 | 184 | KEY DTT_is_primary (DTT_is_primary)"; |
| 186 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 187 | - $table_name = 'esp_event_meta'; |
|
| 188 | - $sql = " |
|
| 185 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 186 | + $table_name = 'esp_event_meta'; |
|
| 187 | + $sql = " |
|
| 189 | 188 | EVTM_ID INT NOT NULL AUTO_INCREMENT, |
| 190 | 189 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 191 | 190 | EVT_display_desc TINYINT(1) UNSIGNED NOT NULL DEFAULT 1, |
@@ -201,34 +200,34 @@ discard block |
||
| 201 | 200 | EVT_donations TINYINT(1) NULL, |
| 202 | 201 | PRIMARY KEY (EVTM_ID), |
| 203 | 202 | KEY EVT_ID (EVT_ID)"; |
| 204 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 205 | - $table_name = 'esp_event_question_group'; |
|
| 206 | - $sql = "EQG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 203 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 204 | + $table_name = 'esp_event_question_group'; |
|
| 205 | + $sql = "EQG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 207 | 206 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 208 | 207 | QSG_ID INT UNSIGNED NOT NULL, |
| 209 | 208 | EQG_primary TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, |
| 210 | 209 | PRIMARY KEY (EQG_ID), |
| 211 | 210 | KEY EVT_ID (EVT_ID), |
| 212 | 211 | KEY QSG_ID (QSG_ID)"; |
| 213 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 214 | - $table_name = 'esp_event_venue'; |
|
| 215 | - $sql = "EVV_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 212 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 213 | + $table_name = 'esp_event_venue'; |
|
| 214 | + $sql = "EVV_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 216 | 215 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 217 | 216 | VNU_ID BIGINT(20) UNSIGNED NOT NULL, |
| 218 | 217 | EVV_primary TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, |
| 219 | 218 | PRIMARY KEY (EVV_ID)"; |
| 220 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 221 | - $table_name = 'esp_extra_meta'; |
|
| 222 | - $sql = "EXM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 219 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 220 | + $table_name = 'esp_extra_meta'; |
|
| 221 | + $sql = "EXM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 223 | 222 | OBJ_ID INT(11) DEFAULT NULL, |
| 224 | 223 | EXM_type VARCHAR(45) DEFAULT NULL, |
| 225 | 224 | EXM_key VARCHAR(45) DEFAULT NULL, |
| 226 | 225 | EXM_value TEXT, |
| 227 | 226 | PRIMARY KEY (EXM_ID), |
| 228 | 227 | KEY EXM_type (EXM_type, OBJ_ID, EXM_key(45))"; |
| 229 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 230 | - $table_name = 'esp_line_item'; |
|
| 231 | - $sql = "LIN_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 228 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 229 | + $table_name = 'esp_line_item'; |
|
| 230 | + $sql = "LIN_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 232 | 231 | LIN_code VARCHAR(245) NOT NULL DEFAULT '', |
| 233 | 232 | TXN_ID INT(11) DEFAULT NULL, |
| 234 | 233 | LIN_name VARCHAR(245) NOT NULL DEFAULT '', |
@@ -246,9 +245,9 @@ discard block |
||
| 246 | 245 | PRIMARY KEY (LIN_ID), |
| 247 | 246 | KEY LIN_code (LIN_code(191)), |
| 248 | 247 | KEY TXN_ID (TXN_ID)"; |
| 249 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 250 | - $table_name = 'esp_log'; |
|
| 251 | - $sql = "LOG_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 248 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 249 | + $table_name = 'esp_log'; |
|
| 250 | + $sql = "LOG_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 252 | 251 | LOG_time DATETIME DEFAULT NULL, |
| 253 | 252 | OBJ_ID VARCHAR(45) DEFAULT NULL, |
| 254 | 253 | OBJ_type VARCHAR(45) DEFAULT NULL, |
@@ -259,18 +258,18 @@ discard block |
||
| 259 | 258 | KEY LOG_time (LOG_time), |
| 260 | 259 | KEY OBJ (OBJ_type,OBJ_ID), |
| 261 | 260 | KEY LOG_type (LOG_type)"; |
| 262 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 263 | - $table_name = 'esp_message_template'; |
|
| 264 | - $sql = "MTP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 261 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 262 | + $table_name = 'esp_message_template'; |
|
| 263 | + $sql = "MTP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 265 | 264 | GRP_ID INT(10) UNSIGNED NOT NULL, |
| 266 | 265 | MTP_context VARCHAR(50) NOT NULL, |
| 267 | 266 | MTP_template_field VARCHAR(30) NOT NULL, |
| 268 | 267 | MTP_content TEXT NOT NULL, |
| 269 | 268 | PRIMARY KEY (MTP_ID), |
| 270 | 269 | KEY GRP_ID (GRP_ID)"; |
| 271 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 272 | - $table_name = 'esp_message_template_group'; |
|
| 273 | - $sql = "GRP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 270 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 271 | + $table_name = 'esp_message_template_group'; |
|
| 272 | + $sql = "GRP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 274 | 273 | MTP_user_id INT(10) NOT NULL DEFAULT '1', |
| 275 | 274 | MTP_name VARCHAR(245) NOT NULL DEFAULT '', |
| 276 | 275 | MTP_description VARCHAR(245) NOT NULL DEFAULT '', |
@@ -282,17 +281,17 @@ discard block |
||
| 282 | 281 | MTP_is_active TINYINT(1) NOT NULL DEFAULT '1', |
| 283 | 282 | PRIMARY KEY (GRP_ID), |
| 284 | 283 | KEY MTP_user_id (MTP_user_id)"; |
| 285 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 286 | - $table_name = 'esp_event_message_template'; |
|
| 287 | - $sql = "EMT_ID BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 284 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 285 | + $table_name = 'esp_event_message_template'; |
|
| 286 | + $sql = "EMT_ID BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 288 | 287 | EVT_ID BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, |
| 289 | 288 | GRP_ID INT(10) UNSIGNED NOT NULL DEFAULT 0, |
| 290 | 289 | PRIMARY KEY (EMT_ID), |
| 291 | 290 | KEY EVT_ID (EVT_ID), |
| 292 | 291 | KEY GRP_ID (GRP_ID)"; |
| 293 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 294 | - $table_name = 'esp_payment'; |
|
| 295 | - $sql = "PAY_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 292 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 293 | + $table_name = 'esp_payment'; |
|
| 294 | + $sql = "PAY_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 296 | 295 | TXN_ID INT(10) UNSIGNED DEFAULT NULL, |
| 297 | 296 | STS_ID VARCHAR(3) COLLATE utf8_bin DEFAULT NULL, |
| 298 | 297 | PAY_timestamp DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', |
@@ -309,9 +308,9 @@ discard block |
||
| 309 | 308 | PRIMARY KEY (PAY_ID), |
| 310 | 309 | KEY PAY_timestamp (PAY_timestamp), |
| 311 | 310 | KEY TXN_ID (TXN_ID)"; |
| 312 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 313 | - $table_name = 'esp_payment_method'; |
|
| 314 | - $sql = "PMD_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 311 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 312 | + $table_name = 'esp_payment_method'; |
|
| 313 | + $sql = "PMD_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 315 | 314 | PMD_type VARCHAR(124) DEFAULT NULL, |
| 316 | 315 | PMD_name VARCHAR(255) DEFAULT NULL, |
| 317 | 316 | PMD_desc TEXT, |
@@ -327,32 +326,32 @@ discard block |
||
| 327 | 326 | PRIMARY KEY (PMD_ID), |
| 328 | 327 | UNIQUE KEY PMD_slug_UNIQUE (PMD_slug), |
| 329 | 328 | KEY PMD_type (PMD_type)"; |
| 330 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 331 | - $table_name = "esp_ticket_price"; |
|
| 332 | - $sql = "TKP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 329 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 330 | + $table_name = "esp_ticket_price"; |
|
| 331 | + $sql = "TKP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 333 | 332 | TKT_ID INT(10) UNSIGNED NOT NULL, |
| 334 | 333 | PRC_ID INT(10) UNSIGNED NOT NULL, |
| 335 | 334 | PRIMARY KEY (TKP_ID), |
| 336 | 335 | KEY TKT_ID (TKT_ID), |
| 337 | 336 | KEY PRC_ID (PRC_ID)"; |
| 338 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 339 | - $table_name = "esp_datetime_ticket"; |
|
| 340 | - $sql = "DTK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 337 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 338 | + $table_name = "esp_datetime_ticket"; |
|
| 339 | + $sql = "DTK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 341 | 340 | DTT_ID INT(10) UNSIGNED NOT NULL, |
| 342 | 341 | TKT_ID INT(10) UNSIGNED NOT NULL, |
| 343 | 342 | PRIMARY KEY (DTK_ID), |
| 344 | 343 | KEY DTT_ID (DTT_ID), |
| 345 | 344 | KEY TKT_ID (TKT_ID)"; |
| 346 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 347 | - $table_name = "esp_ticket_template"; |
|
| 348 | - $sql = "TTM_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 345 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 346 | + $table_name = "esp_ticket_template"; |
|
| 347 | + $sql = "TTM_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 349 | 348 | TTM_name VARCHAR(45) NOT NULL, |
| 350 | 349 | TTM_description TEXT, |
| 351 | 350 | TTM_file VARCHAR(45), |
| 352 | 351 | PRIMARY KEY (TTM_ID)"; |
| 353 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 354 | - $table_name = 'esp_question'; |
|
| 355 | - $sql = 'QST_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 352 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 353 | + $table_name = 'esp_question'; |
|
| 354 | + $sql = 'QST_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 356 | 355 | QST_display_text TEXT NOT NULL, |
| 357 | 356 | QST_admin_label VARCHAR(255) NOT NULL, |
| 358 | 357 | QST_system VARCHAR(25) DEFAULT NULL, |
@@ -365,18 +364,18 @@ discard block |
||
| 365 | 364 | QST_deleted TINYINT UNSIGNED NOT NULL DEFAULT 0, |
| 366 | 365 | PRIMARY KEY (QST_ID), |
| 367 | 366 | KEY QST_order (QST_order)'; |
| 368 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 369 | - $table_name = 'esp_question_group_question'; |
|
| 370 | - $sql = "QGQ_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 367 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 368 | + $table_name = 'esp_question_group_question'; |
|
| 369 | + $sql = "QGQ_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 371 | 370 | QSG_ID INT UNSIGNED NOT NULL, |
| 372 | 371 | QST_ID INT UNSIGNED NOT NULL, |
| 373 | 372 | QGQ_order INT UNSIGNED NOT NULL DEFAULT 0, |
| 374 | 373 | PRIMARY KEY (QGQ_ID), |
| 375 | 374 | KEY QST_ID (QST_ID), |
| 376 | 375 | KEY QSG_ID_order (QSG_ID, QGQ_order)"; |
| 377 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 378 | - $table_name = 'esp_question_option'; |
|
| 379 | - $sql = "QSO_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 376 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 377 | + $table_name = 'esp_question_option'; |
|
| 378 | + $sql = "QSO_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 380 | 379 | QSO_value VARCHAR(255) NOT NULL, |
| 381 | 380 | QSO_desc TEXT NOT NULL, |
| 382 | 381 | QST_ID INT UNSIGNED NOT NULL, |
@@ -385,9 +384,9 @@ discard block |
||
| 385 | 384 | PRIMARY KEY (QSO_ID), |
| 386 | 385 | KEY QST_ID (QST_ID), |
| 387 | 386 | KEY QSO_order (QSO_order)"; |
| 388 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 389 | - $table_name = 'esp_registration'; |
|
| 390 | - $sql = "REG_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 387 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 388 | + $table_name = 'esp_registration'; |
|
| 389 | + $sql = "REG_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 391 | 390 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 392 | 391 | ATT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 393 | 392 | TXN_ID INT(10) UNSIGNED NOT NULL, |
@@ -411,18 +410,18 @@ discard block |
||
| 411 | 410 | KEY TKT_ID (TKT_ID), |
| 412 | 411 | KEY EVT_ID (EVT_ID), |
| 413 | 412 | KEY STS_ID (STS_ID)"; |
| 414 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 415 | - $table_name = 'esp_registration_payment'; |
|
| 416 | - $sql = "RPY_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 413 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 414 | + $table_name = 'esp_registration_payment'; |
|
| 415 | + $sql = "RPY_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 417 | 416 | REG_ID INT(10) UNSIGNED NOT NULL, |
| 418 | 417 | PAY_ID INT(10) UNSIGNED NULL, |
| 419 | 418 | RPY_amount DECIMAL(10,3) NOT NULL DEFAULT '0.00', |
| 420 | 419 | PRIMARY KEY (RPY_ID), |
| 421 | 420 | KEY REG_ID (REG_ID), |
| 422 | 421 | KEY PAY_ID (PAY_ID)"; |
| 423 | - $this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 424 | - $table_name = 'esp_checkin'; |
|
| 425 | - $sql = "CHK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 422 | + $this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 423 | + $table_name = 'esp_checkin'; |
|
| 424 | + $sql = "CHK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 426 | 425 | REG_ID INT(10) UNSIGNED NOT NULL, |
| 427 | 426 | DTT_ID INT(10) UNSIGNED NOT NULL, |
| 428 | 427 | CHK_in TINYINT(1) UNSIGNED NOT NULL DEFAULT 1, |
@@ -430,9 +429,9 @@ discard block |
||
| 430 | 429 | PRIMARY KEY (CHK_ID), |
| 431 | 430 | KEY REG_ID (REG_ID), |
| 432 | 431 | KEY DTT_ID (DTT_ID)"; |
| 433 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 434 | - $table_name = 'esp_state'; |
|
| 435 | - $sql = "STA_ID smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 432 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 433 | + $table_name = 'esp_state'; |
|
| 434 | + $sql = "STA_ID smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 436 | 435 | CNT_ISO VARCHAR(2) COLLATE utf8_bin NOT NULL, |
| 437 | 436 | STA_abbrev VARCHAR(24) COLLATE utf8_bin NOT NULL, |
| 438 | 437 | STA_name VARCHAR(100) COLLATE utf8_bin NOT NULL, |
@@ -440,9 +439,9 @@ discard block |
||
| 440 | 439 | PRIMARY KEY (STA_ID), |
| 441 | 440 | KEY STA_abbrev (STA_abbrev), |
| 442 | 441 | KEY CNT_ISO (CNT_ISO)"; |
| 443 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 444 | - $table_name = 'esp_status'; |
|
| 445 | - $sql = "STS_ID VARCHAR(3) COLLATE utf8_bin NOT NULL, |
|
| 442 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 443 | + $table_name = 'esp_status'; |
|
| 444 | + $sql = "STS_ID VARCHAR(3) COLLATE utf8_bin NOT NULL, |
|
| 446 | 445 | STS_code VARCHAR(45) COLLATE utf8_bin NOT NULL, |
| 447 | 446 | STS_type set('event','registration','transaction','payment','email') COLLATE utf8_bin NOT NULL, |
| 448 | 447 | STS_can_edit TINYINT(1) NOT NULL DEFAULT 0, |
@@ -450,9 +449,9 @@ discard block |
||
| 450 | 449 | STS_open TINYINT(1) NOT NULL DEFAULT 1, |
| 451 | 450 | UNIQUE KEY STS_ID_UNIQUE (STS_ID), |
| 452 | 451 | KEY STS_type (STS_type)"; |
| 453 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 454 | - $table_name = 'esp_transaction'; |
|
| 455 | - $sql = "TXN_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 452 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 453 | + $table_name = 'esp_transaction'; |
|
| 454 | + $sql = "TXN_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 456 | 455 | TXN_timestamp DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', |
| 457 | 456 | TXN_total DECIMAL(10,3) DEFAULT '0.00', |
| 458 | 457 | TXN_paid DECIMAL(10,3) NOT NULL DEFAULT '0.00', |
@@ -464,9 +463,9 @@ discard block |
||
| 464 | 463 | PRIMARY KEY (TXN_ID), |
| 465 | 464 | KEY TXN_timestamp (TXN_timestamp), |
| 466 | 465 | KEY STS_ID (STS_ID)"; |
| 467 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 468 | - $table_name = 'esp_venue_meta'; |
|
| 469 | - $sql = "VNUM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 466 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 467 | + $table_name = 'esp_venue_meta'; |
|
| 468 | + $sql = "VNUM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 470 | 469 | VNU_ID BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, |
| 471 | 470 | VNU_address VARCHAR(255) DEFAULT NULL, |
| 472 | 471 | VNU_address2 VARCHAR(255) DEFAULT NULL, |
@@ -485,10 +484,10 @@ discard block |
||
| 485 | 484 | KEY VNU_ID (VNU_ID), |
| 486 | 485 | KEY STA_ID (STA_ID), |
| 487 | 486 | KEY CNT_ISO (CNT_ISO)"; |
| 488 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 489 | - //modified tables |
|
| 490 | - $table_name = "esp_price"; |
|
| 491 | - $sql = "PRC_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 487 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 488 | + //modified tables |
|
| 489 | + $table_name = "esp_price"; |
|
| 490 | + $sql = "PRC_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 492 | 491 | PRT_ID TINYINT(3) UNSIGNED NOT NULL, |
| 493 | 492 | PRC_amount DECIMAL(10,3) NOT NULL DEFAULT '0.00', |
| 494 | 493 | PRC_name VARCHAR(245) NOT NULL, |
@@ -501,9 +500,9 @@ discard block |
||
| 501 | 500 | PRC_parent INT(10) UNSIGNED DEFAULT 0, |
| 502 | 501 | PRIMARY KEY (PRC_ID), |
| 503 | 502 | KEY PRT_ID (PRT_ID)"; |
| 504 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 505 | - $table_name = "esp_price_type"; |
|
| 506 | - $sql = "PRT_ID TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 503 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 504 | + $table_name = "esp_price_type"; |
|
| 505 | + $sql = "PRT_ID TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 507 | 506 | PRT_name VARCHAR(45) NOT NULL, |
| 508 | 507 | PBT_ID TINYINT(3) UNSIGNED NOT NULL DEFAULT '1', |
| 509 | 508 | PRT_is_percent TINYINT(1) NOT NULL DEFAULT '0', |
@@ -512,9 +511,9 @@ discard block |
||
| 512 | 511 | PRT_deleted TINYINT(1) NOT NULL DEFAULT '0', |
| 513 | 512 | UNIQUE KEY PRT_name_UNIQUE (PRT_name), |
| 514 | 513 | PRIMARY KEY (PRT_ID)"; |
| 515 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 516 | - $table_name = "esp_ticket"; |
|
| 517 | - $sql = "TKT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 514 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 515 | + $table_name = "esp_ticket"; |
|
| 516 | + $sql = "TKT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 518 | 517 | TTM_ID INT(10) UNSIGNED NOT NULL, |
| 519 | 518 | TKT_name VARCHAR(245) NOT NULL DEFAULT '', |
| 520 | 519 | TKT_description TEXT NOT NULL, |
@@ -536,9 +535,9 @@ discard block |
||
| 536 | 535 | TKT_deleted TINYINT(1) NOT NULL DEFAULT '0', |
| 537 | 536 | PRIMARY KEY (TKT_ID), |
| 538 | 537 | KEY TKT_start_date (TKT_start_date)"; |
| 539 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 540 | - $table_name = 'esp_question_group'; |
|
| 541 | - $sql = 'QSG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 538 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 539 | + $table_name = 'esp_question_group'; |
|
| 540 | + $sql = 'QSG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 542 | 541 | QSG_name VARCHAR(255) NOT NULL, |
| 543 | 542 | QSG_identifier VARCHAR(100) NOT NULL, |
| 544 | 543 | QSG_desc TEXT NULL, |
@@ -551,38 +550,38 @@ discard block |
||
| 551 | 550 | PRIMARY KEY (QSG_ID), |
| 552 | 551 | UNIQUE KEY QSG_identifier_UNIQUE (QSG_identifier), |
| 553 | 552 | KEY QSG_order (QSG_order)'; |
| 554 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 555 | - /** @var EE_DMS_Core_4_1_0 $script_4_1_defaults */ |
|
| 556 | - $script_4_1_defaults = EE_Registry::instance()->load_dms('Core_4_1_0'); |
|
| 557 | - //(because many need to convert old string states to foreign keys into the states table) |
|
| 558 | - $script_4_1_defaults->insert_default_states(); |
|
| 559 | - $script_4_1_defaults->insert_default_countries(); |
|
| 560 | - /** @var EE_DMS_Core_4_5_0 $script_4_5_defaults */ |
|
| 561 | - $script_4_5_defaults = EE_Registry::instance()->load_dms('Core_4_5_0'); |
|
| 562 | - $script_4_5_defaults->insert_default_price_types(); |
|
| 563 | - $script_4_5_defaults->insert_default_prices(); |
|
| 564 | - $script_4_5_defaults->insert_default_tickets(); |
|
| 565 | - /** @var EE_DMS_Core_4_6_0 $script_4_6_defaults */ |
|
| 566 | - $script_4_6_defaults = EE_Registry::instance()->load_dms('Core_4_6_0'); |
|
| 567 | - $script_4_6_defaults->add_default_admin_only_payments(); |
|
| 568 | - $script_4_6_defaults->insert_default_currencies(); |
|
| 569 | - return true; |
|
| 570 | - } |
|
| 553 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 554 | + /** @var EE_DMS_Core_4_1_0 $script_4_1_defaults */ |
|
| 555 | + $script_4_1_defaults = EE_Registry::instance()->load_dms('Core_4_1_0'); |
|
| 556 | + //(because many need to convert old string states to foreign keys into the states table) |
|
| 557 | + $script_4_1_defaults->insert_default_states(); |
|
| 558 | + $script_4_1_defaults->insert_default_countries(); |
|
| 559 | + /** @var EE_DMS_Core_4_5_0 $script_4_5_defaults */ |
|
| 560 | + $script_4_5_defaults = EE_Registry::instance()->load_dms('Core_4_5_0'); |
|
| 561 | + $script_4_5_defaults->insert_default_price_types(); |
|
| 562 | + $script_4_5_defaults->insert_default_prices(); |
|
| 563 | + $script_4_5_defaults->insert_default_tickets(); |
|
| 564 | + /** @var EE_DMS_Core_4_6_0 $script_4_6_defaults */ |
|
| 565 | + $script_4_6_defaults = EE_Registry::instance()->load_dms('Core_4_6_0'); |
|
| 566 | + $script_4_6_defaults->add_default_admin_only_payments(); |
|
| 567 | + $script_4_6_defaults->insert_default_currencies(); |
|
| 568 | + return true; |
|
| 569 | + } |
|
| 571 | 570 | |
| 572 | 571 | |
| 573 | 572 | |
| 574 | - /** |
|
| 575 | - * @return boolean |
|
| 576 | - */ |
|
| 577 | - public function schema_changes_after_migration() |
|
| 578 | - { |
|
| 579 | - return true; |
|
| 580 | - } |
|
| 573 | + /** |
|
| 574 | + * @return boolean |
|
| 575 | + */ |
|
| 576 | + public function schema_changes_after_migration() |
|
| 577 | + { |
|
| 578 | + return true; |
|
| 579 | + } |
|
| 581 | 580 | |
| 582 | 581 | |
| 583 | 582 | |
| 584 | - public function migration_page_hooks() |
|
| 585 | - { |
|
| 586 | - } |
|
| 583 | + public function migration_page_hooks() |
|
| 584 | + { |
|
| 585 | + } |
|
| 587 | 586 | } |
| 588 | 587 | // end of file: /core/data_migration_scripts/EE_DMS_Core_4_7_0.dms.php |
| 589 | 588 | \ No newline at end of file |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | // unfortunately, this needs to be done upon INCLUSION of this file, |
| 16 | 16 | // instead of construction, because it only gets constructed on first page load |
| 17 | 17 | // (all other times it gets resurrected from a wordpress option) |
| 18 | -$stages = glob(EE_CORE . 'data_migration_scripts/4_7_0_stages/*'); |
|
| 18 | +$stages = glob(EE_CORE.'data_migration_scripts/4_7_0_stages/*'); |
|
| 19 | 19 | $class_to_filepath = array(); |
| 20 | 20 | foreach ($stages as $filepath) { |
| 21 | 21 | $matches = array(); |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | return true; |
| 80 | 80 | } elseif ( ! $version_string) { |
| 81 | 81 | //no version string provided... this must be pre 4.3 |
| 82 | - return false;//changed mind. dont want people thinking they should migrate yet because they cant |
|
| 82 | + return false; //changed mind. dont want people thinking they should migrate yet because they cant |
|
| 83 | 83 | } else { |
| 84 | 84 | return false; |
| 85 | 85 | } |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | public function schema_changes_before_migration() |
| 104 | 104 | { |
| 105 | 105 | //relies on 4.1's EEH_Activation::create_table |
| 106 | - require_once(EE_HELPERS . 'EEH_Activation.helper.php'); |
|
| 106 | + require_once(EE_HELPERS.'EEH_Activation.helper.php'); |
|
| 107 | 107 | $table_name = 'esp_answer'; |
| 108 | 108 | $sql = " ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
| 109 | 109 | REG_ID INT UNSIGNED NOT NULL, |