On Apr 6, 10:18 pm, cowwoc <[email protected]> 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 SELECT * FROM INFORMATION_SCHEMA.CONSTRAINTS to find out more? -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.
