From f2eb740509f65e6dbdb2ee372df130564dd7c914 Mon Sep 17 00:00:00 2001 From: Robert Conner Date: Tue, 19 Mar 2019 23:27:08 -0400 Subject: [PATCH] Few small cleanup items --- config/tagging.php | 2 +- migrations/2016_06_29_073615_update_tags_table.php | 1 + src/Taggable.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/config/tagging.php b/config/tagging.php index d7765ae..123745c 100644 --- a/config/tagging.php +++ b/config/tagging.php @@ -18,7 +18,7 @@ 'untag_on_delete' => true, // Auto-delete unused tags from the 'tags' database table (when they are used zero times) - 'delete_unused_tags' => true, + 'delete_unused_tags' => false, // Model to use to store the tags in the database 'tag_model'=>'\Conner\Tagging\Model\Tag', diff --git a/migrations/2016_06_29_073615_update_tags_table.php b/migrations/2016_06_29_073615_update_tags_table.php index c0837f5..38b7879 100644 --- a/migrations/2016_06_29_073615_update_tags_table.php +++ b/migrations/2016_06_29_073615_update_tags_table.php @@ -17,6 +17,7 @@ public function up() public function down() { + Schema::disableForeignKeyConstraints(); Schema::table('tagging_tags', function ($table) { $table->dropForeign('tagging_tags_tag_group_id_foreign'); $table->dropColumn('tag_group_id'); diff --git a/src/Taggable.php b/src/Taggable.php index 0d4c673..4bd3636 100644 --- a/src/Taggable.php +++ b/src/Taggable.php @@ -376,7 +376,7 @@ public static function untagOnDelete() */ public static function shouldDeleteUnused(): bool { - return config('tagging.delete_unused_tags', true); + return config('tagging.delete_unused_tags', false); } /**