diff --git a/database/migrations/2017_10_02_202000_ChangeServicesToUseAMoreUniqueIdentifier.php b/database/migrations/2017_10_02_202000_ChangeServicesToUseAMoreUniqueIdentifier.php index 64d31f749..d7e9caa86 100644 --- a/database/migrations/2017_10_02_202000_ChangeServicesToUseAMoreUniqueIdentifier.php +++ b/database/migrations/2017_10_02_202000_ChangeServicesToUseAMoreUniqueIdentifier.php @@ -41,10 +41,11 @@ class ChangeServicesToUseAMoreUniqueIdentifier extends Migration { Schema::table('services', function (Blueprint $table) { $table->dropColumn('uuid'); - $table->string('folder')->unique('file'); - $table->char('author', 36)->change(); + $table->string('folder')->nullable(); + $table->string('author', 36)->change(); $table->unique('name'); + $table->unique('folder', 'services_file_unique'); }); } } diff --git a/database/migrations/2017_10_02_202007_ChangeToABetterUniqueServiceConfiguration.php b/database/migrations/2017_10_02_202007_ChangeToABetterUniqueServiceConfiguration.php index 990a07a63..96a968144 100644 --- a/database/migrations/2017_10_02_202007_ChangeToABetterUniqueServiceConfiguration.php +++ b/database/migrations/2017_10_02_202007_ChangeToABetterUniqueServiceConfiguration.php @@ -49,7 +49,7 @@ class ChangeToABetterUniqueServiceConfiguration extends Migration }); DB::transaction(function () { - DB::table('service_options')->select(['id', 'author'])->get()->each(function ($option) { + DB::table('service_options')->select(['id', 'tag'])->get()->each(function ($option) { DB::table('service_options')->where('id', $option->id)->update([ 'tag' => array_get(explode(':', $option->tag), 1), ]);