Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin/bootstrap-mysql
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-03-28 09:25:31 +0200
committerErich Eckner <git@eckner.net>2018-03-28 09:25:31 +0200
commite305ab9221b5b65ece6afcd65b1ef825dcbbafd8 (patch)
treebc2e84611aa3ec65e6cebff3c31922d3b946fb34 /bin/bootstrap-mysql
parent596be04ae9c2cff14d39241a6d3046c792423fb2 (diff)
bin/bootstrap-mysql: add "ON ... CASCADE" to foreign keys
Diffstat (limited to 'bin/bootstrap-mysql')
-rwxr-xr-xbin/bootstrap-mysql2
1 files changed, 1 insertions, 1 deletions
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}"