@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | <span class="dashicons dashicons-admin-tools"></span> |
| 27 | 27 | <?php esc_html_e("Migration Options", "event_espresso"); ?> |
| 28 | 28 | <span class="tiny-text lt-grey-text"> <?php esc_html_e(' to migrate or not to migrate?', |
| 29 | - "event_espresso"); ?></span> |
|
| 29 | + "event_espresso"); ?></span> |
|
| 30 | 30 | </h2> |
| 31 | 31 | <div class="ee-table-wrap"> |
| 32 | 32 | <table> |
@@ -35,24 +35,24 @@ discard block |
||
| 35 | 35 | <td><h3><?php esc_html_e('1', 'event_espresso'); ?></h3></td> |
| 36 | 36 | <td> |
| 37 | 37 | <?php |
| 38 | - echo apply_filters( |
|
| 39 | - 'FHEE__ee_migration_page__option_1_main', |
|
| 40 | - sprintf( |
|
| 41 | - esc_html__('%1$sYes. I have backed up my database%2$s, %3$sunderstand the risks involved%4$s, and am ready to migrate my existing %5$s data to %6$s.', |
|
| 42 | - "event_espresso"), |
|
| 43 | - '<strong>', |
|
| 44 | - '</strong>', |
|
| 45 | - '<a id="migration-risks" class="" title="' |
|
| 46 | - . esc_attr__('click for more details', "event_espresso") |
|
| 47 | - . '">', |
|
| 48 | - '</a>', |
|
| 49 | - $current_db_state, |
|
| 50 | - $next_db_state |
|
| 51 | - ), |
|
| 52 | - $current_db_state, |
|
| 53 | - $next_db_state |
|
| 54 | - ); |
|
| 55 | - ?> |
|
| 38 | + echo apply_filters( |
|
| 39 | + 'FHEE__ee_migration_page__option_1_main', |
|
| 40 | + sprintf( |
|
| 41 | + esc_html__('%1$sYes. I have backed up my database%2$s, %3$sunderstand the risks involved%4$s, and am ready to migrate my existing %5$s data to %6$s.', |
|
| 42 | + "event_espresso"), |
|
| 43 | + '<strong>', |
|
| 44 | + '</strong>', |
|
| 45 | + '<a id="migration-risks" class="" title="' |
|
| 46 | + . esc_attr__('click for more details', "event_espresso") |
|
| 47 | + . '">', |
|
| 48 | + '</a>', |
|
| 49 | + $current_db_state, |
|
| 50 | + $next_db_state |
|
| 51 | + ), |
|
| 52 | + $current_db_state, |
|
| 53 | + $next_db_state |
|
| 54 | + ); |
|
| 55 | + ?> |
|
| 56 | 56 | <a id="display-migration-details" |
| 57 | 57 | class="display-the-hidden lt-grey-text smaller-text hide-if-no-js" |
| 58 | 58 | rel="migration-details"><?php esc_html_e('click for more details', "event_espresso"); ?> |
@@ -61,37 +61,37 @@ discard block |
||
| 61 | 61 | class="hide-the-displayed lt-grey-text smaller-text hide-if-no-js" |
| 62 | 62 | rel="migration-details" |
| 63 | 63 | style="display:none;"><?php echo sprintf(esc_html__('hide%1$sdetails%1$s-', |
| 64 | - 'event_espresso'), ' '); ?></a> |
|
| 64 | + 'event_espresso'), ' '); ?></a> |
|
| 65 | 65 | </td> |
| 66 | 66 | <td> |
| 67 | 67 | <a id="db-backed-up" |
| 68 | 68 | class="toggle-migration-monitor button-primary"><?php echo apply_filters('FHEE__ee_migration_page__option_1_button_text', |
| 69 | - sprintf(esc_html__("Migrate My %s Data to %s", "event_espresso"), $current_db_state, |
|
| 70 | - $next_db_state), $current_db_state, $next_db_state); ?></a> |
|
| 69 | + sprintf(esc_html__("Migrate My %s Data to %s", "event_espresso"), $current_db_state, |
|
| 70 | + $next_db_state), $current_db_state, $next_db_state); ?></a> |
|
| 71 | 71 | </td> |
| 72 | 72 | </tr> |
| 73 | 73 | <tr> |
| 74 | 74 | <td colspan="3" style="padding: 0"> |
| 75 | 75 | <div id="migration-details-dv" style="display: none; padding: 1em;"> |
| 76 | 76 | <span class="reminder-spn"><?php printf(esc_html__("%s Important: %s Before migrating, please back up your database and files.", |
| 77 | - "event_espresso"), "<b>", "</b>"); ?></span> |
|
| 77 | + "event_espresso"), "<b>", "</b>"); ?></span> |
|
| 78 | 78 | <p> |
| 79 | 79 | <?php |
| 80 | - printf( |
|
| 81 | - esc_html__('%1$sNot sure how to backup your existing data?%2$s Here is %3$sWordPress\'s explanation%7$s, and here\'s %6$sour explanation%7$s.%8$sYou can also search the WordPress plugin database for %4$s database backup plugins %7$s,%8$sor have one of our dedicated support technicians help you by purchasing a %5$sPriority Support Token%7$s.', |
|
| 82 | - "event_espresso"), |
|
| 83 | - '<b>', |
|
| 84 | - '</b>', |
|
| 85 | - "<a href='http://codex.wordpress.org/Backing_Up_Your_Database'>", |
|
| 86 | - "<a href='" |
|
| 87 | - . admin_url('plugin-install.php?tab=search&type=term&s=database+backup&plugin-search-input=Search+Plugins') |
|
| 88 | - . "'>", |
|
| 89 | - "<a href='http://eventespresso.com/product/priority-support-tokens/'>", |
|
| 90 | - '<a href="http://eventespresso.com/wiki/how-to-back-up-your-site/">', |
|
| 91 | - "</a>", |
|
| 92 | - '<br/>' |
|
| 93 | - ); |
|
| 94 | - ?> |
|
| 80 | + printf( |
|
| 81 | + esc_html__('%1$sNot sure how to backup your existing data?%2$s Here is %3$sWordPress\'s explanation%7$s, and here\'s %6$sour explanation%7$s.%8$sYou can also search the WordPress plugin database for %4$s database backup plugins %7$s,%8$sor have one of our dedicated support technicians help you by purchasing a %5$sPriority Support Token%7$s.', |
|
| 82 | + "event_espresso"), |
|
| 83 | + '<b>', |
|
| 84 | + '</b>', |
|
| 85 | + "<a href='http://codex.wordpress.org/Backing_Up_Your_Database'>", |
|
| 86 | + "<a href='" |
|
| 87 | + . admin_url('plugin-install.php?tab=search&type=term&s=database+backup&plugin-search-input=Search+Plugins') |
|
| 88 | + . "'>", |
|
| 89 | + "<a href='http://eventespresso.com/product/priority-support-tokens/'>", |
|
| 90 | + '<a href="http://eventespresso.com/wiki/how-to-back-up-your-site/">', |
|
| 91 | + "</a>", |
|
| 92 | + '<br/>' |
|
| 93 | + ); |
|
| 94 | + ?> |
|
| 95 | 95 | </p> |
| 96 | 96 | <?php do_action('AHEE__ee_migration_page__option_1_extra_details'); ?> |
| 97 | 97 | </div> |
@@ -101,12 +101,12 @@ discard block |
||
| 101 | 101 | <td><h3><?php esc_html_e('2', 'event_espresso'); ?></h3></td> |
| 102 | 102 | <td> |
| 103 | 103 | <?php echo apply_filters('FHEE__ee_migration_page__option_2_main', |
| 104 | - sprintf(esc_html__('I do NOT want to migrate my %1$s data to %2$s at this time and just want to use %3$s without migrating data.', |
|
| 105 | - "event_espresso"), $current_db_state, $next_db_state, |
|
| 106 | - $ultimate_db_state), $current_db_state, $next_db_state, |
|
| 107 | - $ultimate_db_state); ?><br/> |
|
| 104 | + sprintf(esc_html__('I do NOT want to migrate my %1$s data to %2$s at this time and just want to use %3$s without migrating data.', |
|
| 105 | + "event_espresso"), $current_db_state, $next_db_state, |
|
| 106 | + $ultimate_db_state), $current_db_state, $next_db_state, |
|
| 107 | + $ultimate_db_state); ?><br/> |
|
| 108 | 108 | <span class="reminder-spn"><?php esc_html_e('Please Note: In order to avoid errors, any existing Event Espresso data (events, ticket, registrations, etc) in your db will be erased! Regular WP data will NOT be affected.', |
| 109 | - 'event_espresso'); ?></span> |
|
| 109 | + 'event_espresso'); ?></span> |
|
| 110 | 110 | <a id="display-no-migration-details" |
| 111 | 111 | class="display-the-hidden lt-grey-text smaller-text hide-if-no-js" |
| 112 | 112 | rel="no-migration-details"><?php esc_html_e('click for more details', "event_espresso"); ?> |
@@ -115,13 +115,13 @@ discard block |
||
| 115 | 115 | class="hide-the-displayed lt-grey-text smaller-text hide-if-no-js" |
| 116 | 116 | rel="no-migration-details" |
| 117 | 117 | style="display:none;"><?php echo sprintf(esc_html__('hide%1$sdetails%1$s-', |
| 118 | - 'event_espresso'), ' '); ?></a> |
|
| 118 | + 'event_espresso'), ' '); ?></a> |
|
| 119 | 119 | </td> |
| 120 | 120 | <td> |
| 121 | 121 | <a id="do-not-migrate" class="do-not-migrate button-primary" |
| 122 | 122 | href="<?php echo $reset_db_page_link; ?>"><?php echo apply_filters('FHEE__ee_migration_page__option_2_button_text', |
| 123 | - sprintf(esc_html__("Just Start %s and Delete Existing Data", "event_espresso"), |
|
| 124 | - $ultimate_db_state), $ultimate_db_state); ?></a> |
|
| 123 | + sprintf(esc_html__("Just Start %s and Delete Existing Data", "event_espresso"), |
|
| 124 | + $ultimate_db_state), $ultimate_db_state); ?></a> |
|
| 125 | 125 | </td> |
| 126 | 126 | </tr> |
| 127 | 127 | <tr> |
@@ -129,8 +129,8 @@ discard block |
||
| 129 | 129 | <div id="no-migration-details-dv" style="display: none; padding: 1em;"> |
| 130 | 130 | <p> |
| 131 | 131 | <?php echo apply_filters('FHEE__ee_migration_page__option_2_details', |
| 132 | - sprintf(esc_html__("If your existing Event and Registration Data is no longer relevant nor required, you can just start up %s without performing a data migration.", |
|
| 133 | - "event_espresso"), $ultimate_db_state), $ultimate_db_state); ?> |
|
| 132 | + sprintf(esc_html__("If your existing Event and Registration Data is no longer relevant nor required, you can just start up %s without performing a data migration.", |
|
| 133 | + "event_espresso"), $ultimate_db_state), $ultimate_db_state); ?> |
|
| 134 | 134 | </p> |
| 135 | 135 | </div> |
| 136 | 136 | </td> |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | //unfortunately, this needs to be done upon INCLUSION of this file, |
| 13 | 13 | //instead of construction, because it only gets constructed on first page load |
| 14 | 14 | //(all other times it gets resurrected from a wordpress option) |
| 15 | -$stages = glob(EE_CORE . 'data_migration_scripts/4_2_0_stages/*'); |
|
| 15 | +$stages = glob(EE_CORE.'data_migration_scripts/4_2_0_stages/*'); |
|
| 16 | 16 | $class_to_filepath = array(); |
| 17 | 17 | if ( ! empty($stages)) { |
| 18 | 18 | foreach ($stages as $filepath) { |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | // echo "no version string provided: $version_string"; |
| 62 | 62 | //no version string provided... this must be pre 4.1 |
| 63 | 63 | //because since 4.1 we're |
| 64 | - return false;//changed mind. dont want people thinking they should migrate yet because they cant |
|
| 64 | + return false; //changed mind. dont want people thinking they should migrate yet because they cant |
|
| 65 | 65 | } else { |
| 66 | 66 | // echo "$version_string doesnt apply"; |
| 67 | 67 | return false; |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | public function schema_changes_before_migration() |
| 81 | 81 | { |
| 82 | 82 | //relies on 4.1's EEH_Activation::create_table |
| 83 | - require_once(EE_HELPERS . 'EEH_Activation.helper.php'); |
|
| 83 | + require_once(EE_HELPERS.'EEH_Activation.helper.php'); |
|
| 84 | 84 | $table_name = 'esp_answer'; |
| 85 | 85 | $sql = " ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
| 86 | 86 | REG_ID INT UNSIGNED NOT NULL, |
@@ -15,11 +15,11 @@ discard block |
||
| 15 | 15 | $stages = glob(EE_CORE . 'data_migration_scripts/4_2_0_stages/*'); |
| 16 | 16 | $class_to_filepath = array(); |
| 17 | 17 | if ( ! empty($stages)) { |
| 18 | - foreach ($stages as $filepath) { |
|
| 19 | - $matches = array(); |
|
| 20 | - preg_match('~4_2_0_stages/(.*).dmsstage.php~', $filepath, $matches); |
|
| 21 | - $class_to_filepath[$matches[1]] = $filepath; |
|
| 22 | - } |
|
| 18 | + foreach ($stages as $filepath) { |
|
| 19 | + $matches = array(); |
|
| 20 | + preg_match('~4_2_0_stages/(.*).dmsstage.php~', $filepath, $matches); |
|
| 21 | + $class_to_filepath[$matches[1]] = $filepath; |
|
| 22 | + } |
|
| 23 | 23 | } |
| 24 | 24 | //give addons a chance to autoload their stages too |
| 25 | 25 | $class_to_filepath = apply_filters('FHEE__EE_DMS_4_2_0__autoloaded_stages', $class_to_filepath); |
@@ -32,57 +32,57 @@ discard block |
||
| 32 | 32 | |
| 33 | 33 | |
| 34 | 34 | |
| 35 | - /** |
|
| 36 | - * EE_DMS_Core_4_2_0 constructor. |
|
| 37 | - * |
|
| 38 | - * @param TableManager $table_manager |
|
| 39 | - * @param TableAnalysis $table_analysis |
|
| 40 | - */ |
|
| 41 | - public function __construct(TableManager $table_manager = null, TableAnalysis $table_analysis = null) |
|
| 42 | - { |
|
| 43 | - $this->_pretty_name = esc_html__("Data Update to Event Espresso 4.2.0", "event_espresso"); |
|
| 44 | - $this->_priority = 10; |
|
| 45 | - $this->_migration_stages = array( |
|
| 46 | - new EE_DMS_4_2_0_question_group_questions(), |
|
| 47 | - new EE_DMS_4_2_0_datetime_fields(), |
|
| 48 | - ); |
|
| 49 | - parent::__construct($table_manager, $table_analysis); |
|
| 50 | - } |
|
| 35 | + /** |
|
| 36 | + * EE_DMS_Core_4_2_0 constructor. |
|
| 37 | + * |
|
| 38 | + * @param TableManager $table_manager |
|
| 39 | + * @param TableAnalysis $table_analysis |
|
| 40 | + */ |
|
| 41 | + public function __construct(TableManager $table_manager = null, TableAnalysis $table_analysis = null) |
|
| 42 | + { |
|
| 43 | + $this->_pretty_name = esc_html__("Data Update to Event Espresso 4.2.0", "event_espresso"); |
|
| 44 | + $this->_priority = 10; |
|
| 45 | + $this->_migration_stages = array( |
|
| 46 | + new EE_DMS_4_2_0_question_group_questions(), |
|
| 47 | + new EE_DMS_4_2_0_datetime_fields(), |
|
| 48 | + ); |
|
| 49 | + parent::__construct($table_manager, $table_analysis); |
|
| 50 | + } |
|
| 51 | 51 | |
| 52 | 52 | |
| 53 | 53 | |
| 54 | - public function can_migrate_from_version($version_array) |
|
| 55 | - { |
|
| 56 | - $version_string = $version_array['Core']; |
|
| 57 | - if (version_compare($version_string, '4.2.0', '<=') && version_compare($version_string, '4.1.0', '>=')) { |
|
| 54 | + public function can_migrate_from_version($version_array) |
|
| 55 | + { |
|
| 56 | + $version_string = $version_array['Core']; |
|
| 57 | + if (version_compare($version_string, '4.2.0', '<=') && version_compare($version_string, '4.1.0', '>=')) { |
|
| 58 | 58 | // echo "$version_string can be migrated fro"; |
| 59 | - return true; |
|
| 60 | - } elseif ( ! $version_string) { |
|
| 59 | + return true; |
|
| 60 | + } elseif ( ! $version_string) { |
|
| 61 | 61 | // echo "no version string provided: $version_string"; |
| 62 | - //no version string provided... this must be pre 4.1 |
|
| 63 | - //because since 4.1 we're |
|
| 64 | - return false;//changed mind. dont want people thinking they should migrate yet because they cant |
|
| 65 | - } else { |
|
| 62 | + //no version string provided... this must be pre 4.1 |
|
| 63 | + //because since 4.1 we're |
|
| 64 | + return false;//changed mind. dont want people thinking they should migrate yet because they cant |
|
| 65 | + } else { |
|
| 66 | 66 | // echo "$version_string doesnt apply"; |
| 67 | - return false; |
|
| 68 | - } |
|
| 69 | - } |
|
| 67 | + return false; |
|
| 68 | + } |
|
| 69 | + } |
|
| 70 | 70 | |
| 71 | 71 | |
| 72 | 72 | |
| 73 | - public function schema_changes_before_migration() |
|
| 74 | - { |
|
| 75 | - //relies on 4.1's EEH_Activation::create_table |
|
| 76 | - require_once(EE_HELPERS . 'EEH_Activation.helper.php'); |
|
| 77 | - $table_name = 'esp_answer'; |
|
| 78 | - $sql = " ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 73 | + public function schema_changes_before_migration() |
|
| 74 | + { |
|
| 75 | + //relies on 4.1's EEH_Activation::create_table |
|
| 76 | + require_once(EE_HELPERS . 'EEH_Activation.helper.php'); |
|
| 77 | + $table_name = 'esp_answer'; |
|
| 78 | + $sql = " ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 79 | 79 | REG_ID INT UNSIGNED NOT NULL, |
| 80 | 80 | QST_ID INT UNSIGNED NOT NULL, |
| 81 | 81 | ANS_value TEXT NOT NULL, |
| 82 | 82 | PRIMARY KEY (ANS_ID)"; |
| 83 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 84 | - $table_name = 'esp_attendee_meta'; |
|
| 85 | - $sql = "ATTM_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 83 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 84 | + $table_name = 'esp_attendee_meta'; |
|
| 85 | + $sql = "ATTM_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 86 | 86 | ATT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 87 | 87 | ATT_fname VARCHAR(45) NOT NULL, |
| 88 | 88 | ATT_lname VARCHAR(45) NOT NULL, |
@@ -98,9 +98,9 @@ discard block |
||
| 98 | 98 | KEY ATT_fname (ATT_fname), |
| 99 | 99 | KEY ATT_lname (ATT_lname), |
| 100 | 100 | KEY ATT_email (ATT_email)"; |
| 101 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 102 | - $table_name = 'esp_country'; |
|
| 103 | - $sql = "CNT_ISO VARCHAR(2) COLLATE utf8_bin NOT NULL, |
|
| 101 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 102 | + $table_name = 'esp_country'; |
|
| 103 | + $sql = "CNT_ISO VARCHAR(2) COLLATE utf8_bin NOT NULL, |
|
| 104 | 104 | CNT_ISO3 VARCHAR(3) COLLATE utf8_bin NOT NULL, |
| 105 | 105 | RGN_ID TINYINT(3) UNSIGNED DEFAULT NULL, |
| 106 | 106 | CNT_name VARCHAR(45) COLLATE utf8_bin NOT NULL, |
@@ -116,9 +116,9 @@ discard block |
||
| 116 | 116 | CNT_is_EU TINYINT(1) DEFAULT '0', |
| 117 | 117 | CNT_active TINYINT(1) DEFAULT '0', |
| 118 | 118 | PRIMARY KEY (CNT_ISO)"; |
| 119 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 120 | - $table_name = 'esp_datetime'; |
|
| 121 | - $sql = "DTT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 119 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 120 | + $table_name = 'esp_datetime'; |
|
| 121 | + $sql = "DTT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 122 | 122 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 123 | 123 | DTT_name VARCHAR(255) NOT NULL DEFAULT '', |
| 124 | 124 | DTT_description TEXT NOT NULL, |
@@ -133,9 +133,9 @@ discard block |
||
| 133 | 133 | PRIMARY KEY (DTT_ID), |
| 134 | 134 | KEY EVT_ID (EVT_ID), |
| 135 | 135 | KEY DTT_is_primary (DTT_is_primary)"; |
| 136 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 137 | - $table_name = 'esp_event_meta'; |
|
| 138 | - $sql = " |
|
| 136 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 137 | + $table_name = 'esp_event_meta'; |
|
| 138 | + $sql = " |
|
| 139 | 139 | EVTM_ID INT NOT NULL AUTO_INCREMENT, |
| 140 | 140 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 141 | 141 | EVT_display_desc TINYINT(1) UNSIGNED NOT NULL DEFAULT 1, |
@@ -150,31 +150,31 @@ discard block |
||
| 150 | 150 | EVT_external_URL VARCHAR(200) NULL, |
| 151 | 151 | EVT_donations TINYINT(1) NULL, |
| 152 | 152 | PRIMARY KEY (EVTM_ID)"; |
| 153 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 154 | - $table_name = 'esp_event_question_group'; |
|
| 155 | - $sql = "EQG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 153 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 154 | + $table_name = 'esp_event_question_group'; |
|
| 155 | + $sql = "EQG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 156 | 156 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 157 | 157 | QSG_ID INT UNSIGNED NOT NULL, |
| 158 | 158 | EQG_primary TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, |
| 159 | 159 | PRIMARY KEY (EQG_ID)"; |
| 160 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 161 | - $table_name = 'esp_event_venue'; |
|
| 162 | - $sql = "EVV_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 160 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 161 | + $table_name = 'esp_event_venue'; |
|
| 162 | + $sql = "EVV_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 163 | 163 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 164 | 164 | VNU_ID BIGINT(20) UNSIGNED NOT NULL, |
| 165 | 165 | EVV_primary TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, |
| 166 | 166 | PRIMARY KEY (EVV_ID)"; |
| 167 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 168 | - $table_name = 'esp_extra_meta'; |
|
| 169 | - $sql = "EXM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 167 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 168 | + $table_name = 'esp_extra_meta'; |
|
| 169 | + $sql = "EXM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 170 | 170 | OBJ_ID INT(11) DEFAULT NULL, |
| 171 | 171 | EXM_type VARCHAR(45) DEFAULT NULL, |
| 172 | 172 | EXM_key VARCHAR(45) DEFAULT NULL, |
| 173 | 173 | EXM_value TEXT, |
| 174 | 174 | PRIMARY KEY (EXM_ID)"; |
| 175 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 176 | - $table_name = 'esp_line_item'; |
|
| 177 | - $sql = "LIN_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 175 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 176 | + $table_name = 'esp_line_item'; |
|
| 177 | + $sql = "LIN_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 178 | 178 | LIN_code VARCHAR(245) NOT NULL DEFAULT '', |
| 179 | 179 | TXN_ID INT(11) DEFAULT NULL, |
| 180 | 180 | LIN_name VARCHAR(245) NOT NULL DEFAULT '', |
@@ -190,18 +190,18 @@ discard block |
||
| 190 | 190 | OBJ_ID INT(11) DEFAULT NULL, |
| 191 | 191 | OBJ_type VARCHAR(45)DEFAULT NULL, |
| 192 | 192 | PRIMARY KEY (LIN_ID)"; |
| 193 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 194 | - $table_name = 'esp_message_template'; |
|
| 195 | - $sql = "MTP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 193 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 194 | + $table_name = 'esp_message_template'; |
|
| 195 | + $sql = "MTP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 196 | 196 | GRP_ID INT(10) UNSIGNED NOT NULL, |
| 197 | 197 | MTP_context VARCHAR(50) NOT NULL, |
| 198 | 198 | MTP_template_field VARCHAR(30) NOT NULL, |
| 199 | 199 | MTP_content TEXT NOT NULL, |
| 200 | 200 | PRIMARY KEY (MTP_ID), |
| 201 | 201 | KEY GRP_ID (GRP_ID)"; |
| 202 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 203 | - $table_name = 'esp_message_template_group'; |
|
| 204 | - $sql = "GRP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 202 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 203 | + $table_name = 'esp_message_template_group'; |
|
| 204 | + $sql = "GRP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 205 | 205 | EVT_ID BIGINT(20) UNSIGNED DEFAULT NULL, |
| 206 | 206 | MTP_user_id INT(10) NOT NULL DEFAULT '1', |
| 207 | 207 | MTP_messenger VARCHAR(30) NOT NULL, |
@@ -213,9 +213,9 @@ discard block |
||
| 213 | 213 | PRIMARY KEY (GRP_ID), |
| 214 | 214 | KEY EVT_ID (EVT_ID), |
| 215 | 215 | KEY MTP_user_id (MTP_user_id)"; |
| 216 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 217 | - $table_name = 'esp_payment'; |
|
| 218 | - $sql = "PAY_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 216 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 217 | + $table_name = 'esp_payment'; |
|
| 218 | + $sql = "PAY_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 219 | 219 | TXN_ID INT(10) UNSIGNED DEFAULT NULL, |
| 220 | 220 | STS_ID VARCHAR(3) COLLATE utf8_bin DEFAULT NULL, |
| 221 | 221 | PAY_timestamp DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', |
@@ -231,9 +231,9 @@ discard block |
||
| 231 | 231 | PRIMARY KEY (PAY_ID), |
| 232 | 232 | KEY TXN_ID (TXN_ID), |
| 233 | 233 | KEY PAY_timestamp (PAY_timestamp)"; |
| 234 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 235 | - $table_name = "esp_ticket"; |
|
| 236 | - $sql = "TKT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 234 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 235 | + $table_name = "esp_ticket"; |
|
| 236 | + $sql = "TKT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 237 | 237 | TTM_ID INT(10) UNSIGNED NOT NULL, |
| 238 | 238 | TKT_name VARCHAR(245) NOT NULL DEFAULT '', |
| 239 | 239 | TKT_description TEXT NOT NULL, |
@@ -252,28 +252,28 @@ discard block |
||
| 252 | 252 | TKT_parent INT(10) UNSIGNED DEFAULT '0', |
| 253 | 253 | TKT_deleted TINYINT(1) NOT NULL DEFAULT '0', |
| 254 | 254 | PRIMARY KEY (TKT_ID)"; |
| 255 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 256 | - $table_name = "esp_ticket_price"; |
|
| 257 | - $sql = "TKP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 255 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 256 | + $table_name = "esp_ticket_price"; |
|
| 257 | + $sql = "TKP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 258 | 258 | TKT_ID INT(10) UNSIGNED NOT NULL, |
| 259 | 259 | PRC_ID INT(10) UNSIGNED NOT NULL, |
| 260 | 260 | PRIMARY KEY (TKP_ID)"; |
| 261 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 262 | - $table_name = "esp_datetime_ticket"; |
|
| 263 | - $sql = "DTK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 261 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 262 | + $table_name = "esp_datetime_ticket"; |
|
| 263 | + $sql = "DTK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 264 | 264 | DTT_ID INT(10) UNSIGNED NOT NULL, |
| 265 | 265 | TKT_ID INT(10) UNSIGNED NOT NULL, |
| 266 | 266 | PRIMARY KEY (DTK_ID)"; |
| 267 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 268 | - $table_name = "esp_ticket_template"; |
|
| 269 | - $sql = "TTM_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 267 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 268 | + $table_name = "esp_ticket_template"; |
|
| 269 | + $sql = "TTM_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 270 | 270 | TTM_name VARCHAR(45) NOT NULL, |
| 271 | 271 | TTM_description TEXT, |
| 272 | 272 | TTM_file VARCHAR(45), |
| 273 | 273 | PRIMARY KEY (TTM_ID)"; |
| 274 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 275 | - $table_name = "esp_price"; |
|
| 276 | - $sql = "PRC_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 274 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 275 | + $table_name = "esp_price"; |
|
| 276 | + $sql = "PRC_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 277 | 277 | PRT_ID TINYINT(3) UNSIGNED NOT NULL, |
| 278 | 278 | PRC_amount DECIMAL(10,3) NOT NULL DEFAULT '0.00', |
| 279 | 279 | PRC_name VARCHAR(245) NOT NULL, |
@@ -284,9 +284,9 @@ discard block |
||
| 284 | 284 | PRC_order TINYINT(3) UNSIGNED NOT NULL DEFAULT '0', |
| 285 | 285 | PRC_parent INT(10) UNSIGNED DEFAULT 0, |
| 286 | 286 | PRIMARY KEY (PRC_ID)"; |
| 287 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 288 | - $table_name = "esp_price_type"; |
|
| 289 | - $sql = "PRT_ID TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 287 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 288 | + $table_name = "esp_price_type"; |
|
| 289 | + $sql = "PRT_ID TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 290 | 290 | PRT_name VARCHAR(45) NOT NULL, |
| 291 | 291 | PBT_ID TINYINT(3) UNSIGNED NOT NULL DEFAULT '1', |
| 292 | 292 | PRT_is_percent TINYINT(1) NOT NULL DEFAULT '0', |
@@ -294,9 +294,9 @@ discard block |
||
| 294 | 294 | PRT_deleted TINYINT(1) NOT NULL DEFAULT '0', |
| 295 | 295 | UNIQUE KEY PRT_name_UNIQUE (PRT_name), |
| 296 | 296 | PRIMARY KEY (PRT_ID)"; |
| 297 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 298 | - $table_name = 'esp_question'; |
|
| 299 | - $sql = 'QST_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 297 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 298 | + $table_name = 'esp_question'; |
|
| 299 | + $sql = 'QST_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 300 | 300 | QST_display_text TEXT NOT NULL, |
| 301 | 301 | QST_admin_label VARCHAR(255) NOT NULL, |
| 302 | 302 | QST_system VARCHAR(25) DEFAULT NULL, |
@@ -308,10 +308,10 @@ discard block |
||
| 308 | 308 | QST_wp_user BIGINT UNSIGNED NULL, |
| 309 | 309 | QST_deleted TINYINT UNSIGNED NOT NULL DEFAULT 0, |
| 310 | 310 | PRIMARY KEY (QST_ID)'; |
| 311 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 312 | - $this->_get_table_manager()->dropIndex('esp_question_group', 'QSG_identifier_UNIQUE'); |
|
| 313 | - $table_name = 'esp_question_group'; |
|
| 314 | - $sql = 'QSG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 311 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 312 | + $this->_get_table_manager()->dropIndex('esp_question_group', 'QSG_identifier_UNIQUE'); |
|
| 313 | + $table_name = 'esp_question_group'; |
|
| 314 | + $sql = 'QSG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 315 | 315 | QSG_name VARCHAR(255) NOT NULL, |
| 316 | 316 | QSG_identifier VARCHAR(100) NOT NULL, |
| 317 | 317 | QSG_desc TEXT NULL, |
@@ -322,24 +322,24 @@ discard block |
||
| 322 | 322 | QSG_deleted TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, |
| 323 | 323 | PRIMARY KEY (QSG_ID), |
| 324 | 324 | UNIQUE KEY QSG_identifier_UNIQUE (QSG_identifier ASC)'; |
| 325 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 326 | - $table_name = 'esp_question_group_question'; |
|
| 327 | - $sql = "QGQ_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 325 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 326 | + $table_name = 'esp_question_group_question'; |
|
| 327 | + $sql = "QGQ_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 328 | 328 | QSG_ID INT UNSIGNED NOT NULL, |
| 329 | 329 | QST_ID INT UNSIGNED NOT NULL, |
| 330 | 330 | QGQ_order INT UNSIGNED NOT NULL DEFAULT 0, |
| 331 | 331 | PRIMARY KEY (QGQ_ID) "; |
| 332 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 333 | - $table_name = 'esp_question_option'; |
|
| 334 | - $sql = "QSO_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 332 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 333 | + $table_name = 'esp_question_option'; |
|
| 334 | + $sql = "QSO_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 335 | 335 | QSO_value VARCHAR(255) NOT NULL, |
| 336 | 336 | QSO_desc TEXT NOT NULL, |
| 337 | 337 | QST_ID INT UNSIGNED NOT NULL, |
| 338 | 338 | QSO_deleted TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, |
| 339 | 339 | PRIMARY KEY (QSO_ID)"; |
| 340 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 341 | - $table_name = 'esp_registration'; |
|
| 342 | - $sql = "REG_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 340 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 341 | + $table_name = 'esp_registration'; |
|
| 342 | + $sql = "REG_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 343 | 343 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 344 | 344 | ATT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 345 | 345 | TXN_ID INT(10) UNSIGNED NOT NULL, |
@@ -362,25 +362,25 @@ discard block |
||
| 362 | 362 | KEY STS_ID (STS_ID), |
| 363 | 363 | KEY REG_url_link (REG_url_link), |
| 364 | 364 | KEY REG_code (REG_code)"; |
| 365 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 366 | - $table_name = 'esp_checkin'; |
|
| 367 | - $sql = "CHK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 365 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 366 | + $table_name = 'esp_checkin'; |
|
| 367 | + $sql = "CHK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 368 | 368 | REG_ID INT(10) UNSIGNED NOT NULL, |
| 369 | 369 | DTT_ID INT(10) UNSIGNED NOT NULL, |
| 370 | 370 | CHK_in TINYINT(1) UNSIGNED NOT NULL DEFAULT 1, |
| 371 | 371 | CHK_timestamp DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', |
| 372 | 372 | PRIMARY KEY (CHK_ID)"; |
| 373 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 374 | - $table_name = 'esp_state'; |
|
| 375 | - $sql = "STA_ID smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 373 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 374 | + $table_name = 'esp_state'; |
|
| 375 | + $sql = "STA_ID smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 376 | 376 | CNT_ISO VARCHAR(2) COLLATE utf8_bin NOT NULL, |
| 377 | 377 | STA_abbrev VARCHAR(6) COLLATE utf8_bin NOT NULL, |
| 378 | 378 | STA_name VARCHAR(100) COLLATE utf8_bin NOT NULL, |
| 379 | 379 | STA_active TINYINT(1) DEFAULT '1', |
| 380 | 380 | PRIMARY KEY (STA_ID)"; |
| 381 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 382 | - $table_name = 'esp_status'; |
|
| 383 | - $sql = "STS_ID VARCHAR(3) COLLATE utf8_bin NOT NULL, |
|
| 381 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 382 | + $table_name = 'esp_status'; |
|
| 383 | + $sql = "STS_ID VARCHAR(3) COLLATE utf8_bin NOT NULL, |
|
| 384 | 384 | STS_code VARCHAR(45) COLLATE utf8_bin NOT NULL, |
| 385 | 385 | STS_type set('event','registration','transaction','payment','email') COLLATE utf8_bin NOT NULL, |
| 386 | 386 | STS_can_edit TINYINT(1) NOT NULL DEFAULT 0, |
@@ -388,9 +388,9 @@ discard block |
||
| 388 | 388 | STS_open TINYINT(1) NOT NULL DEFAULT 1, |
| 389 | 389 | UNIQUE KEY STS_ID_UNIQUE (STS_ID), |
| 390 | 390 | KEY STS_type (STS_type)"; |
| 391 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 392 | - $table_name = 'esp_transaction'; |
|
| 393 | - $sql = "TXN_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 391 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 392 | + $table_name = 'esp_transaction'; |
|
| 393 | + $sql = "TXN_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 394 | 394 | TXN_timestamp DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', |
| 395 | 395 | TXN_total DECIMAL(10,3) DEFAULT '0.00', |
| 396 | 396 | TXN_paid DECIMAL(10,3) NOT NULL DEFAULT '0.00', |
@@ -400,9 +400,9 @@ discard block |
||
| 400 | 400 | PRIMARY KEY (TXN_ID), |
| 401 | 401 | KEY TXN_timestamp (TXN_timestamp), |
| 402 | 402 | KEY STS_ID (STS_ID)"; |
| 403 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 404 | - $table_name = 'esp_venue_meta'; |
|
| 405 | - $sql = "VNUM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 403 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 404 | + $table_name = 'esp_venue_meta'; |
|
| 405 | + $sql = "VNUM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 406 | 406 | VNU_ID BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, |
| 407 | 407 | VNU_address VARCHAR(255) DEFAULT NULL, |
| 408 | 408 | VNU_address2 VARCHAR(255) DEFAULT NULL, |
@@ -420,38 +420,38 @@ discard block |
||
| 420 | 420 | PRIMARY KEY (VNUM_ID), |
| 421 | 421 | KEY STA_ID (STA_ID), |
| 422 | 422 | KEY CNT_ISO (CNT_ISO)"; |
| 423 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 424 | - $script_with_defaults = EE_Registry::instance()->load_dms('Core_4_1_0'); |
|
| 425 | - //setting up the DEFAULT stats and countries is also essential for the data migrations to run |
|
| 426 | - //(because many need to convert old string states to foreign keys into the states table) |
|
| 427 | - $script_with_defaults->insert_default_states(); |
|
| 428 | - $script_with_defaults->insert_default_countries(); |
|
| 429 | - //setting up DEFAULT prices, price types, and tickets is also essential for the price migrations |
|
| 430 | - $script_with_defaults->insert_default_price_types(); |
|
| 431 | - $script_with_defaults->insert_default_prices(); |
|
| 432 | - $script_with_defaults->insert_default_tickets(); |
|
| 433 | - //setting up the config wp option pretty well counts as a 'schema change', or at least should happen ehre |
|
| 434 | - EE_Config::instance()->update_espresso_config(false, true); |
|
| 435 | - return true; |
|
| 436 | - } |
|
| 423 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 424 | + $script_with_defaults = EE_Registry::instance()->load_dms('Core_4_1_0'); |
|
| 425 | + //setting up the DEFAULT stats and countries is also essential for the data migrations to run |
|
| 426 | + //(because many need to convert old string states to foreign keys into the states table) |
|
| 427 | + $script_with_defaults->insert_default_states(); |
|
| 428 | + $script_with_defaults->insert_default_countries(); |
|
| 429 | + //setting up DEFAULT prices, price types, and tickets is also essential for the price migrations |
|
| 430 | + $script_with_defaults->insert_default_price_types(); |
|
| 431 | + $script_with_defaults->insert_default_prices(); |
|
| 432 | + $script_with_defaults->insert_default_tickets(); |
|
| 433 | + //setting up the config wp option pretty well counts as a 'schema change', or at least should happen ehre |
|
| 434 | + EE_Config::instance()->update_espresso_config(false, true); |
|
| 435 | + return true; |
|
| 436 | + } |
|
| 437 | 437 | |
| 438 | 438 | |
| 439 | 439 | |
| 440 | - /** |
|
| 441 | - * We COULD clean up the esp_question.QST_order field here. We'll leave it for now |
|
| 442 | - * |
|
| 443 | - * @return boolean |
|
| 444 | - */ |
|
| 445 | - public function schema_changes_after_migration() |
|
| 446 | - { |
|
| 447 | - return true; |
|
| 448 | - } |
|
| 440 | + /** |
|
| 441 | + * We COULD clean up the esp_question.QST_order field here. We'll leave it for now |
|
| 442 | + * |
|
| 443 | + * @return boolean |
|
| 444 | + */ |
|
| 445 | + public function schema_changes_after_migration() |
|
| 446 | + { |
|
| 447 | + return true; |
|
| 448 | + } |
|
| 449 | 449 | |
| 450 | 450 | |
| 451 | 451 | |
| 452 | - public function migration_page_hooks() |
|
| 453 | - { |
|
| 454 | - } |
|
| 452 | + public function migration_page_hooks() |
|
| 453 | + { |
|
| 454 | + } |
|
| 455 | 455 | } |
| 456 | 456 | |
| 457 | 457 | |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | //unfortunately, this needs to be done upon INCLUSION of this file, |
| 12 | 12 | //instead of construction, because it only gets constructed on first page load |
| 13 | 13 | //(all other times it gets resurrected from a wordpress option) |
| 14 | -$stages = glob(EE_CORE . 'data_migration_scripts/4_3_0_stages/*'); |
|
| 14 | +$stages = glob(EE_CORE.'data_migration_scripts/4_3_0_stages/*'); |
|
| 15 | 15 | $class_to_filepath = array(); |
| 16 | 16 | if ( ! empty($stages)) { |
| 17 | 17 | foreach ($stages as $filepath) { |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | } elseif ( ! $version_string) { |
| 61 | 61 | // echo "no version string provided: $version_string"; |
| 62 | 62 | //no version string provided... this must be pre 4.2 |
| 63 | - return false;//changed mind. dont want people thinking they should migrate yet because they cant |
|
| 63 | + return false; //changed mind. dont want people thinking they should migrate yet because they cant |
|
| 64 | 64 | } else { |
| 65 | 65 | // echo "$version_string doesnt apply"; |
| 66 | 66 | return false; |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | public function schema_changes_before_migration() |
| 80 | 80 | { |
| 81 | 81 | //relies on 4.1's EEH_Activation::create_table |
| 82 | - require_once(EE_HELPERS . 'EEH_Activation.helper.php'); |
|
| 82 | + require_once(EE_HELPERS.'EEH_Activation.helper.php'); |
|
| 83 | 83 | $table_name = 'esp_answer'; |
| 84 | 84 | $sql = " ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
| 85 | 85 | REG_ID INT UNSIGNED NOT NULL, |
@@ -482,9 +482,9 @@ discard block |
||
| 482 | 482 | public function insert_default_tickets() |
| 483 | 483 | { |
| 484 | 484 | global $wpdb; |
| 485 | - $ticket_table = $wpdb->prefix . "esp_ticket"; |
|
| 485 | + $ticket_table = $wpdb->prefix."esp_ticket"; |
|
| 486 | 486 | if ($this->_get_table_analysis()->tableExists($ticket_table)) { |
| 487 | - $SQL = 'SELECT COUNT(TKT_ID) FROM ' . $ticket_table; |
|
| 487 | + $SQL = 'SELECT COUNT(TKT_ID) FROM '.$ticket_table; |
|
| 488 | 488 | $tickets_exist = $wpdb->get_var($SQL); |
| 489 | 489 | if ( ! $tickets_exist) { |
| 490 | 490 | $SQL = "INSERT INTO $ticket_table |
@@ -496,9 +496,9 @@ discard block |
||
| 496 | 496 | $wpdb->query($SQL); |
| 497 | 497 | } |
| 498 | 498 | } |
| 499 | - $ticket_price_table = $wpdb->prefix . "esp_ticket_price"; |
|
| 499 | + $ticket_price_table = $wpdb->prefix."esp_ticket_price"; |
|
| 500 | 500 | if ($this->_get_table_analysis()->tableExists($ticket_price_table)) { |
| 501 | - $SQL = 'SELECT COUNT(TKP_ID) FROM ' . $ticket_price_table; |
|
| 501 | + $SQL = 'SELECT COUNT(TKP_ID) FROM '.$ticket_price_table; |
|
| 502 | 502 | $ticket_prc_exist = $wpdb->get_var($SQL); |
| 503 | 503 | if ( ! $ticket_prc_exist) { |
| 504 | 504 | $SQL = "INSERT INTO $ticket_price_table |
@@ -14,11 +14,11 @@ discard block |
||
| 14 | 14 | $stages = glob(EE_CORE . 'data_migration_scripts/4_3_0_stages/*'); |
| 15 | 15 | $class_to_filepath = array(); |
| 16 | 16 | if ( ! empty($stages)) { |
| 17 | - foreach ($stages as $filepath) { |
|
| 18 | - $matches = array(); |
|
| 19 | - preg_match('~4_3_0_stages/(.*).dmsstage.php~', $filepath, $matches); |
|
| 20 | - $class_to_filepath[$matches[1]] = $filepath; |
|
| 21 | - } |
|
| 17 | + foreach ($stages as $filepath) { |
|
| 18 | + $matches = array(); |
|
| 19 | + preg_match('~4_3_0_stages/(.*).dmsstage.php~', $filepath, $matches); |
|
| 20 | + $class_to_filepath[$matches[1]] = $filepath; |
|
| 21 | + } |
|
| 22 | 22 | } |
| 23 | 23 | //give addons a chance to autoload their stages too |
| 24 | 24 | $class_to_filepath = apply_filters('FHEE__EE_DMS_4_3_0__autoloaded_stages', $class_to_filepath); |
@@ -31,57 +31,57 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | |
| 33 | 33 | |
| 34 | - /** |
|
| 35 | - * EE_DMS_Core_4_3_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 Update to Event Espresso 4.3.0", "event_espresso"); |
|
| 43 | - $this->_priority = 10; |
|
| 44 | - $this->_migration_stages = array( |
|
| 45 | - new EE_DMS_4_3_0_question_option_order(), |
|
| 46 | - new EE_DMS_4_3_0_event_message_templates(), |
|
| 47 | - new EE_DMS_4_3_0_critical_page_shortcode_tracking(), |
|
| 48 | - ); |
|
| 49 | - parent::__construct($table_manager, $table_analysis); |
|
| 50 | - } |
|
| 34 | + /** |
|
| 35 | + * EE_DMS_Core_4_3_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 Update to Event Espresso 4.3.0", "event_espresso"); |
|
| 43 | + $this->_priority = 10; |
|
| 44 | + $this->_migration_stages = array( |
|
| 45 | + new EE_DMS_4_3_0_question_option_order(), |
|
| 46 | + new EE_DMS_4_3_0_event_message_templates(), |
|
| 47 | + new EE_DMS_4_3_0_critical_page_shortcode_tracking(), |
|
| 48 | + ); |
|
| 49 | + parent::__construct($table_manager, $table_analysis); |
|
| 50 | + } |
|
| 51 | 51 | |
| 52 | 52 | |
| 53 | 53 | |
| 54 | - public function can_migrate_from_version($version_array) |
|
| 55 | - { |
|
| 56 | - $version_string = $version_array['Core']; |
|
| 57 | - if (version_compare($version_string, '4.3.0', '<=') && version_compare($version_string, '4.2.0', '>=')) { |
|
| 54 | + public function can_migrate_from_version($version_array) |
|
| 55 | + { |
|
| 56 | + $version_string = $version_array['Core']; |
|
| 57 | + if (version_compare($version_string, '4.3.0', '<=') && version_compare($version_string, '4.2.0', '>=')) { |
|
| 58 | 58 | // echo "$version_string can be migrated fro"; |
| 59 | - return true; |
|
| 60 | - } elseif ( ! $version_string) { |
|
| 59 | + return true; |
|
| 60 | + } elseif ( ! $version_string) { |
|
| 61 | 61 | // echo "no version string provided: $version_string"; |
| 62 | - //no version string provided... this must be pre 4.2 |
|
| 63 | - return false;//changed mind. dont want people thinking they should migrate yet because they cant |
|
| 64 | - } else { |
|
| 62 | + //no version string provided... this must be pre 4.2 |
|
| 63 | + return false;//changed mind. dont want people thinking they should migrate yet because they cant |
|
| 64 | + } else { |
|
| 65 | 65 | // echo "$version_string doesnt apply"; |
| 66 | - return false; |
|
| 67 | - } |
|
| 68 | - } |
|
| 66 | + return false; |
|
| 67 | + } |
|
| 68 | + } |
|
| 69 | 69 | |
| 70 | 70 | |
| 71 | 71 | |
| 72 | - public function schema_changes_before_migration() |
|
| 73 | - { |
|
| 74 | - //relies on 4.1's EEH_Activation::create_table |
|
| 75 | - require_once(EE_HELPERS . 'EEH_Activation.helper.php'); |
|
| 76 | - $table_name = 'esp_answer'; |
|
| 77 | - $sql = " ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 72 | + public function schema_changes_before_migration() |
|
| 73 | + { |
|
| 74 | + //relies on 4.1's EEH_Activation::create_table |
|
| 75 | + require_once(EE_HELPERS . 'EEH_Activation.helper.php'); |
|
| 76 | + $table_name = 'esp_answer'; |
|
| 77 | + $sql = " ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 78 | 78 | REG_ID INT UNSIGNED NOT NULL, |
| 79 | 79 | QST_ID INT UNSIGNED NOT NULL, |
| 80 | 80 | ANS_value TEXT NOT NULL, |
| 81 | 81 | PRIMARY KEY (ANS_ID)"; |
| 82 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 83 | - $table_name = 'esp_attendee_meta'; |
|
| 84 | - $sql = "ATTM_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 82 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 83 | + $table_name = 'esp_attendee_meta'; |
|
| 84 | + $sql = "ATTM_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 85 | 85 | ATT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 86 | 86 | ATT_fname VARCHAR(45) NOT NULL, |
| 87 | 87 | ATT_lname VARCHAR(45) NOT NULL, |
@@ -97,9 +97,9 @@ discard block |
||
| 97 | 97 | KEY ATT_fname (ATT_fname), |
| 98 | 98 | KEY ATT_lname (ATT_lname), |
| 99 | 99 | KEY ATT_email (ATT_email)"; |
| 100 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 101 | - $table_name = 'esp_country'; |
|
| 102 | - $sql = "CNT_ISO VARCHAR(2) COLLATE utf8_bin NOT NULL, |
|
| 100 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 101 | + $table_name = 'esp_country'; |
|
| 102 | + $sql = "CNT_ISO VARCHAR(2) COLLATE utf8_bin NOT NULL, |
|
| 103 | 103 | CNT_ISO3 VARCHAR(3) COLLATE utf8_bin NOT NULL, |
| 104 | 104 | RGN_ID TINYINT(3) UNSIGNED DEFAULT NULL, |
| 105 | 105 | CNT_name VARCHAR(45) COLLATE utf8_bin NOT NULL, |
@@ -115,9 +115,9 @@ discard block |
||
| 115 | 115 | CNT_is_EU TINYINT(1) DEFAULT '0', |
| 116 | 116 | CNT_active TINYINT(1) DEFAULT '0', |
| 117 | 117 | PRIMARY KEY (CNT_ISO)"; |
| 118 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 119 | - $table_name = 'esp_datetime'; |
|
| 120 | - $sql = "DTT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 118 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 119 | + $table_name = 'esp_datetime'; |
|
| 120 | + $sql = "DTT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 121 | 121 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 122 | 122 | DTT_name VARCHAR(255) NOT NULL DEFAULT '', |
| 123 | 123 | DTT_description TEXT NOT NULL, |
@@ -132,9 +132,9 @@ discard block |
||
| 132 | 132 | PRIMARY KEY (DTT_ID), |
| 133 | 133 | KEY EVT_ID (EVT_ID), |
| 134 | 134 | KEY DTT_is_primary (DTT_is_primary)"; |
| 135 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 136 | - $table_name = 'esp_event_meta'; |
|
| 137 | - $sql = " |
|
| 135 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 136 | + $table_name = 'esp_event_meta'; |
|
| 137 | + $sql = " |
|
| 138 | 138 | EVTM_ID INT NOT NULL AUTO_INCREMENT, |
| 139 | 139 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 140 | 140 | EVT_display_desc TINYINT(1) UNSIGNED NOT NULL DEFAULT 1, |
@@ -149,31 +149,31 @@ discard block |
||
| 149 | 149 | EVT_external_URL VARCHAR(200) NULL, |
| 150 | 150 | EVT_donations TINYINT(1) NULL, |
| 151 | 151 | PRIMARY KEY (EVTM_ID)"; |
| 152 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 153 | - $table_name = 'esp_event_question_group'; |
|
| 154 | - $sql = "EQG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 152 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 153 | + $table_name = 'esp_event_question_group'; |
|
| 154 | + $sql = "EQG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 155 | 155 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 156 | 156 | QSG_ID INT UNSIGNED NOT NULL, |
| 157 | 157 | EQG_primary TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, |
| 158 | 158 | PRIMARY KEY (EQG_ID)"; |
| 159 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 160 | - $table_name = 'esp_event_venue'; |
|
| 161 | - $sql = "EVV_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 159 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 160 | + $table_name = 'esp_event_venue'; |
|
| 161 | + $sql = "EVV_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 162 | 162 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 163 | 163 | VNU_ID BIGINT(20) UNSIGNED NOT NULL, |
| 164 | 164 | EVV_primary TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, |
| 165 | 165 | PRIMARY KEY (EVV_ID)"; |
| 166 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 167 | - $table_name = 'esp_extra_meta'; |
|
| 168 | - $sql = "EXM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 166 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 167 | + $table_name = 'esp_extra_meta'; |
|
| 168 | + $sql = "EXM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 169 | 169 | OBJ_ID INT(11) DEFAULT NULL, |
| 170 | 170 | EXM_type VARCHAR(45) DEFAULT NULL, |
| 171 | 171 | EXM_key VARCHAR(45) DEFAULT NULL, |
| 172 | 172 | EXM_value TEXT, |
| 173 | 173 | PRIMARY KEY (EXM_ID)"; |
| 174 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 175 | - $table_name = 'esp_line_item'; |
|
| 176 | - $sql = "LIN_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 174 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 175 | + $table_name = 'esp_line_item'; |
|
| 176 | + $sql = "LIN_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 177 | 177 | LIN_code VARCHAR(245) NOT NULL DEFAULT '', |
| 178 | 178 | TXN_ID INT(11) DEFAULT NULL, |
| 179 | 179 | LIN_name VARCHAR(245) NOT NULL DEFAULT '', |
@@ -189,19 +189,19 @@ discard block |
||
| 189 | 189 | OBJ_ID INT(11) DEFAULT NULL, |
| 190 | 190 | OBJ_type VARCHAR(45)DEFAULT NULL, |
| 191 | 191 | PRIMARY KEY (LIN_ID)"; |
| 192 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 193 | - $table_name = 'esp_message_template'; |
|
| 194 | - $sql = "MTP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 192 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 193 | + $table_name = 'esp_message_template'; |
|
| 194 | + $sql = "MTP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 195 | 195 | GRP_ID INT(10) UNSIGNED NOT NULL, |
| 196 | 196 | MTP_context VARCHAR(50) NOT NULL, |
| 197 | 197 | MTP_template_field VARCHAR(30) NOT NULL, |
| 198 | 198 | MTP_content TEXT NOT NULL, |
| 199 | 199 | PRIMARY KEY (MTP_ID), |
| 200 | 200 | KEY GRP_ID (GRP_ID)"; |
| 201 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 202 | - $this->_get_table_manager()->dropIndex('esp_message_template_group', 'EVT_ID'); |
|
| 203 | - $table_name = 'esp_message_template_group'; |
|
| 204 | - $sql = "GRP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 201 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 202 | + $this->_get_table_manager()->dropIndex('esp_message_template_group', 'EVT_ID'); |
|
| 203 | + $table_name = 'esp_message_template_group'; |
|
| 204 | + $sql = "GRP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 205 | 205 | MTP_user_id INT(10) NOT NULL DEFAULT '1', |
| 206 | 206 | MTP_name VARCHAR(245) NOT NULL DEFAULT '', |
| 207 | 207 | MTP_description VARCHAR(245) NOT NULL DEFAULT '', |
@@ -213,17 +213,17 @@ discard block |
||
| 213 | 213 | MTP_is_active TINYINT(1) NOT NULL DEFAULT '1', |
| 214 | 214 | PRIMARY KEY (GRP_ID), |
| 215 | 215 | KEY MTP_user_id (MTP_user_id)"; |
| 216 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 217 | - $table_name = 'esp_event_message_template'; |
|
| 218 | - $sql = "EMT_ID BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 216 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 217 | + $table_name = 'esp_event_message_template'; |
|
| 218 | + $sql = "EMT_ID BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 219 | 219 | EVT_ID BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, |
| 220 | 220 | GRP_ID INT(10) UNSIGNED NOT NULL DEFAULT 0, |
| 221 | 221 | PRIMARY KEY (EMT_ID), |
| 222 | 222 | KEY EVT_ID (EVT_ID), |
| 223 | 223 | KEY GRP_ID (GRP_ID)"; |
| 224 | - $this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 225 | - $table_name = 'esp_payment'; |
|
| 226 | - $sql = "PAY_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 224 | + $this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 225 | + $table_name = 'esp_payment'; |
|
| 226 | + $sql = "PAY_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 227 | 227 | TXN_ID INT(10) UNSIGNED DEFAULT NULL, |
| 228 | 228 | STS_ID VARCHAR(3) COLLATE utf8_bin DEFAULT NULL, |
| 229 | 229 | PAY_timestamp DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', |
@@ -239,9 +239,9 @@ discard block |
||
| 239 | 239 | PRIMARY KEY (PAY_ID), |
| 240 | 240 | KEY TXN_ID (TXN_ID), |
| 241 | 241 | KEY PAY_timestamp (PAY_timestamp)"; |
| 242 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 243 | - $table_name = "esp_ticket"; |
|
| 244 | - $sql = "TKT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 242 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 243 | + $table_name = "esp_ticket"; |
|
| 244 | + $sql = "TKT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 245 | 245 | TTM_ID INT(10) UNSIGNED NOT NULL, |
| 246 | 246 | TKT_name VARCHAR(245) NOT NULL DEFAULT '', |
| 247 | 247 | TKT_description TEXT NOT NULL, |
@@ -261,28 +261,28 @@ discard block |
||
| 261 | 261 | TKT_parent INT(10) UNSIGNED DEFAULT '0', |
| 262 | 262 | TKT_deleted TINYINT(1) NOT NULL DEFAULT '0', |
| 263 | 263 | PRIMARY KEY (TKT_ID)"; |
| 264 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 265 | - $table_name = "esp_ticket_price"; |
|
| 266 | - $sql = "TKP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 264 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 265 | + $table_name = "esp_ticket_price"; |
|
| 266 | + $sql = "TKP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 267 | 267 | TKT_ID INT(10) UNSIGNED NOT NULL, |
| 268 | 268 | PRC_ID INT(10) UNSIGNED NOT NULL, |
| 269 | 269 | PRIMARY KEY (TKP_ID)"; |
| 270 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 271 | - $table_name = "esp_datetime_ticket"; |
|
| 272 | - $sql = "DTK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 270 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 271 | + $table_name = "esp_datetime_ticket"; |
|
| 272 | + $sql = "DTK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 273 | 273 | DTT_ID INT(10) UNSIGNED NOT NULL, |
| 274 | 274 | TKT_ID INT(10) UNSIGNED NOT NULL, |
| 275 | 275 | PRIMARY KEY (DTK_ID)"; |
| 276 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 277 | - $table_name = "esp_ticket_template"; |
|
| 278 | - $sql = "TTM_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 276 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 277 | + $table_name = "esp_ticket_template"; |
|
| 278 | + $sql = "TTM_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 279 | 279 | TTM_name VARCHAR(45) NOT NULL, |
| 280 | 280 | TTM_description TEXT, |
| 281 | 281 | TTM_file VARCHAR(45), |
| 282 | 282 | PRIMARY KEY (TTM_ID)"; |
| 283 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 284 | - $table_name = "esp_price"; |
|
| 285 | - $sql = "PRC_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 283 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 284 | + $table_name = "esp_price"; |
|
| 285 | + $sql = "PRC_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 286 | 286 | PRT_ID TINYINT(3) UNSIGNED NOT NULL, |
| 287 | 287 | PRC_amount DECIMAL(10,3) NOT NULL DEFAULT '0.00', |
| 288 | 288 | PRC_name VARCHAR(245) NOT NULL, |
@@ -293,9 +293,9 @@ discard block |
||
| 293 | 293 | PRC_order TINYINT(3) UNSIGNED NOT NULL DEFAULT '0', |
| 294 | 294 | PRC_parent INT(10) UNSIGNED DEFAULT 0, |
| 295 | 295 | PRIMARY KEY (PRC_ID)"; |
| 296 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 297 | - $table_name = "esp_price_type"; |
|
| 298 | - $sql = "PRT_ID TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 296 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 297 | + $table_name = "esp_price_type"; |
|
| 298 | + $sql = "PRT_ID TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 299 | 299 | PRT_name VARCHAR(45) NOT NULL, |
| 300 | 300 | PBT_ID TINYINT(3) UNSIGNED NOT NULL DEFAULT '1', |
| 301 | 301 | PRT_is_percent TINYINT(1) NOT NULL DEFAULT '0', |
@@ -303,9 +303,9 @@ discard block |
||
| 303 | 303 | PRT_deleted TINYINT(1) NOT NULL DEFAULT '0', |
| 304 | 304 | UNIQUE KEY PRT_name_UNIQUE (PRT_name), |
| 305 | 305 | PRIMARY KEY (PRT_ID)"; |
| 306 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 307 | - $table_name = 'esp_question'; |
|
| 308 | - $sql = 'QST_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 306 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 307 | + $table_name = 'esp_question'; |
|
| 308 | + $sql = 'QST_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 309 | 309 | QST_display_text TEXT NOT NULL, |
| 310 | 310 | QST_admin_label VARCHAR(255) NOT NULL, |
| 311 | 311 | QST_system VARCHAR(25) DEFAULT NULL, |
@@ -317,10 +317,10 @@ discard block |
||
| 317 | 317 | QST_wp_user BIGINT UNSIGNED NULL, |
| 318 | 318 | QST_deleted TINYINT UNSIGNED NOT NULL DEFAULT 0, |
| 319 | 319 | PRIMARY KEY (QST_ID)'; |
| 320 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 321 | - $this->_get_table_manager()->dropIndex('esp_question_group', 'QSG_identifier_UNIQUE'); |
|
| 322 | - $table_name = 'esp_question_group'; |
|
| 323 | - $sql = 'QSG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 320 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 321 | + $this->_get_table_manager()->dropIndex('esp_question_group', 'QSG_identifier_UNIQUE'); |
|
| 322 | + $table_name = 'esp_question_group'; |
|
| 323 | + $sql = 'QSG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 324 | 324 | QSG_name VARCHAR(255) NOT NULL, |
| 325 | 325 | QSG_identifier VARCHAR(100) NOT NULL, |
| 326 | 326 | QSG_desc TEXT NULL, |
@@ -331,25 +331,25 @@ discard block |
||
| 331 | 331 | QSG_deleted TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, |
| 332 | 332 | PRIMARY KEY (QSG_ID), |
| 333 | 333 | UNIQUE KEY QSG_identifier_UNIQUE (QSG_identifier ASC)'; |
| 334 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 335 | - $table_name = 'esp_question_group_question'; |
|
| 336 | - $sql = "QGQ_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 334 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 335 | + $table_name = 'esp_question_group_question'; |
|
| 336 | + $sql = "QGQ_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 337 | 337 | QSG_ID INT UNSIGNED NOT NULL, |
| 338 | 338 | QST_ID INT UNSIGNED NOT NULL, |
| 339 | 339 | QGQ_order INT UNSIGNED NOT NULL DEFAULT 0, |
| 340 | 340 | PRIMARY KEY (QGQ_ID) "; |
| 341 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 342 | - $table_name = 'esp_question_option'; |
|
| 343 | - $sql = "QSO_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 341 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 342 | + $table_name = 'esp_question_option'; |
|
| 343 | + $sql = "QSO_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 344 | 344 | QSO_value VARCHAR(255) NOT NULL, |
| 345 | 345 | QSO_desc TEXT NOT NULL, |
| 346 | 346 | QST_ID INT UNSIGNED NOT NULL, |
| 347 | 347 | QSO_order INT UNSIGNED NOT NULL DEFAULT 0, |
| 348 | 348 | QSO_deleted TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, |
| 349 | 349 | PRIMARY KEY (QSO_ID)"; |
| 350 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 351 | - $table_name = 'esp_registration'; |
|
| 352 | - $sql = "REG_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 350 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 351 | + $table_name = 'esp_registration'; |
|
| 352 | + $sql = "REG_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 353 | 353 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 354 | 354 | ATT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 355 | 355 | TXN_ID INT(10) UNSIGNED NOT NULL, |
@@ -372,25 +372,25 @@ discard block |
||
| 372 | 372 | KEY STS_ID (STS_ID), |
| 373 | 373 | KEY REG_url_link (REG_url_link), |
| 374 | 374 | KEY REG_code (REG_code)"; |
| 375 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 376 | - $table_name = 'esp_checkin'; |
|
| 377 | - $sql = "CHK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 375 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 376 | + $table_name = 'esp_checkin'; |
|
| 377 | + $sql = "CHK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 378 | 378 | REG_ID INT(10) UNSIGNED NOT NULL, |
| 379 | 379 | DTT_ID INT(10) UNSIGNED NOT NULL, |
| 380 | 380 | CHK_in TINYINT(1) UNSIGNED NOT NULL DEFAULT 1, |
| 381 | 381 | CHK_timestamp DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', |
| 382 | 382 | PRIMARY KEY (CHK_ID)"; |
| 383 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 384 | - $table_name = 'esp_state'; |
|
| 385 | - $sql = "STA_ID smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 383 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 384 | + $table_name = 'esp_state'; |
|
| 385 | + $sql = "STA_ID smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 386 | 386 | CNT_ISO VARCHAR(2) COLLATE utf8_bin NOT NULL, |
| 387 | 387 | STA_abbrev VARCHAR(6) COLLATE utf8_bin NOT NULL, |
| 388 | 388 | STA_name VARCHAR(100) COLLATE utf8_bin NOT NULL, |
| 389 | 389 | STA_active TINYINT(1) DEFAULT '1', |
| 390 | 390 | PRIMARY KEY (STA_ID)"; |
| 391 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 392 | - $table_name = 'esp_status'; |
|
| 393 | - $sql = "STS_ID VARCHAR(3) COLLATE utf8_bin NOT NULL, |
|
| 391 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 392 | + $table_name = 'esp_status'; |
|
| 393 | + $sql = "STS_ID VARCHAR(3) COLLATE utf8_bin NOT NULL, |
|
| 394 | 394 | STS_code VARCHAR(45) COLLATE utf8_bin NOT NULL, |
| 395 | 395 | STS_type set('event','registration','transaction','payment','email') COLLATE utf8_bin NOT NULL, |
| 396 | 396 | STS_can_edit TINYINT(1) NOT NULL DEFAULT 0, |
@@ -398,9 +398,9 @@ discard block |
||
| 398 | 398 | STS_open TINYINT(1) NOT NULL DEFAULT 1, |
| 399 | 399 | UNIQUE KEY STS_ID_UNIQUE (STS_ID), |
| 400 | 400 | KEY STS_type (STS_type)"; |
| 401 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 402 | - $table_name = 'esp_transaction'; |
|
| 403 | - $sql = "TXN_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 401 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 402 | + $table_name = 'esp_transaction'; |
|
| 403 | + $sql = "TXN_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 404 | 404 | TXN_timestamp DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', |
| 405 | 405 | TXN_total DECIMAL(10,3) DEFAULT '0.00', |
| 406 | 406 | TXN_paid DECIMAL(10,3) NOT NULL DEFAULT '0.00', |
@@ -410,9 +410,9 @@ discard block |
||
| 410 | 410 | PRIMARY KEY (TXN_ID), |
| 411 | 411 | KEY TXN_timestamp (TXN_timestamp), |
| 412 | 412 | KEY STS_ID (STS_ID)"; |
| 413 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 414 | - $table_name = 'esp_venue_meta'; |
|
| 415 | - $sql = "VNUM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 413 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 414 | + $table_name = 'esp_venue_meta'; |
|
| 415 | + $sql = "VNUM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 416 | 416 | VNU_ID BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, |
| 417 | 417 | VNU_address VARCHAR(255) DEFAULT NULL, |
| 418 | 418 | VNU_address2 VARCHAR(255) DEFAULT NULL, |
@@ -430,79 +430,79 @@ discard block |
||
| 430 | 430 | PRIMARY KEY (VNUM_ID), |
| 431 | 431 | KEY STA_ID (STA_ID), |
| 432 | 432 | KEY CNT_ISO (CNT_ISO)"; |
| 433 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 434 | - $script_with_defaults = EE_Registry::instance()->load_dms('Core_4_1_0'); |
|
| 435 | - //setting up the DEFAULT stats and countries is also essential for the data migrations to run |
|
| 436 | - //(because many need to convert old string states to foreign keys into the states table) |
|
| 437 | - $script_with_defaults->insert_default_states(); |
|
| 438 | - $script_with_defaults->insert_default_countries(); |
|
| 439 | - //setting up DEFAULT prices, price types, and tickets is also essential for the price migrations |
|
| 440 | - $script_with_defaults->insert_default_price_types(); |
|
| 441 | - $script_with_defaults->insert_default_prices(); |
|
| 442 | - //but the schema on the tickets table has changed since 4.1, so use our DEFAULT ticket method instead of 4.1's |
|
| 443 | - $this->insert_default_tickets(); |
|
| 444 | - //setting up the config wp option pretty well counts as a 'schema change', or at least should happen ehre |
|
| 445 | - EE_Config::instance()->update_espresso_config(false, true); |
|
| 446 | - return true; |
|
| 447 | - } |
|
| 448 | - |
|
| 449 | - |
|
| 450 | - |
|
| 451 | - /** |
|
| 452 | - * @return boolean |
|
| 453 | - */ |
|
| 454 | - public function schema_changes_after_migration() |
|
| 455 | - { |
|
| 456 | - return true; |
|
| 457 | - } |
|
| 458 | - |
|
| 459 | - |
|
| 460 | - |
|
| 461 | - public function migration_page_hooks() |
|
| 462 | - { |
|
| 463 | - } |
|
| 464 | - |
|
| 465 | - |
|
| 466 | - |
|
| 467 | - /** |
|
| 468 | - * insert DEFAULT ticket |
|
| 469 | - * Almost identical to EE_DMS_Core_4_1_0::insert_default_tickets, except is aware of the TKT_required field |
|
| 470 | - * |
|
| 471 | - * @access public |
|
| 472 | - * @static |
|
| 473 | - * @return void |
|
| 474 | - */ |
|
| 475 | - public function insert_default_tickets() |
|
| 476 | - { |
|
| 477 | - global $wpdb; |
|
| 478 | - $ticket_table = $wpdb->prefix . "esp_ticket"; |
|
| 479 | - if ($this->_get_table_analysis()->tableExists($ticket_table)) { |
|
| 480 | - $SQL = 'SELECT COUNT(TKT_ID) FROM ' . $ticket_table; |
|
| 481 | - $tickets_exist = $wpdb->get_var($SQL); |
|
| 482 | - if ( ! $tickets_exist) { |
|
| 483 | - $SQL = "INSERT INTO $ticket_table |
|
| 433 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 434 | + $script_with_defaults = EE_Registry::instance()->load_dms('Core_4_1_0'); |
|
| 435 | + //setting up the DEFAULT stats and countries is also essential for the data migrations to run |
|
| 436 | + //(because many need to convert old string states to foreign keys into the states table) |
|
| 437 | + $script_with_defaults->insert_default_states(); |
|
| 438 | + $script_with_defaults->insert_default_countries(); |
|
| 439 | + //setting up DEFAULT prices, price types, and tickets is also essential for the price migrations |
|
| 440 | + $script_with_defaults->insert_default_price_types(); |
|
| 441 | + $script_with_defaults->insert_default_prices(); |
|
| 442 | + //but the schema on the tickets table has changed since 4.1, so use our DEFAULT ticket method instead of 4.1's |
|
| 443 | + $this->insert_default_tickets(); |
|
| 444 | + //setting up the config wp option pretty well counts as a 'schema change', or at least should happen ehre |
|
| 445 | + EE_Config::instance()->update_espresso_config(false, true); |
|
| 446 | + return true; |
|
| 447 | + } |
|
| 448 | + |
|
| 449 | + |
|
| 450 | + |
|
| 451 | + /** |
|
| 452 | + * @return boolean |
|
| 453 | + */ |
|
| 454 | + public function schema_changes_after_migration() |
|
| 455 | + { |
|
| 456 | + return true; |
|
| 457 | + } |
|
| 458 | + |
|
| 459 | + |
|
| 460 | + |
|
| 461 | + public function migration_page_hooks() |
|
| 462 | + { |
|
| 463 | + } |
|
| 464 | + |
|
| 465 | + |
|
| 466 | + |
|
| 467 | + /** |
|
| 468 | + * insert DEFAULT ticket |
|
| 469 | + * Almost identical to EE_DMS_Core_4_1_0::insert_default_tickets, except is aware of the TKT_required field |
|
| 470 | + * |
|
| 471 | + * @access public |
|
| 472 | + * @static |
|
| 473 | + * @return void |
|
| 474 | + */ |
|
| 475 | + public function insert_default_tickets() |
|
| 476 | + { |
|
| 477 | + global $wpdb; |
|
| 478 | + $ticket_table = $wpdb->prefix . "esp_ticket"; |
|
| 479 | + if ($this->_get_table_analysis()->tableExists($ticket_table)) { |
|
| 480 | + $SQL = 'SELECT COUNT(TKT_ID) FROM ' . $ticket_table; |
|
| 481 | + $tickets_exist = $wpdb->get_var($SQL); |
|
| 482 | + if ( ! $tickets_exist) { |
|
| 483 | + $SQL = "INSERT INTO $ticket_table |
|
| 484 | 484 | ( 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_deleted ) VALUES |
| 485 | 485 | ( 1, 0, '" |
| 486 | - . __("Free Ticket", "event_espresso") |
|
| 487 | - . "', '', 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, 0);"; |
|
| 488 | - $SQL = apply_filters('FHEE__EE_DMS_4_1_0__insert_default_tickets__SQL', $SQL); |
|
| 489 | - $wpdb->query($SQL); |
|
| 490 | - } |
|
| 491 | - } |
|
| 492 | - $ticket_price_table = $wpdb->prefix . "esp_ticket_price"; |
|
| 493 | - if ($this->_get_table_analysis()->tableExists($ticket_price_table)) { |
|
| 494 | - $SQL = 'SELECT COUNT(TKP_ID) FROM ' . $ticket_price_table; |
|
| 495 | - $ticket_prc_exist = $wpdb->get_var($SQL); |
|
| 496 | - if ( ! $ticket_prc_exist) { |
|
| 497 | - $SQL = "INSERT INTO $ticket_price_table |
|
| 486 | + . __("Free Ticket", "event_espresso") |
|
| 487 | + . "', '', 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, 0);"; |
|
| 488 | + $SQL = apply_filters('FHEE__EE_DMS_4_1_0__insert_default_tickets__SQL', $SQL); |
|
| 489 | + $wpdb->query($SQL); |
|
| 490 | + } |
|
| 491 | + } |
|
| 492 | + $ticket_price_table = $wpdb->prefix . "esp_ticket_price"; |
|
| 493 | + if ($this->_get_table_analysis()->tableExists($ticket_price_table)) { |
|
| 494 | + $SQL = 'SELECT COUNT(TKP_ID) FROM ' . $ticket_price_table; |
|
| 495 | + $ticket_prc_exist = $wpdb->get_var($SQL); |
|
| 496 | + if ( ! $ticket_prc_exist) { |
|
| 497 | + $SQL = "INSERT INTO $ticket_price_table |
|
| 498 | 498 | ( TKP_ID, TKT_ID, PRC_ID ) VALUES |
| 499 | 499 | ( 1, 1, 1 ) |
| 500 | 500 | "; |
| 501 | - $SQL = apply_filters('FHEE__EE_DMS_4_1_0__insert_default_tickets__SQL__ticket_price', $SQL); |
|
| 502 | - $wpdb->query($SQL); |
|
| 503 | - } |
|
| 504 | - } |
|
| 505 | - } |
|
| 501 | + $SQL = apply_filters('FHEE__EE_DMS_4_1_0__insert_default_tickets__SQL__ticket_price', $SQL); |
|
| 502 | + $wpdb->query($SQL); |
|
| 503 | + } |
|
| 504 | + } |
|
| 505 | + } |
|
| 506 | 506 | |
| 507 | 507 | } |
| 508 | 508 | |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | //unfortunately, this needs to be done upon INCLUSION of this file, |
| 12 | 12 | //instead of construction, because it only gets constructed on first page load |
| 13 | 13 | //(all other times it gets resurrected from a wordpress option) |
| 14 | -$stages = glob(EE_CORE . 'data_migration_scripts/4_6_0_stages/*'); |
|
| 14 | +$stages = glob(EE_CORE.'data_migration_scripts/4_6_0_stages/*'); |
|
| 15 | 15 | $class_to_filepath = array(); |
| 16 | 16 | foreach ($stages as $filepath) { |
| 17 | 17 | $matches = array(); |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | } elseif ( ! $version_string) { |
| 75 | 75 | // echo "no version string provided: $version_string"; |
| 76 | 76 | //no version string provided... this must be pre 4.3 |
| 77 | - return false;//changed mind. dont want people thinking they should migrate yet because they cant |
|
| 77 | + return false; //changed mind. dont want people thinking they should migrate yet because they cant |
|
| 78 | 78 | } else { |
| 79 | 79 | // echo "$version_string doesnt apply"; |
| 80 | 80 | return false; |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | public function schema_changes_before_migration() |
| 100 | 100 | { |
| 101 | 101 | //relies on 4.1's EEH_Activation::create_table |
| 102 | - require_once(EE_HELPERS . 'EEH_Activation.helper.php'); |
|
| 102 | + require_once(EE_HELPERS.'EEH_Activation.helper.php'); |
|
| 103 | 103 | $table_name = 'esp_answer'; |
| 104 | 104 | $sql = " ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
| 105 | 105 | REG_ID INT UNSIGNED NOT NULL, |
@@ -546,7 +546,7 @@ discard block |
||
| 546 | 546 | public function add_default_admin_only_payments() |
| 547 | 547 | { |
| 548 | 548 | global $wpdb; |
| 549 | - $table_name = $wpdb->prefix . "esp_payment_method"; |
|
| 549 | + $table_name = $wpdb->prefix."esp_payment_method"; |
|
| 550 | 550 | $user_id = EEH_Activation::get_default_creator_id(); |
| 551 | 551 | if ($this->_get_table_analysis()->tableExists($table_name)) { |
| 552 | 552 | $SQL = "SELECT COUNT( * ) FROM $table_name"; |
@@ -585,13 +585,13 @@ discard block |
||
| 585 | 585 | $table_name, |
| 586 | 586 | $values, |
| 587 | 587 | array( |
| 588 | - '%s',//PMD_type |
|
| 589 | - '%s',//PMD_name |
|
| 590 | - '%s',//PMD_admin_name |
|
| 591 | - '%s',//PMD_admin_desc |
|
| 592 | - '%s',//PMD_slug |
|
| 593 | - '%d',//PMD_wp_user |
|
| 594 | - '%s',//PMD_scope |
|
| 588 | + '%s', //PMD_type |
|
| 589 | + '%s', //PMD_name |
|
| 590 | + '%s', //PMD_admin_name |
|
| 591 | + '%s', //PMD_admin_desc |
|
| 592 | + '%s', //PMD_slug |
|
| 593 | + '%d', //PMD_wp_user |
|
| 594 | + '%s', //PMD_scope |
|
| 595 | 595 | ) |
| 596 | 596 | ); |
| 597 | 597 | if ( ! $success) { |
@@ -614,7 +614,7 @@ discard block |
||
| 614 | 614 | public function insert_default_currencies() |
| 615 | 615 | { |
| 616 | 616 | global $wpdb; |
| 617 | - $currency_table = $wpdb->prefix . "esp_currency"; |
|
| 617 | + $currency_table = $wpdb->prefix."esp_currency"; |
|
| 618 | 618 | if ($this->_get_table_analysis()->tableExists($currency_table)) { |
| 619 | 619 | $SQL = "SELECT COUNT('CUR_code') FROM $currency_table"; |
| 620 | 620 | $countries = $wpdb->get_var($SQL); |
@@ -14,9 +14,9 @@ discard block |
||
| 14 | 14 | $stages = glob(EE_CORE . 'data_migration_scripts/4_6_0_stages/*'); |
| 15 | 15 | $class_to_filepath = array(); |
| 16 | 16 | foreach ($stages as $filepath) { |
| 17 | - $matches = array(); |
|
| 18 | - preg_match('~4_6_0_stages/(.*).dmsstage.php~', $filepath, $matches); |
|
| 19 | - $class_to_filepath[$matches[1]] = $filepath; |
|
| 17 | + $matches = array(); |
|
| 18 | + preg_match('~4_6_0_stages/(.*).dmsstage.php~', $filepath, $matches); |
|
| 19 | + $class_to_filepath[$matches[1]] = $filepath; |
|
| 20 | 20 | } |
| 21 | 21 | //give addons a chance to autoload their stages too |
| 22 | 22 | $class_to_filepath = apply_filters('FHEE__EE_DMS_4_6_0__autoloaded_stages', $class_to_filepath); |
@@ -35,70 +35,70 @@ discard block |
||
| 35 | 35 | class EE_DMS_Core_4_6_0 extends EE_Data_Migration_Script_Base |
| 36 | 36 | { |
| 37 | 37 | |
| 38 | - /** |
|
| 39 | - * return EE_DMS_Core_4_6_0 |
|
| 40 | - * |
|
| 41 | - * @param TableManager $table_manager |
|
| 42 | - * @param TableAnalysis $table_analysis |
|
| 43 | - */ |
|
| 44 | - public function __construct(TableManager $table_manager = null, TableAnalysis $table_analysis = null) |
|
| 45 | - { |
|
| 46 | - $this->_pretty_name = __("Data Update to Event Espresso 4.6.0", "event_espresso"); |
|
| 47 | - $this->_priority = 10; |
|
| 48 | - $this->_migration_stages = array( |
|
| 49 | - new EE_DMS_4_6_0_gateways(), |
|
| 50 | - new EE_DMS_4_6_0_payment_method_currencies(), |
|
| 51 | - new EE_DMS_4_6_0_question_types(), |
|
| 52 | - new EE_DMS_4_6_0_country_system_question(), |
|
| 53 | - new EE_DMS_4_6_0_state_system_question(), |
|
| 54 | - new EE_DMS_4_6_0_billing_info(), |
|
| 55 | - new EE_DMS_4_6_0_transactions(), |
|
| 56 | - new EE_DMS_4_6_0_payments(), |
|
| 57 | - new EE_DMS_4_6_0_invoice_settings(), |
|
| 58 | - ); |
|
| 59 | - parent::__construct($table_manager, $table_analysis); |
|
| 60 | - } |
|
| 61 | - |
|
| 62 | - |
|
| 63 | - |
|
| 64 | - /** |
|
| 65 | - * @param array $version_array |
|
| 66 | - * @return bool |
|
| 67 | - */ |
|
| 68 | - public function can_migrate_from_version($version_array) |
|
| 69 | - { |
|
| 70 | - $version_string = $version_array['Core']; |
|
| 71 | - if (version_compare($version_string, '4.6.0', '<=') && version_compare($version_string, '4.5.0', '>=')) { |
|
| 38 | + /** |
|
| 39 | + * return EE_DMS_Core_4_6_0 |
|
| 40 | + * |
|
| 41 | + * @param TableManager $table_manager |
|
| 42 | + * @param TableAnalysis $table_analysis |
|
| 43 | + */ |
|
| 44 | + public function __construct(TableManager $table_manager = null, TableAnalysis $table_analysis = null) |
|
| 45 | + { |
|
| 46 | + $this->_pretty_name = __("Data Update to Event Espresso 4.6.0", "event_espresso"); |
|
| 47 | + $this->_priority = 10; |
|
| 48 | + $this->_migration_stages = array( |
|
| 49 | + new EE_DMS_4_6_0_gateways(), |
|
| 50 | + new EE_DMS_4_6_0_payment_method_currencies(), |
|
| 51 | + new EE_DMS_4_6_0_question_types(), |
|
| 52 | + new EE_DMS_4_6_0_country_system_question(), |
|
| 53 | + new EE_DMS_4_6_0_state_system_question(), |
|
| 54 | + new EE_DMS_4_6_0_billing_info(), |
|
| 55 | + new EE_DMS_4_6_0_transactions(), |
|
| 56 | + new EE_DMS_4_6_0_payments(), |
|
| 57 | + new EE_DMS_4_6_0_invoice_settings(), |
|
| 58 | + ); |
|
| 59 | + parent::__construct($table_manager, $table_analysis); |
|
| 60 | + } |
|
| 61 | + |
|
| 62 | + |
|
| 63 | + |
|
| 64 | + /** |
|
| 65 | + * @param array $version_array |
|
| 66 | + * @return bool |
|
| 67 | + */ |
|
| 68 | + public function can_migrate_from_version($version_array) |
|
| 69 | + { |
|
| 70 | + $version_string = $version_array['Core']; |
|
| 71 | + if (version_compare($version_string, '4.6.0', '<=') && version_compare($version_string, '4.5.0', '>=')) { |
|
| 72 | 72 | // echo "$version_string can be migrated from"; |
| 73 | - return true; |
|
| 74 | - } elseif ( ! $version_string) { |
|
| 73 | + return true; |
|
| 74 | + } elseif ( ! $version_string) { |
|
| 75 | 75 | // echo "no version string provided: $version_string"; |
| 76 | - //no version string provided... this must be pre 4.3 |
|
| 77 | - return false;//changed mind. dont want people thinking they should migrate yet because they cant |
|
| 78 | - } else { |
|
| 76 | + //no version string provided... this must be pre 4.3 |
|
| 77 | + return false;//changed mind. dont want people thinking they should migrate yet because they cant |
|
| 78 | + } else { |
|
| 79 | 79 | // echo "$version_string doesnt apply"; |
| 80 | - return false; |
|
| 81 | - } |
|
| 82 | - } |
|
| 80 | + return false; |
|
| 81 | + } |
|
| 82 | + } |
|
| 83 | 83 | |
| 84 | 84 | |
| 85 | 85 | |
| 86 | - /** |
|
| 87 | - * @return bool |
|
| 88 | - */ |
|
| 89 | - public function schema_changes_before_migration() |
|
| 90 | - { |
|
| 91 | - //relies on 4.1's EEH_Activation::create_table |
|
| 92 | - require_once(EE_HELPERS . 'EEH_Activation.helper.php'); |
|
| 93 | - $table_name = 'esp_answer'; |
|
| 94 | - $sql = " ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 86 | + /** |
|
| 87 | + * @return bool |
|
| 88 | + */ |
|
| 89 | + public function schema_changes_before_migration() |
|
| 90 | + { |
|
| 91 | + //relies on 4.1's EEH_Activation::create_table |
|
| 92 | + require_once(EE_HELPERS . 'EEH_Activation.helper.php'); |
|
| 93 | + $table_name = 'esp_answer'; |
|
| 94 | + $sql = " ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 95 | 95 | REG_ID INT UNSIGNED NOT NULL, |
| 96 | 96 | QST_ID INT UNSIGNED NOT NULL, |
| 97 | 97 | ANS_value TEXT NOT NULL, |
| 98 | 98 | PRIMARY KEY (ANS_ID)"; |
| 99 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 100 | - $table_name = 'esp_attendee_meta'; |
|
| 101 | - $sql = "ATTM_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 99 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 100 | + $table_name = 'esp_attendee_meta'; |
|
| 101 | + $sql = "ATTM_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 102 | 102 | ATT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 103 | 103 | ATT_fname VARCHAR(45) NOT NULL, |
| 104 | 104 | ATT_lname VARCHAR(45) NOT NULL, |
@@ -114,9 +114,9 @@ discard block |
||
| 114 | 114 | KEY ATT_fname (ATT_fname), |
| 115 | 115 | KEY ATT_lname (ATT_lname), |
| 116 | 116 | KEY ATT_email (ATT_email)"; |
| 117 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 118 | - $table_name = 'esp_country'; |
|
| 119 | - $sql = "CNT_ISO VARCHAR(2) COLLATE utf8_bin NOT NULL, |
|
| 117 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 118 | + $table_name = 'esp_country'; |
|
| 119 | + $sql = "CNT_ISO VARCHAR(2) COLLATE utf8_bin NOT NULL, |
|
| 120 | 120 | CNT_ISO3 VARCHAR(3) COLLATE utf8_bin NOT NULL, |
| 121 | 121 | RGN_ID TINYINT(3) UNSIGNED DEFAULT NULL, |
| 122 | 122 | CNT_name VARCHAR(45) COLLATE utf8_bin NOT NULL, |
@@ -132,24 +132,24 @@ discard block |
||
| 132 | 132 | CNT_is_EU TINYINT(1) DEFAULT '0', |
| 133 | 133 | CNT_active TINYINT(1) DEFAULT '0', |
| 134 | 134 | PRIMARY KEY (CNT_ISO)"; |
| 135 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 136 | - $table_name = 'esp_currency'; |
|
| 137 | - $sql = "CUR_code VARCHAR(6) COLLATE utf8_bin NOT NULL, |
|
| 135 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 136 | + $table_name = 'esp_currency'; |
|
| 137 | + $sql = "CUR_code VARCHAR(6) COLLATE utf8_bin NOT NULL, |
|
| 138 | 138 | CUR_single VARCHAR(45) COLLATE utf8_bin DEFAULT 'dollar', |
| 139 | 139 | CUR_plural VARCHAR(45) COLLATE utf8_bin DEFAULT 'dollars', |
| 140 | 140 | CUR_sign VARCHAR(45) COLLATE utf8_bin DEFAULT '$', |
| 141 | 141 | CUR_dec_plc VARCHAR(1) COLLATE utf8_bin NOT NULL DEFAULT '2', |
| 142 | 142 | CUR_active TINYINT(1) DEFAULT '0', |
| 143 | 143 | PRIMARY KEY (CUR_code)"; |
| 144 | - $this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 145 | - $table_name = 'esp_currency_payment_method'; |
|
| 146 | - $sql = "CPM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 144 | + $this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 145 | + $table_name = 'esp_currency_payment_method'; |
|
| 146 | + $sql = "CPM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 147 | 147 | CUR_code VARCHAR(6) COLLATE utf8_bin NOT NULL, |
| 148 | 148 | PMD_ID INT(11) NOT NULL, |
| 149 | 149 | PRIMARY KEY (CPM_ID)"; |
| 150 | - $this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 151 | - $table_name = 'esp_datetime'; |
|
| 152 | - $sql = "DTT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 150 | + $this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 151 | + $table_name = 'esp_datetime'; |
|
| 152 | + $sql = "DTT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 153 | 153 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 154 | 154 | DTT_name VARCHAR(255) NOT NULL DEFAULT '', |
| 155 | 155 | DTT_description TEXT NOT NULL, |
@@ -164,9 +164,9 @@ discard block |
||
| 164 | 164 | PRIMARY KEY (DTT_ID), |
| 165 | 165 | KEY EVT_ID (EVT_ID), |
| 166 | 166 | KEY DTT_is_primary (DTT_is_primary)"; |
| 167 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 168 | - $table_name = 'esp_event_meta'; |
|
| 169 | - $sql = " |
|
| 167 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 168 | + $table_name = 'esp_event_meta'; |
|
| 169 | + $sql = " |
|
| 170 | 170 | EVTM_ID INT NOT NULL AUTO_INCREMENT, |
| 171 | 171 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 172 | 172 | EVT_display_desc TINYINT(1) UNSIGNED NOT NULL DEFAULT 1, |
@@ -181,31 +181,31 @@ discard block |
||
| 181 | 181 | EVT_external_URL VARCHAR(200) NULL, |
| 182 | 182 | EVT_donations TINYINT(1) NULL, |
| 183 | 183 | PRIMARY KEY (EVTM_ID)"; |
| 184 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 185 | - $table_name = 'esp_event_question_group'; |
|
| 186 | - $sql = "EQG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 184 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 185 | + $table_name = 'esp_event_question_group'; |
|
| 186 | + $sql = "EQG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 187 | 187 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 188 | 188 | QSG_ID INT UNSIGNED NOT NULL, |
| 189 | 189 | EQG_primary TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, |
| 190 | 190 | PRIMARY KEY (EQG_ID)"; |
| 191 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 192 | - $table_name = 'esp_event_venue'; |
|
| 193 | - $sql = "EVV_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 191 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 192 | + $table_name = 'esp_event_venue'; |
|
| 193 | + $sql = "EVV_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 194 | 194 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 195 | 195 | VNU_ID BIGINT(20) UNSIGNED NOT NULL, |
| 196 | 196 | EVV_primary TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, |
| 197 | 197 | PRIMARY KEY (EVV_ID)"; |
| 198 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 199 | - $table_name = 'esp_extra_meta'; |
|
| 200 | - $sql = "EXM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 198 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 199 | + $table_name = 'esp_extra_meta'; |
|
| 200 | + $sql = "EXM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 201 | 201 | OBJ_ID INT(11) DEFAULT NULL, |
| 202 | 202 | EXM_type VARCHAR(45) DEFAULT NULL, |
| 203 | 203 | EXM_key VARCHAR(45) DEFAULT NULL, |
| 204 | 204 | EXM_value TEXT, |
| 205 | 205 | PRIMARY KEY (EXM_ID)"; |
| 206 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 207 | - $table_name = 'esp_line_item'; |
|
| 208 | - $sql = "LIN_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 206 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 207 | + $table_name = 'esp_line_item'; |
|
| 208 | + $sql = "LIN_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 209 | 209 | LIN_code VARCHAR(245) NOT NULL DEFAULT '', |
| 210 | 210 | TXN_ID INT(11) DEFAULT NULL, |
| 211 | 211 | LIN_name VARCHAR(245) NOT NULL DEFAULT '', |
@@ -221,9 +221,9 @@ discard block |
||
| 221 | 221 | OBJ_ID INT(11) DEFAULT NULL, |
| 222 | 222 | OBJ_type VARCHAR(45)DEFAULT NULL, |
| 223 | 223 | PRIMARY KEY (LIN_ID)"; |
| 224 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 225 | - $table_name = 'esp_log'; |
|
| 226 | - $sql = "LOG_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 224 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 225 | + $table_name = 'esp_log'; |
|
| 226 | + $sql = "LOG_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 227 | 227 | LOG_time DATETIME DEFAULT NULL, |
| 228 | 228 | OBJ_ID VARCHAR(45) DEFAULT NULL, |
| 229 | 229 | OBJ_type VARCHAR(45) DEFAULT NULL, |
@@ -231,19 +231,19 @@ discard block |
||
| 231 | 231 | LOG_message TEXT, |
| 232 | 232 | LOG_wp_user INT(11) DEFAULT NULL, |
| 233 | 233 | PRIMARY KEY (LOG_ID)"; |
| 234 | - $this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 235 | - $table_name = 'esp_message_template'; |
|
| 236 | - $sql = "MTP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 234 | + $this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 235 | + $table_name = 'esp_message_template'; |
|
| 236 | + $sql = "MTP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 237 | 237 | GRP_ID INT(10) UNSIGNED NOT NULL, |
| 238 | 238 | MTP_context VARCHAR(50) NOT NULL, |
| 239 | 239 | MTP_template_field VARCHAR(30) NOT NULL, |
| 240 | 240 | MTP_content TEXT NOT NULL, |
| 241 | 241 | PRIMARY KEY (MTP_ID), |
| 242 | 242 | KEY GRP_ID (GRP_ID)"; |
| 243 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 244 | - $this->_get_table_manager()->dropIndex('esp_message_template_group', 'EVT_ID'); |
|
| 245 | - $table_name = 'esp_message_template_group'; |
|
| 246 | - $sql = "GRP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 243 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 244 | + $this->_get_table_manager()->dropIndex('esp_message_template_group', 'EVT_ID'); |
|
| 245 | + $table_name = 'esp_message_template_group'; |
|
| 246 | + $sql = "GRP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 247 | 247 | MTP_user_id INT(10) NOT NULL DEFAULT '1', |
| 248 | 248 | MTP_name VARCHAR(245) NOT NULL DEFAULT '', |
| 249 | 249 | MTP_description VARCHAR(245) NOT NULL DEFAULT '', |
@@ -255,17 +255,17 @@ discard block |
||
| 255 | 255 | MTP_is_active TINYINT(1) NOT NULL DEFAULT '1', |
| 256 | 256 | PRIMARY KEY (GRP_ID), |
| 257 | 257 | KEY MTP_user_id (MTP_user_id)"; |
| 258 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 259 | - $table_name = 'esp_event_message_template'; |
|
| 260 | - $sql = "EMT_ID BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 258 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 259 | + $table_name = 'esp_event_message_template'; |
|
| 260 | + $sql = "EMT_ID BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 261 | 261 | EVT_ID BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, |
| 262 | 262 | GRP_ID INT(10) UNSIGNED NOT NULL DEFAULT 0, |
| 263 | 263 | PRIMARY KEY (EMT_ID), |
| 264 | 264 | KEY EVT_ID (EVT_ID), |
| 265 | 265 | KEY GRP_ID (GRP_ID)"; |
| 266 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 267 | - $table_name = 'esp_payment'; |
|
| 268 | - $sql = "PAY_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 266 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 267 | + $table_name = 'esp_payment'; |
|
| 268 | + $sql = "PAY_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 269 | 269 | TXN_ID INT(10) UNSIGNED DEFAULT NULL, |
| 270 | 270 | STS_ID VARCHAR(3) COLLATE utf8_bin DEFAULT NULL, |
| 271 | 271 | PAY_timestamp DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', |
@@ -282,9 +282,9 @@ discard block |
||
| 282 | 282 | PRIMARY KEY (PAY_ID), |
| 283 | 283 | KEY TXN_ID (TXN_ID), |
| 284 | 284 | KEY PAY_timestamp (PAY_timestamp)"; |
| 285 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 286 | - $table_name = 'esp_payment_method'; |
|
| 287 | - $sql = "PMD_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 285 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 286 | + $table_name = 'esp_payment_method'; |
|
| 287 | + $sql = "PMD_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 288 | 288 | PMD_type VARCHAR(124) DEFAULT NULL, |
| 289 | 289 | PMD_name VARCHAR(255) DEFAULT NULL, |
| 290 | 290 | PMD_desc TEXT, |
@@ -299,28 +299,28 @@ discard block |
||
| 299 | 299 | PMD_scope VARCHAR(255) NULL DEFAULT 'frontend', |
| 300 | 300 | PRIMARY KEY (PMD_ID), |
| 301 | 301 | UNIQUE KEY PMD_slug_UNIQUE (PMD_slug)"; |
| 302 | - $this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 303 | - $table_name = "esp_ticket_price"; |
|
| 304 | - $sql = "TKP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 302 | + $this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 303 | + $table_name = "esp_ticket_price"; |
|
| 304 | + $sql = "TKP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 305 | 305 | TKT_ID INT(10) UNSIGNED NOT NULL, |
| 306 | 306 | PRC_ID INT(10) UNSIGNED NOT NULL, |
| 307 | 307 | PRIMARY KEY (TKP_ID)"; |
| 308 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 309 | - $table_name = "esp_datetime_ticket"; |
|
| 310 | - $sql = "DTK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 308 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 309 | + $table_name = "esp_datetime_ticket"; |
|
| 310 | + $sql = "DTK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 311 | 311 | DTT_ID INT(10) UNSIGNED NOT NULL, |
| 312 | 312 | TKT_ID INT(10) UNSIGNED NOT NULL, |
| 313 | 313 | PRIMARY KEY (DTK_ID)"; |
| 314 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 315 | - $table_name = "esp_ticket_template"; |
|
| 316 | - $sql = "TTM_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 314 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 315 | + $table_name = "esp_ticket_template"; |
|
| 316 | + $sql = "TTM_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 317 | 317 | TTM_name VARCHAR(45) NOT NULL, |
| 318 | 318 | TTM_description TEXT, |
| 319 | 319 | TTM_file VARCHAR(45), |
| 320 | 320 | PRIMARY KEY (TTM_ID)"; |
| 321 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 322 | - $table_name = 'esp_question'; |
|
| 323 | - $sql = 'QST_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 321 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 322 | + $table_name = 'esp_question'; |
|
| 323 | + $sql = 'QST_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 324 | 324 | QST_display_text TEXT NOT NULL, |
| 325 | 325 | QST_admin_label VARCHAR(255) NOT NULL, |
| 326 | 326 | QST_system VARCHAR(25) DEFAULT NULL, |
@@ -332,25 +332,25 @@ discard block |
||
| 332 | 332 | QST_wp_user BIGINT UNSIGNED NULL, |
| 333 | 333 | QST_deleted TINYINT UNSIGNED NOT NULL DEFAULT 0, |
| 334 | 334 | PRIMARY KEY (QST_ID)'; |
| 335 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 336 | - $table_name = 'esp_question_group_question'; |
|
| 337 | - $sql = "QGQ_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 335 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 336 | + $table_name = 'esp_question_group_question'; |
|
| 337 | + $sql = "QGQ_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 338 | 338 | QSG_ID INT UNSIGNED NOT NULL, |
| 339 | 339 | QST_ID INT UNSIGNED NOT NULL, |
| 340 | 340 | QGQ_order INT UNSIGNED NOT NULL DEFAULT 0, |
| 341 | 341 | PRIMARY KEY (QGQ_ID) "; |
| 342 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 343 | - $table_name = 'esp_question_option'; |
|
| 344 | - $sql = "QSO_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 342 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 343 | + $table_name = 'esp_question_option'; |
|
| 344 | + $sql = "QSO_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 345 | 345 | QSO_value VARCHAR(255) NOT NULL, |
| 346 | 346 | QSO_desc TEXT NOT NULL, |
| 347 | 347 | QST_ID INT UNSIGNED NOT NULL, |
| 348 | 348 | QSO_order INT UNSIGNED NOT NULL DEFAULT 0, |
| 349 | 349 | QSO_deleted TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, |
| 350 | 350 | PRIMARY KEY (QSO_ID)"; |
| 351 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 352 | - $table_name = 'esp_registration'; |
|
| 353 | - $sql = "REG_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 351 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 352 | + $table_name = 'esp_registration'; |
|
| 353 | + $sql = "REG_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 354 | 354 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 355 | 355 | ATT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 356 | 356 | TXN_ID INT(10) UNSIGNED NOT NULL, |
@@ -373,25 +373,25 @@ discard block |
||
| 373 | 373 | KEY STS_ID (STS_ID), |
| 374 | 374 | KEY REG_url_link (REG_url_link), |
| 375 | 375 | KEY REG_code (REG_code)"; |
| 376 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 377 | - $table_name = 'esp_checkin'; |
|
| 378 | - $sql = "CHK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 376 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 377 | + $table_name = 'esp_checkin'; |
|
| 378 | + $sql = "CHK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 379 | 379 | REG_ID INT(10) UNSIGNED NOT NULL, |
| 380 | 380 | DTT_ID INT(10) UNSIGNED NOT NULL, |
| 381 | 381 | CHK_in TINYINT(1) UNSIGNED NOT NULL DEFAULT 1, |
| 382 | 382 | CHK_timestamp DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', |
| 383 | 383 | PRIMARY KEY (CHK_ID)"; |
| 384 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 385 | - $table_name = 'esp_state'; |
|
| 386 | - $sql = "STA_ID smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 384 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 385 | + $table_name = 'esp_state'; |
|
| 386 | + $sql = "STA_ID smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 387 | 387 | CNT_ISO VARCHAR(2) COLLATE utf8_bin NOT NULL, |
| 388 | 388 | STA_abbrev VARCHAR(24) COLLATE utf8_bin NOT NULL, |
| 389 | 389 | STA_name VARCHAR(100) COLLATE utf8_bin NOT NULL, |
| 390 | 390 | STA_active TINYINT(1) DEFAULT '1', |
| 391 | 391 | PRIMARY KEY (STA_ID)"; |
| 392 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 393 | - $table_name = 'esp_status'; |
|
| 394 | - $sql = "STS_ID VARCHAR(3) COLLATE utf8_bin NOT NULL, |
|
| 392 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 393 | + $table_name = 'esp_status'; |
|
| 394 | + $sql = "STS_ID VARCHAR(3) COLLATE utf8_bin NOT NULL, |
|
| 395 | 395 | STS_code VARCHAR(45) COLLATE utf8_bin NOT NULL, |
| 396 | 396 | STS_type set('event','registration','transaction','payment','email') COLLATE utf8_bin NOT NULL, |
| 397 | 397 | STS_can_edit TINYINT(1) NOT NULL DEFAULT 0, |
@@ -399,9 +399,9 @@ discard block |
||
| 399 | 399 | STS_open TINYINT(1) NOT NULL DEFAULT 1, |
| 400 | 400 | UNIQUE KEY STS_ID_UNIQUE (STS_ID), |
| 401 | 401 | KEY STS_type (STS_type)"; |
| 402 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 403 | - $table_name = 'esp_transaction'; |
|
| 404 | - $sql = "TXN_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 402 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 403 | + $table_name = 'esp_transaction'; |
|
| 404 | + $sql = "TXN_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 405 | 405 | TXN_timestamp DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', |
| 406 | 406 | TXN_total DECIMAL(10,3) DEFAULT '0.00', |
| 407 | 407 | TXN_paid DECIMAL(10,3) NOT NULL DEFAULT '0.00', |
@@ -413,9 +413,9 @@ discard block |
||
| 413 | 413 | PRIMARY KEY (TXN_ID), |
| 414 | 414 | KEY TXN_timestamp (TXN_timestamp), |
| 415 | 415 | KEY STS_ID (STS_ID)"; |
| 416 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 417 | - $table_name = 'esp_venue_meta'; |
|
| 418 | - $sql = "VNUM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 416 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 417 | + $table_name = 'esp_venue_meta'; |
|
| 418 | + $sql = "VNUM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 419 | 419 | VNU_ID BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, |
| 420 | 420 | VNU_address VARCHAR(255) DEFAULT NULL, |
| 421 | 421 | VNU_address2 VARCHAR(255) DEFAULT NULL, |
@@ -433,10 +433,10 @@ discard block |
||
| 433 | 433 | PRIMARY KEY (VNUM_ID), |
| 434 | 434 | KEY STA_ID (STA_ID), |
| 435 | 435 | KEY CNT_ISO (CNT_ISO)"; |
| 436 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 437 | - //modified tables |
|
| 438 | - $table_name = "esp_price"; |
|
| 439 | - $sql = "PRC_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 436 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 437 | + //modified tables |
|
| 438 | + $table_name = "esp_price"; |
|
| 439 | + $sql = "PRC_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 440 | 440 | PRT_ID TINYINT(3) UNSIGNED NOT NULL, |
| 441 | 441 | PRC_amount DECIMAL(10,3) NOT NULL DEFAULT '0.00', |
| 442 | 442 | PRC_name VARCHAR(245) NOT NULL, |
@@ -448,9 +448,9 @@ discard block |
||
| 448 | 448 | PRC_wp_user BIGINT UNSIGNED NULL, |
| 449 | 449 | PRC_parent INT(10) UNSIGNED DEFAULT 0, |
| 450 | 450 | PRIMARY KEY (PRC_ID)"; |
| 451 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 452 | - $table_name = "esp_price_type"; |
|
| 453 | - $sql = "PRT_ID TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 451 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 452 | + $table_name = "esp_price_type"; |
|
| 453 | + $sql = "PRT_ID TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 454 | 454 | PRT_name VARCHAR(45) NOT NULL, |
| 455 | 455 | PBT_ID TINYINT(3) UNSIGNED NOT NULL DEFAULT '1', |
| 456 | 456 | PRT_is_percent TINYINT(1) NOT NULL DEFAULT '0', |
@@ -459,9 +459,9 @@ discard block |
||
| 459 | 459 | PRT_deleted TINYINT(1) NOT NULL DEFAULT '0', |
| 460 | 460 | UNIQUE KEY PRT_name_UNIQUE (PRT_name), |
| 461 | 461 | PRIMARY KEY (PRT_ID)"; |
| 462 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 463 | - $table_name = "esp_ticket"; |
|
| 464 | - $sql = "TKT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 462 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 463 | + $table_name = "esp_ticket"; |
|
| 464 | + $sql = "TKT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 465 | 465 | TTM_ID INT(10) UNSIGNED NOT NULL, |
| 466 | 466 | TKT_name VARCHAR(245) NOT NULL DEFAULT '', |
| 467 | 467 | TKT_description TEXT NOT NULL, |
@@ -482,10 +482,10 @@ discard block |
||
| 482 | 482 | TKT_parent INT(10) UNSIGNED DEFAULT '0', |
| 483 | 483 | TKT_deleted TINYINT(1) NOT NULL DEFAULT '0', |
| 484 | 484 | PRIMARY KEY (TKT_ID)"; |
| 485 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 486 | - $this->_get_table_manager()->dropIndex('esp_question_group', 'QSG_identifier_UNIQUE'); |
|
| 487 | - $table_name = 'esp_question_group'; |
|
| 488 | - $sql = 'QSG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 485 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 486 | + $this->_get_table_manager()->dropIndex('esp_question_group', 'QSG_identifier_UNIQUE'); |
|
| 487 | + $table_name = 'esp_question_group'; |
|
| 488 | + $sql = 'QSG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 489 | 489 | QSG_name VARCHAR(255) NOT NULL, |
| 490 | 490 | QSG_identifier VARCHAR(100) NOT NULL, |
| 491 | 491 | QSG_desc TEXT NULL, |
@@ -497,119 +497,119 @@ discard block |
||
| 497 | 497 | QSG_wp_user BIGINT UNSIGNED NULL, |
| 498 | 498 | PRIMARY KEY (QSG_ID), |
| 499 | 499 | UNIQUE KEY QSG_identifier_UNIQUE (QSG_identifier ASC)'; |
| 500 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 501 | - /** @var EE_DMS_Core_4_1_0 $script_4_1_defaults */ |
|
| 502 | - $script_4_1_defaults = EE_Registry::instance()->load_dms('Core_4_1_0'); |
|
| 503 | - //(because many need to convert old string states to foreign keys into the states table) |
|
| 504 | - $script_4_1_defaults->insert_default_states(); |
|
| 505 | - $script_4_1_defaults->insert_default_countries(); |
|
| 506 | - /** @var EE_DMS_Core_4_5_0 $script_4_5_defaults */ |
|
| 507 | - $script_4_5_defaults = EE_Registry::instance()->load_dms('Core_4_5_0'); |
|
| 508 | - $script_4_5_defaults->insert_default_price_types(); |
|
| 509 | - $script_4_5_defaults->insert_default_prices(); |
|
| 510 | - $script_4_5_defaults->insert_default_tickets(); |
|
| 511 | - //setting up the config wp option pretty well counts as a 'schema change', or at least should happen here |
|
| 512 | - EE_Config::instance()->update_espresso_config(false, true); |
|
| 513 | - $this->add_default_admin_only_payments(); |
|
| 514 | - $this->insert_default_currencies(); |
|
| 515 | - return true; |
|
| 516 | - } |
|
| 517 | - |
|
| 518 | - |
|
| 519 | - |
|
| 520 | - /** |
|
| 521 | - * @return boolean |
|
| 522 | - */ |
|
| 523 | - public function schema_changes_after_migration() |
|
| 524 | - { |
|
| 525 | - return true; |
|
| 526 | - } |
|
| 527 | - |
|
| 528 | - |
|
| 529 | - |
|
| 530 | - public function migration_page_hooks() |
|
| 531 | - { |
|
| 532 | - } |
|
| 533 | - |
|
| 534 | - |
|
| 535 | - |
|
| 536 | - public function add_default_admin_only_payments() |
|
| 537 | - { |
|
| 538 | - global $wpdb; |
|
| 539 | - $table_name = $wpdb->prefix . "esp_payment_method"; |
|
| 540 | - $user_id = EEH_Activation::get_default_creator_id(); |
|
| 541 | - if ($this->_get_table_analysis()->tableExists($table_name)) { |
|
| 542 | - $SQL = "SELECT COUNT( * ) FROM $table_name"; |
|
| 543 | - $existing_payment_methods = $wpdb->get_var($SQL); |
|
| 544 | - $default_admin_only_payment_methods = apply_filters( |
|
| 545 | - 'FHEE__EEH_Activation__add_default_admin_only_payments__default_admin_only_payment_methods', |
|
| 546 | - array( |
|
| 547 | - __("Bank", 'event_espresso') => __("Bank Draft", 'event_espresso'), |
|
| 548 | - __("Cash", 'event_espresso') => __("Cash Delivered Physically", 'event_espresso'), |
|
| 549 | - __("Check", 'event_espresso') => __("Paper Check", 'event_espresso'), |
|
| 550 | - __("Credit Card", 'event_espresso') => __("Offline Credit Card Payment", 'event_espresso'), |
|
| 551 | - __("Debit Card", 'event_espresso') => __("Offline Debit Payment", 'event_espresso'), |
|
| 552 | - __("Invoice", 'event_espresso') => __("Invoice received with monies included", |
|
| 553 | - 'event_espresso'), |
|
| 554 | - __("Money Order", 'event_espresso') => '', |
|
| 555 | - __("Paypal", 'event_espresso') => __("Paypal eCheck, Invoice, etc", 'event_espresso'), |
|
| 556 | - __('Other', 'event_espresso') => __('Other method of payment', 'event_espresso'), |
|
| 557 | - )); |
|
| 558 | - //make sure we hae payment method records for the following |
|
| 559 | - //so admins can record payments for them from the admin page |
|
| 560 | - foreach ($default_admin_only_payment_methods as $nicename => $description) { |
|
| 561 | - $slug = sanitize_key($nicename); |
|
| 562 | - //check that such a payment method exists |
|
| 563 | - $exists = $wpdb->get_var($wpdb->prepare("SELECT count(*) FROM $table_name WHERE PMD_slug = %s", $slug)); |
|
| 564 | - if ( ! $exists) { |
|
| 565 | - $values = array( |
|
| 566 | - 'PMD_type' => 'Admin_Only', |
|
| 567 | - 'PMD_name' => $nicename, |
|
| 568 | - 'PMD_admin_name' => $nicename, |
|
| 569 | - 'PMD_admin_desc' => $description, |
|
| 570 | - 'PMD_slug' => $slug, |
|
| 571 | - 'PMD_wp_user' => $user_id, |
|
| 572 | - 'PMD_scope' => serialize(array('ADMIN')), |
|
| 573 | - ); |
|
| 574 | - $success = $wpdb->insert( |
|
| 575 | - $table_name, |
|
| 576 | - $values, |
|
| 577 | - array( |
|
| 578 | - '%s',//PMD_type |
|
| 579 | - '%s',//PMD_name |
|
| 580 | - '%s',//PMD_admin_name |
|
| 581 | - '%s',//PMD_admin_desc |
|
| 582 | - '%s',//PMD_slug |
|
| 583 | - '%d',//PMD_wp_user |
|
| 584 | - '%s',//PMD_scope |
|
| 585 | - ) |
|
| 586 | - ); |
|
| 587 | - if ( ! $success) { |
|
| 588 | - $this->add_error(sprintf(__("Could not insert new admin-only payment method with values %s during migration", |
|
| 589 | - "event_espresso"), $this->_json_encode($values))); |
|
| 590 | - } |
|
| 591 | - } |
|
| 592 | - } |
|
| 593 | - } |
|
| 594 | - } |
|
| 595 | - |
|
| 596 | - |
|
| 597 | - |
|
| 598 | - /** |
|
| 599 | - * insert_default_countries |
|
| 600 | - * |
|
| 601 | - * @static |
|
| 602 | - * @return void |
|
| 603 | - */ |
|
| 604 | - public function insert_default_currencies() |
|
| 605 | - { |
|
| 606 | - global $wpdb; |
|
| 607 | - $currency_table = $wpdb->prefix . "esp_currency"; |
|
| 608 | - if ($this->_get_table_analysis()->tableExists($currency_table)) { |
|
| 609 | - $SQL = "SELECT COUNT('CUR_code') FROM $currency_table"; |
|
| 610 | - $countries = $wpdb->get_var($SQL); |
|
| 611 | - if ( ! $countries) { |
|
| 612 | - $SQL = "INSERT INTO $currency_table |
|
| 500 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 501 | + /** @var EE_DMS_Core_4_1_0 $script_4_1_defaults */ |
|
| 502 | + $script_4_1_defaults = EE_Registry::instance()->load_dms('Core_4_1_0'); |
|
| 503 | + //(because many need to convert old string states to foreign keys into the states table) |
|
| 504 | + $script_4_1_defaults->insert_default_states(); |
|
| 505 | + $script_4_1_defaults->insert_default_countries(); |
|
| 506 | + /** @var EE_DMS_Core_4_5_0 $script_4_5_defaults */ |
|
| 507 | + $script_4_5_defaults = EE_Registry::instance()->load_dms('Core_4_5_0'); |
|
| 508 | + $script_4_5_defaults->insert_default_price_types(); |
|
| 509 | + $script_4_5_defaults->insert_default_prices(); |
|
| 510 | + $script_4_5_defaults->insert_default_tickets(); |
|
| 511 | + //setting up the config wp option pretty well counts as a 'schema change', or at least should happen here |
|
| 512 | + EE_Config::instance()->update_espresso_config(false, true); |
|
| 513 | + $this->add_default_admin_only_payments(); |
|
| 514 | + $this->insert_default_currencies(); |
|
| 515 | + return true; |
|
| 516 | + } |
|
| 517 | + |
|
| 518 | + |
|
| 519 | + |
|
| 520 | + /** |
|
| 521 | + * @return boolean |
|
| 522 | + */ |
|
| 523 | + public function schema_changes_after_migration() |
|
| 524 | + { |
|
| 525 | + return true; |
|
| 526 | + } |
|
| 527 | + |
|
| 528 | + |
|
| 529 | + |
|
| 530 | + public function migration_page_hooks() |
|
| 531 | + { |
|
| 532 | + } |
|
| 533 | + |
|
| 534 | + |
|
| 535 | + |
|
| 536 | + public function add_default_admin_only_payments() |
|
| 537 | + { |
|
| 538 | + global $wpdb; |
|
| 539 | + $table_name = $wpdb->prefix . "esp_payment_method"; |
|
| 540 | + $user_id = EEH_Activation::get_default_creator_id(); |
|
| 541 | + if ($this->_get_table_analysis()->tableExists($table_name)) { |
|
| 542 | + $SQL = "SELECT COUNT( * ) FROM $table_name"; |
|
| 543 | + $existing_payment_methods = $wpdb->get_var($SQL); |
|
| 544 | + $default_admin_only_payment_methods = apply_filters( |
|
| 545 | + 'FHEE__EEH_Activation__add_default_admin_only_payments__default_admin_only_payment_methods', |
|
| 546 | + array( |
|
| 547 | + __("Bank", 'event_espresso') => __("Bank Draft", 'event_espresso'), |
|
| 548 | + __("Cash", 'event_espresso') => __("Cash Delivered Physically", 'event_espresso'), |
|
| 549 | + __("Check", 'event_espresso') => __("Paper Check", 'event_espresso'), |
|
| 550 | + __("Credit Card", 'event_espresso') => __("Offline Credit Card Payment", 'event_espresso'), |
|
| 551 | + __("Debit Card", 'event_espresso') => __("Offline Debit Payment", 'event_espresso'), |
|
| 552 | + __("Invoice", 'event_espresso') => __("Invoice received with monies included", |
|
| 553 | + 'event_espresso'), |
|
| 554 | + __("Money Order", 'event_espresso') => '', |
|
| 555 | + __("Paypal", 'event_espresso') => __("Paypal eCheck, Invoice, etc", 'event_espresso'), |
|
| 556 | + __('Other', 'event_espresso') => __('Other method of payment', 'event_espresso'), |
|
| 557 | + )); |
|
| 558 | + //make sure we hae payment method records for the following |
|
| 559 | + //so admins can record payments for them from the admin page |
|
| 560 | + foreach ($default_admin_only_payment_methods as $nicename => $description) { |
|
| 561 | + $slug = sanitize_key($nicename); |
|
| 562 | + //check that such a payment method exists |
|
| 563 | + $exists = $wpdb->get_var($wpdb->prepare("SELECT count(*) FROM $table_name WHERE PMD_slug = %s", $slug)); |
|
| 564 | + if ( ! $exists) { |
|
| 565 | + $values = array( |
|
| 566 | + 'PMD_type' => 'Admin_Only', |
|
| 567 | + 'PMD_name' => $nicename, |
|
| 568 | + 'PMD_admin_name' => $nicename, |
|
| 569 | + 'PMD_admin_desc' => $description, |
|
| 570 | + 'PMD_slug' => $slug, |
|
| 571 | + 'PMD_wp_user' => $user_id, |
|
| 572 | + 'PMD_scope' => serialize(array('ADMIN')), |
|
| 573 | + ); |
|
| 574 | + $success = $wpdb->insert( |
|
| 575 | + $table_name, |
|
| 576 | + $values, |
|
| 577 | + array( |
|
| 578 | + '%s',//PMD_type |
|
| 579 | + '%s',//PMD_name |
|
| 580 | + '%s',//PMD_admin_name |
|
| 581 | + '%s',//PMD_admin_desc |
|
| 582 | + '%s',//PMD_slug |
|
| 583 | + '%d',//PMD_wp_user |
|
| 584 | + '%s',//PMD_scope |
|
| 585 | + ) |
|
| 586 | + ); |
|
| 587 | + if ( ! $success) { |
|
| 588 | + $this->add_error(sprintf(__("Could not insert new admin-only payment method with values %s during migration", |
|
| 589 | + "event_espresso"), $this->_json_encode($values))); |
|
| 590 | + } |
|
| 591 | + } |
|
| 592 | + } |
|
| 593 | + } |
|
| 594 | + } |
|
| 595 | + |
|
| 596 | + |
|
| 597 | + |
|
| 598 | + /** |
|
| 599 | + * insert_default_countries |
|
| 600 | + * |
|
| 601 | + * @static |
|
| 602 | + * @return void |
|
| 603 | + */ |
|
| 604 | + public function insert_default_currencies() |
|
| 605 | + { |
|
| 606 | + global $wpdb; |
|
| 607 | + $currency_table = $wpdb->prefix . "esp_currency"; |
|
| 608 | + if ($this->_get_table_analysis()->tableExists($currency_table)) { |
|
| 609 | + $SQL = "SELECT COUNT('CUR_code') FROM $currency_table"; |
|
| 610 | + $countries = $wpdb->get_var($SQL); |
|
| 611 | + if ( ! $countries) { |
|
| 612 | + $SQL = "INSERT INTO $currency_table |
|
| 613 | 613 | ( CUR_code, CUR_single, CUR_plural, CUR_sign, CUR_dec_plc, CUR_active) VALUES |
| 614 | 614 | ( 'EUR', 'Euro', 'Euros', '€', 2,1), |
| 615 | 615 | ( 'AED', 'Dirham', 'Dirhams', 'د.إ',2,1), |
@@ -763,10 +763,10 @@ discard block |
||
| 763 | 763 | ( 'ZAR', 'Rand', 'Rands', 'R', 2,1), |
| 764 | 764 | ( 'ZMK', 'Kwacha', 'Kwachas', '', 2,1), |
| 765 | 765 | ( 'ZWD', 'Dollar', 'Dollars', 'Z$', 2,1);"; |
| 766 | - $wpdb->query($SQL); |
|
| 767 | - } |
|
| 768 | - } |
|
| 769 | - } |
|
| 766 | + $wpdb->query($SQL); |
|
| 767 | + } |
|
| 768 | + } |
|
| 769 | + } |
|
| 770 | 770 | |
| 771 | 771 | } |
| 772 | 772 | |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | //unfortunately, this needs to be done upon INCLUSION of this file, |
| 15 | 15 | //instead of construction, because it only gets constructed on first page load |
| 16 | 16 | //(all other times it gets resurrected from a wordpress option) |
| 17 | -$stages = glob(EE_CORE . 'data_migration_scripts/4_8_0_stages/*'); |
|
| 17 | +$stages = glob(EE_CORE.'data_migration_scripts/4_8_0_stages/*'); |
|
| 18 | 18 | $class_to_filepath = array(); |
| 19 | 19 | foreach ($stages as $filepath) { |
| 20 | 20 | $matches = array(); |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 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; |
@@ -99,9 +99,9 @@ discard block |
||
| 99 | 99 | */ |
| 100 | 100 | public function schema_changes_before_migration() |
| 101 | 101 | { |
| 102 | - require_once(EE_HELPERS . 'EEH_Activation.helper.php'); |
|
| 102 | + require_once(EE_HELPERS.'EEH_Activation.helper.php'); |
|
| 103 | 103 | $now_in_mysql = current_time('mysql', true); |
| 104 | - require_once(EE_HELPERS . 'EEH_Activation.helper.php'); |
|
| 104 | + require_once(EE_HELPERS.'EEH_Activation.helper.php'); |
|
| 105 | 105 | $table_name = 'esp_answer'; |
| 106 | 106 | $sql = " ANS_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
| 107 | 107 | REG_ID int(10) unsigned NOT NULL, |
@@ -697,7 +697,7 @@ discard block |
||
| 697 | 697 | ), |
| 698 | 698 | ); |
| 699 | 699 | global $wpdb; |
| 700 | - $country_table = $wpdb->prefix . "esp_country"; |
|
| 700 | + $country_table = $wpdb->prefix."esp_country"; |
|
| 701 | 701 | $country_format = array( |
| 702 | 702 | "CNT_ISO" => '%s', |
| 703 | 703 | "CNT_ISO3" => '%s', |
@@ -743,7 +743,7 @@ discard block |
||
| 743 | 743 | array('RSD', 'Dinar', 'Dinars', '', 3, 1), |
| 744 | 744 | ); |
| 745 | 745 | global $wpdb; |
| 746 | - $currency_table = $wpdb->prefix . "esp_currency"; |
|
| 746 | + $currency_table = $wpdb->prefix."esp_currency"; |
|
| 747 | 747 | $currency_format = array( |
| 748 | 748 | "CUR_code" => '%s', |
| 749 | 749 | "CUR_single" => '%s', |
@@ -17,9 +17,9 @@ discard block |
||
| 17 | 17 | $stages = glob(EE_CORE . 'data_migration_scripts/4_8_0_stages/*'); |
| 18 | 18 | $class_to_filepath = array(); |
| 19 | 19 | foreach ($stages as $filepath) { |
| 20 | - $matches = array(); |
|
| 21 | - preg_match('~4_8_0_stages/(.*).dmsstage.php~', $filepath, $matches); |
|
| 22 | - $class_to_filepath[$matches[1]] = $filepath; |
|
| 20 | + $matches = array(); |
|
| 21 | + preg_match('~4_8_0_stages/(.*).dmsstage.php~', $filepath, $matches); |
|
| 22 | + $class_to_filepath[$matches[1]] = $filepath; |
|
| 23 | 23 | } |
| 24 | 24 | //give addons a chance to autoload their stages too |
| 25 | 25 | $class_to_filepath = apply_filters('FHEE__EE_DMS_4_8_0__autoloaded_stages', $class_to_filepath); |
@@ -38,71 +38,71 @@ discard block |
||
| 38 | 38 | class EE_DMS_Core_4_8_0 extends EE_Data_Migration_Script_Base |
| 39 | 39 | { |
| 40 | 40 | |
| 41 | - /** |
|
| 42 | - * return EE_DMS_Core_4_8_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 = esc_html__("Data Update to Event Espresso 4.8.0", "event_espresso"); |
|
| 50 | - $this->_priority = 10; |
|
| 51 | - $this->_migration_stages = array( |
|
| 52 | - new EE_DMS_4_8_0_pretax_totals(), |
|
| 53 | - new EE_DMS_4_8_0_event_subtotals(), |
|
| 54 | - ); |
|
| 55 | - parent::__construct($table_manager, $table_analysis); |
|
| 56 | - } |
|
| 41 | + /** |
|
| 42 | + * return EE_DMS_Core_4_8_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 = esc_html__("Data Update to Event Espresso 4.8.0", "event_espresso"); |
|
| 50 | + $this->_priority = 10; |
|
| 51 | + $this->_migration_stages = array( |
|
| 52 | + new EE_DMS_4_8_0_pretax_totals(), |
|
| 53 | + new EE_DMS_4_8_0_event_subtotals(), |
|
| 54 | + ); |
|
| 55 | + parent::__construct($table_manager, $table_analysis); |
|
| 56 | + } |
|
| 57 | 57 | |
| 58 | 58 | |
| 59 | 59 | |
| 60 | - /** |
|
| 61 | - * Because this is being done at basically the same time as the MER-ready branch |
|
| 62 | - * of core, it's possible people might have installed MEr-ready branch first, |
|
| 63 | - * and then this one, in which case we still want to perform this migration, |
|
| 64 | - * even though the version might not have increased |
|
| 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.8.0', '<=') && version_compare($version_string, '4.7.0', '>=')) { |
|
| 60 | + /** |
|
| 61 | + * Because this is being done at basically the same time as the MER-ready branch |
|
| 62 | + * of core, it's possible people might have installed MEr-ready branch first, |
|
| 63 | + * and then this one, in which case we still want to perform this migration, |
|
| 64 | + * even though the version might not have increased |
|
| 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.8.0', '<=') && version_compare($version_string, '4.7.0', '>=')) { |
|
| 73 | 73 | // echo "$version_string can be migrated from"; |
| 74 | - return true; |
|
| 75 | - } elseif ( ! $version_string) { |
|
| 74 | + return true; |
|
| 75 | + } elseif ( ! $version_string) { |
|
| 76 | 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 { |
|
| 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 | 80 | // echo "$version_string doesnt apply"; |
| 81 | - return false; |
|
| 82 | - } |
|
| 83 | - } |
|
| 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 | - require_once(EE_HELPERS . 'EEH_Activation.helper.php'); |
|
| 95 | - $table_name = 'esp_answer'; |
|
| 96 | - $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 | + require_once(EE_HELPERS . 'EEH_Activation.helper.php'); |
|
| 95 | + $table_name = 'esp_answer'; |
|
| 96 | + $sql = " ANS_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
| 97 | 97 | REG_ID int(10) unsigned NOT NULL, |
| 98 | 98 | QST_ID int(10) unsigned NOT NULL, |
| 99 | 99 | ANS_value text NOT NULL, |
| 100 | 100 | PRIMARY KEY (ANS_ID), |
| 101 | 101 | KEY REG_ID (REG_ID), |
| 102 | 102 | KEY QST_ID (QST_ID)"; |
| 103 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 104 | - $table_name = 'esp_attendee_meta'; |
|
| 105 | - $sql = "ATTM_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
| 103 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 104 | + $table_name = 'esp_attendee_meta'; |
|
| 105 | + $sql = "ATTM_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
| 106 | 106 | ATT_ID bigint(20) unsigned NOT NULL, |
| 107 | 107 | ATT_fname varchar(45) NOT NULL, |
| 108 | 108 | ATT_lname varchar(45) NOT NULL, |
@@ -119,9 +119,9 @@ discard block |
||
| 119 | 119 | KEY ATT_email (ATT_email), |
| 120 | 120 | KEY ATT_lname (ATT_lname), |
| 121 | 121 | KEY ATT_fname (ATT_fname)"; |
| 122 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 123 | - $table_name = 'esp_country'; |
|
| 124 | - $sql = "CNT_ISO varchar(2) collate utf8_bin NOT NULL, |
|
| 122 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 123 | + $table_name = 'esp_country'; |
|
| 124 | + $sql = "CNT_ISO varchar(2) collate utf8_bin NOT NULL, |
|
| 125 | 125 | CNT_ISO3 varchar(3) collate utf8_bin NOT NULL, |
| 126 | 126 | RGN_ID tinyint(3) unsigned DEFAULT NULL, |
| 127 | 127 | CNT_name varchar(45) collate utf8_bin NOT NULL, |
@@ -137,25 +137,25 @@ discard block |
||
| 137 | 137 | CNT_is_EU tinyint(1) DEFAULT '0', |
| 138 | 138 | CNT_active tinyint(1) DEFAULT '0', |
| 139 | 139 | PRIMARY KEY (CNT_ISO)"; |
| 140 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 141 | - $table_name = 'esp_currency'; |
|
| 142 | - $sql = "CUR_code varchar(6) collate utf8_bin NOT NULL, |
|
| 140 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 141 | + $table_name = 'esp_currency'; |
|
| 142 | + $sql = "CUR_code varchar(6) collate utf8_bin NOT NULL, |
|
| 143 | 143 | CUR_single varchar(45) collate utf8_bin DEFAULT 'dollar', |
| 144 | 144 | CUR_plural varchar(45) collate utf8_bin DEFAULT 'dollars', |
| 145 | 145 | CUR_sign varchar(45) collate utf8_bin DEFAULT '$', |
| 146 | 146 | CUR_dec_plc varchar(1) collate utf8_bin NOT NULL DEFAULT '2', |
| 147 | 147 | CUR_active tinyint(1) DEFAULT '0', |
| 148 | 148 | PRIMARY KEY (CUR_code)"; |
| 149 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 150 | - $table_name = 'esp_currency_payment_method'; |
|
| 151 | - $sql = "CPM_ID int(11) NOT NULL AUTO_INCREMENT, |
|
| 149 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 150 | + $table_name = 'esp_currency_payment_method'; |
|
| 151 | + $sql = "CPM_ID int(11) NOT NULL AUTO_INCREMENT, |
|
| 152 | 152 | CUR_code varchar(6) collate utf8_bin NOT NULL, |
| 153 | 153 | PMD_ID int(11) NOT NULL, |
| 154 | 154 | PRIMARY KEY (CPM_ID), |
| 155 | 155 | KEY PMD_ID (PMD_ID)"; |
| 156 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 157 | - $table_name = 'esp_datetime'; |
|
| 158 | - $sql = "DTT_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
| 156 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 157 | + $table_name = 'esp_datetime'; |
|
| 158 | + $sql = "DTT_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
| 159 | 159 | EVT_ID bigint(20) unsigned NOT NULL, |
| 160 | 160 | DTT_name varchar(255) NOT NULL DEFAULT '', |
| 161 | 161 | DTT_description text NOT NULL, |
@@ -171,9 +171,9 @@ discard block |
||
| 171 | 171 | KEY DTT_EVT_start (DTT_EVT_start), |
| 172 | 172 | KEY EVT_ID (EVT_ID), |
| 173 | 173 | KEY DTT_is_primary (DTT_is_primary)"; |
| 174 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 175 | - $table_name = 'esp_event_meta'; |
|
| 176 | - $sql = " |
|
| 174 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 175 | + $table_name = 'esp_event_meta'; |
|
| 176 | + $sql = " |
|
| 177 | 177 | EVTM_ID int(10) NOT NULL AUTO_INCREMENT, |
| 178 | 178 | EVT_ID bigint(20) unsigned NOT NULL, |
| 179 | 179 | EVT_display_desc tinyint(1) unsigned NOT NULL DEFAULT 1, |
@@ -189,34 +189,34 @@ discard block |
||
| 189 | 189 | EVT_donations tinyint(1) NULL, |
| 190 | 190 | PRIMARY KEY (EVTM_ID), |
| 191 | 191 | KEY EVT_ID (EVT_ID)"; |
| 192 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 193 | - $table_name = 'esp_event_question_group'; |
|
| 194 | - $sql = "EQG_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
| 192 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 193 | + $table_name = 'esp_event_question_group'; |
|
| 194 | + $sql = "EQG_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
| 195 | 195 | EVT_ID bigint(20) unsigned NOT NULL, |
| 196 | 196 | QSG_ID int(10) unsigned NOT NULL, |
| 197 | 197 | EQG_primary tinyint(1) unsigned NOT NULL DEFAULT 0, |
| 198 | 198 | PRIMARY KEY (EQG_ID), |
| 199 | 199 | KEY EVT_ID (EVT_ID), |
| 200 | 200 | KEY QSG_ID (QSG_ID)"; |
| 201 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 202 | - $table_name = 'esp_event_venue'; |
|
| 203 | - $sql = "EVV_ID int(11) NOT NULL AUTO_INCREMENT, |
|
| 201 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 202 | + $table_name = 'esp_event_venue'; |
|
| 203 | + $sql = "EVV_ID int(11) NOT NULL AUTO_INCREMENT, |
|
| 204 | 204 | EVT_ID bigint(20) unsigned NOT NULL, |
| 205 | 205 | VNU_ID bigint(20) unsigned NOT NULL, |
| 206 | 206 | EVV_primary tinyint(1) unsigned NOT NULL DEFAULT 0, |
| 207 | 207 | PRIMARY KEY (EVV_ID)"; |
| 208 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 209 | - $table_name = 'esp_extra_meta'; |
|
| 210 | - $sql = "EXM_ID int(11) NOT NULL AUTO_INCREMENT, |
|
| 208 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 209 | + $table_name = 'esp_extra_meta'; |
|
| 210 | + $sql = "EXM_ID int(11) NOT NULL AUTO_INCREMENT, |
|
| 211 | 211 | OBJ_ID int(11) DEFAULT NULL, |
| 212 | 212 | EXM_type varchar(45) DEFAULT NULL, |
| 213 | 213 | EXM_key varchar(45) DEFAULT NULL, |
| 214 | 214 | EXM_value text, |
| 215 | 215 | PRIMARY KEY (EXM_ID), |
| 216 | 216 | KEY EXM_type (EXM_type,OBJ_ID,EXM_key)"; |
| 217 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 218 | - $table_name = 'esp_extra_join'; |
|
| 219 | - $sql = "EXJ_ID int(11) NOT NULL AUTO_INCREMENT, |
|
| 217 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 218 | + $table_name = 'esp_extra_join'; |
|
| 219 | + $sql = "EXJ_ID int(11) NOT NULL AUTO_INCREMENT, |
|
| 220 | 220 | EXJ_first_model_id varchar(6) NOT NULL, |
| 221 | 221 | EXJ_first_model_name varchar(20) NOT NULL, |
| 222 | 222 | EXJ_second_model_id varchar(6) NOT NULL, |
@@ -224,9 +224,9 @@ discard block |
||
| 224 | 224 | PRIMARY KEY (EXJ_ID), |
| 225 | 225 | KEY first_model (EXJ_first_model_name,EXJ_first_model_id), |
| 226 | 226 | KEY second_model (EXJ_second_model_name,EXJ_second_model_id)"; |
| 227 | - $this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 228 | - $table_name = 'esp_line_item'; |
|
| 229 | - $sql = "LIN_ID int(11) NOT NULL AUTO_INCREMENT, |
|
| 227 | + $this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 228 | + $table_name = 'esp_line_item'; |
|
| 229 | + $sql = "LIN_ID int(11) NOT NULL AUTO_INCREMENT, |
|
| 230 | 230 | LIN_code varchar(245) NOT NULL DEFAULT '', |
| 231 | 231 | TXN_ID int(11) DEFAULT NULL, |
| 232 | 232 | LIN_name varchar(245) NOT NULL DEFAULT '', |
@@ -245,9 +245,9 @@ discard block |
||
| 245 | 245 | PRIMARY KEY (LIN_ID), |
| 246 | 246 | KEY LIN_code (LIN_code(191)), |
| 247 | 247 | KEY TXN_ID (TXN_ID)"; |
| 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, |
|
| 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, |
|
| 251 | 251 | LOG_time datetime DEFAULT NULL, |
| 252 | 252 | OBJ_ID varchar(45) DEFAULT NULL, |
| 253 | 253 | OBJ_type varchar(45) DEFAULT NULL, |
@@ -258,18 +258,18 @@ discard block |
||
| 258 | 258 | KEY LOG_time (LOG_time), |
| 259 | 259 | KEY OBJ (OBJ_type,OBJ_ID), |
| 260 | 260 | KEY LOG_type (LOG_type)"; |
| 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, |
|
| 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, |
|
| 264 | 264 | GRP_ID int(10) unsigned NOT NULL, |
| 265 | 265 | MTP_context varchar(50) NOT NULL, |
| 266 | 266 | MTP_template_field varchar(30) NOT NULL, |
| 267 | 267 | MTP_content text NOT NULL, |
| 268 | 268 | PRIMARY KEY (MTP_ID), |
| 269 | 269 | KEY GRP_ID (GRP_ID)"; |
| 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, |
|
| 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, |
|
| 273 | 273 | MTP_user_id int(10) NOT NULL DEFAULT '1', |
| 274 | 274 | MTP_name varchar(245) NOT NULL DEFAULT '', |
| 275 | 275 | MTP_description varchar(245) NOT NULL DEFAULT '', |
@@ -281,17 +281,17 @@ discard block |
||
| 281 | 281 | MTP_is_active tinyint(1) NOT NULL DEFAULT '1', |
| 282 | 282 | PRIMARY KEY (GRP_ID), |
| 283 | 283 | KEY MTP_user_id (MTP_user_id)"; |
| 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, |
|
| 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, |
|
| 287 | 287 | EVT_ID bigint(20) unsigned NOT NULL DEFAULT 0, |
| 288 | 288 | GRP_ID int(10) unsigned NOT NULL DEFAULT 0, |
| 289 | 289 | PRIMARY KEY (EMT_ID), |
| 290 | 290 | KEY EVT_ID (EVT_ID), |
| 291 | 291 | KEY GRP_ID (GRP_ID)"; |
| 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, |
|
| 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, |
|
| 295 | 295 | TXN_ID int(10) unsigned DEFAULT NULL, |
| 296 | 296 | STS_ID varchar(3) collate utf8_bin DEFAULT NULL, |
| 297 | 297 | PAY_timestamp datetime NOT NULL DEFAULT '0000-00-00 00:00:00', |
@@ -308,9 +308,9 @@ discard block |
||
| 308 | 308 | PRIMARY KEY (PAY_ID), |
| 309 | 309 | KEY PAY_timestamp (PAY_timestamp), |
| 310 | 310 | KEY TXN_ID (TXN_ID)"; |
| 311 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 312 | - $table_name = 'esp_payment_method'; |
|
| 313 | - $sql = "PMD_ID int(11) NOT NULL AUTO_INCREMENT, |
|
| 311 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 312 | + $table_name = 'esp_payment_method'; |
|
| 313 | + $sql = "PMD_ID int(11) NOT NULL AUTO_INCREMENT, |
|
| 314 | 314 | PMD_type varchar(124) DEFAULT NULL, |
| 315 | 315 | PMD_name varchar(255) DEFAULT NULL, |
| 316 | 316 | PMD_desc text, |
@@ -326,32 +326,32 @@ discard block |
||
| 326 | 326 | PRIMARY KEY (PMD_ID), |
| 327 | 327 | UNIQUE KEY PMD_slug_UNIQUE (PMD_slug), |
| 328 | 328 | KEY PMD_type (PMD_type)"; |
| 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, |
|
| 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, |
|
| 332 | 332 | TKT_ID int(10) unsigned NOT NULL, |
| 333 | 333 | PRC_ID int(10) unsigned NOT NULL, |
| 334 | 334 | PRIMARY KEY (TKP_ID), |
| 335 | 335 | KEY TKT_ID (TKT_ID), |
| 336 | 336 | KEY PRC_ID (PRC_ID)"; |
| 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, |
|
| 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, |
|
| 340 | 340 | DTT_ID int(10) unsigned NOT NULL, |
| 341 | 341 | TKT_ID int(10) unsigned NOT NULL, |
| 342 | 342 | PRIMARY KEY (DTK_ID), |
| 343 | 343 | KEY DTT_ID (DTT_ID), |
| 344 | 344 | KEY TKT_ID (TKT_ID)"; |
| 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, |
|
| 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, |
|
| 348 | 348 | TTM_name varchar(45) NOT NULL, |
| 349 | 349 | TTM_description text, |
| 350 | 350 | TTM_file varchar(45), |
| 351 | 351 | PRIMARY KEY (TTM_ID)"; |
| 352 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 353 | - $table_name = 'esp_question'; |
|
| 354 | - $sql = 'QST_ID int(10) 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(10) unsigned NOT NULL AUTO_INCREMENT, |
|
| 355 | 355 | QST_display_text text NOT NULL, |
| 356 | 356 | QST_admin_label varchar(255) NOT NULL, |
| 357 | 357 | QST_system varchar(25) NOT NULL DEFAULT "", |
@@ -365,18 +365,18 @@ discard block |
||
| 365 | 365 | QST_deleted tinyint(2) unsigned NOT NULL DEFAULT 0, |
| 366 | 366 | PRIMARY KEY (QST_ID), |
| 367 | 367 | 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(10) unsigned NOT NULL AUTO_INCREMENT, |
|
| 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(10) unsigned NOT NULL AUTO_INCREMENT, |
|
| 371 | 371 | QSG_ID int(10) unsigned NOT NULL, |
| 372 | 372 | QST_ID int(10) unsigned NOT NULL, |
| 373 | 373 | QGQ_order int(10) unsigned NOT NULL DEFAULT 0, |
| 374 | 374 | PRIMARY KEY (QGQ_ID), |
| 375 | 375 | KEY QST_ID (QST_ID), |
| 376 | 376 | 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(10) unsigned NOT NULL AUTO_INCREMENT, |
|
| 377 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 378 | + $table_name = 'esp_question_option'; |
|
| 379 | + $sql = "QSO_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
| 380 | 380 | QSO_value varchar(255) NOT NULL, |
| 381 | 381 | QSO_desc text NOT NULL, |
| 382 | 382 | QST_ID int(10) unsigned NOT NULL, |
@@ -386,9 +386,9 @@ discard block |
||
| 386 | 386 | PRIMARY KEY (QSO_ID), |
| 387 | 387 | KEY QST_ID (QST_ID), |
| 388 | 388 | KEY QSO_order (QSO_order)"; |
| 389 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 390 | - $table_name = 'esp_registration'; |
|
| 391 | - $sql = "REG_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
| 389 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 390 | + $table_name = 'esp_registration'; |
|
| 391 | + $sql = "REG_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
| 392 | 392 | EVT_ID bigint(20) unsigned NOT NULL, |
| 393 | 393 | ATT_ID bigint(20) unsigned NOT NULL, |
| 394 | 394 | TXN_ID int(10) unsigned NOT NULL, |
@@ -412,18 +412,18 @@ discard block |
||
| 412 | 412 | KEY TKT_ID (TKT_ID), |
| 413 | 413 | KEY EVT_ID (EVT_ID), |
| 414 | 414 | KEY STS_ID (STS_ID)"; |
| 415 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 416 | - $table_name = 'esp_registration_payment'; |
|
| 417 | - $sql = "RPY_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
| 415 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 416 | + $table_name = 'esp_registration_payment'; |
|
| 417 | + $sql = "RPY_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
| 418 | 418 | REG_ID int(10) unsigned NOT NULL, |
| 419 | 419 | PAY_ID int(10) unsigned NULL, |
| 420 | 420 | RPY_amount decimal(10,3) NOT NULL DEFAULT '0.00', |
| 421 | 421 | PRIMARY KEY (RPY_ID), |
| 422 | 422 | KEY REG_ID (REG_ID), |
| 423 | 423 | KEY PAY_ID (PAY_ID)"; |
| 424 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 425 | - $table_name = 'esp_checkin'; |
|
| 426 | - $sql = "CHK_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
| 424 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 425 | + $table_name = 'esp_checkin'; |
|
| 426 | + $sql = "CHK_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
| 427 | 427 | REG_ID int(10) unsigned NOT NULL, |
| 428 | 428 | DTT_ID int(10) unsigned NOT NULL, |
| 429 | 429 | CHK_in tinyint(1) unsigned NOT NULL DEFAULT 1, |
@@ -431,9 +431,9 @@ discard block |
||
| 431 | 431 | PRIMARY KEY (CHK_ID), |
| 432 | 432 | KEY REG_ID (REG_ID), |
| 433 | 433 | KEY DTT_ID (DTT_ID)"; |
| 434 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 435 | - $table_name = 'esp_state'; |
|
| 436 | - $sql = "STA_ID smallint(5) unsigned NOT NULL AUTO_INCREMENT, |
|
| 434 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 435 | + $table_name = 'esp_state'; |
|
| 436 | + $sql = "STA_ID smallint(5) unsigned NOT NULL AUTO_INCREMENT, |
|
| 437 | 437 | CNT_ISO varchar(2) collate utf8_bin NOT NULL, |
| 438 | 438 | STA_abbrev varchar(24) collate utf8_bin NOT NULL, |
| 439 | 439 | STA_name varchar(100) collate utf8_bin NOT NULL, |
@@ -441,9 +441,9 @@ discard block |
||
| 441 | 441 | PRIMARY KEY (STA_ID), |
| 442 | 442 | KEY STA_abbrev (STA_abbrev), |
| 443 | 443 | KEY CNT_ISO (CNT_ISO)"; |
| 444 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 445 | - $table_name = 'esp_status'; |
|
| 446 | - $sql = "STS_ID varchar(3) NOT NULL, |
|
| 444 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 445 | + $table_name = 'esp_status'; |
|
| 446 | + $sql = "STS_ID varchar(3) NOT NULL, |
|
| 447 | 447 | STS_code varchar(45) NOT NULL, |
| 448 | 448 | STS_type varchar(45) NOT NULL, |
| 449 | 449 | STS_can_edit tinyint(1) NOT NULL DEFAULT 0, |
@@ -451,9 +451,9 @@ discard block |
||
| 451 | 451 | STS_open tinyint(1) NOT NULL DEFAULT 1, |
| 452 | 452 | UNIQUE KEY STS_ID_UNIQUE (STS_ID), |
| 453 | 453 | KEY STS_type (STS_type)"; |
| 454 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 455 | - $table_name = 'esp_transaction'; |
|
| 456 | - $sql = "TXN_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
| 454 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 455 | + $table_name = 'esp_transaction'; |
|
| 456 | + $sql = "TXN_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
| 457 | 457 | TXN_timestamp datetime NOT NULL DEFAULT '0000-00-00 00:00:00', |
| 458 | 458 | TXN_total decimal(10,3) DEFAULT '0.00', |
| 459 | 459 | TXN_paid decimal(10,3) NOT NULL DEFAULT '0.00', |
@@ -465,9 +465,9 @@ discard block |
||
| 465 | 465 | PRIMARY KEY (TXN_ID), |
| 466 | 466 | KEY TXN_timestamp (TXN_timestamp), |
| 467 | 467 | KEY STS_ID (STS_ID)"; |
| 468 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 469 | - $table_name = 'esp_venue_meta'; |
|
| 470 | - $sql = "VNUM_ID int(11) NOT NULL AUTO_INCREMENT, |
|
| 468 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 469 | + $table_name = 'esp_venue_meta'; |
|
| 470 | + $sql = "VNUM_ID int(11) NOT NULL AUTO_INCREMENT, |
|
| 471 | 471 | VNU_ID bigint(20) unsigned NOT NULL DEFAULT 0, |
| 472 | 472 | VNU_address varchar(255) DEFAULT NULL, |
| 473 | 473 | VNU_address2 varchar(255) DEFAULT NULL, |
@@ -486,10 +486,10 @@ discard block |
||
| 486 | 486 | KEY VNU_ID (VNU_ID), |
| 487 | 487 | KEY STA_ID (STA_ID), |
| 488 | 488 | KEY CNT_ISO (CNT_ISO)"; |
| 489 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 490 | - //modified tables |
|
| 491 | - $table_name = "esp_price"; |
|
| 492 | - $sql = "PRC_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
| 489 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 490 | + //modified tables |
|
| 491 | + $table_name = "esp_price"; |
|
| 492 | + $sql = "PRC_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
| 493 | 493 | PRT_ID tinyint(3) unsigned NOT NULL, |
| 494 | 494 | PRC_amount decimal(10,3) NOT NULL DEFAULT '0.00', |
| 495 | 495 | PRC_name varchar(245) NOT NULL, |
@@ -502,9 +502,9 @@ discard block |
||
| 502 | 502 | PRC_parent int(10) unsigned DEFAULT 0, |
| 503 | 503 | PRIMARY KEY (PRC_ID), |
| 504 | 504 | KEY PRT_ID (PRT_ID)"; |
| 505 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 506 | - $table_name = "esp_price_type"; |
|
| 507 | - $sql = "PRT_ID tinyint(3) unsigned NOT NULL AUTO_INCREMENT, |
|
| 505 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 506 | + $table_name = "esp_price_type"; |
|
| 507 | + $sql = "PRT_ID tinyint(3) unsigned NOT NULL AUTO_INCREMENT, |
|
| 508 | 508 | PRT_name varchar(45) NOT NULL, |
| 509 | 509 | PBT_ID tinyint(3) unsigned NOT NULL DEFAULT '1', |
| 510 | 510 | PRT_is_percent tinyint(1) NOT NULL DEFAULT '0', |
@@ -513,9 +513,9 @@ discard block |
||
| 513 | 513 | PRT_deleted tinyint(1) NOT NULL DEFAULT '0', |
| 514 | 514 | UNIQUE KEY PRT_name_UNIQUE (PRT_name), |
| 515 | 515 | PRIMARY KEY (PRT_ID)"; |
| 516 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 517 | - $table_name = "esp_ticket"; |
|
| 518 | - $sql = "TKT_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
| 516 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 517 | + $table_name = "esp_ticket"; |
|
| 518 | + $sql = "TKT_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
| 519 | 519 | TTM_ID int(10) unsigned NOT NULL, |
| 520 | 520 | TKT_name varchar(245) NOT NULL DEFAULT '', |
| 521 | 521 | TKT_description text NOT NULL, |
@@ -537,9 +537,9 @@ discard block |
||
| 537 | 537 | TKT_deleted tinyint(1) NOT NULL DEFAULT '0', |
| 538 | 538 | PRIMARY KEY (TKT_ID), |
| 539 | 539 | KEY TKT_start_date (TKT_start_date)"; |
| 540 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 541 | - $table_name = 'esp_question_group'; |
|
| 542 | - $sql = 'QSG_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
| 540 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 541 | + $table_name = 'esp_question_group'; |
|
| 542 | + $sql = 'QSG_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
| 543 | 543 | QSG_name varchar(255) NOT NULL, |
| 544 | 544 | QSG_identifier varchar(100) NOT NULL, |
| 545 | 545 | QSG_desc text NULL, |
@@ -552,221 +552,221 @@ discard block |
||
| 552 | 552 | PRIMARY KEY (QSG_ID), |
| 553 | 553 | UNIQUE KEY QSG_identifier_UNIQUE (QSG_identifier), |
| 554 | 554 | KEY QSG_order (QSG_order)'; |
| 555 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 556 | - /** @var EE_DMS_Core_4_1_0 $script_4_1_defaults */ |
|
| 557 | - $script_4_1_defaults = EE_Registry::instance()->load_dms('Core_4_1_0'); |
|
| 558 | - //(because many need to convert old string states to foreign keys into the states table) |
|
| 559 | - $script_4_1_defaults->insert_default_states(); |
|
| 560 | - $script_4_1_defaults->insert_default_countries(); |
|
| 561 | - /** @var EE_DMS_Core_4_5_0 $script_4_5_defaults */ |
|
| 562 | - $script_4_5_defaults = EE_Registry::instance()->load_dms('Core_4_5_0'); |
|
| 563 | - $script_4_5_defaults->insert_default_price_types(); |
|
| 564 | - $script_4_5_defaults->insert_default_prices(); |
|
| 565 | - $script_4_5_defaults->insert_default_tickets(); |
|
| 566 | - /** @var EE_DMS_Core_4_6_0 $script_4_6_defaults */ |
|
| 567 | - $script_4_6_defaults = EE_Registry::instance()->load_dms('Core_4_6_0'); |
|
| 568 | - $script_4_6_defaults->add_default_admin_only_payments(); |
|
| 569 | - $script_4_6_defaults->insert_default_currencies(); |
|
| 570 | - $this->verify_new_countries(); |
|
| 571 | - $this->verify_new_currencies(); |
|
| 572 | - return true; |
|
| 573 | - } |
|
| 555 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 556 | + /** @var EE_DMS_Core_4_1_0 $script_4_1_defaults */ |
|
| 557 | + $script_4_1_defaults = EE_Registry::instance()->load_dms('Core_4_1_0'); |
|
| 558 | + //(because many need to convert old string states to foreign keys into the states table) |
|
| 559 | + $script_4_1_defaults->insert_default_states(); |
|
| 560 | + $script_4_1_defaults->insert_default_countries(); |
|
| 561 | + /** @var EE_DMS_Core_4_5_0 $script_4_5_defaults */ |
|
| 562 | + $script_4_5_defaults = EE_Registry::instance()->load_dms('Core_4_5_0'); |
|
| 563 | + $script_4_5_defaults->insert_default_price_types(); |
|
| 564 | + $script_4_5_defaults->insert_default_prices(); |
|
| 565 | + $script_4_5_defaults->insert_default_tickets(); |
|
| 566 | + /** @var EE_DMS_Core_4_6_0 $script_4_6_defaults */ |
|
| 567 | + $script_4_6_defaults = EE_Registry::instance()->load_dms('Core_4_6_0'); |
|
| 568 | + $script_4_6_defaults->add_default_admin_only_payments(); |
|
| 569 | + $script_4_6_defaults->insert_default_currencies(); |
|
| 570 | + $this->verify_new_countries(); |
|
| 571 | + $this->verify_new_currencies(); |
|
| 572 | + return true; |
|
| 573 | + } |
|
| 574 | 574 | |
| 575 | 575 | |
| 576 | 576 | |
| 577 | - /** |
|
| 578 | - * @return boolean |
|
| 579 | - */ |
|
| 580 | - public function schema_changes_after_migration() |
|
| 581 | - { |
|
| 582 | - $this->fix_non_default_taxes(); |
|
| 583 | - //this is actually the same as the last DMS |
|
| 584 | - /** @var EE_DMS_Core_4_7_0 $script_4_7_defaults */ |
|
| 585 | - $script_4_7_defaults = EE_Registry::instance()->load_dms('Core_4_7_0'); |
|
| 586 | - return $script_4_7_defaults->schema_changes_after_migration(); |
|
| 587 | - } |
|
| 577 | + /** |
|
| 578 | + * @return boolean |
|
| 579 | + */ |
|
| 580 | + public function schema_changes_after_migration() |
|
| 581 | + { |
|
| 582 | + $this->fix_non_default_taxes(); |
|
| 583 | + //this is actually the same as the last DMS |
|
| 584 | + /** @var EE_DMS_Core_4_7_0 $script_4_7_defaults */ |
|
| 585 | + $script_4_7_defaults = EE_Registry::instance()->load_dms('Core_4_7_0'); |
|
| 586 | + return $script_4_7_defaults->schema_changes_after_migration(); |
|
| 587 | + } |
|
| 588 | 588 | |
| 589 | 589 | |
| 590 | 590 | |
| 591 | - public function migration_page_hooks() |
|
| 592 | - { |
|
| 593 | - } |
|
| 591 | + public function migration_page_hooks() |
|
| 592 | + { |
|
| 593 | + } |
|
| 594 | 594 | |
| 595 | 595 | |
| 596 | 596 | |
| 597 | - /** |
|
| 598 | - * verifies each of the new countries exists that somehow we missed in 4.1 |
|
| 599 | - */ |
|
| 600 | - public function verify_new_countries() |
|
| 601 | - { |
|
| 602 | - //a list of countries (and specifically some which were missed in another list):https://gist.github.com/adhipg/1600028 |
|
| 603 | - //how many decimal places? https://en.wikipedia.org/wiki/ISO_4217 |
|
| 604 | - //currency symbols: http://www.xe.com/symbols.php |
|
| 605 | - //CNT_ISO, CNT_ISO3, RGN_ID, CNT_name, CNT_cur_code, CNT_cur_single, CNT_cur_plural, CNT_cur_sign, CNT_cur_sign_b4, CNT_cur_dec_plc, CNT_tel_code, CNT_is_EU, CNT_active |
|
| 606 | - //('AD', 'AND', 0, 'Andorra', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+376', 0, 0), |
|
| 607 | - $newer_countries = array( |
|
| 608 | - array('AX', 'ALA', 0, 'Åland Islands', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+358', 1, 0), |
|
| 609 | - array('BL', 'BLM', 0, 'Saint Barthelemy', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+590', 1, 0), |
|
| 610 | - array('CW', 'CUW', 0, 'Curacao', 'ANG', 'Guilder', 'Guilders', 'ƒ', 1, 2, '+599', 1, 0), |
|
| 611 | - array('GG', 'GGY', 0, 'Guernsey', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+44', 0, 0), |
|
| 612 | - array('IM', 'IMN', 0, 'Isle of Man', 'GBP', 'Pound', 'Pounds', '£', 1, 2, '+44', 0, 0), |
|
| 613 | - array('JE', 'JEY', 0, 'Jersey', 'GBP', 'Pound', 'Pounds', '£', 1, 2, '+44', 0, 0), |
|
| 614 | - array('MF', 'MAF', 0, 'Saint Martin', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+590', 1, 0), |
|
| 615 | - array('ME', 'MNE', 0, 'Montenegro', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+382', 0, 0), |
|
| 616 | - array('RS', 'SRB', 0, 'Serbia', 'RSD', 'Dinar', 'Dinars', '', 0, 2, '+381', 1, 0), |
|
| 617 | - array('SS', 'SSD', 0, 'South Sudan', 'SSP', 'Pound', 'Pounds', '£', 1, 2, '+211', 0, 0), |
|
| 618 | - array('SX', 'SXM', 0, 'Sint Maarten', 'ANG', 'Guilder', 'Guilders', 'ƒ', 1, 2, '+1', 1, 0), |
|
| 619 | - array('XK', 'XKX', 0, 'Kosovo', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+383', 0, 0), |
|
| 620 | - array('YT', 'MYT', 0, 'Mayotte', 'EUR', 'Euro', 'Euros', '€', 0, 2, '+262', 1, 0), |
|
| 621 | - array( |
|
| 622 | - 'BQ', |
|
| 623 | - 'BES', |
|
| 624 | - 0, |
|
| 625 | - 'Bonaire, Saint Eustatius and Saba', |
|
| 626 | - 'USD', |
|
| 627 | - 'Dollar', |
|
| 628 | - 'Dollars', |
|
| 629 | - '$', |
|
| 630 | - 1, |
|
| 631 | - 2, |
|
| 632 | - '+599', |
|
| 633 | - 0, |
|
| 634 | - 0, |
|
| 635 | - ), |
|
| 636 | - array('BV', 'BVT', 0, 'Bouvet Island', 'NOK', 'Krone', 'Krones', 'kr', 1, 2, '+47', 0, 0), |
|
| 637 | - array('IO', 'IOT', 0, 'British Indian Ocean Territory', 'GBP', 'Pound', 'Pounds', '£', 1, 2, '+246', 0, 0), |
|
| 638 | - array('CX', 'CXR', 0, 'Christmas Island', 'AUD', 'Dollar', 'Dollars', '$', 1, 2, '+61', 0, 0), |
|
| 639 | - array('CC', 'CCK', 0, 'Cocos (Keeling) Islands', 'AUD', 'Dollar', 'Dollars', '$', 1, 2, '+891', 0, 0), |
|
| 640 | - array( |
|
| 641 | - 'HM', |
|
| 642 | - 'HMD', |
|
| 643 | - 0, |
|
| 644 | - 'Heard Island and McDonald Islands', |
|
| 645 | - 'AUD', |
|
| 646 | - 'Dollar', |
|
| 647 | - 'Dollars', |
|
| 648 | - '$', |
|
| 649 | - 1, |
|
| 650 | - 2, |
|
| 651 | - '+891', |
|
| 652 | - 0, |
|
| 653 | - 0, |
|
| 654 | - ), |
|
| 655 | - array('PS', 'PSE', 0, 'Palestinian Territory', 'ILS', 'Shekel', 'Shekels', '₪', 1, 2, '+970', 0, 0), |
|
| 656 | - array( |
|
| 657 | - 'GS', |
|
| 658 | - 'SGS', |
|
| 659 | - 0, |
|
| 660 | - 'South Georgia and the South Sandwich Islands', |
|
| 661 | - 'GBP', |
|
| 662 | - 'Pound', |
|
| 663 | - 'Pounds', |
|
| 664 | - '£', |
|
| 665 | - 1, |
|
| 666 | - 2, |
|
| 667 | - '+500', |
|
| 668 | - 0, |
|
| 669 | - 0, |
|
| 670 | - ), |
|
| 671 | - array('TL', 'TLS', 0, 'Timor-Leste', 'USD', 'Dollar', 'Dollars', '$', 1, 2, '+670', 0, 0), |
|
| 672 | - array('TF', 'ATF', 0, 'French Southern Territories', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+262', 0, 0), |
|
| 673 | - array( |
|
| 674 | - 'UM', |
|
| 675 | - 'UMI', |
|
| 676 | - 0, |
|
| 677 | - 'United States Minor Outlying Islands', |
|
| 678 | - 'USD', |
|
| 679 | - 'Dollar', |
|
| 680 | - 'Dollars', |
|
| 681 | - '$', |
|
| 682 | - 1, |
|
| 683 | - 2, |
|
| 684 | - '+1', |
|
| 685 | - 0, |
|
| 686 | - 0, |
|
| 687 | - ), |
|
| 688 | - ); |
|
| 689 | - global $wpdb; |
|
| 690 | - $country_table = $wpdb->prefix . "esp_country"; |
|
| 691 | - $country_format = array( |
|
| 692 | - "CNT_ISO" => '%s', |
|
| 693 | - "CNT_ISO3" => '%s', |
|
| 694 | - "RGN_ID" => '%d', |
|
| 695 | - "CNT_name" => '%s', |
|
| 696 | - "CNT_cur_code" => '%s', |
|
| 697 | - "CNT_cur_single" => '%s', |
|
| 698 | - "CNT_cur_plural" => '%s', |
|
| 699 | - "CNT_cur_sign" => '%s', |
|
| 700 | - "CNT_cur_sign_b4" => '%d', |
|
| 701 | - "CNT_cur_dec_plc" => '%d', |
|
| 702 | - "CNT_tel_code" => '%s', |
|
| 703 | - "CNT_is_EU" => '%d', |
|
| 704 | - "CNT_active" => '%d', |
|
| 705 | - ); |
|
| 706 | - if ($this->_get_table_analysis()->tableExists($country_table)) { |
|
| 707 | - foreach ($newer_countries as $country) { |
|
| 708 | - $SQL = "SELECT COUNT('CNT_ISO') FROM {$country_table} WHERE CNT_ISO='{$country[0]}' LIMIT 1"; |
|
| 709 | - $countries = $wpdb->get_var($SQL); |
|
| 710 | - if ( ! $countries) { |
|
| 711 | - $wpdb->insert($country_table, |
|
| 712 | - array_combine(array_keys($country_format), $country), |
|
| 713 | - $country_format |
|
| 714 | - ); |
|
| 715 | - } |
|
| 716 | - } |
|
| 717 | - } |
|
| 718 | - } |
|
| 597 | + /** |
|
| 598 | + * verifies each of the new countries exists that somehow we missed in 4.1 |
|
| 599 | + */ |
|
| 600 | + public function verify_new_countries() |
|
| 601 | + { |
|
| 602 | + //a list of countries (and specifically some which were missed in another list):https://gist.github.com/adhipg/1600028 |
|
| 603 | + //how many decimal places? https://en.wikipedia.org/wiki/ISO_4217 |
|
| 604 | + //currency symbols: http://www.xe.com/symbols.php |
|
| 605 | + //CNT_ISO, CNT_ISO3, RGN_ID, CNT_name, CNT_cur_code, CNT_cur_single, CNT_cur_plural, CNT_cur_sign, CNT_cur_sign_b4, CNT_cur_dec_plc, CNT_tel_code, CNT_is_EU, CNT_active |
|
| 606 | + //('AD', 'AND', 0, 'Andorra', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+376', 0, 0), |
|
| 607 | + $newer_countries = array( |
|
| 608 | + array('AX', 'ALA', 0, 'Åland Islands', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+358', 1, 0), |
|
| 609 | + array('BL', 'BLM', 0, 'Saint Barthelemy', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+590', 1, 0), |
|
| 610 | + array('CW', 'CUW', 0, 'Curacao', 'ANG', 'Guilder', 'Guilders', 'ƒ', 1, 2, '+599', 1, 0), |
|
| 611 | + array('GG', 'GGY', 0, 'Guernsey', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+44', 0, 0), |
|
| 612 | + array('IM', 'IMN', 0, 'Isle of Man', 'GBP', 'Pound', 'Pounds', '£', 1, 2, '+44', 0, 0), |
|
| 613 | + array('JE', 'JEY', 0, 'Jersey', 'GBP', 'Pound', 'Pounds', '£', 1, 2, '+44', 0, 0), |
|
| 614 | + array('MF', 'MAF', 0, 'Saint Martin', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+590', 1, 0), |
|
| 615 | + array('ME', 'MNE', 0, 'Montenegro', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+382', 0, 0), |
|
| 616 | + array('RS', 'SRB', 0, 'Serbia', 'RSD', 'Dinar', 'Dinars', '', 0, 2, '+381', 1, 0), |
|
| 617 | + array('SS', 'SSD', 0, 'South Sudan', 'SSP', 'Pound', 'Pounds', '£', 1, 2, '+211', 0, 0), |
|
| 618 | + array('SX', 'SXM', 0, 'Sint Maarten', 'ANG', 'Guilder', 'Guilders', 'ƒ', 1, 2, '+1', 1, 0), |
|
| 619 | + array('XK', 'XKX', 0, 'Kosovo', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+383', 0, 0), |
|
| 620 | + array('YT', 'MYT', 0, 'Mayotte', 'EUR', 'Euro', 'Euros', '€', 0, 2, '+262', 1, 0), |
|
| 621 | + array( |
|
| 622 | + 'BQ', |
|
| 623 | + 'BES', |
|
| 624 | + 0, |
|
| 625 | + 'Bonaire, Saint Eustatius and Saba', |
|
| 626 | + 'USD', |
|
| 627 | + 'Dollar', |
|
| 628 | + 'Dollars', |
|
| 629 | + '$', |
|
| 630 | + 1, |
|
| 631 | + 2, |
|
| 632 | + '+599', |
|
| 633 | + 0, |
|
| 634 | + 0, |
|
| 635 | + ), |
|
| 636 | + array('BV', 'BVT', 0, 'Bouvet Island', 'NOK', 'Krone', 'Krones', 'kr', 1, 2, '+47', 0, 0), |
|
| 637 | + array('IO', 'IOT', 0, 'British Indian Ocean Territory', 'GBP', 'Pound', 'Pounds', '£', 1, 2, '+246', 0, 0), |
|
| 638 | + array('CX', 'CXR', 0, 'Christmas Island', 'AUD', 'Dollar', 'Dollars', '$', 1, 2, '+61', 0, 0), |
|
| 639 | + array('CC', 'CCK', 0, 'Cocos (Keeling) Islands', 'AUD', 'Dollar', 'Dollars', '$', 1, 2, '+891', 0, 0), |
|
| 640 | + array( |
|
| 641 | + 'HM', |
|
| 642 | + 'HMD', |
|
| 643 | + 0, |
|
| 644 | + 'Heard Island and McDonald Islands', |
|
| 645 | + 'AUD', |
|
| 646 | + 'Dollar', |
|
| 647 | + 'Dollars', |
|
| 648 | + '$', |
|
| 649 | + 1, |
|
| 650 | + 2, |
|
| 651 | + '+891', |
|
| 652 | + 0, |
|
| 653 | + 0, |
|
| 654 | + ), |
|
| 655 | + array('PS', 'PSE', 0, 'Palestinian Territory', 'ILS', 'Shekel', 'Shekels', '₪', 1, 2, '+970', 0, 0), |
|
| 656 | + array( |
|
| 657 | + 'GS', |
|
| 658 | + 'SGS', |
|
| 659 | + 0, |
|
| 660 | + 'South Georgia and the South Sandwich Islands', |
|
| 661 | + 'GBP', |
|
| 662 | + 'Pound', |
|
| 663 | + 'Pounds', |
|
| 664 | + '£', |
|
| 665 | + 1, |
|
| 666 | + 2, |
|
| 667 | + '+500', |
|
| 668 | + 0, |
|
| 669 | + 0, |
|
| 670 | + ), |
|
| 671 | + array('TL', 'TLS', 0, 'Timor-Leste', 'USD', 'Dollar', 'Dollars', '$', 1, 2, '+670', 0, 0), |
|
| 672 | + array('TF', 'ATF', 0, 'French Southern Territories', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+262', 0, 0), |
|
| 673 | + array( |
|
| 674 | + 'UM', |
|
| 675 | + 'UMI', |
|
| 676 | + 0, |
|
| 677 | + 'United States Minor Outlying Islands', |
|
| 678 | + 'USD', |
|
| 679 | + 'Dollar', |
|
| 680 | + 'Dollars', |
|
| 681 | + '$', |
|
| 682 | + 1, |
|
| 683 | + 2, |
|
| 684 | + '+1', |
|
| 685 | + 0, |
|
| 686 | + 0, |
|
| 687 | + ), |
|
| 688 | + ); |
|
| 689 | + global $wpdb; |
|
| 690 | + $country_table = $wpdb->prefix . "esp_country"; |
|
| 691 | + $country_format = array( |
|
| 692 | + "CNT_ISO" => '%s', |
|
| 693 | + "CNT_ISO3" => '%s', |
|
| 694 | + "RGN_ID" => '%d', |
|
| 695 | + "CNT_name" => '%s', |
|
| 696 | + "CNT_cur_code" => '%s', |
|
| 697 | + "CNT_cur_single" => '%s', |
|
| 698 | + "CNT_cur_plural" => '%s', |
|
| 699 | + "CNT_cur_sign" => '%s', |
|
| 700 | + "CNT_cur_sign_b4" => '%d', |
|
| 701 | + "CNT_cur_dec_plc" => '%d', |
|
| 702 | + "CNT_tel_code" => '%s', |
|
| 703 | + "CNT_is_EU" => '%d', |
|
| 704 | + "CNT_active" => '%d', |
|
| 705 | + ); |
|
| 706 | + if ($this->_get_table_analysis()->tableExists($country_table)) { |
|
| 707 | + foreach ($newer_countries as $country) { |
|
| 708 | + $SQL = "SELECT COUNT('CNT_ISO') FROM {$country_table} WHERE CNT_ISO='{$country[0]}' LIMIT 1"; |
|
| 709 | + $countries = $wpdb->get_var($SQL); |
|
| 710 | + if ( ! $countries) { |
|
| 711 | + $wpdb->insert($country_table, |
|
| 712 | + array_combine(array_keys($country_format), $country), |
|
| 713 | + $country_format |
|
| 714 | + ); |
|
| 715 | + } |
|
| 716 | + } |
|
| 717 | + } |
|
| 718 | + } |
|
| 719 | 719 | |
| 720 | 720 | |
| 721 | 721 | |
| 722 | - /** |
|
| 723 | - * verifies each of the new currencies exists that somehow we missed in 4.6 |
|
| 724 | - */ |
|
| 725 | - public function verify_new_currencies() |
|
| 726 | - { |
|
| 727 | - //a list of countries (and specifically some which were missed in another list):https://gist.github.com/adhipg/1600028 |
|
| 728 | - //how many decimal places? https://en.wikipedia.org/wiki/ISO_4217 |
|
| 729 | - //currency symbols: http://www.xe.com/symbols.php |
|
| 730 | - // CUR_code, CUR_single, CUR_plural, CUR_sign, CUR_dec_plc, CUR_active |
|
| 731 | - //( 'EUR', 'Euro', 'Euros', '€', 2,1), |
|
| 732 | - $newer_currencies = array( |
|
| 733 | - array('RSD', 'Dinar', 'Dinars', '', 3, 1), |
|
| 734 | - ); |
|
| 735 | - global $wpdb; |
|
| 736 | - $currency_table = $wpdb->prefix . "esp_currency"; |
|
| 737 | - $currency_format = array( |
|
| 738 | - "CUR_code" => '%s', |
|
| 739 | - "CUR_single" => '%s', |
|
| 740 | - "CUR_plural" => '%s', |
|
| 741 | - "CUR_sign" => '%s', |
|
| 742 | - "CUR_dec_plc" => '%d', |
|
| 743 | - "CUR_active" => '%d', |
|
| 744 | - ); |
|
| 745 | - if ($this->_get_table_analysis()->tableExists($currency_table)) { |
|
| 746 | - foreach ($newer_currencies as $currency) { |
|
| 747 | - $SQL = "SELECT COUNT('CUR_code') FROM {$currency_table} WHERE CUR_code='{$currency[0]}' LIMIT 1"; |
|
| 748 | - $countries = $wpdb->get_var($SQL); |
|
| 749 | - if ( ! $countries) { |
|
| 750 | - $wpdb->insert($currency_table, |
|
| 751 | - array_combine(array_keys($currency_format), $currency), |
|
| 752 | - $currency_format |
|
| 753 | - ); |
|
| 754 | - } |
|
| 755 | - } |
|
| 756 | - } |
|
| 757 | - } |
|
| 722 | + /** |
|
| 723 | + * verifies each of the new currencies exists that somehow we missed in 4.6 |
|
| 724 | + */ |
|
| 725 | + public function verify_new_currencies() |
|
| 726 | + { |
|
| 727 | + //a list of countries (and specifically some which were missed in another list):https://gist.github.com/adhipg/1600028 |
|
| 728 | + //how many decimal places? https://en.wikipedia.org/wiki/ISO_4217 |
|
| 729 | + //currency symbols: http://www.xe.com/symbols.php |
|
| 730 | + // CUR_code, CUR_single, CUR_plural, CUR_sign, CUR_dec_plc, CUR_active |
|
| 731 | + //( 'EUR', 'Euro', 'Euros', '€', 2,1), |
|
| 732 | + $newer_currencies = array( |
|
| 733 | + array('RSD', 'Dinar', 'Dinars', '', 3, 1), |
|
| 734 | + ); |
|
| 735 | + global $wpdb; |
|
| 736 | + $currency_table = $wpdb->prefix . "esp_currency"; |
|
| 737 | + $currency_format = array( |
|
| 738 | + "CUR_code" => '%s', |
|
| 739 | + "CUR_single" => '%s', |
|
| 740 | + "CUR_plural" => '%s', |
|
| 741 | + "CUR_sign" => '%s', |
|
| 742 | + "CUR_dec_plc" => '%d', |
|
| 743 | + "CUR_active" => '%d', |
|
| 744 | + ); |
|
| 745 | + if ($this->_get_table_analysis()->tableExists($currency_table)) { |
|
| 746 | + foreach ($newer_currencies as $currency) { |
|
| 747 | + $SQL = "SELECT COUNT('CUR_code') FROM {$currency_table} WHERE CUR_code='{$currency[0]}' LIMIT 1"; |
|
| 748 | + $countries = $wpdb->get_var($SQL); |
|
| 749 | + if ( ! $countries) { |
|
| 750 | + $wpdb->insert($currency_table, |
|
| 751 | + array_combine(array_keys($currency_format), $currency), |
|
| 752 | + $currency_format |
|
| 753 | + ); |
|
| 754 | + } |
|
| 755 | + } |
|
| 756 | + } |
|
| 757 | + } |
|
| 758 | 758 | |
| 759 | 759 | |
| 760 | 760 | |
| 761 | - /** |
|
| 762 | - * addresses https://events.codebasehq.com/projects/event-espresso/tickets/8731 |
|
| 763 | - * which should just be a temporary issue for folks who installed 4.8.0-4.8.5; |
|
| 764 | - * we should be able to stop doing this in 4.9 |
|
| 765 | - */ |
|
| 766 | - public function fix_non_default_taxes() |
|
| 767 | - { |
|
| 768 | - global $wpdb; |
|
| 769 | - $query = $wpdb->prepare("UPDATE |
|
| 761 | + /** |
|
| 762 | + * addresses https://events.codebasehq.com/projects/event-espresso/tickets/8731 |
|
| 763 | + * which should just be a temporary issue for folks who installed 4.8.0-4.8.5; |
|
| 764 | + * we should be able to stop doing this in 4.9 |
|
| 765 | + */ |
|
| 766 | + public function fix_non_default_taxes() |
|
| 767 | + { |
|
| 768 | + global $wpdb; |
|
| 769 | + $query = $wpdb->prepare("UPDATE |
|
| 770 | 770 | {$wpdb->prefix}esp_price p INNER JOIN |
| 771 | 771 | {$wpdb->prefix}esp_price_type pt ON p.PRT_ID = pt.PRT_ID |
| 772 | 772 | SET |
@@ -775,6 +775,6 @@ discard block |
||
| 775 | 775 | p.PRC_is_default = 0 AND |
| 776 | 776 | pt.PBT_ID = %d |
| 777 | 777 | ", EEM_Price_Type::base_type_tax); |
| 778 | - $wpdb->query($query); |
|
| 779 | - } |
|
| 778 | + $wpdb->query($query); |
|
| 779 | + } |
|
| 780 | 780 | } |
@@ -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 |
@@ -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,59 +31,59 @@ 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 Update to Event Espresso 4.5.0", "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 Update to Event Espresso 4.5.0", "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 schema_changes_before_migration() |
|
| 75 | - { |
|
| 76 | - //relies on 4.1's EEH_Activation::create_table |
|
| 77 | - require_once(EE_HELPERS . 'EEH_Activation.helper.php'); |
|
| 78 | - $table_name = 'esp_answer'; |
|
| 79 | - $sql = " ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 74 | + public function schema_changes_before_migration() |
|
| 75 | + { |
|
| 76 | + //relies on 4.1's EEH_Activation::create_table |
|
| 77 | + require_once(EE_HELPERS . 'EEH_Activation.helper.php'); |
|
| 78 | + $table_name = 'esp_answer'; |
|
| 79 | + $sql = " ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 80 | 80 | REG_ID INT UNSIGNED NOT NULL, |
| 81 | 81 | QST_ID INT UNSIGNED NOT NULL, |
| 82 | 82 | ANS_value TEXT NOT NULL, |
| 83 | 83 | PRIMARY KEY (ANS_ID)"; |
| 84 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 85 | - $table_name = 'esp_attendee_meta'; |
|
| 86 | - $sql = "ATTM_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 84 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 85 | + $table_name = 'esp_attendee_meta'; |
|
| 86 | + $sql = "ATTM_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 87 | 87 | ATT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 88 | 88 | ATT_fname VARCHAR(45) NOT NULL, |
| 89 | 89 | ATT_lname VARCHAR(45) NOT NULL, |
@@ -99,9 +99,9 @@ discard block |
||
| 99 | 99 | KEY ATT_fname (ATT_fname), |
| 100 | 100 | KEY ATT_lname (ATT_lname), |
| 101 | 101 | KEY ATT_email (ATT_email)"; |
| 102 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 103 | - $table_name = 'esp_country'; |
|
| 104 | - $sql = "CNT_ISO VARCHAR(2) COLLATE utf8_bin NOT NULL, |
|
| 102 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 103 | + $table_name = 'esp_country'; |
|
| 104 | + $sql = "CNT_ISO VARCHAR(2) COLLATE utf8_bin NOT NULL, |
|
| 105 | 105 | CNT_ISO3 VARCHAR(3) COLLATE utf8_bin NOT NULL, |
| 106 | 106 | RGN_ID TINYINT(3) UNSIGNED DEFAULT NULL, |
| 107 | 107 | CNT_name VARCHAR(45) COLLATE utf8_bin NOT NULL, |
@@ -117,9 +117,9 @@ discard block |
||
| 117 | 117 | CNT_is_EU TINYINT(1) DEFAULT '0', |
| 118 | 118 | CNT_active TINYINT(1) DEFAULT '0', |
| 119 | 119 | PRIMARY KEY (CNT_ISO)"; |
| 120 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 121 | - $table_name = 'esp_datetime'; |
|
| 122 | - $sql = "DTT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 120 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 121 | + $table_name = 'esp_datetime'; |
|
| 122 | + $sql = "DTT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 123 | 123 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 124 | 124 | DTT_name VARCHAR(255) NOT NULL DEFAULT '', |
| 125 | 125 | DTT_description TEXT NOT NULL, |
@@ -134,9 +134,9 @@ discard block |
||
| 134 | 134 | PRIMARY KEY (DTT_ID), |
| 135 | 135 | KEY EVT_ID (EVT_ID), |
| 136 | 136 | KEY DTT_is_primary (DTT_is_primary)"; |
| 137 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 138 | - $table_name = 'esp_event_meta'; |
|
| 139 | - $sql = " |
|
| 137 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 138 | + $table_name = 'esp_event_meta'; |
|
| 139 | + $sql = " |
|
| 140 | 140 | EVTM_ID INT NOT NULL AUTO_INCREMENT, |
| 141 | 141 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 142 | 142 | EVT_display_desc TINYINT(1) UNSIGNED NOT NULL DEFAULT 1, |
@@ -151,31 +151,31 @@ discard block |
||
| 151 | 151 | EVT_external_URL VARCHAR(200) NULL, |
| 152 | 152 | EVT_donations TINYINT(1) NULL, |
| 153 | 153 | PRIMARY KEY (EVTM_ID)"; |
| 154 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 155 | - $table_name = 'esp_event_question_group'; |
|
| 156 | - $sql = "EQG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 154 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 155 | + $table_name = 'esp_event_question_group'; |
|
| 156 | + $sql = "EQG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 157 | 157 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 158 | 158 | QSG_ID INT UNSIGNED NOT NULL, |
| 159 | 159 | EQG_primary TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, |
| 160 | 160 | PRIMARY KEY (EQG_ID)"; |
| 161 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 162 | - $table_name = 'esp_event_venue'; |
|
| 163 | - $sql = "EVV_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 161 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 162 | + $table_name = 'esp_event_venue'; |
|
| 163 | + $sql = "EVV_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 164 | 164 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 165 | 165 | VNU_ID BIGINT(20) UNSIGNED NOT NULL, |
| 166 | 166 | EVV_primary TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, |
| 167 | 167 | PRIMARY KEY (EVV_ID)"; |
| 168 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 169 | - $table_name = 'esp_extra_meta'; |
|
| 170 | - $sql = "EXM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 168 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 169 | + $table_name = 'esp_extra_meta'; |
|
| 170 | + $sql = "EXM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 171 | 171 | OBJ_ID INT(11) DEFAULT NULL, |
| 172 | 172 | EXM_type VARCHAR(45) DEFAULT NULL, |
| 173 | 173 | EXM_key VARCHAR(45) DEFAULT NULL, |
| 174 | 174 | EXM_value TEXT, |
| 175 | 175 | PRIMARY KEY (EXM_ID)"; |
| 176 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 177 | - $table_name = 'esp_line_item'; |
|
| 178 | - $sql = "LIN_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 176 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 177 | + $table_name = 'esp_line_item'; |
|
| 178 | + $sql = "LIN_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 179 | 179 | LIN_code VARCHAR(245) NOT NULL DEFAULT '', |
| 180 | 180 | TXN_ID INT(11) DEFAULT NULL, |
| 181 | 181 | LIN_name VARCHAR(245) NOT NULL DEFAULT '', |
@@ -191,19 +191,19 @@ discard block |
||
| 191 | 191 | OBJ_ID INT(11) DEFAULT NULL, |
| 192 | 192 | OBJ_type VARCHAR(45)DEFAULT NULL, |
| 193 | 193 | PRIMARY KEY (LIN_ID)"; |
| 194 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 195 | - $table_name = 'esp_message_template'; |
|
| 196 | - $sql = "MTP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 194 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 195 | + $table_name = 'esp_message_template'; |
|
| 196 | + $sql = "MTP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 197 | 197 | GRP_ID INT(10) UNSIGNED NOT NULL, |
| 198 | 198 | MTP_context VARCHAR(50) NOT NULL, |
| 199 | 199 | MTP_template_field VARCHAR(30) NOT NULL, |
| 200 | 200 | MTP_content TEXT NOT NULL, |
| 201 | 201 | PRIMARY KEY (MTP_ID), |
| 202 | 202 | KEY GRP_ID (GRP_ID)"; |
| 203 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 204 | - $this->_get_table_manager()->dropIndex('esp_message_template_group', 'EVT_ID'); |
|
| 205 | - $table_name = 'esp_message_template_group'; |
|
| 206 | - $sql = "GRP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 203 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 204 | + $this->_get_table_manager()->dropIndex('esp_message_template_group', 'EVT_ID'); |
|
| 205 | + $table_name = 'esp_message_template_group'; |
|
| 206 | + $sql = "GRP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 207 | 207 | MTP_user_id INT(10) NOT NULL DEFAULT '1', |
| 208 | 208 | MTP_name VARCHAR(245) NOT NULL DEFAULT '', |
| 209 | 209 | MTP_description VARCHAR(245) NOT NULL DEFAULT '', |
@@ -215,17 +215,17 @@ discard block |
||
| 215 | 215 | MTP_is_active TINYINT(1) NOT NULL DEFAULT '1', |
| 216 | 216 | PRIMARY KEY (GRP_ID), |
| 217 | 217 | KEY MTP_user_id (MTP_user_id)"; |
| 218 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 219 | - $table_name = 'esp_event_message_template'; |
|
| 220 | - $sql = "EMT_ID BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 218 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 219 | + $table_name = 'esp_event_message_template'; |
|
| 220 | + $sql = "EMT_ID BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 221 | 221 | EVT_ID BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, |
| 222 | 222 | GRP_ID INT(10) UNSIGNED NOT NULL DEFAULT 0, |
| 223 | 223 | PRIMARY KEY (EMT_ID), |
| 224 | 224 | KEY EVT_ID (EVT_ID), |
| 225 | 225 | KEY GRP_ID (GRP_ID)"; |
| 226 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 227 | - $table_name = 'esp_payment'; |
|
| 228 | - $sql = "PAY_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 226 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 227 | + $table_name = 'esp_payment'; |
|
| 228 | + $sql = "PAY_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 229 | 229 | TXN_ID INT(10) UNSIGNED DEFAULT NULL, |
| 230 | 230 | STS_ID VARCHAR(3) COLLATE utf8_bin DEFAULT NULL, |
| 231 | 231 | PAY_timestamp DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', |
@@ -241,28 +241,28 @@ discard block |
||
| 241 | 241 | PRIMARY KEY (PAY_ID), |
| 242 | 242 | KEY TXN_ID (TXN_ID), |
| 243 | 243 | KEY PAY_timestamp (PAY_timestamp)"; |
| 244 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 245 | - $table_name = "esp_ticket_price"; |
|
| 246 | - $sql = "TKP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 244 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 245 | + $table_name = "esp_ticket_price"; |
|
| 246 | + $sql = "TKP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 247 | 247 | TKT_ID INT(10) UNSIGNED NOT NULL, |
| 248 | 248 | PRC_ID INT(10) UNSIGNED NOT NULL, |
| 249 | 249 | PRIMARY KEY (TKP_ID)"; |
| 250 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 251 | - $table_name = "esp_datetime_ticket"; |
|
| 252 | - $sql = "DTK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 250 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 251 | + $table_name = "esp_datetime_ticket"; |
|
| 252 | + $sql = "DTK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 253 | 253 | DTT_ID INT(10) UNSIGNED NOT NULL, |
| 254 | 254 | TKT_ID INT(10) UNSIGNED NOT NULL, |
| 255 | 255 | PRIMARY KEY (DTK_ID)"; |
| 256 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 257 | - $table_name = "esp_ticket_template"; |
|
| 258 | - $sql = "TTM_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 256 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 257 | + $table_name = "esp_ticket_template"; |
|
| 258 | + $sql = "TTM_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 259 | 259 | TTM_name VARCHAR(45) NOT NULL, |
| 260 | 260 | TTM_description TEXT, |
| 261 | 261 | TTM_file VARCHAR(45), |
| 262 | 262 | PRIMARY KEY (TTM_ID)"; |
| 263 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 264 | - $table_name = 'esp_question'; |
|
| 265 | - $sql = 'QST_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 263 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 264 | + $table_name = 'esp_question'; |
|
| 265 | + $sql = 'QST_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 266 | 266 | QST_display_text TEXT NOT NULL, |
| 267 | 267 | QST_admin_label VARCHAR(255) NOT NULL, |
| 268 | 268 | QST_system VARCHAR(25) DEFAULT NULL, |
@@ -274,25 +274,25 @@ discard block |
||
| 274 | 274 | QST_wp_user BIGINT UNSIGNED NULL, |
| 275 | 275 | QST_deleted TINYINT UNSIGNED NOT NULL DEFAULT 0, |
| 276 | 276 | PRIMARY KEY (QST_ID)'; |
| 277 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 278 | - $table_name = 'esp_question_group_question'; |
|
| 279 | - $sql = "QGQ_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 277 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 278 | + $table_name = 'esp_question_group_question'; |
|
| 279 | + $sql = "QGQ_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 280 | 280 | QSG_ID INT UNSIGNED NOT NULL, |
| 281 | 281 | QST_ID INT UNSIGNED NOT NULL, |
| 282 | 282 | QGQ_order INT UNSIGNED NOT NULL DEFAULT 0, |
| 283 | 283 | PRIMARY KEY (QGQ_ID) "; |
| 284 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 285 | - $table_name = 'esp_question_option'; |
|
| 286 | - $sql = "QSO_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 284 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 285 | + $table_name = 'esp_question_option'; |
|
| 286 | + $sql = "QSO_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 287 | 287 | QSO_value VARCHAR(255) NOT NULL, |
| 288 | 288 | QSO_desc TEXT NOT NULL, |
| 289 | 289 | QST_ID INT UNSIGNED NOT NULL, |
| 290 | 290 | QSO_order INT UNSIGNED NOT NULL DEFAULT 0, |
| 291 | 291 | QSO_deleted TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, |
| 292 | 292 | PRIMARY KEY (QSO_ID)"; |
| 293 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 294 | - $table_name = 'esp_registration'; |
|
| 295 | - $sql = "REG_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 293 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 294 | + $table_name = 'esp_registration'; |
|
| 295 | + $sql = "REG_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 296 | 296 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 297 | 297 | ATT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 298 | 298 | TXN_ID INT(10) UNSIGNED NOT NULL, |
@@ -315,25 +315,25 @@ discard block |
||
| 315 | 315 | KEY STS_ID (STS_ID), |
| 316 | 316 | KEY REG_url_link (REG_url_link), |
| 317 | 317 | KEY REG_code (REG_code)"; |
| 318 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 319 | - $table_name = 'esp_checkin'; |
|
| 320 | - $sql = "CHK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 318 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 319 | + $table_name = 'esp_checkin'; |
|
| 320 | + $sql = "CHK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 321 | 321 | REG_ID INT(10) UNSIGNED NOT NULL, |
| 322 | 322 | DTT_ID INT(10) UNSIGNED NOT NULL, |
| 323 | 323 | CHK_in TINYINT(1) UNSIGNED NOT NULL DEFAULT 1, |
| 324 | 324 | CHK_timestamp DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', |
| 325 | 325 | PRIMARY KEY (CHK_ID)"; |
| 326 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 327 | - $table_name = 'esp_state'; |
|
| 328 | - $sql = "STA_ID smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 326 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 327 | + $table_name = 'esp_state'; |
|
| 328 | + $sql = "STA_ID smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 329 | 329 | CNT_ISO VARCHAR(2) COLLATE utf8_bin NOT NULL, |
| 330 | 330 | STA_abbrev VARCHAR(6) COLLATE utf8_bin NOT NULL, |
| 331 | 331 | STA_name VARCHAR(100) COLLATE utf8_bin NOT NULL, |
| 332 | 332 | STA_active TINYINT(1) DEFAULT '1', |
| 333 | 333 | PRIMARY KEY (STA_ID)"; |
| 334 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 335 | - $table_name = 'esp_status'; |
|
| 336 | - $sql = "STS_ID VARCHAR(3) COLLATE utf8_bin NOT NULL, |
|
| 334 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 335 | + $table_name = 'esp_status'; |
|
| 336 | + $sql = "STS_ID VARCHAR(3) COLLATE utf8_bin NOT NULL, |
|
| 337 | 337 | STS_code VARCHAR(45) COLLATE utf8_bin NOT NULL, |
| 338 | 338 | STS_type set('event','registration','transaction','payment','email') COLLATE utf8_bin NOT NULL, |
| 339 | 339 | STS_can_edit TINYINT(1) NOT NULL DEFAULT 0, |
@@ -341,9 +341,9 @@ discard block |
||
| 341 | 341 | STS_open TINYINT(1) NOT NULL DEFAULT 1, |
| 342 | 342 | UNIQUE KEY STS_ID_UNIQUE (STS_ID), |
| 343 | 343 | KEY STS_type (STS_type)"; |
| 344 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 345 | - $table_name = 'esp_transaction'; |
|
| 346 | - $sql = "TXN_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 344 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 345 | + $table_name = 'esp_transaction'; |
|
| 346 | + $sql = "TXN_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 347 | 347 | TXN_timestamp DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', |
| 348 | 348 | TXN_total DECIMAL(10,3) DEFAULT '0.00', |
| 349 | 349 | TXN_paid DECIMAL(10,3) NOT NULL DEFAULT '0.00', |
@@ -354,9 +354,9 @@ discard block |
||
| 354 | 354 | PRIMARY KEY (TXN_ID), |
| 355 | 355 | KEY TXN_timestamp (TXN_timestamp), |
| 356 | 356 | KEY STS_ID (STS_ID)"; |
| 357 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 358 | - $table_name = 'esp_venue_meta'; |
|
| 359 | - $sql = "VNUM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 357 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 358 | + $table_name = 'esp_venue_meta'; |
|
| 359 | + $sql = "VNUM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 360 | 360 | VNU_ID BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, |
| 361 | 361 | VNU_address VARCHAR(255) DEFAULT NULL, |
| 362 | 362 | VNU_address2 VARCHAR(255) DEFAULT NULL, |
@@ -374,10 +374,10 @@ discard block |
||
| 374 | 374 | PRIMARY KEY (VNUM_ID), |
| 375 | 375 | KEY STA_ID (STA_ID), |
| 376 | 376 | KEY CNT_ISO (CNT_ISO)"; |
| 377 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 378 | - //modified tables |
|
| 379 | - $table_name = "esp_price"; |
|
| 380 | - $sql = "PRC_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 377 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 378 | + //modified tables |
|
| 379 | + $table_name = "esp_price"; |
|
| 380 | + $sql = "PRC_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 381 | 381 | PRT_ID TINYINT(3) UNSIGNED NOT NULL, |
| 382 | 382 | PRC_amount DECIMAL(10,3) NOT NULL DEFAULT '0.00', |
| 383 | 383 | PRC_name VARCHAR(245) NOT NULL, |
@@ -389,9 +389,9 @@ discard block |
||
| 389 | 389 | PRC_wp_user BIGINT UNSIGNED NULL, |
| 390 | 390 | PRC_parent INT(10) UNSIGNED DEFAULT 0, |
| 391 | 391 | PRIMARY KEY (PRC_ID)"; |
| 392 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 393 | - $table_name = "esp_price_type"; |
|
| 394 | - $sql = "PRT_ID TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 392 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 393 | + $table_name = "esp_price_type"; |
|
| 394 | + $sql = "PRT_ID TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 395 | 395 | PRT_name VARCHAR(45) NOT NULL, |
| 396 | 396 | PBT_ID TINYINT(3) UNSIGNED NOT NULL DEFAULT '1', |
| 397 | 397 | PRT_is_percent TINYINT(1) NOT NULL DEFAULT '0', |
@@ -400,9 +400,9 @@ discard block |
||
| 400 | 400 | PRT_deleted TINYINT(1) NOT NULL DEFAULT '0', |
| 401 | 401 | UNIQUE KEY PRT_name_UNIQUE (PRT_name), |
| 402 | 402 | PRIMARY KEY (PRT_ID)"; |
| 403 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 404 | - $table_name = "esp_ticket"; |
|
| 405 | - $sql = "TKT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 403 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 404 | + $table_name = "esp_ticket"; |
|
| 405 | + $sql = "TKT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 406 | 406 | TTM_ID INT(10) UNSIGNED NOT NULL, |
| 407 | 407 | TKT_name VARCHAR(245) NOT NULL DEFAULT '', |
| 408 | 408 | TKT_description TEXT NOT NULL, |
@@ -423,10 +423,10 @@ discard block |
||
| 423 | 423 | TKT_parent INT(10) UNSIGNED DEFAULT '0', |
| 424 | 424 | TKT_deleted TINYINT(1) NOT NULL DEFAULT '0', |
| 425 | 425 | PRIMARY KEY (TKT_ID)"; |
| 426 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 427 | - $this->_get_table_manager()->dropIndex('esp_question_group', 'QSG_identifier_UNIQUE'); |
|
| 428 | - $table_name = 'esp_question_group'; |
|
| 429 | - $sql = 'QSG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 426 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 427 | + $this->_get_table_manager()->dropIndex('esp_question_group', 'QSG_identifier_UNIQUE'); |
|
| 428 | + $table_name = 'esp_question_group'; |
|
| 429 | + $sql = 'QSG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 430 | 430 | QSG_name VARCHAR(255) NOT NULL, |
| 431 | 431 | QSG_identifier VARCHAR(100) NOT NULL, |
| 432 | 432 | QSG_desc TEXT NULL, |
@@ -438,135 +438,135 @@ discard block |
||
| 438 | 438 | QSG_wp_user BIGINT UNSIGNED NULL, |
| 439 | 439 | PRIMARY KEY (QSG_ID), |
| 440 | 440 | UNIQUE KEY QSG_identifier_UNIQUE (QSG_identifier ASC)'; |
| 441 | - $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 442 | - $script_4_1_defaults = EE_Registry::instance()->load_dms('Core_4_1_0'); |
|
| 443 | - //(because many need to convert old string states to foreign keys into the states table) |
|
| 444 | - $script_4_1_defaults->insert_default_states(); |
|
| 445 | - $script_4_1_defaults->insert_default_countries(); |
|
| 446 | - //schema on price, price_types and tickets has changed so use the DEFAULT method in here instead of 4.1's and later. |
|
| 447 | - $this->insert_default_price_types(); |
|
| 448 | - $this->insert_default_prices(); |
|
| 449 | - $this->insert_default_tickets(); |
|
| 450 | - //setting up the config wp option pretty well counts as a 'schema change', or at least should happen ehre |
|
| 451 | - EE_Config::instance()->update_espresso_config(false, true); |
|
| 452 | - return true; |
|
| 453 | - } |
|
| 454 | - |
|
| 455 | - |
|
| 456 | - |
|
| 457 | - /** |
|
| 458 | - * @return boolean |
|
| 459 | - */ |
|
| 460 | - public function schema_changes_after_migration() |
|
| 461 | - { |
|
| 462 | - return true; |
|
| 463 | - } |
|
| 464 | - |
|
| 465 | - |
|
| 466 | - |
|
| 467 | - public function migration_page_hooks() |
|
| 468 | - { |
|
| 469 | - } |
|
| 470 | - |
|
| 471 | - |
|
| 472 | - |
|
| 473 | - /** |
|
| 474 | - * insert_default_price_types |
|
| 475 | - * |
|
| 476 | - * @since 4.5.0 |
|
| 477 | - * @return void |
|
| 478 | - */ |
|
| 479 | - public function insert_default_price_types() |
|
| 480 | - { |
|
| 481 | - global $wpdb; |
|
| 482 | - $price_type_table = $wpdb->prefix . "esp_price_type"; |
|
| 483 | - if ($this->_get_table_analysis()->tableExists($price_type_table)) { |
|
| 484 | - $SQL = 'SELECT COUNT(PRT_ID) FROM ' . $price_type_table; |
|
| 485 | - $price_types_exist = $wpdb->get_var($SQL); |
|
| 486 | - if ( ! $price_types_exist) { |
|
| 487 | - $user_id = EEH_Activation::get_default_creator_id(); |
|
| 488 | - $SQL = "INSERT INTO $price_type_table ( PRT_ID, PRT_name, PBT_ID, PRT_is_percent, PRT_order, PRT_wp_user, PRT_deleted ) VALUES |
|
| 441 | + $this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 442 | + $script_4_1_defaults = EE_Registry::instance()->load_dms('Core_4_1_0'); |
|
| 443 | + //(because many need to convert old string states to foreign keys into the states table) |
|
| 444 | + $script_4_1_defaults->insert_default_states(); |
|
| 445 | + $script_4_1_defaults->insert_default_countries(); |
|
| 446 | + //schema on price, price_types and tickets has changed so use the DEFAULT method in here instead of 4.1's and later. |
|
| 447 | + $this->insert_default_price_types(); |
|
| 448 | + $this->insert_default_prices(); |
|
| 449 | + $this->insert_default_tickets(); |
|
| 450 | + //setting up the config wp option pretty well counts as a 'schema change', or at least should happen ehre |
|
| 451 | + EE_Config::instance()->update_espresso_config(false, true); |
|
| 452 | + return true; |
|
| 453 | + } |
|
| 454 | + |
|
| 455 | + |
|
| 456 | + |
|
| 457 | + /** |
|
| 458 | + * @return boolean |
|
| 459 | + */ |
|
| 460 | + public function schema_changes_after_migration() |
|
| 461 | + { |
|
| 462 | + return true; |
|
| 463 | + } |
|
| 464 | + |
|
| 465 | + |
|
| 466 | + |
|
| 467 | + public function migration_page_hooks() |
|
| 468 | + { |
|
| 469 | + } |
|
| 470 | + |
|
| 471 | + |
|
| 472 | + |
|
| 473 | + /** |
|
| 474 | + * insert_default_price_types |
|
| 475 | + * |
|
| 476 | + * @since 4.5.0 |
|
| 477 | + * @return void |
|
| 478 | + */ |
|
| 479 | + public function insert_default_price_types() |
|
| 480 | + { |
|
| 481 | + global $wpdb; |
|
| 482 | + $price_type_table = $wpdb->prefix . "esp_price_type"; |
|
| 483 | + if ($this->_get_table_analysis()->tableExists($price_type_table)) { |
|
| 484 | + $SQL = 'SELECT COUNT(PRT_ID) FROM ' . $price_type_table; |
|
| 485 | + $price_types_exist = $wpdb->get_var($SQL); |
|
| 486 | + if ( ! $price_types_exist) { |
|
| 487 | + $user_id = EEH_Activation::get_default_creator_id(); |
|
| 488 | + $SQL = "INSERT INTO $price_type_table ( PRT_ID, PRT_name, PBT_ID, PRT_is_percent, PRT_order, PRT_wp_user, PRT_deleted ) VALUES |
|
| 489 | 489 | (1, '" . __('Base Price', 'event_espresso') . "', 1, 0, 0, $user_id, 0), |
| 490 | 490 | (2, '" . __('Percent Discount', 'event_espresso') . "', 2, 1, 20, $user_id, 0), |
| 491 | 491 | (3, '" . __('Dollar Discount', 'event_espresso') . "', 2, 0, 30, $user_id, 0), |
| 492 | 492 | (4, '" . __('Percent Surcharge', 'event_espresso') . "', 3, 1, 40, $user_id, 0), |
| 493 | 493 | (5, '" . __('Dollar Surcharge', 'event_espresso') . "', 3, 0, 50, $user_id, 0);"; |
| 494 | - $SQL = apply_filters('FHEE__EE_DMS_4_5_0__insert_default_price_types__SQL', $SQL); |
|
| 495 | - $wpdb->query($SQL); |
|
| 496 | - } |
|
| 497 | - } |
|
| 498 | - } |
|
| 499 | - |
|
| 500 | - |
|
| 501 | - |
|
| 502 | - /** |
|
| 503 | - * insert DEFAULT prices. |
|
| 504 | - * If we're INSTALLING 4.x CAF, then we add a few extra DEFAULT prices |
|
| 505 | - * when EEH_Activaion's initialize_db_content is called via ahook in |
|
| 506 | - * EE_Brewing_regular |
|
| 507 | - * |
|
| 508 | - * @since 4.5.0 |
|
| 509 | - * @return void |
|
| 510 | - */ |
|
| 511 | - public function insert_default_prices() |
|
| 512 | - { |
|
| 513 | - global $wpdb; |
|
| 514 | - $price_table = $wpdb->prefix . "esp_price"; |
|
| 515 | - if ($this->_get_table_analysis()->tableExists($price_table)) { |
|
| 516 | - $SQL = 'SELECT COUNT(PRC_ID) FROM ' . $price_table; |
|
| 517 | - $prices_exist = $wpdb->get_var($SQL); |
|
| 518 | - if ( ! $prices_exist) { |
|
| 519 | - $user_id = EEH_Activation::get_default_creator_id(); |
|
| 520 | - $SQL = "INSERT INTO $price_table |
|
| 494 | + $SQL = apply_filters('FHEE__EE_DMS_4_5_0__insert_default_price_types__SQL', $SQL); |
|
| 495 | + $wpdb->query($SQL); |
|
| 496 | + } |
|
| 497 | + } |
|
| 498 | + } |
|
| 499 | + |
|
| 500 | + |
|
| 501 | + |
|
| 502 | + /** |
|
| 503 | + * insert DEFAULT prices. |
|
| 504 | + * If we're INSTALLING 4.x CAF, then we add a few extra DEFAULT prices |
|
| 505 | + * when EEH_Activaion's initialize_db_content is called via ahook in |
|
| 506 | + * EE_Brewing_regular |
|
| 507 | + * |
|
| 508 | + * @since 4.5.0 |
|
| 509 | + * @return void |
|
| 510 | + */ |
|
| 511 | + public function insert_default_prices() |
|
| 512 | + { |
|
| 513 | + global $wpdb; |
|
| 514 | + $price_table = $wpdb->prefix . "esp_price"; |
|
| 515 | + if ($this->_get_table_analysis()->tableExists($price_table)) { |
|
| 516 | + $SQL = 'SELECT COUNT(PRC_ID) FROM ' . $price_table; |
|
| 517 | + $prices_exist = $wpdb->get_var($SQL); |
|
| 518 | + if ( ! $prices_exist) { |
|
| 519 | + $user_id = EEH_Activation::get_default_creator_id(); |
|
| 520 | + $SQL = "INSERT INTO $price_table |
|
| 521 | 521 | (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 |
| 522 | 522 | (1, 1, '0.00', 'Free Admission', '', 1, NULL, $user_id, 0, 0, 0);"; |
| 523 | - $SQL = apply_filters('FHEE__EE_DMS_4_5_0__insert_default_prices__SQL', $SQL); |
|
| 524 | - $wpdb->query($SQL); |
|
| 525 | - } |
|
| 526 | - } |
|
| 527 | - } |
|
| 528 | - |
|
| 529 | - |
|
| 530 | - |
|
| 531 | - /** |
|
| 532 | - * insert DEFAULT ticket |
|
| 533 | - * Almost identical to EE_DMS_Core_4_3_0::insert_default_tickets, except is aware of the TKT_wp_user field |
|
| 534 | - * |
|
| 535 | - * @since 4.5.0 |
|
| 536 | - * @return void |
|
| 537 | - */ |
|
| 538 | - public function insert_default_tickets() |
|
| 539 | - { |
|
| 540 | - global $wpdb; |
|
| 541 | - $ticket_table = $wpdb->prefix . "esp_ticket"; |
|
| 542 | - if ($this->_get_table_analysis()->tableExists($ticket_table)) { |
|
| 543 | - $SQL = 'SELECT COUNT(TKT_ID) FROM ' . $ticket_table; |
|
| 544 | - $tickets_exist = $wpdb->get_var($SQL); |
|
| 545 | - if ( ! $tickets_exist) { |
|
| 546 | - $user_id = EEH_Activation::get_default_creator_id(); |
|
| 547 | - $SQL = "INSERT INTO $ticket_table |
|
| 523 | + $SQL = apply_filters('FHEE__EE_DMS_4_5_0__insert_default_prices__SQL', $SQL); |
|
| 524 | + $wpdb->query($SQL); |
|
| 525 | + } |
|
| 526 | + } |
|
| 527 | + } |
|
| 528 | + |
|
| 529 | + |
|
| 530 | + |
|
| 531 | + /** |
|
| 532 | + * insert DEFAULT ticket |
|
| 533 | + * Almost identical to EE_DMS_Core_4_3_0::insert_default_tickets, except is aware of the TKT_wp_user field |
|
| 534 | + * |
|
| 535 | + * @since 4.5.0 |
|
| 536 | + * @return void |
|
| 537 | + */ |
|
| 538 | + public function insert_default_tickets() |
|
| 539 | + { |
|
| 540 | + global $wpdb; |
|
| 541 | + $ticket_table = $wpdb->prefix . "esp_ticket"; |
|
| 542 | + if ($this->_get_table_analysis()->tableExists($ticket_table)) { |
|
| 543 | + $SQL = 'SELECT COUNT(TKT_ID) FROM ' . $ticket_table; |
|
| 544 | + $tickets_exist = $wpdb->get_var($SQL); |
|
| 545 | + if ( ! $tickets_exist) { |
|
| 546 | + $user_id = EEH_Activation::get_default_creator_id(); |
|
| 547 | + $SQL = "INSERT INTO $ticket_table |
|
| 548 | 548 | ( 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 |
| 549 | 549 | ( 1, 0, '" |
| 550 | - . __("Free Ticket", "event_espresso") |
|
| 551 | - . "', '', 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);"; |
|
| 552 | - $SQL = apply_filters('FHEE__EE_DMS_4_5_0__insert_default_tickets__SQL', $SQL); |
|
| 553 | - $wpdb->query($SQL); |
|
| 554 | - } |
|
| 555 | - } |
|
| 556 | - $ticket_price_table = $wpdb->prefix . "esp_ticket_price"; |
|
| 557 | - if ($this->_get_table_analysis()->tableExists($ticket_price_table)) { |
|
| 558 | - $SQL = 'SELECT COUNT(TKP_ID) FROM ' . $ticket_price_table; |
|
| 559 | - $ticket_prc_exist = $wpdb->get_var($SQL); |
|
| 560 | - if ( ! $ticket_prc_exist) { |
|
| 561 | - $SQL = "INSERT INTO $ticket_price_table |
|
| 550 | + . __("Free Ticket", "event_espresso") |
|
| 551 | + . "', '', 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);"; |
|
| 552 | + $SQL = apply_filters('FHEE__EE_DMS_4_5_0__insert_default_tickets__SQL', $SQL); |
|
| 553 | + $wpdb->query($SQL); |
|
| 554 | + } |
|
| 555 | + } |
|
| 556 | + $ticket_price_table = $wpdb->prefix . "esp_ticket_price"; |
|
| 557 | + if ($this->_get_table_analysis()->tableExists($ticket_price_table)) { |
|
| 558 | + $SQL = 'SELECT COUNT(TKP_ID) FROM ' . $ticket_price_table; |
|
| 559 | + $ticket_prc_exist = $wpdb->get_var($SQL); |
|
| 560 | + if ( ! $ticket_prc_exist) { |
|
| 561 | + $SQL = "INSERT INTO $ticket_price_table |
|
| 562 | 562 | ( TKP_ID, TKT_ID, PRC_ID ) VALUES |
| 563 | 563 | ( 1, 1, 1 ) |
| 564 | 564 | "; |
| 565 | - $SQL = apply_filters('FHEE__EE_DMS_4_5_0__insert_default_tickets__SQL__ticket_price', $SQL); |
|
| 566 | - $wpdb->query($SQL); |
|
| 567 | - } |
|
| 568 | - } |
|
| 569 | - } |
|
| 565 | + $SQL = apply_filters('FHEE__EE_DMS_4_5_0__insert_default_tickets__SQL__ticket_price', $SQL); |
|
| 566 | + $wpdb->query($SQL); |
|
| 567 | + } |
|
| 568 | + } |
|
| 569 | + } |
|
| 570 | 570 | |
| 571 | 571 | } |
| 572 | 572 | |
@@ -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, |
@@ -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,72 +38,72 @@ 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 Update to Event Espresso 4.7.0", "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 Update to Event Espresso 4.7.0", "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 bool |
|
| 92 | - */ |
|
| 93 | - public function schema_changes_before_migration() |
|
| 94 | - { |
|
| 95 | - //relies on 4.1's EEH_Activation::create_table |
|
| 96 | - require_once(EE_HELPERS . 'EEH_Activation.helper.php'); |
|
| 97 | - $table_name = 'esp_answer'; |
|
| 98 | - $sql = " ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 89 | + /** |
|
| 90 | + * @return bool |
|
| 91 | + */ |
|
| 92 | + public function schema_changes_before_migration() |
|
| 93 | + { |
|
| 94 | + //relies on 4.1's EEH_Activation::create_table |
|
| 95 | + require_once(EE_HELPERS . 'EEH_Activation.helper.php'); |
|
| 96 | + $table_name = 'esp_answer'; |
|
| 97 | + $sql = " ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 99 | 98 | REG_ID INT UNSIGNED NOT NULL, |
| 100 | 99 | QST_ID INT UNSIGNED NOT NULL, |
| 101 | 100 | ANS_value TEXT NOT NULL, |
| 102 | 101 | PRIMARY KEY (ANS_ID), |
| 103 | 102 | KEY REG_ID (REG_ID), |
| 104 | 103 | KEY QST_ID (QST_ID)"; |
| 105 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 106 | - $table_name = 'esp_attendee_meta'; |
|
| 107 | - $sql = "ATTM_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 104 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 105 | + $table_name = 'esp_attendee_meta'; |
|
| 106 | + $sql = "ATTM_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 108 | 107 | ATT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 109 | 108 | ATT_fname VARCHAR(45) NOT NULL, |
| 110 | 109 | ATT_lname VARCHAR(45) NOT NULL, |
@@ -121,9 +120,9 @@ discard block |
||
| 121 | 120 | KEY ATT_email (ATT_email), |
| 122 | 121 | KEY ATT_lname (ATT_lname), |
| 123 | 122 | KEY ATT_fname (ATT_fname)"; |
| 124 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 125 | - $table_name = 'esp_country'; |
|
| 126 | - $sql = "CNT_ISO VARCHAR(2) COLLATE utf8_bin NOT NULL, |
|
| 123 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 124 | + $table_name = 'esp_country'; |
|
| 125 | + $sql = "CNT_ISO VARCHAR(2) COLLATE utf8_bin NOT NULL, |
|
| 127 | 126 | CNT_ISO3 VARCHAR(3) COLLATE utf8_bin NOT NULL, |
| 128 | 127 | RGN_ID TINYINT(3) UNSIGNED DEFAULT NULL, |
| 129 | 128 | CNT_name VARCHAR(45) COLLATE utf8_bin NOT NULL, |
@@ -139,25 +138,25 @@ discard block |
||
| 139 | 138 | CNT_is_EU TINYINT(1) DEFAULT '0', |
| 140 | 139 | CNT_active TINYINT(1) DEFAULT '0', |
| 141 | 140 | PRIMARY KEY (CNT_ISO)"; |
| 142 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 143 | - $table_name = 'esp_currency'; |
|
| 144 | - $sql = "CUR_code VARCHAR(6) COLLATE utf8_bin NOT NULL, |
|
| 141 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 142 | + $table_name = 'esp_currency'; |
|
| 143 | + $sql = "CUR_code VARCHAR(6) COLLATE utf8_bin NOT NULL, |
|
| 145 | 144 | CUR_single VARCHAR(45) COLLATE utf8_bin DEFAULT 'dollar', |
| 146 | 145 | CUR_plural VARCHAR(45) COLLATE utf8_bin DEFAULT 'dollars', |
| 147 | 146 | CUR_sign VARCHAR(45) COLLATE utf8_bin DEFAULT '$', |
| 148 | 147 | CUR_dec_plc VARCHAR(1) COLLATE utf8_bin NOT NULL DEFAULT '2', |
| 149 | 148 | CUR_active TINYINT(1) DEFAULT '0', |
| 150 | 149 | PRIMARY KEY (CUR_code)"; |
| 151 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 152 | - $table_name = 'esp_currency_payment_method'; |
|
| 153 | - $sql = "CPM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 150 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 151 | + $table_name = 'esp_currency_payment_method'; |
|
| 152 | + $sql = "CPM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 154 | 153 | CUR_code VARCHAR(6) COLLATE utf8_bin NOT NULL, |
| 155 | 154 | PMD_ID INT(11) NOT NULL, |
| 156 | 155 | PRIMARY KEY (CPM_ID), |
| 157 | 156 | KEY PMD_ID (PMD_ID)"; |
| 158 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 159 | - $table_name = 'esp_datetime'; |
|
| 160 | - $sql = "DTT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 157 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 158 | + $table_name = 'esp_datetime'; |
|
| 159 | + $sql = "DTT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 161 | 160 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 162 | 161 | DTT_name VARCHAR(255) NOT NULL DEFAULT '', |
| 163 | 162 | DTT_description TEXT NOT NULL, |
@@ -173,9 +172,9 @@ discard block |
||
| 173 | 172 | KEY DTT_EVT_start (DTT_EVT_start), |
| 174 | 173 | KEY EVT_ID (EVT_ID), |
| 175 | 174 | KEY DTT_is_primary (DTT_is_primary)"; |
| 176 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 177 | - $table_name = 'esp_event_meta'; |
|
| 178 | - $sql = " |
|
| 175 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 176 | + $table_name = 'esp_event_meta'; |
|
| 177 | + $sql = " |
|
| 179 | 178 | EVTM_ID INT NOT NULL AUTO_INCREMENT, |
| 180 | 179 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 181 | 180 | EVT_display_desc TINYINT(1) UNSIGNED NOT NULL DEFAULT 1, |
@@ -191,34 +190,34 @@ discard block |
||
| 191 | 190 | EVT_donations TINYINT(1) NULL, |
| 192 | 191 | PRIMARY KEY (EVTM_ID), |
| 193 | 192 | KEY EVT_ID (EVT_ID)"; |
| 194 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 195 | - $table_name = 'esp_event_question_group'; |
|
| 196 | - $sql = "EQG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 193 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 194 | + $table_name = 'esp_event_question_group'; |
|
| 195 | + $sql = "EQG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 197 | 196 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 198 | 197 | QSG_ID INT UNSIGNED NOT NULL, |
| 199 | 198 | EQG_primary TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, |
| 200 | 199 | PRIMARY KEY (EQG_ID), |
| 201 | 200 | KEY EVT_ID (EVT_ID), |
| 202 | 201 | KEY QSG_ID (QSG_ID)"; |
| 203 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 204 | - $table_name = 'esp_event_venue'; |
|
| 205 | - $sql = "EVV_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 202 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 203 | + $table_name = 'esp_event_venue'; |
|
| 204 | + $sql = "EVV_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 206 | 205 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 207 | 206 | VNU_ID BIGINT(20) UNSIGNED NOT NULL, |
| 208 | 207 | EVV_primary TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, |
| 209 | 208 | PRIMARY KEY (EVV_ID)"; |
| 210 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 211 | - $table_name = 'esp_extra_meta'; |
|
| 212 | - $sql = "EXM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 209 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 210 | + $table_name = 'esp_extra_meta'; |
|
| 211 | + $sql = "EXM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 213 | 212 | OBJ_ID INT(11) DEFAULT NULL, |
| 214 | 213 | EXM_type VARCHAR(45) DEFAULT NULL, |
| 215 | 214 | EXM_key VARCHAR(45) DEFAULT NULL, |
| 216 | 215 | EXM_value TEXT, |
| 217 | 216 | PRIMARY KEY (EXM_ID), |
| 218 | 217 | KEY EXM_type (EXM_type, OBJ_ID, EXM_key(45))"; |
| 219 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 220 | - $table_name = 'esp_line_item'; |
|
| 221 | - $sql = "LIN_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 218 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 219 | + $table_name = 'esp_line_item'; |
|
| 220 | + $sql = "LIN_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 222 | 221 | LIN_code VARCHAR(245) NOT NULL DEFAULT '', |
| 223 | 222 | TXN_ID INT(11) DEFAULT NULL, |
| 224 | 223 | LIN_name VARCHAR(245) NOT NULL DEFAULT '', |
@@ -236,9 +235,9 @@ discard block |
||
| 236 | 235 | PRIMARY KEY (LIN_ID), |
| 237 | 236 | KEY LIN_code (LIN_code(191)), |
| 238 | 237 | KEY TXN_ID (TXN_ID)"; |
| 239 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 240 | - $table_name = 'esp_log'; |
|
| 241 | - $sql = "LOG_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 238 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 239 | + $table_name = 'esp_log'; |
|
| 240 | + $sql = "LOG_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 242 | 241 | LOG_time DATETIME DEFAULT NULL, |
| 243 | 242 | OBJ_ID VARCHAR(45) DEFAULT NULL, |
| 244 | 243 | OBJ_type VARCHAR(45) DEFAULT NULL, |
@@ -249,18 +248,18 @@ discard block |
||
| 249 | 248 | KEY LOG_time (LOG_time), |
| 250 | 249 | KEY OBJ (OBJ_type,OBJ_ID), |
| 251 | 250 | KEY LOG_type (LOG_type)"; |
| 252 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 253 | - $table_name = 'esp_message_template'; |
|
| 254 | - $sql = "MTP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 251 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 252 | + $table_name = 'esp_message_template'; |
|
| 253 | + $sql = "MTP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 255 | 254 | GRP_ID INT(10) UNSIGNED NOT NULL, |
| 256 | 255 | MTP_context VARCHAR(50) NOT NULL, |
| 257 | 256 | MTP_template_field VARCHAR(30) NOT NULL, |
| 258 | 257 | MTP_content TEXT NOT NULL, |
| 259 | 258 | PRIMARY KEY (MTP_ID), |
| 260 | 259 | KEY GRP_ID (GRP_ID)"; |
| 261 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 262 | - $table_name = 'esp_message_template_group'; |
|
| 263 | - $sql = "GRP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 260 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 261 | + $table_name = 'esp_message_template_group'; |
|
| 262 | + $sql = "GRP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 264 | 263 | MTP_user_id INT(10) NOT NULL DEFAULT '1', |
| 265 | 264 | MTP_name VARCHAR(245) NOT NULL DEFAULT '', |
| 266 | 265 | MTP_description VARCHAR(245) NOT NULL DEFAULT '', |
@@ -272,17 +271,17 @@ discard block |
||
| 272 | 271 | MTP_is_active TINYINT(1) NOT NULL DEFAULT '1', |
| 273 | 272 | PRIMARY KEY (GRP_ID), |
| 274 | 273 | KEY MTP_user_id (MTP_user_id)"; |
| 275 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 276 | - $table_name = 'esp_event_message_template'; |
|
| 277 | - $sql = "EMT_ID BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 274 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 275 | + $table_name = 'esp_event_message_template'; |
|
| 276 | + $sql = "EMT_ID BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 278 | 277 | EVT_ID BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, |
| 279 | 278 | GRP_ID INT(10) UNSIGNED NOT NULL DEFAULT 0, |
| 280 | 279 | PRIMARY KEY (EMT_ID), |
| 281 | 280 | KEY EVT_ID (EVT_ID), |
| 282 | 281 | KEY GRP_ID (GRP_ID)"; |
| 283 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 284 | - $table_name = 'esp_payment'; |
|
| 285 | - $sql = "PAY_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 282 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 283 | + $table_name = 'esp_payment'; |
|
| 284 | + $sql = "PAY_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 286 | 285 | TXN_ID INT(10) UNSIGNED DEFAULT NULL, |
| 287 | 286 | STS_ID VARCHAR(3) COLLATE utf8_bin DEFAULT NULL, |
| 288 | 287 | PAY_timestamp DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', |
@@ -299,9 +298,9 @@ discard block |
||
| 299 | 298 | PRIMARY KEY (PAY_ID), |
| 300 | 299 | KEY PAY_timestamp (PAY_timestamp), |
| 301 | 300 | KEY TXN_ID (TXN_ID)"; |
| 302 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 303 | - $table_name = 'esp_payment_method'; |
|
| 304 | - $sql = "PMD_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 301 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 302 | + $table_name = 'esp_payment_method'; |
|
| 303 | + $sql = "PMD_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 305 | 304 | PMD_type VARCHAR(124) DEFAULT NULL, |
| 306 | 305 | PMD_name VARCHAR(255) DEFAULT NULL, |
| 307 | 306 | PMD_desc TEXT, |
@@ -317,32 +316,32 @@ discard block |
||
| 317 | 316 | PRIMARY KEY (PMD_ID), |
| 318 | 317 | UNIQUE KEY PMD_slug_UNIQUE (PMD_slug), |
| 319 | 318 | KEY PMD_type (PMD_type)"; |
| 320 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 321 | - $table_name = "esp_ticket_price"; |
|
| 322 | - $sql = "TKP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 319 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 320 | + $table_name = "esp_ticket_price"; |
|
| 321 | + $sql = "TKP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 323 | 322 | TKT_ID INT(10) UNSIGNED NOT NULL, |
| 324 | 323 | PRC_ID INT(10) UNSIGNED NOT NULL, |
| 325 | 324 | PRIMARY KEY (TKP_ID), |
| 326 | 325 | KEY TKT_ID (TKT_ID), |
| 327 | 326 | KEY PRC_ID (PRC_ID)"; |
| 328 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 329 | - $table_name = "esp_datetime_ticket"; |
|
| 330 | - $sql = "DTK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 327 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 328 | + $table_name = "esp_datetime_ticket"; |
|
| 329 | + $sql = "DTK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 331 | 330 | DTT_ID INT(10) UNSIGNED NOT NULL, |
| 332 | 331 | TKT_ID INT(10) UNSIGNED NOT NULL, |
| 333 | 332 | PRIMARY KEY (DTK_ID), |
| 334 | 333 | KEY DTT_ID (DTT_ID), |
| 335 | 334 | KEY TKT_ID (TKT_ID)"; |
| 336 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 337 | - $table_name = "esp_ticket_template"; |
|
| 338 | - $sql = "TTM_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 335 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 336 | + $table_name = "esp_ticket_template"; |
|
| 337 | + $sql = "TTM_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 339 | 338 | TTM_name VARCHAR(45) NOT NULL, |
| 340 | 339 | TTM_description TEXT, |
| 341 | 340 | TTM_file VARCHAR(45), |
| 342 | 341 | PRIMARY KEY (TTM_ID)"; |
| 343 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 344 | - $table_name = 'esp_question'; |
|
| 345 | - $sql = 'QST_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 342 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 343 | + $table_name = 'esp_question'; |
|
| 344 | + $sql = 'QST_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 346 | 345 | QST_display_text TEXT NOT NULL, |
| 347 | 346 | QST_admin_label VARCHAR(255) NOT NULL, |
| 348 | 347 | QST_system VARCHAR(25) DEFAULT NULL, |
@@ -355,18 +354,18 @@ discard block |
||
| 355 | 354 | QST_deleted TINYINT UNSIGNED NOT NULL DEFAULT 0, |
| 356 | 355 | PRIMARY KEY (QST_ID), |
| 357 | 356 | KEY QST_order (QST_order)'; |
| 358 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 359 | - $table_name = 'esp_question_group_question'; |
|
| 360 | - $sql = "QGQ_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 357 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 358 | + $table_name = 'esp_question_group_question'; |
|
| 359 | + $sql = "QGQ_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 361 | 360 | QSG_ID INT UNSIGNED NOT NULL, |
| 362 | 361 | QST_ID INT UNSIGNED NOT NULL, |
| 363 | 362 | QGQ_order INT UNSIGNED NOT NULL DEFAULT 0, |
| 364 | 363 | PRIMARY KEY (QGQ_ID), |
| 365 | 364 | KEY QST_ID (QST_ID), |
| 366 | 365 | KEY QSG_ID_order (QSG_ID, QGQ_order)"; |
| 367 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 368 | - $table_name = 'esp_question_option'; |
|
| 369 | - $sql = "QSO_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 366 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 367 | + $table_name = 'esp_question_option'; |
|
| 368 | + $sql = "QSO_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 370 | 369 | QSO_value VARCHAR(255) NOT NULL, |
| 371 | 370 | QSO_desc TEXT NOT NULL, |
| 372 | 371 | QST_ID INT UNSIGNED NOT NULL, |
@@ -375,9 +374,9 @@ discard block |
||
| 375 | 374 | PRIMARY KEY (QSO_ID), |
| 376 | 375 | KEY QST_ID (QST_ID), |
| 377 | 376 | KEY QSO_order (QSO_order)"; |
| 378 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 379 | - $table_name = 'esp_registration'; |
|
| 380 | - $sql = "REG_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 377 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 378 | + $table_name = 'esp_registration'; |
|
| 379 | + $sql = "REG_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 381 | 380 | EVT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 382 | 381 | ATT_ID BIGINT(20) UNSIGNED NOT NULL, |
| 383 | 382 | TXN_ID INT(10) UNSIGNED NOT NULL, |
@@ -401,18 +400,18 @@ discard block |
||
| 401 | 400 | KEY TKT_ID (TKT_ID), |
| 402 | 401 | KEY EVT_ID (EVT_ID), |
| 403 | 402 | KEY STS_ID (STS_ID)"; |
| 404 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 405 | - $table_name = 'esp_registration_payment'; |
|
| 406 | - $sql = "RPY_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 403 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 404 | + $table_name = 'esp_registration_payment'; |
|
| 405 | + $sql = "RPY_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 407 | 406 | REG_ID INT(10) UNSIGNED NOT NULL, |
| 408 | 407 | PAY_ID INT(10) UNSIGNED NULL, |
| 409 | 408 | RPY_amount DECIMAL(10,3) NOT NULL DEFAULT '0.00', |
| 410 | 409 | PRIMARY KEY (RPY_ID), |
| 411 | 410 | KEY REG_ID (REG_ID), |
| 412 | 411 | KEY PAY_ID (PAY_ID)"; |
| 413 | - $this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 414 | - $table_name = 'esp_checkin'; |
|
| 415 | - $sql = "CHK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 412 | + $this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 413 | + $table_name = 'esp_checkin'; |
|
| 414 | + $sql = "CHK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 416 | 415 | REG_ID INT(10) UNSIGNED NOT NULL, |
| 417 | 416 | DTT_ID INT(10) UNSIGNED NOT NULL, |
| 418 | 417 | CHK_in TINYINT(1) UNSIGNED NOT NULL DEFAULT 1, |
@@ -420,9 +419,9 @@ discard block |
||
| 420 | 419 | PRIMARY KEY (CHK_ID), |
| 421 | 420 | KEY REG_ID (REG_ID), |
| 422 | 421 | KEY DTT_ID (DTT_ID)"; |
| 423 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 424 | - $table_name = 'esp_state'; |
|
| 425 | - $sql = "STA_ID smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 422 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 423 | + $table_name = 'esp_state'; |
|
| 424 | + $sql = "STA_ID smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 426 | 425 | CNT_ISO VARCHAR(2) COLLATE utf8_bin NOT NULL, |
| 427 | 426 | STA_abbrev VARCHAR(24) COLLATE utf8_bin NOT NULL, |
| 428 | 427 | STA_name VARCHAR(100) COLLATE utf8_bin NOT NULL, |
@@ -430,9 +429,9 @@ discard block |
||
| 430 | 429 | PRIMARY KEY (STA_ID), |
| 431 | 430 | KEY STA_abbrev (STA_abbrev), |
| 432 | 431 | KEY CNT_ISO (CNT_ISO)"; |
| 433 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 434 | - $table_name = 'esp_status'; |
|
| 435 | - $sql = "STS_ID VARCHAR(3) COLLATE utf8_bin NOT NULL, |
|
| 432 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 433 | + $table_name = 'esp_status'; |
|
| 434 | + $sql = "STS_ID VARCHAR(3) COLLATE utf8_bin NOT NULL, |
|
| 436 | 435 | STS_code VARCHAR(45) COLLATE utf8_bin NOT NULL, |
| 437 | 436 | STS_type set('event','registration','transaction','payment','email') COLLATE utf8_bin NOT NULL, |
| 438 | 437 | STS_can_edit TINYINT(1) NOT NULL DEFAULT 0, |
@@ -440,9 +439,9 @@ discard block |
||
| 440 | 439 | STS_open TINYINT(1) NOT NULL DEFAULT 1, |
| 441 | 440 | UNIQUE KEY STS_ID_UNIQUE (STS_ID), |
| 442 | 441 | KEY STS_type (STS_type)"; |
| 443 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 444 | - $table_name = 'esp_transaction'; |
|
| 445 | - $sql = "TXN_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 442 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 443 | + $table_name = 'esp_transaction'; |
|
| 444 | + $sql = "TXN_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 446 | 445 | TXN_timestamp DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', |
| 447 | 446 | TXN_total DECIMAL(10,3) DEFAULT '0.00', |
| 448 | 447 | TXN_paid DECIMAL(10,3) NOT NULL DEFAULT '0.00', |
@@ -454,9 +453,9 @@ discard block |
||
| 454 | 453 | PRIMARY KEY (TXN_ID), |
| 455 | 454 | KEY TXN_timestamp (TXN_timestamp), |
| 456 | 455 | KEY STS_ID (STS_ID)"; |
| 457 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 458 | - $table_name = 'esp_venue_meta'; |
|
| 459 | - $sql = "VNUM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 456 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 457 | + $table_name = 'esp_venue_meta'; |
|
| 458 | + $sql = "VNUM_ID INT(11) NOT NULL AUTO_INCREMENT, |
|
| 460 | 459 | VNU_ID BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, |
| 461 | 460 | VNU_address VARCHAR(255) DEFAULT NULL, |
| 462 | 461 | VNU_address2 VARCHAR(255) DEFAULT NULL, |
@@ -475,10 +474,10 @@ discard block |
||
| 475 | 474 | KEY VNU_ID (VNU_ID), |
| 476 | 475 | KEY STA_ID (STA_ID), |
| 477 | 476 | KEY CNT_ISO (CNT_ISO)"; |
| 478 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 479 | - //modified tables |
|
| 480 | - $table_name = "esp_price"; |
|
| 481 | - $sql = "PRC_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 477 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 478 | + //modified tables |
|
| 479 | + $table_name = "esp_price"; |
|
| 480 | + $sql = "PRC_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 482 | 481 | PRT_ID TINYINT(3) UNSIGNED NOT NULL, |
| 483 | 482 | PRC_amount DECIMAL(10,3) NOT NULL DEFAULT '0.00', |
| 484 | 483 | PRC_name VARCHAR(245) NOT NULL, |
@@ -491,9 +490,9 @@ discard block |
||
| 491 | 490 | PRC_parent INT(10) UNSIGNED DEFAULT 0, |
| 492 | 491 | PRIMARY KEY (PRC_ID), |
| 493 | 492 | KEY PRT_ID (PRT_ID)"; |
| 494 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 495 | - $table_name = "esp_price_type"; |
|
| 496 | - $sql = "PRT_ID TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 493 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 494 | + $table_name = "esp_price_type"; |
|
| 495 | + $sql = "PRT_ID TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 497 | 496 | PRT_name VARCHAR(45) NOT NULL, |
| 498 | 497 | PBT_ID TINYINT(3) UNSIGNED NOT NULL DEFAULT '1', |
| 499 | 498 | PRT_is_percent TINYINT(1) NOT NULL DEFAULT '0', |
@@ -502,9 +501,9 @@ discard block |
||
| 502 | 501 | PRT_deleted TINYINT(1) NOT NULL DEFAULT '0', |
| 503 | 502 | UNIQUE KEY PRT_name_UNIQUE (PRT_name), |
| 504 | 503 | PRIMARY KEY (PRT_ID)"; |
| 505 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 506 | - $table_name = "esp_ticket"; |
|
| 507 | - $sql = "TKT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 504 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB '); |
|
| 505 | + $table_name = "esp_ticket"; |
|
| 506 | + $sql = "TKT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 508 | 507 | TTM_ID INT(10) UNSIGNED NOT NULL, |
| 509 | 508 | TKT_name VARCHAR(245) NOT NULL DEFAULT '', |
| 510 | 509 | TKT_description TEXT NOT NULL, |
@@ -526,9 +525,9 @@ discard block |
||
| 526 | 525 | TKT_deleted TINYINT(1) NOT NULL DEFAULT '0', |
| 527 | 526 | PRIMARY KEY (TKT_ID), |
| 528 | 527 | KEY TKT_start_date (TKT_start_date)"; |
| 529 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 530 | - $table_name = 'esp_question_group'; |
|
| 531 | - $sql = 'QSG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 528 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 529 | + $table_name = 'esp_question_group'; |
|
| 530 | + $sql = 'QSG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
| 532 | 531 | QSG_name VARCHAR(255) NOT NULL, |
| 533 | 532 | QSG_identifier VARCHAR(100) NOT NULL, |
| 534 | 533 | QSG_desc TEXT NULL, |
@@ -541,38 +540,38 @@ discard block |
||
| 541 | 540 | PRIMARY KEY (QSG_ID), |
| 542 | 541 | UNIQUE KEY QSG_identifier_UNIQUE (QSG_identifier), |
| 543 | 542 | KEY QSG_order (QSG_order)'; |
| 544 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 545 | - /** @var EE_DMS_Core_4_1_0 $script_4_1_defaults */ |
|
| 546 | - $script_4_1_defaults = EE_Registry::instance()->load_dms('Core_4_1_0'); |
|
| 547 | - //(because many need to convert old string states to foreign keys into the states table) |
|
| 548 | - $script_4_1_defaults->insert_default_states(); |
|
| 549 | - $script_4_1_defaults->insert_default_countries(); |
|
| 550 | - /** @var EE_DMS_Core_4_5_0 $script_4_5_defaults */ |
|
| 551 | - $script_4_5_defaults = EE_Registry::instance()->load_dms('Core_4_5_0'); |
|
| 552 | - $script_4_5_defaults->insert_default_price_types(); |
|
| 553 | - $script_4_5_defaults->insert_default_prices(); |
|
| 554 | - $script_4_5_defaults->insert_default_tickets(); |
|
| 555 | - /** @var EE_DMS_Core_4_6_0 $script_4_6_defaults */ |
|
| 556 | - $script_4_6_defaults = EE_Registry::instance()->load_dms('Core_4_6_0'); |
|
| 557 | - $script_4_6_defaults->add_default_admin_only_payments(); |
|
| 558 | - $script_4_6_defaults->insert_default_currencies(); |
|
| 559 | - return true; |
|
| 560 | - } |
|
| 543 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
| 544 | + /** @var EE_DMS_Core_4_1_0 $script_4_1_defaults */ |
|
| 545 | + $script_4_1_defaults = EE_Registry::instance()->load_dms('Core_4_1_0'); |
|
| 546 | + //(because many need to convert old string states to foreign keys into the states table) |
|
| 547 | + $script_4_1_defaults->insert_default_states(); |
|
| 548 | + $script_4_1_defaults->insert_default_countries(); |
|
| 549 | + /** @var EE_DMS_Core_4_5_0 $script_4_5_defaults */ |
|
| 550 | + $script_4_5_defaults = EE_Registry::instance()->load_dms('Core_4_5_0'); |
|
| 551 | + $script_4_5_defaults->insert_default_price_types(); |
|
| 552 | + $script_4_5_defaults->insert_default_prices(); |
|
| 553 | + $script_4_5_defaults->insert_default_tickets(); |
|
| 554 | + /** @var EE_DMS_Core_4_6_0 $script_4_6_defaults */ |
|
| 555 | + $script_4_6_defaults = EE_Registry::instance()->load_dms('Core_4_6_0'); |
|
| 556 | + $script_4_6_defaults->add_default_admin_only_payments(); |
|
| 557 | + $script_4_6_defaults->insert_default_currencies(); |
|
| 558 | + return true; |
|
| 559 | + } |
|
| 561 | 560 | |
| 562 | 561 | |
| 563 | 562 | |
| 564 | - /** |
|
| 565 | - * @return boolean |
|
| 566 | - */ |
|
| 567 | - public function schema_changes_after_migration() |
|
| 568 | - { |
|
| 569 | - return true; |
|
| 570 | - } |
|
| 563 | + /** |
|
| 564 | + * @return boolean |
|
| 565 | + */ |
|
| 566 | + public function schema_changes_after_migration() |
|
| 567 | + { |
|
| 568 | + return true; |
|
| 569 | + } |
|
| 571 | 570 | |
| 572 | 571 | |
| 573 | 572 | |
| 574 | - public function migration_page_hooks() |
|
| 575 | - { |
|
| 576 | - } |
|
| 573 | + public function migration_page_hooks() |
|
| 574 | + { |
|
| 575 | + } |
|
| 577 | 576 | } |
| 578 | 577 | // end of file: /core/data_migration_scripts/EE_DMS_Core_4_7_0.dms.php |
| 579 | 578 | \ No newline at end of file |
@@ -5,39 +5,39 @@ discard block |
||
| 5 | 5 | /** @type string $reset_db_action_url */ |
| 6 | 6 | /** @type EE_Data_Migration_Script_Base $most_recent_migration */ |
| 7 | 7 | ?> |
| 8 | -<?php if ( $success ) { ?> |
|
| 9 | - <h1><?php _e( "Database Update Crash Report Sent", "event_espresso" ); ?></h1> |
|
| 10 | - <p><?php _e( "A crash report email was sent to Event Espresso. You should hear back from us soon.", "event_espresso" ); ?></p> |
|
| 8 | +<?php if ($success) { ?> |
|
| 9 | + <h1><?php _e("Database Update Crash Report Sent", "event_espresso"); ?></h1> |
|
| 10 | + <p><?php _e("A crash report email was sent to Event Espresso. You should hear back from us soon.", "event_espresso"); ?></p> |
|
| 11 | 11 | <?php } else {//didn't send email properly ?> |
| 12 | - <h1><?php _e( "Migration Report not sent", "event_espresso" ); ?></h1> |
|
| 13 | - <p><?php _e( "An error occurred and we were not able to automatically send a report to Event Espresso support.", "event_espresso" ); ?></p> |
|
| 14 | - <p><?php printf( esc_html__( "Please copy-and-paste the system information below to %s", "event_espresso" ), '<a href="mailto:' . EE_SUPPORT_EMAIL . '">' .EE_SUPPORT_EMAIL . "</a>" ); ?></p> |
|
| 12 | + <h1><?php _e("Migration Report not sent", "event_espresso"); ?></h1> |
|
| 13 | + <p><?php _e("An error occurred and we were not able to automatically send a report to Event Espresso support.", "event_espresso"); ?></p> |
|
| 14 | + <p><?php printf(esc_html__("Please copy-and-paste the system information below to %s", "event_espresso"), '<a href="mailto:'.EE_SUPPORT_EMAIL.'">'.EE_SUPPORT_EMAIL."</a>"); ?></p> |
|
| 15 | 15 | <label> |
| 16 | - <?php _e( "system status info", "event_espresso" ); ?> |
|
| 17 | - <textarea name="system_status_info" class="system_status_info"><?php print_r( EEM_System_Status::instance()->get_system_stati() ); ?></textarea> |
|
| 16 | + <?php _e("system status info", "event_espresso"); ?> |
|
| 17 | + <textarea name="system_status_info" class="system_status_info"><?php print_r(EEM_System_Status::instance()->get_system_stati()); ?></textarea> |
|
| 18 | 18 | </label> |
| 19 | 19 | <?php } ?> |
| 20 | 20 | |
| 21 | 21 | |
| 22 | -<h1><?php _e( "What's next?", 'event_espresso' ); ?></h1> |
|
| 23 | -<p><?php _e( "Well, it depends on your situation:", 'event_espresso' ); ?></p> |
|
| 22 | +<h1><?php _e("What's next?", 'event_espresso'); ?></h1> |
|
| 23 | +<p><?php _e("Well, it depends on your situation:", 'event_espresso'); ?></p> |
|
| 24 | 24 | <div class='ee-table-wrap'> |
| 25 | 25 | <table> |
| 26 | 26 | <thead> |
| 27 | 27 | <tr> |
| 28 | - <th><?php _e( "Your Situation", 'event_espresso' ); ?></th> |
|
| 29 | - <th><?php _e( "Suggested Action", 'event_espresso' ); ?></th> |
|
| 28 | + <th><?php _e("Your Situation", 'event_espresso'); ?></th> |
|
| 29 | + <th><?php _e("Suggested Action", 'event_espresso'); ?></th> |
|
| 30 | 30 | </tr> |
| 31 | 31 | </thead> |
| 32 | 32 | <tbody> |
| 33 | 33 | <tr> |
| 34 | - <td><p class='big-text'><?php _e( "I want to retry migrating my data", 'event_espresso' ); ?></p></td> |
|
| 34 | + <td><p class='big-text'><?php _e("I want to retry migrating my data", 'event_espresso'); ?></p></td> |
|
| 35 | 35 | <td> |
| 36 | 36 | <p> |
| 37 | 37 | <?php |
| 38 | 38 | printf( |
| 39 | - esc_html__( 'First, %1$s check the forums %2$s to see if there is a solution before re-attempting the Database Update. Often it helps to deactivate other plugins which may have conflicts; or it may help to add %3$s to your %4$s wp-config.php%5$s (which will make the update run slower, but may resolve any memory exhaustion errors.', 'event_espresso' ), |
|
| 40 | - "<a href='" . EE_SUPPORT_EMAIL . "' target='_blank'>", |
|
| 39 | + esc_html__('First, %1$s check the forums %2$s to see if there is a solution before re-attempting the Database Update. Often it helps to deactivate other plugins which may have conflicts; or it may help to add %3$s to your %4$s wp-config.php%5$s (which will make the update run slower, but may resolve any memory exhaustion errors.', 'event_espresso'), |
|
| 40 | + "<a href='".EE_SUPPORT_EMAIL."' target='_blank'>", |
|
| 41 | 41 | '</a>', |
| 42 | 42 | '<pre lang="php">define( EE_MIGRATION_STEP_SIZE, 10 );</pre>', |
| 43 | 43 | '<b>', |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | <p> |
| 50 | 50 | <?php |
| 51 | 51 | printf( |
| 52 | - esc_html__( 'To retry updating your data: restore to the backup you made before the update and reactivate EE (and any addons you are using) and re-run the Database Update. If you did not make a database backup and are migrating from EE3: delete your EE4 data (use the %1$s Reset/Delete Data tab above%2$s), and then reactivate EE4, and then re-run the migration and updates. If you did not make a database backup, are only updating from a previous install of EE4, have found a solution to the fatal error you received, and are willing to possibly have some data lost, %3$sattempt to continue migrating%2$s.', 'event_espresso' ), |
|
| 52 | + esc_html__('To retry updating your data: restore to the backup you made before the update and reactivate EE (and any addons you are using) and re-run the Database Update. If you did not make a database backup and are migrating from EE3: delete your EE4 data (use the %1$s Reset/Delete Data tab above%2$s), and then reactivate EE4, and then re-run the migration and updates. If you did not make a database backup, are only updating from a previous install of EE4, have found a solution to the fatal error you received, and are willing to possibly have some data lost, %3$sattempt to continue migrating%2$s.', 'event_espresso'), |
|
| 53 | 53 | "<a href='$reset_db_page_url'>", |
| 54 | 54 | "</a>", |
| 55 | 55 | "<a class='button-primary' href='$reattempt_action_url'>" |
@@ -60,13 +60,13 @@ discard block |
||
| 60 | 60 | </tr> |
| 61 | 61 | <tr> |
| 62 | 62 | <td> |
| 63 | - <p class='big-text'><?php _e( "I want to hear from Support before proceeding", 'event_espresso' ); ?></p> |
|
| 63 | + <p class='big-text'><?php _e("I want to hear from Support before proceeding", 'event_espresso'); ?></p> |
|
| 64 | 64 | </td> |
| 65 | 65 | <td> |
| 66 | 66 | <?php |
| 67 | 67 | printf( |
| 68 | - esc_html__( 'Just make sure you\'ve %1$s checked for a solution in the forums,%2$s and properly contacted Support. We will get back to you as soon as possible', 'event_espresso' ), |
|
| 69 | - "<a href='" . EE_SUPPORT_EMAIL . "'>", |
|
| 68 | + esc_html__('Just make sure you\'ve %1$s checked for a solution in the forums,%2$s and properly contacted Support. We will get back to you as soon as possible', 'event_espresso'), |
|
| 69 | + "<a href='".EE_SUPPORT_EMAIL."'>", |
|
| 70 | 70 | "</a>" |
| 71 | 71 | ); |
| 72 | 72 | ?> |
@@ -74,12 +74,12 @@ discard block |
||
| 74 | 74 | </tr> |
| 75 | 75 | <tr> |
| 76 | 76 | <td> |
| 77 | - <p class='big-text'><?php printf( esc_html__( 'I don\'t need my old EE %s data', 'event_espresso' ), $most_recent_migration->slug() ); ?></p> |
|
| 77 | + <p class='big-text'><?php printf(esc_html__('I don\'t need my old EE %s data', 'event_espresso'), $most_recent_migration->slug()); ?></p> |
|
| 78 | 78 | </td> |
| 79 | 79 | <td> |
| 80 | 80 | <?php |
| 81 | 81 | printf( |
| 82 | - esc_html__( 'If you are ok with losing all the EE %1$s data, you can skip the Database Updates and %2$s use EE4 with only default Data%3$s', 'event_espresso' ), |
|
| 82 | + esc_html__('If you are ok with losing all the EE %1$s data, you can skip the Database Updates and %2$s use EE4 with only default Data%3$s', 'event_espresso'), |
|
| 83 | 83 | $most_recent_migration->slug(), |
| 84 | 84 | "<a id='do-not-migrate' class='do-not-migrate button-primary' href='$reset_db_action_url'>", |
| 85 | 85 | "</a>" |
@@ -89,20 +89,20 @@ discard block |
||
| 89 | 89 | </tr> |
| 90 | 90 | <tr> |
| 91 | 91 | <td> |
| 92 | - <p class='big-text'><?php printf( esc_html__( 'I want to go back to my old version of EE %1$s', 'event_espresso' ), $most_recent_migration->slug() ); ?> |
|
| 92 | + <p class='big-text'><?php printf(esc_html__('I want to go back to my old version of EE %1$s', 'event_espresso'), $most_recent_migration->slug()); ?> |
|
| 93 | 93 | </td> |
| 94 | 94 | <td> |
| 95 | 95 | <p> |
| 96 | 96 | <?php |
| 97 | 97 | printf( |
| 98 | - esc_html__( 'Then we suggest you re-activate the old version of EE %3$s and restore your database to the backup you made just before the Database Update . If you didn\'t backup your database and are migrating from EE3, you can also delete your EE4 data (use on the %1$s"Reset/Delete Data" tab above%2$s), and then reactivate EE3 from the plugins page. Note: some of your EE3 shortcodes may have been changed to their EE4 equivalents, so you will need to change them back.', 'event_espresso' ), |
|
| 98 | + esc_html__('Then we suggest you re-activate the old version of EE %3$s and restore your database to the backup you made just before the Database Update . If you didn\'t backup your database and are migrating from EE3, you can also delete your EE4 data (use on the %1$s"Reset/Delete Data" tab above%2$s), and then reactivate EE3 from the plugins page. Note: some of your EE3 shortcodes may have been changed to their EE4 equivalents, so you will need to change them back.', 'event_espresso'), |
|
| 99 | 99 | "<a href='$reset_db_page_url'>", |
| 100 | 100 | "</a>", |
| 101 | 101 | $most_recent_migration->slug() |
| 102 | 102 | ); |
| 103 | 103 | ?> |
| 104 | 104 | </p> |
| 105 | - <p><?php _e( "If you ever decide to re-attempt using EE4, you will again be given the option to migrate your EE3 data or not.", 'event_espresso' ); ?></p> |
|
| 105 | + <p><?php _e("If you ever decide to re-attempt using EE4, you will again be given the option to migrate your EE3 data or not.", 'event_espresso'); ?></p> |
|
| 106 | 106 | </td> |
| 107 | 107 | </tr> |
| 108 | 108 | |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | ?> |
| 4 | -<h1><?php esc_html_e("You must upgrade your Event Espresso Add-ons before Migrating", "event_espresso");?></h1> |
|
| 5 | -<p><?php printf(esc_html__("Please %s visit the plugins page%s and update all Event Espresso addon plugins before updating your database.", "event_espresso"), "<a href='".admin_url('/plugins.php')."'>","</a>");?></p> |
|
| 6 | -<p><?php esc_html_e("You can also deactivate the addons, but all of their data will be lost when your database is migrated", "event_espresso");?></p> |
|
| 7 | 4 | \ No newline at end of file |
| 5 | +<h1><?php esc_html_e("You must upgrade your Event Espresso Add-ons before Migrating", "event_espresso"); ?></h1> |
|
| 6 | +<p><?php printf(esc_html__("Please %s visit the plugins page%s and update all Event Espresso addon plugins before updating your database.", "event_espresso"), "<a href='".admin_url('/plugins.php')."'>", "</a>"); ?></p> |
|
| 7 | +<p><?php esc_html_e("You can also deactivate the addons, but all of their data will be lost when your database is migrated", "event_espresso"); ?></p> |
|
| 8 | 8 | \ No newline at end of file |