From e305ab9221b5b65ece6afcd65b1ef825dcbbafd8 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 28 Mar 2018 09:25:31 +0200 Subject: bin/bootstrap-mysql: add "ON ... CASCADE" to foreign keys --- bin/bootstrap-mysql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/bootstrap-mysql b/bin/bootstrap-mysql index b2277e9..eb37900 100755 --- a/bin/bootstrap-mysql +++ b/bin/bootstrap-mysql @@ -234,7 +234,7 @@ if [ ! "$1" = 'slim' ]; then tr ' ' '\n' | \ sed -n 's/^://;T;p' | \ while read -r link; do - printf 'ALTER TABLE `%s` ADD FOREIGN KEY (`%s`) REFERENCES `%s` (`id`);\n' \ + printf 'ALTER TABLE `%s` ADD FOREIGN KEY (`%s`) REFERENCES `%s` (`id`) ON UPDATE CASCADE ON DELETE CASCADE;\n' \ "${table}" \ "${column}" \ "${link}" -- cgit v1.2.3-70-g09d2