Skip to content

A free open source IT asset/license management system

Updated paveit command to delete by user_id instead of ID

sniped6c09aae6b0b
diff --git a/app/Console/Commands/PaveIt.php b/app/Console/Commands/PaveIt.php
index ef69d25a5b..36aacd6636 100644
--- a/app/Console/Commands/PaveIt.php
+++ b/app/Console/Commands/PaveIt.php
@@ -4,7 +4,7 @@ namespace App\Console\Commands;
use App\Models\Asset;
use App\Models\CustomField;
-use Schema;
+use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\DB;
use Illuminate\Console\Command;
@@ -66,8 +66,8 @@ class PaveIt extends Command
foreach ($custom_fields as $custom_field) {
$this->info('DROP the '.$custom_field->db_column.' column from assets as well.');
- if (\Schema::hasColumn('assets', $custom_field->db_column)) {
- \Schema::table('assets', function ($table) use ($custom_field) {
+ if (Schema::hasColumn('assets', $custom_field->db_column)) {
+ Schema::table('assets', function ($table) use ($custom_field) {
$table->dropColumn($custom_field->db_column);
});
}
@@ -84,8 +84,8 @@ class PaveIt extends Command
}
// Leave in the demo oauth keys so we don't have to reset them every day in the demos
- \DB::statement('delete from oauth_clients WHERE id > 2');
- \DB::statement('delete from oauth_access_tokens WHERE id > 2');
+ DB::statement('delete from oauth_clients WHERE id > 2');
+ DB::statement('delete from oauth_access_tokens WHERE user_id > 2');
}
}
\ No newline at end of file