diff options
Diffstat (limited to 'python/skytools/dbstruct.py')
-rw-r--r-- | python/skytools/dbstruct.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/python/skytools/dbstruct.py b/python/skytools/dbstruct.py index 916de131..8e559036 100644 --- a/python/skytools/dbstruct.py +++ b/python/skytools/dbstruct.py @@ -93,7 +93,9 @@ class TConstraint(TElem): def get_create_sql(self, curs, new_table_name=None): """Generate creation SQL.""" - fmt = "ALTER TABLE ONLY %s ADD CONSTRAINT %s %s;" + # no ONLY here as table with childs (only case that matters) + # cannot have contraints that childs do not have + fmt = "ALTER TABLE %s ADD CONSTRAINT %s %s;" if new_table_name: name = self.name if self.contype in ('p', 'u'): |