add_foreign_key can now detect table and pk, refs #25

This commit is contained in:
Simon Willison 2019-06-12 21:51:09 -07:00
commit d645032cfa
7 changed files with 100 additions and 13 deletions

View file

@ -200,8 +200,8 @@ def add_column(path, table, col_name, col_type, fk, fk_col, not_null_default):
)
@click.argument("table")
@click.argument("column")
@click.argument("other_table")
@click.argument("other_column")
@click.argument("other_table", required=False)
@click.argument("other_column", required=False)
def add_foreign_key(path, table, column, other_table, other_column):
"""
Add a new foreign key constraint to an existing table. Example usage: