`REFERENCES` keyword does not work in a column definition
- Dominant language
- Go
- Stars
- 24.4k
- Forks
- 873
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 120
Description
As part of a MySQL [column definition](https://dev.mysql.com/doc/refman/8.0/en/create-table.html), you can specify a foreign key reference, e.g.: `myFk int REFERENCES othertable(id)`, but this syntax doesn't currently work in Dolt. Dolt allows defining FK references, but they can't be in a column definition, they need to be listed at the end in a `CONSTRAINT FOREIGN KEY` clause.
Repro:
```
create table child (pk int primary key, fk int REFERENCES parent(id));
Error parsing SQL
syntax error at position 58 near 'REFERENCES'
create table child (pk int primary key, fk int REFERENCES parent(id))
```
In addition to testing this with `CREATE TABLE`, we also need to make sure to test this with `ALTER TABLE`, too.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.