If you are getting errors with foreign keys, please note that we generally discourage the use of foreign keys, and more specifically foreign key constraints. There may be unexpected consequences when using them in sharded keyspaces.  


However, you can use foreign key constraints when their scope is contained within a shard or unsharded keyspace. You may find that some foreign key syntax will not be accepted through `vtctlclient ApplySchema...`. You may be able to submit the foreign key syntax through vtgate or directly through the mysqld instance.  


Please note that if you do shard or re-shard an existing keyspqce with foreign keys, you will need to take extra steps to confirm they are working as intended.