From 2cbece9234df56dd620c5e09a2c185d58c6e4b60 Mon Sep 17 00:00:00 2001 From: Mateus Junges Date: Fri, 13 Mar 2020 13:30:33 -0300 Subject: [PATCH 1/2] Change descritpion field to a new migration and adds a test script to composer.json --- composer.json | 7 ++++-- .../2014_01_07_073615_create_tags_table.php | 1 - ...3_083515_add_description_to_tags_table.php | 23 +++++++++++++++++++ 3 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 migrations/2020_03_13_083515_add_description_to_tags_table.php diff --git a/composer.json b/composer.json index d6bf685..773087a 100644 --- a/composer.json +++ b/composer.json @@ -38,5 +38,8 @@ ] } }, - "minimum-stability": "dev" -} \ No newline at end of file + "minimum-stability": "dev", + "scripts": { + "test": "./vendor/bin/phpunit tests" + } +} diff --git a/migrations/2014_01_07_073615_create_tags_table.php b/migrations/2014_01_07_073615_create_tags_table.php index 12d922b..1a3a747 100644 --- a/migrations/2014_01_07_073615_create_tags_table.php +++ b/migrations/2014_01_07_073615_create_tags_table.php @@ -11,7 +11,6 @@ public function up() $table->increments('id'); $table->string('slug', 125)->index(); $table->string('name', 125); - $table->text('description')->nullable(); $table->boolean('suggest')->default(false); $table->integer('count')->unsigned()->default(0); // count of how many times this tag was used $table->integer('tag_group_id')->unsigned()->nullable(); diff --git a/migrations/2020_03_13_083515_add_description_to_tags_table.php b/migrations/2020_03_13_083515_add_description_to_tags_table.php new file mode 100644 index 0000000..b11ed68 --- /dev/null +++ b/migrations/2020_03_13_083515_add_description_to_tags_table.php @@ -0,0 +1,23 @@ +text('description')->nullable(); + }); + + } + + + public function down() + { + Schema::table('tags', function ($table) { + $table->dropColumn('description'); + }); + } +} From 5127d21d9609658e0afe2ba7f221a71d49845009 Mon Sep 17 00:00:00 2001 From: Mateus Junges Date: Sat, 14 Mar 2020 23:01:33 -0300 Subject: [PATCH 2/2] Fix table name --- .../2020_03_13_083515_add_description_to_tags_table.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/migrations/2020_03_13_083515_add_description_to_tags_table.php b/migrations/2020_03_13_083515_add_description_to_tags_table.php index b11ed68..07e32e2 100644 --- a/migrations/2020_03_13_083515_add_description_to_tags_table.php +++ b/migrations/2020_03_13_083515_add_description_to_tags_table.php @@ -7,7 +7,7 @@ class AddDescriptionToTagsTable extends Migration { public function up() { - Schema::table('tags', function ($table) { + Schema::table('tagging_tags', function ($table) { $table->text('description')->nullable(); }); @@ -16,7 +16,7 @@ public function up() public function down() { - Schema::table('tags', function ($table) { + Schema::table('tagging_tags', function ($table) { $table->dropColumn('description'); }); }