On Apr 6, 10:18 pm, cowwoc <
cow...@bbs.darktech.org> wrote:
> My mistake. The SQL command I mentioned on top is not the one that H2
> was tripping on (although they look similar). The problem was this
> line:
>
> CONSTRAINT FOREIGN KEY(...)
>
> notice the lack of name between CONSTRAINT and FOREIGN KEY.
>
> Now I'm getting a different error:
>
> Constraint "FK_CLINIC_ID" already exists; SQL statement:
> CREATE TABLE queues (id IDENTITY PRIMARY KEY, `name` VARCHAR NOT NULL,
> clinic_id BIGINT NOT NULL,
> CONSTRAINT fk_clinic_id FOREIGN KEY(clinic_id) REFERENCES clinics(id))
> [90045-154]
>
> How could the foreign key "fk_clinic_id" already exist in the above
> SQL statement?
No idea.... but the command works (as given, after creating the table
clinics). Have you tried