$warnings[]='Database schema warning: *dbprefix* should only appear once in name of table '.$table->name;
}
if(strlen($tableName)>27){
$errors[]='Database schema error: Name of table '.$table->name.' is too long ('.strlen($tableName).'), max. 27 characters (21 characters for tables with autoincrement) + *dbprefix* allowed';
}
$hasAutoIncrement=false;
// Column names
foreach($table->declaration->fieldas$column){
if(strpos($column->name,'*dbprefix*')!==false){
$warnings[]='Database schema warning: *dbprefix* should not appear in name of column '.$column->name.' on table '.$table->name;
}
if(strlen($column->name)>30){
$errors[]='Database schema error: Name of column '.$column->name.' on table '.$table->name.' is too long ('.strlen($tableName).'), max. 30 characters allowed';
}
if($column->autoincrement){
if($hasAutoIncrement){
$errors[]='Database schema error: Table '.$table->name.' has multiple autoincrement columns';
}
if(strlen($tableName)>21){
$errors[]='Database schema error: Name of table '.$table->name.' is too long ('.strlen($tableName).'), max. 27 characters (21 characters for tables with autoincrement) + *dbprefix* allowed';
$errors[]='Database schema error: Name of index '.$index->name.' on table '.$table->name.' is too long ('.strlen($tableName).'), max. 27 characters + *dbprefix* allowed';