Created
February 21, 2016 14:35
-
-
Save jaredjburgess/b92570074086db8a8245 to your computer and use it in GitHub Desktop.
PostgreSQL syntax to create a foreign key on an existing table
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alter table table_name add constraint table_name_column_name_fkey foreign key (column_name) references other_table_name (other_column_name) on delete cascade; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment