28 parent::__construct();
29 $this->title =
'Update database schema: Create tables and fields';
39 $description =
'There are tables or fields in the database which need to be created.<br /><br />' .
40 'You have to run this update wizard before you can run any other update wizard to make sure all needed tables and fields are present.';
43 $updateSuggestions = $this->schemaMigrationService->getUpdateSuggestions($databaseDifferences);
45 return isset($updateSuggestions[
'create_table']) || isset($updateSuggestions[
'add']);
58 $updateSuggestions = $this->schemaMigrationService->getUpdateSuggestions($databaseDifferences);
60 if (isset($updateSuggestions[
'create_table'])) {
63 Add the following tables: 66 <ol class="t3-install-form-label-after">%s</ol> 69 <li class="labelAfter"> 70 <label><strong>%1$s</strong></label> 74 foreach ($databaseDifferences[
'extra'] as $tableName => $difference) {
75 if ($difference[
'whole_table'] == 1) {
76 $items[] = sprintf($item, $tableName);
79 $result .= sprintf($list, implode(
'', $items));
82 if (isset($updateSuggestions[
'add'])) {
85 Add the following fields to tables: 88 <ol class="t3-install-form-label-after">%s</ol> 92 Add the following keys to tables: 95 <ol class="t3-install-form-label-after">%s</ol> 98 <li class="labelAfter"> 99 <label><strong>%1$s</strong>: %2$s</label> 102 $fieldItems = array();
104 foreach ($databaseDifferences[
'extra'] as $tableName => $difference) {
105 if ($difference[
'whole_table'] != 1) {
106 if ($difference[
'fields']) {
107 $fieldNames = array();
108 foreach ($difference[
'fields'] as $fieldName =>
$sql) {
109 $fieldNames[] = $fieldName;
111 $fieldItems[] = sprintf($item, $tableName, implode(
', ', $fieldNames));
113 if ($difference[
'keys']) {
115 foreach ($difference[
'keys'] as $keyName =>
$sql) {
116 $keyNames[] = $keyName;
118 $keyItems[] = sprintf($item, $tableName, implode(
', ', $keyNames));
122 if (!empty($fieldItems)) {
123 $result .= sprintf($fieldsList, implode(
'', $fieldItems));
125 if (!empty($keyItems)) {
126 $result .= sprintf($keysList, implode(
'', $keyItems));
145 $updateStatements = $this->schemaMigrationService->getUpdateSuggestions($databaseDifferences);
147 foreach ((array)$updateStatements[
'create_table'] as $query) {
148 $GLOBALS[
'TYPO3_DB']->admin_query($query);
149 $dbQueries[] = $query;
150 if (
$GLOBALS[
'TYPO3_DB']->sql_error()) {
151 $customMessages =
'SQL-ERROR: ' . htmlspecialchars(
$GLOBALS[
'TYPO3_DB']->sql_error());
156 foreach ((array)$updateStatements[
'add'] as $query) {
157 $GLOBALS[
'TYPO3_DB']->admin_query($query);
158 $dbQueries[] = $query;
159 if (
$GLOBALS[
'TYPO3_DB']->sql_error()) {
160 $customMessages =
'SQL-ERROR: ' . htmlspecialchars(
$GLOBALS[
'TYPO3_DB']->sql_error());
if($list_of_literals) if(!empty($literals)) if(!empty($literals)) $result
Analyse literals to prepend the N char to them if their contents aren't numeric.
getUserInput($inputPrefix)
performUpdate(array &$dbQueries, &$customMessages)
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
checkForUpdate(&$description)