We have now opened a commercial services section here on the forum for registered users. If you have a Fabrik project that you wish to have someone work on for you, post it under Help Wanted. If you are an application developer and wish to earn some money helping others, post your details under Fabrik Application Developers.
Both of these are unmoderated. It will be up to both parties to work out the details and come to an agreement.
For running J!5.1 you must https://fabrikar.com/forums/index.php?wiki/update-from-github/ or include the new file manually https://fabrikar.com/forums/index.php?threads/joomla-5-1-and-fabrik-cannot-find-files-error.54473/post-285151 See also Announcements
/**
* Make the create sql statement for the table
*
* [USER=20939]param[/USER] bool $addIfNotExists add 'if not exists' to query
* [USER=20939]param[/USER] string $table table to get sql for(leave out to use models table)
*
* @return string sql to drop & or create table
*/
public function getCreateTableSQL($addIfNotExists = false, $table = null)
{
$addIfNotExists = $addIfNotExists ? 'IF NOT EXISTS ' : '';
if (is_null($table))
{
$table = $this->getGenericTableName();
}
$fields = $this->getDBFields($table);
$primaryKey = "";
$sql = "";
$table = FabrikString::safeColName($table);
if (is_array($fields))
{
$sql .= "CREATE TABLE $addIfNotExists" . $table . " (\n";
foreach ($fields as $field)
{
$field->Field = FabrikString::safeColName($field->Field);
if ($field->Key == 'PRI' && $field->Extra == 'auto_increment')
{
$primaryKey = "PRIMARY KEY ($field->Field)";
}
$sql .= "$field->Field ";
$sql .= ' ' . $field->Type . ' ';
if ($field->Null == '')
{
$sql .= " NOT NULL ";
}
if ($field->Default != '' && $field->Key != 'PRI')
{
if ($field->Default == 'CURRENT_TIMESTAMP')
{
$sql .= "DEFAULT $field->Default";
}
else
{
$sql .= "DEFAULT '$field->Default'";
}
}
$sql .= $field->Extra . ",\n";
}
if ($primaryKey == '')
{
$sql = rtrim($sql, ",\n");
}
$sql .= $primaryKey . ");";
}
return $sql;
}