I’m new to MySQL Workbench, so i’ve been trying a couple projects and right now i’m trying to create a foreign key (by the Workbench menu), but every time i try to apply it the Workbench says that the code is wrong and i should check my MariaDB manual, but i haven’t installed MariaDB, nor do I know how to mess with it.
this is the code:
ALTER TABLE
mercado.
produtos ADD INDEX
fk_udm_idx (
ID_unidadeASC) VISIBLE; ; ALTER TABLE
mercado.
produtos ADD CONSTRAINT
fk_udm FOREIGN KEY (
ID_unidade) REFERENCES
mercado.
udm (
udm_ID) ON DELETE NO ACTION ON UPDATE NO ACTION;
And this is the error:
ERROR 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ” at line 2
SQL Statement:
ALTER TABLE
mercado.
produtos ADD INDEX
fk_udm_idx (
ID_unidade ASC) VISIBLE
I’ve already tried removing the second ‘;’ but to no avail, it just points to the same error.
gagabriel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.