10
Quote:
It also doesn't support a CREATE INDEX statement.
No, but ALTER TABLE is supported.
Could you not rephrase your SQL statements to use
this?
eg
ALTER TABLE mytable ADD INDEX myindex (col1, col2);
ALTER TABLE mytable ADD CONSTRAINT myconstraint PRIMARY INDEX (col1, col2);
etc.
Quote:
Is there a way to tell to the query processor to add prefix also on REFERENCE <table name> (<field>)?
Try by adding this in function prefixQuery of /class/database/sqlutility.php
$matches[0] = preg_replace($pattern, $replace, $query);
// start hack ghia
$pattern3 = "/
(.*REFERENCES)(s)+([`]?)([^`s]+)\3(s)+/siU";
if (preg_match($pattern3, $query))
{
$matches[0] = preg_replace($pattern3, $replace, $matches[0]);
}
// end hack ghia
return $matches;
Limitation: it works only for 1 table reference per statement, so if you have multiple foreign keys, you have to add them one by one by separate alter table statements.
Quote:
I think, and correct me please if I am wrong, that you're missing an index svy_attributi(id) before FOREIGN KEY (attributi_id) ?
It seems good to me. I think the only problem he has, is that the statement executes without prefixing the referenced table and then fails for an unknown table.