Added the option to set the row_format per table in the admin view. Converted all the JCB tables to have a DYNAMIC row format. Fixed gh-369 so that JCB packages like JMM can be imported.
This commit is contained in:
@ -718,7 +718,8 @@ class Get
|
||||
public $mysqlTableKeys = array(
|
||||
'engine' => array('default' => 'MyISAM'),
|
||||
'charset' => array('default' => 'utf8'),
|
||||
'collate' => array('default' => 'utf8_general_ci')
|
||||
'collate' => array('default' => 'utf8_general_ci'),
|
||||
'row_format' => array('default' => '')
|
||||
);
|
||||
|
||||
/**
|
||||
|
@ -6360,7 +6360,13 @@ class Interpretation extends Fields
|
||||
$easy[$_mysqlTableKey] = $this->mysqlTableKeys[$_mysqlTableKey]['default'];
|
||||
}
|
||||
}
|
||||
$db_ .= PHP_EOL . ") ENGINE=" . $easy['engine'] . " AUTO_INCREMENT=0 DEFAULT CHARSET=" . $easy['charset'] . " DEFAULT COLLATE=" . $easy['collate'] . ";";
|
||||
// add a little fix for the row_format
|
||||
if (ComponentbuilderHelper::checkString($easy['row_format']))
|
||||
{
|
||||
$easy['row_format'] = ' ROW_FORMAT=' . $easy['row_format'];
|
||||
}
|
||||
// now build db string
|
||||
$db_ .= PHP_EOL . ") ENGINE=" . $easy['engine'] . " AUTO_INCREMENT=0 DEFAULT CHARSET=" . $easy['charset'] . " DEFAULT COLLATE=" . $easy['collate'] . $easy['row_format'] . ";";
|
||||
|
||||
// check if this is a new table that should be added via update SQL
|
||||
if (isset($this->addSQL['adminview']) && ComponentbuilderHelper::checkArray($this->addSQL['adminview']) && in_array($view, $this->addSQL['adminview']))
|
||||
@ -6368,6 +6374,12 @@ class Interpretation extends Fields
|
||||
// build the update array
|
||||
$this->updateSQLBuilder["CREATETABLEIFNOTEXISTS`#__" . $component . "_" . $view . "`"] = $db_;
|
||||
}
|
||||
// check if the table row_format has changed
|
||||
if (ComponentbuilderHelper::checkString($easy['row_format']) && isset($this->updateSQL['table_row_format']) && isset($this->updateSQL['table_row_format'][$view]))
|
||||
{
|
||||
// build the update array
|
||||
$this->updateSQLBuilder["ALTERTABLE`#__" . $component . "_" . $view . "`" . trim($easy['row_format'])] = "ALTER TABLE `#__" . $component . "_" . $view . "`" . $easy['row_format'] . ";";
|
||||
}
|
||||
// check if the table engine has changed
|
||||
if (isset($this->updateSQL['table_engine']) && isset($this->updateSQL['table_engine'][$view]))
|
||||
{
|
||||
|
Reference in New Issue
Block a user