UuidViranyani.php 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. namespace App\Console\Commands;
  3. use App\Tools\Tools;
  4. use Illuminate\Console\Command;
  5. use Illuminate\Support\Facades\DB;
  6. class UuidViranyani extends Command
  7. {
  8. /**
  9. * The name and signature of the console command.
  10. *
  11. * @var string
  12. */
  13. protected $signature = 'uuid:viranyani';
  14. /**
  15. * The console command description.
  16. *
  17. * @var string
  18. */
  19. protected $description = '修改各个表中的viranyani 的 user_uid 为小写';
  20. /**
  21. * Create a new command instance.
  22. *
  23. * @return void
  24. */
  25. public function __construct()
  26. {
  27. parent::__construct();
  28. }
  29. /**
  30. * Execute the console command.
  31. *
  32. * @return int
  33. */
  34. public function handle()
  35. {
  36. if (Tools::isStop()) {
  37. return 0;
  38. }
  39. $old = 'C1AB2ABF-EAA8-4EEF-B4D9-3854321852B4';
  40. $result = DB::select('UPDATE "articles" set "owner"=? where "owner"=? ', [strtolower($old), $old]);
  41. $result = DB::select('UPDATE "channels" set "owner_uid"=? where "owner_uid"=? ', [strtolower($old), $old]);
  42. $result = DB::select('UPDATE "collections" set "owner"=? where "owner"=? ', [strtolower($old), $old]);
  43. $result = DB::select('UPDATE "dhamma_terms" set "owner"=? where "owner"=? ', [strtolower($old), $old]);
  44. $result = DB::select('UPDATE "group_infos" set "owner"=? where "owner"=? ', [strtolower($old), $old]);
  45. $result = DB::select('UPDATE "group_members" set "user_id"=? where "user_id"=? ', [strtolower($old), $old]);
  46. $result = DB::select('UPDATE "sent_blocks" set "owner_uid"=? where "owner_uid"=? ', [strtolower($old), $old]);
  47. $result = DB::select('UPDATE "sent_blocks" set "editor_uid"=? where "editor_uid"=? ', [strtolower($old), $old]);
  48. $result = DB::select('UPDATE "sent_histories" set "user_uid"=? where "user_uid"=? ', [strtolower($old), $old]);
  49. $result = DB::select('UPDATE "sent_prs" set "editor_uid"=? where "editor_uid"=? ', [strtolower($old), $old]);
  50. $result = DB::select('UPDATE "sentences" set "editor_uid"=? where "editor_uid"=? ', [strtolower($old), $old]);
  51. $result = DB::select('UPDATE "shares" set "cooperator_id"=? where "cooperator_id"=? ', [strtolower($old), $old]);
  52. $result = DB::select('UPDATE "wbw_blocks" set "creator_uid"=? where "creator_uid"=? ', [strtolower($old), $old]);
  53. $result = DB::select('UPDATE "wbws" set "creator_uid"=? where "creator_uid"=? ', [strtolower($old), $old]);
  54. $this->info('done');
  55. return 0;
  56. }
  57. }