Add sample on how to add multiple column foreign keys to the same table

This commit is contained in:
Alejandro Foronda committed 2021-04-04 16:05:13 -04:00
1 parent d203b90c3a
commit 02edecc7bb
1 file changed
+7
+7
View File
@@ -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