From 02edecc7bb697f01fd603c6cdf340fc1b97f9890 Mon Sep 17 00:00:00 2001 From: Alejandro Foronda Date: Sun, 4 Apr 2021 16:05:13 -0400 Subject: [PATCH] Add sample on how to add multiple column foreign keys to the same table --- web/spec/postgres.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/web/spec/postgres.yml b/web/spec/postgres.yml index 28fd071994a..ffe7d6aae05 100644 --- a/web/spec/postgres.yml +++ b/web/spec/postgres.yml @@ -111,6 +111,13 @@ pages: primary key (column_1, column_2) ); ``` + - name: Multiple foreign keys to the same table + sql: | + ```sql + alter table table_name + add constraint constraint_name_1 foreign key (colum_1) references foreign_table(id), + add constraint constraint_name_2 foreign key (colum_2) references foreign_table(id); + ``` - name: Delete a table sql: | ```sql