1
0
Fork 0
mirror of https://github.com/yweber/lodel2.git synced 2026-07-05 07:10:48 +02:00

MigrationHandler : add ON DELETE CASCADE & ON UPDATE CASCADE to FK

This commit is contained in:
Yann 2016-01-28 14:34:32 +01:00
commit e9fcd15c48

View file

@ -494,7 +494,9 @@ ADD COLUMN {col_name} {col_type} {col_specs};"""
self._query("""ALTER TABLE {src_table}
ADD CONSTRAINT {fk_name}
FOREIGN KEY ({src_col}) references {dst_table}({dst_col});""".format(
FOREIGN KEY ({src_col}) references {dst_table}({dst_col})
ON DELETE CASCADE
ON UPDATE CASCADE;""".format(
fk_name=utils.escape_idname(fk_name),
src_table=stname,
src_col=scname,