Adding a column as a foreign key gives ERROR column referenced in foreign key constraint does not exist

前端 未结 5 558
抹茶落季
抹茶落季 2021-01-31 13:02

I have the following set up,

CREATE TABLE auth_user ( id int PRIMARY KEY );
CREATE TABLE links_chatpicmessage ();

I\'m trying to add a

5条回答
  •  情歌与酒
    2021-01-31 13:40

    ****foreign key reference for existing column****

    ALTER TABLE table_name ADD CONSTRAINT fkey_name FOREIGN KEY (id) REFERENCES ref_table(id)

提交回复
热议问题