Hi
I have 2 tables:
CREATE TABLE users (
id_user INTEGER NOT NULL GENERATED
ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1),
name VARCHAR(30),
PRIMARY KEY (id_user)
);
CREATE TABLE articles (
id_article INTEGER NOT NULL GENERATED
ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1),
creator SMALLINT NOT NULL,
PRIMARY KEY (id_article)
FOREIGN KEY (creator) REFERENCES users (id_user)
);
Second table doesn`t create.
Error message is:
ERROR X0Y44: Constraint 'SQL061110025111171' is invalid: there is no unique or primary key constraint on table 'APP.UZIVATELE' that matches the number and types of the columns in the foreign key.
Where is the problem?